I am trying to setup Stripe payments on my React native app by following Stripe's mobile element. When I click on 'CHeckout', I see card details but don't see Google Pay as an option. Here is the code snippet:
const { error, paymentOption } = await initPaymentSheet({
merchantDisplayName: "Example, Inc",
customerId: customer,
customerEphemeralKeySecret: ephemeralKey,
paymentIntentClientSecret: paymentIntent,
// Set `allowsDelayedPaymentMethods` to true if your business can handle payment
//methods that complete payment after a delay, like SEPA Debit and Sofort.
allowsDelayedPaymentMethods: true,
defaultBillingDetails: {
name: 'Jane Doe',
},
googlePay: {
merchantCountryCode: 'US',
testEnv: true, // use test environment
currencyCode: 'USD',
},
});
I added the following in AndroidManifest.xml:
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true" />
app/build.gradle:
dependencies {
implementation("com.stripe:stripe-android:20.36.1")
implementation("com.google.android.gms:play-services-wallet:19.3.0-beta01")
}
Added google and maven to buildscript and allprojectsbuild.gradle:
allprojects {
repositories {
google()
mavenCentral()
}
}
Even though I enabled test mode, I installed Google Pay and set it up too. I still dont see Google pay, when i checkout. It shows me an option only to enter card details and nothing else. What am I missing?