A payment intent represents your intent to take a payment from a customer on your checkout page. A payment intent is associated with a single shopping cart or an individual customer shopping session during the checkout phase. For example, you create a payment intent for a customer's online order. When you create a payment intent, you must include the payment amount and the currency type.
The following procedure is a high-level overview of how to create and confirm a payment intent.
-
Use your hosted checkout - payment credentials to send a
POSTrequest to the/v1/payment-intentsendpoint of the payment intents API to create a payment intent. -
Send a
POSTrequest to thev1/payment-methodsendpoint of the payment methods API to create a payment method to attach to the payment intent. This returns aPaymentMethodResponse. -
Confirm the payment intent by invoking the
SDK function or send aconfirmIntentPOSTrequest to the/v1/payment-intents/{paymentIntentId}/confirmendpoint of the payment intents API.