#nothing_api
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/1341283040504188984
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! Looking into this!
Hello Sam.
Yes please i have been stuck on this from last 2 days.
Can you provide me with the code for your payment sheet and ephemeral key?
Yes
fetch('https://api.stripe.com/v1/ephemeral_keys',{
method:'POST',
headers:{
'Authorization':'Bearer ,
'Content-Type':'application/x-www-form-urlencoded',
'Stripe-Version':'2023-10-16'
},
body:customer=${"cus_Rn1GwvvGPow7Q7"}
}).then(res=>res.json()).then(key=>{
console.log(key.secret);
initPaymentSheet({
merchantDisplayName:"Example, Inc.",
paymentIntentClientSecret:"pi_3QtjFPGHic5sXtZa1VSEr7l2_secret_N2RjLu2OyQfJXFW53iUQVUiiT",
customerEphemeralKeySecret:key.secret
}).then(()=>presentPaymentSheet());
});
Should i share it as file or this would work ? .
You shouldn't be sharing your secret key. Please remove that.
Yes removed.
it was secret test key
A few updates:
- Do not create the ephemeral key at the front end, always do it on the back end
- The payment intent created (pi_3QtjFPGHic5sXtZa1VSEr7l2) doesn't have a customer ID: https://dashboard.stripe.com/test/logs/req_VFv9EFk2efvEJs
- The document requires
customer: customer.id
I tried to create the payment intent again with the customer id but still the saved methods are not visible in sheet
pi_3QtjtUGHic5sXtZa0Rkd9OIa_secret_tzW3vpMIgYpM3yOzV2fvOcBZa
Can I get the latest code you used to test with the new payment intent?
Yes
fetch('https://api.stripe.com/v1/ephemeral_keys',{
method:'POST',
headers:{
'Authorization':'Bearer ,
'Content-Type':'application/x-www-form-urlencoded',
'Stripe-Version':'2023-10-16'
},
body:customer=cus_Rn1GwvvGPow7Q7
}).then(res=>res.json()).then(key=>{
console.log(key.secret);
initPaymentSheet({
merchantDisplayName:"Example, Inc.",
paymentIntentClientSecret:"pi_3QtjtUGHic5sXtZa0Rkd9OIa_secret_tzW3vpMIgYpM3yOzV2fvOcBZa",
customerEphemeralKeySecret:key.secret
}).then(()=>presentPaymentSheet());
});
Can you try by adding the customer ID to initPaymentSheet similar to what is here: https://docs.stripe.com/payments/accept-a-payment?platform=react-native#react-native-collect-payment-details
Yes it worked.
the customer id was missing.
Thanks you so much Sam.