androidkotlinpaymentgoogle-pay

Google Pay API is not displayed all the countries while adding the cards at the time of payment


I have configured the Google Pay API integration in Android app successfully and tested this via Test Cards in stag environment. After that, i have submit the integration to Google Team to make it enable on the production application where I got the positive confirmation and integration is approved as well.

After this, I tried to test this on production version of the app. Here I found the major difference is that my client (who belongs to MENA region) is able to see only two countries i.e. US and UK when opened the pop-up dialog to enter the credit card details for transaction.

I tried to check this at my end and it appeared all the countries for me. FYI, I belongs to India.

Here my possible assumptions ::

For better understanding of the issue, i am adding the screenshot.

enter image description here

Code Snippet which I used to prepare the Payment Data Request:

fun getPaymentDataRequest(price: String): JSONObject {
        return baseRequest.apply {
                put("allowedPaymentMethods", JSONArray().put(cardPaymentMethod()))
                put("transactionInfo", getTransactionInfo(price))
                put("merchantInfo", merchantInfo)

                // An optional shipping address requirement is a top-level property of the
                // PaymentDataRequest JSON object.
                val shippingAddressParameters = JSONObject().apply {
                    put("phoneNumberRequired", false)
                    put("allowedCountryCodes", JSONArray(listOf("US", "GB")))
                }
                put("shippingAddressParameters", shippingAddressParameters)
                put("shippingAddressRequired", true)
            }
    }

Can anyone lead me to right direction?


Solution

  • The screenshot shows the "Add shipping address" screen and not the "pop-up dialog to enter the credit card details". In order to see more shipping countries in the dropdown either add some countries to the allowedCountryCodes array or remove the property completely to enable all countries.