#ludongming_code
1 messages · Page 1 of 1 (latest)
👋 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/1315847351256092692
📝 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.
- ludongming_code, 12 hours ago, 85 messages
- ludongming_code, 17 hours ago, 17 messages
- ludongming_code, 4 days ago, 38 messages
Hi, buddy
You can take a look at this link first https://discord.com/channels/841573134531821608/1315591499152363530
Have you tried the suggestion from my colleague @.os4m37 to run react-native example code from Stripe?
This is the example code specifically: https://github.com/stripe/stripe-react-native/tree/master/example
{"code": "Failed", "declineCode": null, "localizedMessage": "There was an unexpected error -- try again in a few seconds", "message": "No such setupintent: 'seti_1QUIGgHiYvn8ZIkeF7X7HNQL'", "stripeErrorCode": "resource_missing", "type": "invalid_request_error"}
Your demo API no longer has a 404
Sorry, I don’t get your question. Could you explain what problem you’re facing with the example code?
No value was returned here
Our server-side generates an error message when calling up the payment pop-up with the setup intent, but there is no such setup intent
{"code": "Failed", "declineCode": null, "localizedMessage": "There was an unexpected error -- try again in a few seconds", "message": "No such setupintent: 'seti_1QUIGgHiYvn8ZIkeF7X7HNQL'", "stripeErrorCode": "resource_missing", "type": "invalid_request_error"}
initPaymentSheet({
customerId: 'cus_RMnoEyyQI5icD5',
setupIntentClientSecret: 'seti_1QUIGgHiYvn8ZIkeF7X7HNQL_secret_RN2LrbW95Y6ODLJIUkD9YeBwNSSPZb8',
customerEphemeralKeySecret: 'ek_test_YWNjdF8xT2J3bzJIaVl2bjhaSWtlLHlZZXlsUmVmYVhRZXR4RG13WDB0ZzRKcGNoZmlDV3U_00MTjd6Jof',
merchantDisplayName: 'Example Inc.',
applePay: {
merchantCountryCode: 'US',
cartItems: [
{
paymentType: 'Recurring',
label: 'This is a subscription',
amount: '10.00',
intervalCount: 1,
intervalUnit: 'month',
startDate: startDate,
endDate: endDate,
},
],
},
style: 'automatic',
googlePay: {
merchantCountryCode: 'US',
testEnv: true,
},
returnURL: 'stripe-example://stripe-redirect',
allowsDelayedPaymentMethods: true,
})
This doesn't look like our example code. Could you try our example code as it is?
My screenshot is your demo
Can you understand what I mean? In your example, when it comes to remotely obtaining payment parameters, the interface reported an error
What I mean is that you should run the entire project from the code example, not copy and paste the code to your own project
With reference to your first screenshot, it looks like you're running from own project directory
I might be wrong, are you trying the example code as it is?
I understand what you mean, but I have copied the entire code into our project and there are no dependency issues. Now it's an interface error. https://rigorous-heartbreaking-cephalopod.glitch.me/payment-sheet-subscription
Responsive.json serialization failed
Is the issue with seralization or seti_1QUIGgHiYvn8ZIkeF7X7HNQL not found?
The information you shared are mixed that I can't pinpoint which is the issue you're facing
Because your interface reported an error, we went to our own server to generate the setup intent, but it would report an error stating that the setup intent does not exist
Thanks for sharing. This explains the errors you shared. I'd recommend sharing the what you've done and their relationships, so that we can understand your issues better.
Has the glitch server responded the necessary information correctly?
Did you follow this example code here to create the server implementation of /payment-sheet-subscription endpoint? https://github.com/stripe/stripe-react-native/blob/master/example/server/index.ts#L627-L721
{"_h": 0, "_i": 0, "_j": null, "_k": null} {"_bodyBlob": {"_data": {"__collector": [Object], "blobId": "b273d626-2901-4ed0-a029-ac531e13c177", "offset": 0, "size": 166}}, "_bodyInit": {"_data": {"__collector": [Object], "blobId": "b273d626-2901-4ed0-a029-ac531e13c177", "offset": 0, "size": 166}}, "bodyUsed": true, "headers": {"map": {"content-length": "166", "content-security-policy": "default-src 'none'", "content-type": "text/html; charset=utf-8", "date": "Tue, 10 Dec 2024 02:44:46 GMT", "x-content-type-options": "nosniff", "x-powered-by": "Express"}}, "ok": false, "status": 404, "statusText": "", "type": "default", "url": "https://rigorous-heartbreaking-cephalopod.glitch.me/payment-sheet-subscription"}
It looks like we hard coded the https://rigorous-heartbreaking-cephalopod.glitch.me in this file https://github.com/stripe/stripe-react-native/blob/master/example/src/Config.ts while this glitch URL is likely outdated
Could you point this URL to your own server or your own glitch and implement this code with the code here? https://github.com/stripe/stripe-react-native/blob/master/example/server/index.ts#L627-L721
So does your URL have a new one
So I also need to start a service?
Don't you have this interface online now?
As per checking, it looks like we didn't implement /payment-sheet-subscription endpoint, that's why 404 error was thrown: https://glitch.com/edit/#!/rigorous-heartbreaking-cephalopod?path=server.js
The glitch is out of sync from the example code, that's why 404 error is thrown
I'm sorry for that and I'll share the feedback to the relevant team to fix this
Meanwhile, can you do following?
- Clone this glitch
- Add the code implementation of
/payment-sheet-subscription - Then update https://github.com/stripe/stripe-react-native/blob/master/example/src/Config.ts to point to your own clone glitch URL
Are you saying I raised an issue on GitHub?
I have reported internally to fix the issue, but the fix won't be immediate
Meanwhile, you can clone and glitch and implement the missing endpoint
So, where should I create a work order and upload my code
- Go to https://glitch.com/edit/#!/rigorous-heartbreaking-cephalopod?path=server.js and click "Remix" to clone the code
- Add the code implementation of
/payment-sheet-subscription: https://github.com/stripe/stripe-react-native/blob/master/example/server/index.ts#L627-L721 - Then update https://github.com/stripe/stripe-react-native/blob/master/example/src/Config.ts to point to your own clone glitch URL
This will create a new server using glitch
Can I request a work order regarding my original question?
We are unable to reproduce the issue you described in your original question, i.e. Google Pay isn't shown in the Payment Sheet. We are unable to identify whether it's a device, code or your project configuration issue since we can't reproduce with your initPaymentSheet config.
That's the reason why we suggest to use stripe code example as it is (running directly from code example instead of copying to your own project) to test out to eliminate environment configuration.
Another few items we can test here are:
- Does your Payment Sheet configuration work in other android device?
- Have you tried in the Pixel 3 Android simulator? Google Pay only works on Pixel 3 simulator
If it still doesn't work, I'm afraid we need to check with the relevant team to look into it further.