diff --git a/example/src/test/java/org/wordpress/android/fluxc/wc/gateways/GatewayFixtures.kt b/example/src/test/java/org/wordpress/android/fluxc/wc/gateways/GatewayFixtures.kt index 86eef7e3d4..0b11f67c91 100644 --- a/example/src/test/java/org/wordpress/android/fluxc/wc/gateways/GatewayFixtures.kt +++ b/example/src/test/java/org/wordpress/android/fluxc/wc/gateways/GatewayFixtures.kt @@ -7,7 +7,7 @@ val GATEWAYS_RESPONSE = listOf( "cod", "Cash on Delivery", "Pay cash", - 0, + "", false, "COD: Method title", "COD: Method description", @@ -17,7 +17,7 @@ val GATEWAYS_RESPONSE = listOf( "stripe", "Credit card", "Pay with CC", - 1, + "1", true, "Stripe: Method title", "Stripe: Method description", diff --git a/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/model/gateways/GatewayMapper.kt b/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/model/gateways/GatewayMapper.kt index 4c330ddef3..b2d4739bd6 100644 --- a/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/model/gateways/GatewayMapper.kt +++ b/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/model/gateways/GatewayMapper.kt @@ -10,11 +10,11 @@ class GatewayMapper response.gatewayId, response.title ?: "", response.description ?: "", - response.order, - response.enabled, + response.order?.toIntOrNull() ?: 0, + response.enabled ?: false, response.methodTitle ?: "", response.methodDescription ?: "", - response.features + response.features ?: emptyList() ) } } diff --git a/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/gateways/GatewayRestClient.kt b/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/gateways/GatewayRestClient.kt index a2fd7e1823..580bf27658 100644 --- a/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/gateways/GatewayRestClient.kt +++ b/plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/gateways/GatewayRestClient.kt @@ -75,10 +75,10 @@ constructor( @SerializedName("id") val gatewayId: String, @SerializedName("title") val title: String?, @SerializedName("description") val description: String?, - @SerializedName("order") val order: Int, - @SerializedName("enabled") val enabled: Boolean, + @SerializedName("order") val order: String?, + @SerializedName("enabled") val enabled: Boolean?, @SerializedName("method_title") val methodTitle: String?, @SerializedName("method_description") val methodDescription: String?, - @SerializedName("method_supports") val features: List + @SerializedName("method_supports") val features: List? ) }