diff --git a/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductApiResponse.kt b/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductApiResponse.kt index 7a740c8058..c5fa2b37b8 100644 --- a/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductApiResponse.kt +++ b/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductApiResponse.kt @@ -87,4 +87,6 @@ data class ProductApiResponse( val max_quantity: String? = null, val group_of_quantity: String? = null, val combine_variations: String? = null, + @SerializedName("post_password") + val password: String? = null, ) diff --git a/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductDtoMapper.kt b/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductDtoMapper.kt index ea5e7823d4..c22e4130e5 100644 --- a/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductDtoMapper.kt +++ b/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductDtoMapper.kt @@ -112,6 +112,9 @@ class ProductDtoMapper @Inject constructor( // Save only the subscription data, the rest of the metadata will be saved separately metadata = metaData.filter { it.key in WCProductModel.SubscriptionMetadataKeys.ALL_KEYS } .let { gson.toJson(it) } + + password = dto.password + isSampleProduct = dto.metadata?.any { val metaDataEntry = WCMetaData.fromJson(it.asJsonObject) metaDataEntry?.let { json ->