Payment Intent Object
The Payment Intent object contains the following properties:- amount: The total amount to be paid.
- currency: The currency of the payment (optional).
- payment_methods: A list of accepted payment methods (optional) (e.g., “card”, “bank”, “wallet”).
- title: A title for the payment (optional).
- description: A description of the payment (optional).
- customer: The ID of the customer making the payment (optional).
- customer_name: The name of the customer making the payment (optional).
- customer_email: The email address of the customer making the payment (optional).
- customer_phone: The phone number of the customer making the payment (optional).
- metadata: Any additional information about the payment (optional).
- return_url: The URL to which the customer is redirected after a successful payment (optional).
- cancel_url: The URL to which the customer is redirected if they cancel the payment (optional).
- payment_method: The specific payment method to use (optional).
- coupon: The ID of a coupon to apply to the payment (optional). If provided, the coupon’s discount will be applied to the payment amount.
- callback_url: The endpoint where Modem Pay will send a webhook notification after the payment has been processed.
Payment Intent Response Object
These are the response properties after the Payment Intent is created:- status: A boolean value indicating whether the payment intent creation was successful. Returns
true
if successful,false
otherwise. - message: A descriptive message about the result of the Payment Intent creation (e.g., “Payment intent created successfully. Please proceed to complete the payment.”).
- data: An object containing the details of the payment intent. The properties inside this object are:
- intent_secret: A secret key used to secure the payment intent, required for completing the payment.
- payment_link: A URL to the hosted payment page where the customer can complete the payment.
- amount: The total amount to be paid, expressed in the currency specified in currency.
- currency: The currency code (e.g.,
GMD
for Gambian Dalasi) in which the payment is to be made. - expires_at: A timestamp (ISO 8601 format) indicating when the payment intent will expire. After this time, the payment intent will no longer be valid.
- status: The current status of the payment intent. It can be one of the following:
requires_payment_method
: Payment method is required before proceeding.processing
: The payment is currently being processed.successful
: The payment was successfully completed.failed
: The payment failed to process.cancelled
: The payment was canceled by the customer or the system.