#supriya
1 messages ยท Page 1 of 1 (latest)
HI ๐ how can we help?
@worn yacht I'm copying your question into the thread that was created for context:
I have implemented stripe in react native mobile app but not getting apple pay and google pay options
Have you gone through the Enable Apple Pay and Enable Google Pay sections contained in our guide?
https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-apple-pay
I followed same link but still not getting this option
What type of device are you testing on?
google pixel phone android 13
Alright, so all you'd be able to see on that device is Google Pay. Is your device fully set up for testing Google Pay? As in, do you have the Google Pay app installed, have completed its setup flow, and confirmed that you are able to see a card in your wallet (our integrations require that a card already be present in the associated wallet in order for wallet payment methods to be offered).
Yes because for web app I am able to see the google pay option
Also I am not seeing Apple pay option in iPhone - iPhoneX
And just double checking (focusing on Google Pay for the moment) you did update your AndroidManifest and modify the code initializing the PaymentSheet to include the necessary googlePay details?
Yes
I added this for googlePay
googlePay: {
merchantCountryCode: 'US',
currencyCode: 'usd',
}
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" /> - in AndroidMenifest
And your flow is using the mobile payment element/payment sheet?
payment sheet
Are you by chance trying to test this from India? I believe there are also regional limitations to Google Pay.
Yes this was tested in India for googlePay but applePay was tested in US only
Okay, I think that is likely why you aren't seeing Google Pay then.
Hello ๐
Taking over as toby needs to step away soon
does your integration use Expo by any chance?
No Expo is not used
Do you see an Apple Pay button when you go to this page on the iPhone (in the US)?
https://stripe.com/docs/stripe-js/elements/payment-request-button
hmm okay
do you see any errors in your console regarding Apple Pay not being available or something?
Oh wait, you said the button didn't show on this page?
https://stripe.com/docs/stripe-js/elements/payment-request-button
No. Actually I release app to appcenter and then check that option
Sorry I think there's a misunderstanding here.
I'm asking if you see an Apple Pay button when you visit the above link in safari on the iPhone you're using to test Apple Pay
Yes I am seeing that option. Also we have web app and seeing apple pay only in mobile app not seeing
Can you share your code that initializes <StripeProvider> as well as initializes the PaymentSheet?
<StripeProvider
publishableKey={this.state.publishableKey}
merchantIdentifier="merchant.com.wellzio">
<CheckoutScreen checkPaymentDone={this.checkPaymentDone} clientSecret={this.state.clientSecret} email={this.state.email} />
</StripeProvider>
const initializePaymentSheet = async () => {
try {
setVisible(true);
const { error } = await initPaymentSheet({
paymentIntentClientSecret: clientSecret,
merchantDisplayName: "Wellzio",
googlePay: {
merchantCountryCode: 'US',
currencyCode: 'usd',
},
applePay: {
merchantCountryCode: 'US',
}
}
);
if (error) {
setVisible(false);
Alert.alert("Error", "Failed to initialize payment sheet");
}
else {
setVisible(false);
openPaymentSheet();
}
}
catch (exc) {
setVisible(false);
Alert.alert('Error', exc.message);
}
};
One thing we can try is to see if Apple pay is supported on the device, we have a guide for this here
https://stripe.com/docs/apple-pay?platform=react-native#check-if-apple-pay-supported
once you intialize useApplePay() flag, all you'd want to do is print isApplePaySupported before PaymentSheet gets called.
This would allow you to check if the device supports Apple Pay