Accept a payment – Create a PaymentIntent with Node.js

Accepting a one-time payment with a custom form requires two steps. First, creating a PaymentIntent on the server. Second, confirming the payment intent on the client. It’s also recommended that you handle fulfillment for a purchase when receiving a webhook…

Accept a payment - Create a PaymentIntent with Node.js

Source

0
(0)

Accepting a one-time payment with a custom form requires two steps. First, creating a PaymentIntent on the server. Second, confirming the payment intent on the client. It’s also recommended that you handle fulfillment for a purchase when receiving a webhook notification of successful payment.

In this video, you’ll learn how to create a PaymentIntent on the server using Node.js and how to setup a basic Webhook handler. For part two of this series to confirm a PaymentIntent using a variety of payment methods, watch one of the videos in the playlists for front end frameworks:

HTML and JavaScript – https://www.youtube.com/playlist?list=PLy1nL-pvL2M7EUdqARPiayuj5cjGMLCvM
React – https://www.youtube.com/playlist?list=PLy1nL-pvL2M6HFApWUDSGA4Y7btyKx7cE
iOS – https://www.youtube.com/playlist?list=PLy1nL-pvL2M6yD1D72ceqqrW_1BqyN4It
Android – https://www.youtube.com/playlist?list=PLy1nL-pvL2M4IvDG-DOFKi_UCEgQkHu3n

If you’d like to learn how to create a PaymentIntent on the server in another server side language, consider watching one of these episodes:

Ruby – https://www.youtube.com/watch?v=079khYtqWPo&list=PLy1nL-pvL2M50RmP6ie-gdcSnfOuQCRYk&index=12
Python – https://www.youtube.com/watch?v=Tgjwx-38Dic&list=PLy1nL-pvL2M55YVn0mGoQ5r-39A1-ZypO&index=11
PHP – https://youtu.be/BPfpPGl85tk
Node.js – https://www.youtube.com/watch?v=WG4ehXSEpz4&list=PLy1nL-pvL2M5xNIuNapwmABwEy2uifAlY&index=11
Java – https://www.youtube.com/watch?v=-uyXCnPXegE&list=PLy1nL-pvL2M5TnSGVjEHTTMgdnnHi-KPg&index=11
Go – https://www.youtube.com/watch?v=cbsCxLDL4EY&list=PLy1nL-pvL2M5eqpSBR9KL7K0lcnWo0V0a&index=12
.NET – https://www.youtube.com/watch?v=mqEjRgoZWdo&list=PLy1nL-pvL2M4cNNoUtjWevYSci4ubsbhC&index=11

### Resources

Code: https://github.com/stripe-samples/accept-a-payment/tree/main/custom-payment-flow
Documentation: https://stripe.com/docs/payments/payment-intents
How intents work: https://stripe.com/docs/payments/intents
Playlist: https://www.youtube.com/playlist?list=PLy1nL-pvL2M5eqpSBR9KL7K0lcnWo0V0a

### Table of contents

00:00 Overview
01:11 Setup the office hours sample
01:45 Add route to create-payment-intent
02:12 Create a basic PaymentIntent using the API with stripe-go
02:45 Test the endpoint with cURL
03:12 Accept payment method type and currency in request
04:57 Handle errors
05:48 Handle webhook notifications
08:23 Add a config route for fetching publishable keys
09:00 Recap and conclusion

### Presenter

CJ Avilla, Developer Advocate at Stripe – https://twitter.com/cjav_dev

### Support

If you have a question, please feel free to reach out to our support team at https://support.stripe.com/ or on Discord at https://stripe.com/go/developer-chat.

### Updates

Sign up to stay updated with developer news: https://go.stripe.global/dev-digest.

### Feedback

If you have any feedback about this or other episodes, let us know: https://forms.gle/VjNqzRhotM2snYo88.

0 / 5. 0