-
Notifications
You must be signed in to change notification settings - Fork 50
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
Switch to Stripe Elements and Intents API #1590
Conversation
476d693
to
9648fd7
Compare
9648fd7
to
b2b34aa
Compare
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.
Will take a proper look at it when I have time in the next few weeks
app/reducers/registrations.js
Outdated
case Event.SOCKET_PAYMENT.SUCCESS: { | ||
const registration = normalize(action.payload, registrationSchema) | ||
.entities.registrations[action.payload.id]; | ||
if (!registration) { |
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.
There should be some kind of error handling here
setSuccess={() => this.setSuccess()} | ||
setError={error => this.setError(error)} | ||
setLoading={loading => this.setLoading(loading)} | ||
ledgend={ |
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.
New payment flow: 1. Create payment intent in backend and return the client_secret to frontend 2. Use this, and pass all payment details to Stripe.js 3. Stripe handles payment details
You now have a 'start payment' button that creates a payment intent, and the client_secret is sent with Websockets to the client for further action. Also renamed `charge` to `payment`.
Depends on webkom/lego#1669
This PR:
What's missing:
The current plan is to use the synchronous flow as Stripe calls it, which is the easiest method of handling the payments.Stripe recommends using the automatic confirmation method though.I'm thinking we should go the easier way since our payments are so simple, and we wouldn't need webhooks, need feedback on this!I've migrated backend to the synchronous flow automatic confirmation method, but need to test and make sure we go this way before making a PR.I am not able to test this until we upgrade our Stripe API version though. Should be safe to upgrade in a few days!