stripe / stripe-android

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

[BUG] Unable to see Google Pay option when Payment Sheet is opened #8695

Open sidharth1196 opened 4 days ago

sidharth1196 commented 4 days ago

Summary

Hello, I've been trying to get google pay working for my stripe payment gateway in my android application.

I did see it once a few months ago but was in backlog for a while. I've come back to get it addressed but the same code that was working before doesn't seem to be working right now.

I'm in the UK and testing in a device within UK with a debit card liked to Google Wallet.

Code to reproduce

  fun checkoutButtonOnClick(amount: Double, currency: String) {
          val intentConfig = PaymentSheet.IntentConfiguration(
              mode = PaymentSheet.IntentConfiguration.Mode.Payment(
                  amount = (amount*100).toLong(),
                  currency = currency,
              ),
              // Other configuration options...
          )

    val address = PaymentSheet.Address(country = "GB")
    val billingDetails = PaymentSheet.BillingDetails(
        address = address
    )
    val googlePayButtonConfig = PaymentSheet.GooglePayConfiguration(
        environment = PaymentSheet.GooglePayConfiguration.Environment.Test,
        countryCode = "GB",
        currencyCode = "GBP",
    )
    val configuration = PaymentSheet.Configuration(
        merchantDisplayName = "",
        googlePay = googlePayButtonConfig,
        defaultBillingDetails = billingDetails
    )
    paymentSheet.presentWithIntentConfiguration(
        intentConfiguration = intentConfig,
        configuration = configuration
        // Optional configuration - See the "Customize the sheet" section in this guide
        /*configuration = PaymentSheet.Configuration(
            merchantDisplayName = "Example Inc.",
        )*/
    )

}

Android version

Android 14

Impacted devices

Pixel 7a

Installation method

Gradle

Dependency Versions

kotlin: stripe-android: Android Gradle Plugin: Gradle:

SDK classes

Video

Other information

porter-stripe commented 4 days ago

Hi @sidharth1196 we've tested with the code you have provided and it worked on our end. Can you ensure that you have Google Pay enabled on your Dashboard and also have updated your Android manifest file according to our docs.

MohandIbrahim commented 4 days ago

Hello @porter-stripe, I'm part of the same team working on the project We double checked the docs -updated stripe to latest version -Manifest is the same -Dashboard is also fine and as you can see the code should work fine. Do you have any other ideas why would this happen?

sidharth1196 commented 4 days ago

@porter-stripe Hi Nick, yes, we have Google Pay enabled in the stripe dashboard as well. Manifest file contains the metadata within the application tag like the documentation says.

I believe we've followed everything as recommended but can't seem to see the google pay button on the payment sheet. Any help/suggestion would be greatly appreciated. Thanks !

jaynewstrom-stripe commented 4 days ago

Could you share a payment_intent_id / setup_intent_id for us to look at?