What is a Payment Intent?
A payment intent is a resource that represents your wish to receive payment for a specific amount. When you create a payment intent, you don’t immediately capture the amount; it’s a preparatory step. A payment intent tracks a customer’s payment process. It records details such as amount, currency and payment method.Prepare your request
The endpoint to use isPOST https://pay.sandbox.yabetoopay.com/v1/payment-intents
for sandbox environment and POST https://pay.api.yabetoopay.com/v1/payment-intents
for production environment.
Secret key security: The secret key (secret_key) must be kept confidential and
must never be exposed in the frontend or client code. It must only be used on
the server side.
- Use the secret key provided
secret_key
to authenticate yourself to the API. For security reasons, this key must only be used on the server side. - The request body should contain the following parameters:
Parameters
amount
: The amount to be paidcurrency
: The currency of the paymentdescription
: A description of the payment (optional)metadata
: Additional metadata (optional)
Create a Payment Intent
You can create a payment intent by using the following code, this example is in JavaScript (Node.js) but you can use any language you want just by following the same logic.Response
200 OK
The response body will contain the following parameters:amount
: The amount to be paidcurrency
: The currency of the paymentlabel
: The label of the payment intentid
: The ID of the payment intentclient_secret
: The client secret of the payment intent