#ludongming_code

1 messages ¡ Page 1 of 1 (latest)

mild loomBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1315591499152363530

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

atomic geode
stark narwhal
#

Could you share the code of googlePay config in the initPaymentSheet?

atomic geode
#

The first picture shows me using initPaymentSheet and presentaPaymentSheet to create a payment pop-up, while the second picture shows me using confirmPlatformPayment. So why doesn't the first picture have a Google Pay option?

#

{
merchantDisplayName: merchantName,
customerId: trialData?.customer,
customerEphemeralKeySecret: trialData?.ephemeralKey,
setupIntentClientSecret: trialData?.setupIntent,
returnURL: 'yigolicarwashintl://stripe-redirect',
paymentMethodTypes: trialData ? ['card', 'googlePay', 'applePay'] : undefined,
googlePay: {
merchantCountryCode: 'US',
currencyCode: 'USD',
testEnv: IS_DEV,
merchantName,
existingPaymentMethodRequired: false,
billingAddressRequired: true,
},
applePay: {
merchantCountryCode: 'US',
currencyCode: 'USD',
}
}

stark narwhal
#

The code here uses Setup Intent whereas the screenshot for PlatformPay used Payment Intent.

Could you set the same Payment Intent client secret and googlePay config for both initPaymentSheet() and confirmPlatformPay() to check whether the behaviours are the same?

atomic geode
#

I use confirmPlatformPaySetup Intent, which can also be pulled up

#

This parameter was successfully obtained by the server from you. Using initPaymentSheet with the same parameter will not display Google Pay, but using confirmPlatformPaySetup Intent can

stark narwhal
#

Could you share the code for both initPaymentSheet() and confirmPlatformPaySetup()?

atomic geode
#

const param = {
merchantDisplayName: merchantName,
customerId: trialData?.customer,
customerEphemeralKeySecret: trialData?.ephemeralKey,
setupIntentClientSecret: trialData?.setupIntent,
returnURL: 'yigolicarwashintl://stripe-redirect',
paymentMethodTypes: ['card', 'googlePay', 'applePay'],
googlePay: {
merchantCountryCode: 'US',
currencyCode: 'USD',
testEnv: IS_DEV,
merchantName,
label: merchantName,
},
applePay: {
merchantCountryCode: 'US',
currencyCode: 'USD',
buttonType: 'short'
}
}
const { error } = await initPaymentSheet(param);

#

const { error } = await confirmPlatformPaySetupIntent(trialData?.setupIntent, {
googlePay: {
testEnv: IS_DEV,
merchantName: options.label,
merchantCountryCode: 'US',
currencyCode: 'USD',
// billingAddressConfig: {
// format: PlatformPay.BillingAddressFormat.Full,
// isPhoneNumberRequired: true,
// isRequired: true,
// },
},
});

stark narwhal
#

This is indeed strange. Let me check internally and get back to you

mild loomBOT
pulsar pawn
#

what's the SetupIntent ID seti_xxx ?

atomic geode
#

seti_1QU2zRHiYvn8ZIkeRGuDMGFr_secret_RMmYcrgxyge4NjfqFHVBRkmMIEzG0H6

pulsar pawn
#

can you remove paymentMethodTypes from the parameters to initPaymentSheet ?

atomic geode
#

I have already configured AndroidManifest.xml

#

Will the 'setupIntentClientSecret' generated by our server limit the selection of payment methods?

pulsar pawn
#

anyway, I have no idea why Google Pay is not appearing here, I'm sorry. My best guess is maybe the PaymentElement can only show one "wallet", and CashApp takes priority to display over the Google Pay wallet.

atomic geode
#

Is there any other way for my users to choose Google Pay payment?

pulsar pawn
#

those are the possible integrations, PaymentSheet and the platformPay components

atomic geode
#

It's like this, we pull up the payment control to obtain the user's payment method. If I can use ConfirmPlatformPaySetup Intent to pull up a payment pop-up window, and then the user pays 0 yuan, can I also get the user's payment method, so that the server can automatically deduct the payment through this payment method in the future?https://docs.stripe.com/payments/save-and-reuse?platform=react-native&mobile-ui=payment-element#add-google-pay

Learn how to save payment details and charge your customers later.

pulsar pawn
#

not sure what you mean. That guide you linked is for processing a payment and saving a card during the payment. If your question is can you pass 0 to the amount on the PaymentIntent, no, you can't.

atomic geode
#

I am currently collecting payment methods from users to facilitate automatic deduction for future subscriptions. Now calling initPaymentSheet, if users cannot choose Google Pay, it will affect our users'

pulsar pawn
#

as I said, I have no idea why Google Pay is not appearing here, I'm sorry. It feels like it should, maybe there's something I'm missing. You could open a support ticket at https://support.stripe.com/?contact=true with a minimal reproduction of your app that exhibits the problem and we could try investigate deeper.

atomic geode
#

Does the server need to add special parameters when generating the setup IntentClient Secret? For example, payment methods: ['card ',' appePay ',' googlePay ']

pulsar pawn
#

no it does not

#

I already checked the logs on your account and on the backend the SetupIntent seems to support GooglePay. I don't know why the PaymentSheet is not showing it.

atomic geode
pulsar pawn
atomic geode
#

After closing the cashapp, you will have a card

pulsar pawn
#

I see. Then I'm out of ideas and I'd suggest opening a support ticket.

atomic geode
#

confirmPlatformPaySetupIntent(trialData?.setupIntent, {
googlePay: {
testEnv: IS_DEV,
merchantName: options.label,
merchantCountryCode: 'US',
currencyCode: 'USD',
// billingAddressConfig: {
// format: PlatformPay.BillingAddressFormat.Full,
// isPhoneNumberRequired: true,
// isRequired: true,
// },
},
})

#

I found that this can pull up Google Pay, but it shows 0 yuan. Does clicking continue also mean that the server has collected the user's payment method

mild loomBOT
pulsar pawn
#

it would confirm the SetupIntent, and if that SetupIntent has a customer set, the PaymentMethod is saved to that customer

atomic geode
#

So triggering Google Pay to pass the parameter 'amount 0' allows for normal payment

pulsar pawn
#

it should be the same, the PaymentElement is also using a SetupIntent, so it's also using amount:0.

#

which is why I say I don't know why it's not working the same as platformPay, there's no reason I can think of or discover from everthing I've checked unfortunately ( so please open a support ticket if the issue persists so we can try and dig deeper)

atomic geode
#

So where can I pick up the work order?

orchid bison
#

Hey! Taking over for my colleague. Let me catch up.

atomic geode
#

const param = { "applePay": { "merchantCountryCode": "US" }, "customerEphemeralKeySecret": "ek_test_YWNjdF8xT2J3bzJIaVl2bjhaSWtlLDd2Q0Q3ckJUTEd0VEQyc0F3Yk5uV3pmeVlXWmJyS1g_00BeGZcpmo", "customerId": "cus_RMnoEyyQI5icD5", "googlePay": { "currencyCode": "USD", "merchantCountryCode": "US", "testEnv": true }, "merchantDisplayName": "JETX Platform Services", "returnURL": "yigolicarwashintl://stripe-redirect", "setupIntentClientSecret": "seti_1QU4MBHiYvn8ZIkeCA4uTKd1_secret_RMny5edgyc3242LXKCAMvCXXh9J1zu9" }
const { error } = await initPaymentSheet(param);

    const { error: error2 } = await presentPaymentSheet();
orchid bison
atomic geode
#

The above is my code, the parameters have not been used yet. You can see why Google Pay does not display them when pulling up the payment control

orchid bison
#

Do you have a valid card in your Google Wallet ?

atomic geode
atomic geode
# atomic geode

his is a control pulled up through confirmPlatformPaySetup Intent

orchid bison
#

Where are you based ? which country ?

orchid bison
orchid bison
#

Google Pay seems active in your Stripe Dashboard.

#

Where are you based currently? You are testing from which country?

atomic geode
#

Yes, I can also pull up the control through ConfirmPlatformPaySetup Intent, but it shows a payment of 0 yuan. What I expect is for the user to choose a payment method such as Apple Pay or Google Pay

#

China

#

I can see

orchid bison
atomic geode
#

I am using React Native

#

not web

orchid bison
#

Yes I know. Just I want to make sure that your mobile device meet all the requirements and display Google Pay

#

I invite you please to open the link I shared above from your mobile browser, the same device you are using to test/run your ReactNative App.

atomic geode
orchid bison
#

Ok great thanks.

atomic geode
#

Can you help me create a work order

orchid bison
#

Now let's move to our official ReactNative example in tegration and try running it on the same device

#

And see if you sees Google Pay or not ?

atomic geode
#

Currently, the payment controls pulled up using initPaymentSheet and presentaPaymentSheet only display card and cash app payments without Google Pay and Apple Pay options. However, I can pull up the Google Pay payment control through ConfirmPlatformPayment

#

I'll give you the code first. Am I getting off work? Looking forward to a good response from you tomorrow

orchid bison
#

Could you please try the example I shared with you first ?

atomic geode
#

My question is very clear. When I use initPaymentSheet to collect user payment methods, there is no Google Pay in the control, only Card and Cash App. However, when I use ConfirmPlatformPaySetup Intent to pull up Google Pay separately, it can be pulled up normally. But this is not what I want. I want to use initPaymentSheet to pull up the control and let users choose Google Pay. Most importantly, it is written in your document that it is possible.
https://docs.stripe.com/payments/save-and-reuse?platform=react -native&mobile-ui=payment-element#charge-saved-payment-method

orchid bison
#

Yes I totally understand that, but we are not able to reproduce or underline the root issue here. That's why I'm inviting you to try reproduce the issue on our official project and share with us a reproduction steps.

mild loomBOT