#henrique-gpay-paymentsheet
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- henriquenascimento7167, 1 hour ago, 14 messages
- henriquenascimento7167, 1 day ago, 13 messages
Hi 👋
Can you describe more completely what is going wrong here?
What docs are you following? What code are you using (text, not screenshots), and what is the behavior you expect?
Opting to force light mode on Android affects all applications, but you would like to leave only the payment screen, so that the Google button can continue dark and then Google approves that screen.
Okay what options are you passing to the initPaymentSheet function?
const initializePaymentSheet = async () => {
const {
paymentIntent,
ephemeralKey,
customer,
publishableKey,
} = await fetchPaymentSheetParams();
const { error } = await initPaymentSheet({
merchantDisplayName: "Blist",
googlePay: {
merchantCountryCode: 'US',
currencyCode: 'usd',
// testEnv: true,
},
applePay: {
merchantCountryCode: 'US',
},
style: 'automatic',
customerId: customer,
customerEphemeralKeySecret: ephemeralKey,
paymentIntentClientSecret: paymentIntent,
allowsDelayedPaymentMethods: true,
defaultBillingDetails: {
name: userData.name,
}
});
if (!error) {
setLoading(true);
openPaymentSheet(paymentIntent);
}
};
You must turn the Google Pay button on when the device is in dark mode, and dark when in light mode, so that it passes through Google's review. So you can fix the Stripe element always in light mode but without affecting other screens of my app
Sorry, I'm finding this wording rather confusing. We allow you to specify either dark or light mode for only the PaymentSheet by passing in arguments to the initPaymentSheet function but I don't see you doing that.
So what do you expect to happen?
style: 'automatic' will mean the Payment Sheet (on iOS) will adjust to match whatever the device is set to
We mention the options you have here: https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#dark-mode
Okay but your issue is that the GooglePay button is NOT changing color even when the rest of the PaymentSheet is in Dark mode?
What version of the React Native SDK are you using?
yes
Can you share which version of the Stripe RN SDK you are using?
"react-native": "^0.67.5",
"@stripe/stripe-react-native": "^0.19.0",
The current version is 0.35.0. I realize upgrading is non-trivial but could you try building a quick repro following our canonical doc https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet with the latest version and see if that addresses your issue?
okay, I'll try... but as it's a relatively old application, the last time I tried to use the latest version, it broke a lot of elements. Thanks for the help anyway
Yeah, I know I've hit similar issues with even simple RN apps. It's easy to run into dependency issues
I can confirm that my React Native integration with "@stripe/stripe-react-native": "^0.35.0", does render the Google Pay button in Light mode when the Payment Sheet is in Dark
Looking in the Changelog you can see the Google Pay element was updated to match Google brand guidelines in version 0.27.0
https://github.com/stripe/stripe-react-native/blob/master/CHANGELOG.md#0270---2023-04-21
As Google and Apple update their branding guidelines we will have to update the assets in our React Native library. To maintain compliance with those guidelines you will need to keep your stripe RN sdk up to date ase well.
I'm going to close this thread but if you are still having difficulties once you've tested out an integration with our updated SDK feel free to come back to the main channel and ask your question there.