Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You cannot create a charge with a PaymentMethod? #39

Closed
wyxcoder opened this issue Sep 25, 2019 · 6 comments
Closed

You cannot create a charge with a PaymentMethod? #39

wyxcoder opened this issue Sep 25, 2019 · 6 comments

Comments

@wyxcoder
Copy link

When I use the token to call stripe.Charge.create, I got error

You cannot create a charge with a PaymentMethod. Use the Payment Intents API instead

Any idea what is the problem?

@jonasbark
Copy link
Owner

how do you call "stripe.Charge.create"? which package is that? Context?

@wyxcoder
Copy link
Author

That is how my current webapp works, on browser, I use https://js.stripe.com/v3/, collect stripe token. On server side, I call stripe.charge.create with the token to complete the purchase.
I tried to use the same backend to handle the purchase on Android.
It looks like this lib is using PaymentIntent which is the new way stripe created. I am still checking how to switch.

@wyxcoder
Copy link
Author

Could you please add some flutter sample code for the whole flow to use this lib?
To use PaymentInent, It seems you need create client secret on server first and pass to client side and then collect client side info and submit on server side.

@jonasbark
Copy link
Owner

Please refer to the official docs - they include lots of examples also for the server side.

@HathTech
Copy link

tipsi-stripe returns token not payment id.
Can you let me know the way to return the token and not payment id.

@jonasbark
Copy link
Owner

tipsi-stripe in the latest branch returns the exact same thing as flutter_stripe_payment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants