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

Switch to Stripe Elements and Intents API #1590

Merged
merged 16 commits into from
Aug 23, 2020
Merged

Switch to Stripe Elements and Intents API #1590

merged 16 commits into from
Aug 23, 2020

Conversation

LudvigHz
Copy link
Member

@LudvigHz LudvigHz commented Sep 8, 2019

Depends on webkom/lego#1669
This PR:

What's missing:

  • Handle the payment requests server response. docs
  • Testing with a newer API version
  • Some styling and finishing touches
  • Error handling

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!

@LudvigHz LudvigHz changed the title [WIP] Switch to Stripe Elements and Intents API Switch to Stripe Elements and Intents API Sep 12, 2019
@LudvigHz
Copy link
Member Author

New Payment Form 🔥 🔥
image

3D secure
image

Error messages delivered by stripe
image

Copy link
Member

@odinuge odinuge left a 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/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
app/utils/configureStore.js Outdated Show resolved Hide resolved
app/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
app/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
server/pageRenderer.js Show resolved Hide resolved
app/reducers/registrations.js Outdated Show resolved Hide resolved
app/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
app/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
app/routes/events/components/JoinEventForm.js Outdated Show resolved Hide resolved
app/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
app/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
app/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
@odinuge odinuge changed the title Switch to Stripe Elements and Intents API [WIP] Switch to Stripe Elements and Intents API Sep 30, 2019
case Event.SOCKET_PAYMENT.SUCCESS: {
const registration = normalize(action.payload, registrationSchema)
.entities.registrations[action.payload.id];
if (!registration) {
Copy link
Member

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

app/routes/events/components/JoinEventForm.js Outdated Show resolved Hide resolved
setSuccess={() => this.setSuccess()}
setError={error => this.setError(error)}
setLoading={loading => this.setLoading(loading)}
ledgend={
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app/routes/events/components/StripeElement.js Outdated Show resolved Hide resolved
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`.
@LudvigHz LudvigHz merged commit 7026b97 into master Aug 23, 2020
@LudvigHz LudvigHz deleted the stripe-sca branch August 23, 2020 19:52
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

Successfully merging this pull request may close these issues.

4 participants