#Jane_Zhong
1 messages · Page 1 of 1 (latest)
Hi,I am not sure what that mean ,but in Front kent ,I use :@stripe/react-stripe-js ;
I have followed this doc :https://github.com/stripe/react-stripe-js
What's your Stripe account ID?
Or better. Could you please share the Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
There you go :req_kgvyOD1uUjUi6J
This Payment Intent belongs to a different Stripe Account. Are you sure you're using the secret and publishable key from the same pair?
Let me double check it
Hi,you were right ,and the secret key was wrong ,and I have modified it ,thank you so much ! However ,the problem still there ,I have checked the log ,it is 200 ,but when I check the the payment,showing imcomplete ,could you please take a look :
req_QE1K173HhWLOtp
and the screenshort of Frontend also
Could you please provide the error message with ID in text?
Yes,this is the error from React:No such payment_intent: 'pi_3NLOOBImZeQYXOtG2LNxkcDF' ; and the req_id:req_QE1K173HhWLOtp
No I mean the PaymentIntent ID from the error message.
No, the one on the picture.
Oh,I have fleshed it ...But the new one happen the same ,pi_3NLOReImZeQYXOtG0PNHEuWZ also :
This error still suggests the PaymentIntent belongs to a different Stripe Account.
Where does the error come from on the frontend?
Yes ,from the frontend ,and I have confirmed that the public key and secret key dosen't have problem ....
So where does the error come from then?
That's why I confused 😢
And it dosen't make sence, because ,the state is 200 ok ...
the request to create it can succeed, but the request on the frontend can fail
make sure you use the same pair of keys from https://dashboard.stripe.com/apikeys from the same account, and configure the frontend React app to use the public key pk_test_xxx and the backend to use the secret key sk_test_xxx
Yes ,,, I have checked many times : this is my publish key in Stripe: ,and I have checked in Frontent :They are the same
you need to check again
I looked and on the frontend you are making a request still using an "example key"(you copied and pasted some of our docs which contain a key), instead of using the key from your account
make sure you are saiving the file and re-starting your server for example when you change something
No worries .... I guess I have find out the problem .I have checked ,and solved it,thank you so much for your patience ... Now I have got another error :Invalid URL: An explicit scheme (such as https) must be provided.
This is the :pi_3NLOm6ImZeQYXOtG2IiQhVdK
what is your exact code you're using?
Backend or Frontend ?
both
hold on a sec,I send to you
in the meantime, note you can look at your own logs e.g. https://dashboard.stripe.com/test/logs/req_0sK2KiDLKlW2V5
so you can debug for yourself and see that you passed return_url: "undefined/success", which is a bug in your code that is calculating the variable you pass to return_url in the frontend Javascript
I seee.... it is for my return url ... I am not using https
it doesn't have to be HTTPS(when in test mode), but it needs to be a real URL (like http://localhost:4242/success for example)
yes ,I am using http://localhost:5000/succes
and I test it ,it works in the browser
yep but you can see that see that you passed return_url: "undefined/success", which is a bug in your code that is calculating the variable you pass to return_url in the frontend Javascript
so if you look at your own code, you will see you probably have code that you think is supposed to create the string "http://localhost:5000" but actually is returning undefined
I got it bro!!You are right ,I have solved it ,because I am using VITE,and after I added it ,it works ,thank you so much !!! And now I still have error:Payment details were collected through Stripe Elements using automatic payment methods and cannot be confirmed with a Payment Intent configured with payment_method_types. pi_3NLOwOImZeQYXOtG1TYwFpjQ