ezet / stripe-sdk

A simple and flexible Stripe library for Flutter with complete support for SCA and PSD2.
https://pub.dev/packages/stripe_sdk
Other
137 stars 137 forks source link

backend question #108

Closed joe-getcouragenow closed 3 years ago

joe-getcouragenow commented 3 years ago

Was looking at https://github.com/ezet/stripe-sdk-demo-api

SO the dart code calls this code, which then calls the strip server ?

I ask because i want to replace the firebase code with golang code so i dont need google firebase.

BTW thanks for making this flutter plugin. Having no native is a huge bonus, because we can then use it on web, desktop, mobile and embedded ( rasp pi, etc).

ezet commented 3 years ago

Yes, correct. Some calls are made directly from the library to Stripe, while other calls must be done from your own backend because they require the secret key. And thank you :)

joe-getcouragenow commented 3 years ago

Can i just confirm by using one of your examples please.

"confirmPayment" is called from https://github.com/ezet/stripe-sdk/blob/master/example/lib/ui/payment_screen.dart#L75, which is i presume being handled by this https://github.com/ezet/stripe-sdk-demo-api/blob/master/functions/src/handlers/confirmPaymentHandler.ts#L5 ?

SO the flutter code is calling the firebase function ?

ezet commented 3 years ago

Correct. The firebase function then calls the Stripe API, and returns the response to the flutter client.

edit: No, sorry, not correct.

https://github.com/ezet/stripe-sdk/blob/master/example/lib/ui/payment_screen.dart#L75 calls the Stripe API.

https://github.com/ezet/stripe-sdk/blob/master/example/lib/ui/payment_screen.dart#L68 is calling a firebase function to create a payment intent.