-
-
Notifications
You must be signed in to change notification settings - Fork 724
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
Add new Stripe payment method compatible with the new Stripe Payment Intents API #4672
Add new Stripe payment method compatible with the new Stripe Payment Intents API #4672
Conversation
40a0061
to
71f910b
Compare
Nice work! Looks like some of the stubbed requests in the new specs need adjusting a bit... |
yes, thanks @Matt-Yorkley I am finishing that spec today. I wanted to get some early feedback 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fabulous. 🚀
556f7f3
to
ca33d8a
Compare
ok, I rebased and added the two last commits: make one method better looking and add some missing translations. There are two test scenarios that are not working yet. 4 and 7.
the problem here is that this customer form does not have any association with a payment method, so we dont know if this will be used for a stripe payment method with SCA or the legacy stripe api. Currently the form is adding the card to the legacy stripe api and these cards will only work with payment methods that use the legacy stripe api (non sca). I am not sure how we should proceed here because while the new sca payment method is not completed and all user data migrated, we will still want the old stripe payment methods to work.
Without point 4 above, cards that work with the new sca method can only be added through checking out with the save card option enabled. I think we should ship this PR as is if no one disagress. the new stripe sca payment method will be available but only works in limited list of use cases. We can then improve it until we can replace the old one. |
Thanks @luisramos0 I agree with your approach above. Do you foresee any issues when we come to merge the old API user data with the new API user data. As the above approach means we'll have split user data including potentially the same user across both APIs. I guess this is totally handled by Stripe? |
Something I'm not sure to understand: if we upgrade the API, doesn't it means that we should disable the current form that saves card in the legacy API? |
@RachL this is not related to upgrading to the latest api version. We can have both payment methods work at the same time, we just need to see what to do with this customer form. if you agree we can just go forward with this PR as is. I can start investigate the easiest approach afterwards:
|
@lin-d-hop answering your question: I still have to see if I can use the existing data in the new api. I havent managed so far but I think it will be possible. Conclusion: lets go forward with this PR that adds the new payment method (Stripe SCA) and works with the new payment intents api. This way we can already validate it in staging and live. And meanwhile we can work on making this payment method ready for the full process. |
7c67667
to
8ede82b
Compare
ok, it looks like subscriptions are working :-) This is ready to be reviewed and tested 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really exciting. Two questions though:
- Do we need to place a warning there or mark SCA as experimental so that people don't start using SCA without it working 100%? I'm imagining a new enterprise setting up, not talking to us and then using SCA and adding cards as admin. What would happen then?
- I guess, with the new legislation, if an admin adds a card from the backend, it could happen that the system decides that it needs further authorisation and emails or texts the owner of the card. But it's still legal to add a card to the system without being the owner? I could imagine that that's why a card added with the old API is not usable in the intents API (not sufficiently authorised).
|
app/assets/javascripts/admin/payments/services/payment.js.coffee
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👍
I left a couple of comments, and I'm also not sure we should make the payment method public until it's all finished. Maybe superadmin only would be good, so we can test it whilst we iterate?
thanks for the review Matt. Yeah, we can change its name or make it super admin only. |
6390cd0
to
bd55340
Compare
bd55340
to
408bff4
Compare
… Intents API This commit can be reverted once we upgrade to v1.98.0
…ents API instead of the Stripe Charges API that the current StripeConnect gatreway uses
Update Source is dead since a74c502
…nt id before making the call to the stripe api This account id cannot be sent when dealing with the old StripeConnect gateway
…ition to it and the other stripe template We need to set the stripe object with the stripe account id to work with the payment intents api but we cannot set it to work with the stripe charges api This makes the two payment methods incompatible: a given enterprise cannot use both the old stripe integration and this new one at the same time.
…aking profile storer work with the slightly different api responses from stripe
…ipe_account_id must be included in the stripe api call
stripe_connect_spec will be deleted at some point when all users are migrated to the sca api
…ribute cases: existin stripe integration and new stripe sca
…etting up of process of a payment method and subscriptions Here we are copy pasting and adding stripe SCA because we are planning to delete the StripeConnect that will be replaced by the stripe sca implementation
408bff4
to
b3ac5d8
Compare
rebased to resolve conflicts and pushed to upstream so that this is also seen in #4719 |
tested as part of 4719, merging. |
What? Why?
Relates to #4180
Closes #4686 and #4173
The decision to duplicate the existing Stripe payment method has the objective of making the migration as smooth as possible and also of making it possible for us, after we migrate all users, to delete the original stripe payment method (and its code), and keep only the new one (that uses the new SCA compatible APIs).
Although this new API was made by stripe for European SCA it does work worldwide, we don't need to keep both integrations 👍
This PR is not introducing any new auth processes yet. It should just work like the existing stripe payment method.
I have added entries to rubocop_manual_todo for the remaining rubocop issues. Code climate is not picking the exceptions list from rubocop_manual_todo...
In terms of tests we are not adding any feature tests here as we plan to get something new with #4639
What should we test?
We need to verify that the existing Stripe payment method works.
We need to verify the new payment method, it should just work like the existing stripe payment method.
Processes we need to test:
The following details are valid before #4719, if we are testing 4719, all cases above should work.
Release notes
Changelog Category: Added
Added new payment method that integrates with the new Stripe Payment Intents API that is compatible with SCA. This is a initial preparation for us to implement the more complex payment authentication flows that banks will start to enforce in Europe soon.