capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 74 forks source link

Migration guide from v1 to v3 #86

Closed nkCreation closed 2 years ago

nkCreation commented 2 years ago

First of all, thank you for your amazing work here. I've seen a lot of changes and glad to see it, running under latest specs.

However, I have an ionic capacitor angular 12 app running Stripe with the version 1 of this plugin. Today I started to migrate all the things from capacitor 2 to capacitor 3.

When it comes to Stripe, I see that everything changed and consequence here is I think I have to adjust the backend of my app or create new endpoint because of breaking changes?

I used createCardToken, setPublishableKey, payWithGooglePay, payWithApplePay, finalizeApplePayTransaction methods... but all of them have been removed.

Also, regarding your screenshots, I fear that my app will have UI changes with the update : I already have a good designed payment form with all the required fields, which I used to pass to creadCardToken before.

Maybe a migration guide is necessary here for people like me looking to update. In short: If I can't update to v3 here, Will I be able to update to capacitor 3?

Thank your for reading!

rdlabo commented 2 years ago

@nkCreation Good Morning.

  1. I think I have to adjust the backend of my app or create new endpoint

Yes. Plugin of v1 is using secret key at frontend. This is not recommend, and we must use endpoint in backend: https://github.com/capacitor-community/stripe/pull/74#issuecomment-860231530

I fear that my app will have UI changes with the update

That's right. Now this plugin support payment sheet only, and you can't use previous design.

Will I be able to update to capacitor 3?

Not technically impossible, but

So we don't recommend and support.

Thanks.

nkCreation commented 2 years ago

actually in my app the payment is set in the backend, the only key I used in the front end. is the publishable key but ok, I will edit my back end code.

I'll write an article after that.

thank you

rdlabo commented 2 years ago

Yes, v3's important things is secure that we can't get user's card information. Only get card token. I am looking forward to your article. Thank you.

rdlabo commented 2 years ago

@nkCreation Did you adapt this plugin for production? If yes, please tell us what app. Please help us to develop this plugin in 2022. https://github.com/capacitor-community/stripe/issues/145 Thanks.

hcassar93 commented 1 year ago

actually in my app the payment is set in the backend, the only key I used in the front end. is the publishable key but ok, I will edit my back end code.

I'll write an article after that.

thank you

We're in a similar situation moving over from Stripe cordova. Would very much appreciate your advice. How did you end up resolving this issue? We want to maintain the ability to use createCardToken so cards can be added to users accounts using our existing UI. We're storing the secret key on the backend obviously.