Accept a payment - Create a PaymentIntent with PHP

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 PHP 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:

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

#php #html #css #javascript

Accept a payment - Create a PaymentIntent with PHP