#Jane_Zhong

1 messages · Page 1 of 1 (latest)

wicked vaporBOT
sly hatch
#

Hi! Let me help you with this.

#

Are you using Stripe Connect?

severe rapids
#

Hi,I am not sure what that mean ,but in Front kent ,I use :@stripe/react-stripe-js ;

sly hatch
#

What's your Stripe account ID?

severe rapids
#

There you go :req_kgvyOD1uUjUi6J

sly hatch
#

This Payment Intent belongs to a different Stripe Account. Are you sure you're using the secret and publishable key from the same pair?

severe rapids
#

Let me double check it

severe rapids
#

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

sly hatch
#

Could you please provide the error message with ID in text?

wicked vaporBOT
severe rapids
#

Yes,this is the error from React:No such payment_intent: 'pi_3NLOOBImZeQYXOtG2LNxkcDF' ; and the req_id:req_QE1K173HhWLOtp

sly hatch
severe rapids
#

pi_3NLOReImZeQYXOtG0PNHEuWZ

#

this one ?

sly hatch
severe rapids
#

Oh,I have fleshed it ...But the new one happen the same ,pi_3NLOReImZeQYXOtG0PNHEuWZ also :

sly hatch
#

Where does the error come from on the frontend?

severe rapids
#

Yes ,from the frontend ,and I have confirmed that the public key and secret key dosen't have problem ....

sly hatch
#

So where does the error come from then?

severe rapids
#

That's why I confused 😢

#

And it dosen't make sence, because ,the state is 200 ok ...

minor yacht
#

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

severe rapids
#

Yes ,,, I have checked many times : this is my publish key in Stripe: ,and I have checked in Frontent :They are the same

minor yacht
#

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

severe rapids
#

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

minor yacht
#

what is your exact code you're using?

severe rapids
#

Backend or Frontend ?

minor yacht
#

both

severe rapids
#

hold on a sec,I send to you

minor yacht
#

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

severe rapids
#

I seee.... it is for my return url ... I am not using https

minor yacht
#

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)

severe rapids
#

and I test it ,it works in the browser

minor yacht
#

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

severe rapids
#

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

minor yacht
#

you should pass automatic_payment_methods: {enabled: true} when creating the PaymentIntent as the docs describe, instead of using payment_method_types:['card']