stripe / stripe-android

Stripe Android SDK
https://stripe.com/docs/mobile/android
MIT License
1.29k stars 645 forks source link

[BUG] [Google Pay] Google pay not show #7477

Closed kiss718867 closed 10 months ago

kiss718867 commented 1 year ago

Summary

already add credit card to Google Wallet,use stripe-android paymentsheet-example,Google Pay not show in test environment

Code to reproduce

method isReadyToPay params

{
    "apiVersion": 2,
    "apiVersionMinor": 0,
    "allowedPaymentMethods": [
        {
            "type": "CARD",
            "parameters": {
                "allowedAuthMethods": [
                    "PAN_ONLY",
                    "CRYPTOGRAM_3DS"
                ],
                "allowedCardNetworks": [
                    "AMEX",
                    "DISCOVER",
                    "MASTERCARD",
                    "VISA"
                ],
                "allowCreditCards": true
            },
            "tokenizationSpecification": {
                "type": "PAYMENT_GATEWAY",
                "parameters": {
                    "gateway": "stripe",
                    "stripe:version": "2020-03-02",
                    "stripe:publishableKey": "pk_test_51HvTI7Lu5o3P18Zp6t5AgBSkMvWoTtA0nyA7pVYDqpfLkRtWun7qZTYCOHCReprfLM464yaBeF72UFfB7cY9WG4a00ZnDtiC2C"
                }
            }
        }
    ],
    "existingPaymentMethodRequired": true
}

existingPaymentMethodRequired = true and allowedPaymentMethods have one payment method, but isReadyToPay return false existingPaymentMethodRequired annotation says If set to true, then the isReadyToPay() class method will return true if the current viewer is ready to pay with one or more payment methods specified in allowedPaymentMethods.

Android version

Android 13

Impacted devices

xiaomi 10s

Installation method

run stripe-android paymentsheet-example

Dependency Versions

kotlin: 1.8.0 stripe-android: 20.21.1 Android Gradle Plugin: 7.4.2 Gradle: 8.0

seanzhang-stripe commented 1 year ago

Hi @kiss718867 Google Pay's document says

In the TEST environment, if you set existingPaymentMethodRequired to true in an IsReadyToPay() request, the response always returns true.

So I'd expect IsReadyToPay returns true and PaymentSheet should display Google Pay. Are you currently located in a country where Google Pay is supported?

kiss718867 commented 1 year ago

@seanzhang-stripe hi, thanks for your reply, I am in China, i modified the Google Play profile and Google Wallet payment profile to HongKong,and use VPN to locate to HongKong,but IsReadyToPay still return false, is there any other info needs to be modified?

seanzhang-stripe commented 1 year ago

Hi @kiss718867 to my best knowledge Google Pay is not available in China, and I'm not sure if Google Pay is allowed through VPN.

Maybe you want to test it again in an Android emulator which allows you to set a location? You should also make sure to use a Google account that was created in a country where Google Pay is supported.

sfriedman-stripe commented 10 months ago

Closing due to inactivity