Appearance
POST Payment Process
https://api.magmaonepay.com/v1/payment/process
Process Payment
This guide helps you to understand how to process a payment that has already been initialized using the API.
Response Information
Upon processing the payment, the API will return the following information:
Response Parameter | Type | Description |
---|---|---|
code | integer | The HTTP status code returned by the API |
message | string | A message indicating the result of the API operation |
data | object | An object containing the payment processing details |
data.payment_token | string | A unique identifier for the payment transaction |
data.created_at | string | The timestamp when the payment was created |
data.updated_at | string | The timestamp when the payment was last updated |
data.success_at | string | The timestamp when the payment was successfully processed |
data.merchant_transaction_id | string | The unique ID for the transaction provided by the merchant |
data.amount | string | The amount of the payment |
data.currency | string | The currency of the payment |
data.description | string | A description of the payment |
data.payee | string | The payee's mobile number |
data.payee_first_name | string | The payee's first name |
data.payee_last_name | string | The payee's last name |
data.payment_method | string | The payment method used for the transaction |
data.payment_processing_reference | string | A reference for the payment processing |
data.custom_field | string | A custom field for additional information |
data.payment_status | string | The current status of the payment |
data.payment_status_code | string | The code representing the payment status |
data.payment_status_message | string | The message describing the payment status |
data.meta | object | Additional metadata related to the payment transaction |
data.meta.otp | boolean | Indicates whether the payment requires an OTP code |
data.meta.otp_length | integer | The length of the OTP code required |
data.meta.redirect_customer_to_url_processing | boolean | Indicates whether the customer should be redirected to a URL for processing |
data.meta.before_payment_instructions | string | Instructions before the payment |
data.meta.after_payment_instructions | string | Instructions after the payment |
This response information can be used by the merchant to update the transaction's status on their end, provide a receipt to the customer, or handle any next steps required based on the payment's status.
HEADERS
Authorization | Bearer TOKEN |
---|
NB: TOKEN is your private secret key dependant on your mode (live or test) for server-side
Body
raw (json)
json
{
"payment_token": "payment_token",
"otp_code": "1234" // Required if payment_method has otp true
}
Example Request
curl
curl --location 'https://api.magmaonepay.com/v1/payment/process' \
--header 'Authorization: Bearer TOKEN' \
--data '{
"payment_token": "91ce0608-16b3-4bf4-a2d8-1ab46e776cc2",
"otp_code": "1234"
}'
Example Response ([Pending])
Body
json
{
"code": 200,
"message": "OK",
"data": {
"payment_token": "73351d2a-c2bd-4d7c-8f1a-35ddbe9bd606",
"created_at": "2024-06-04 00:12:55",
"updated_at": "2024-06-04 00:35:18",
"success_at": null,
"merchant_transaction_id": "97e1ab54-871-11ee-b9d1-0242ac12000s3ss",
"amount": "10000",
"currency": "XOF",
"description": "Payment description",
"payee": "+2250759423253",
"payee_first_name": "john",
"payee_last_name": "doe",
"payment_method": "ORANGE_CI",
"payment_processing_reference": null,
"custom_field": "any_string",
"payment_status": "pending",
"payment_status_code": "103",
"payment_status_message": "WAITING_CUSTOMER_CONFIRMATION",
"meta": {
"otp": false,
"otp_length": 0,
"redirect_customer_to_url_processing": false,
"before_payment_instructions": "Make sure you have enough balance.",
"after_payment_instructions": "Check your account for the transaction details."
}
}
}
Headers (1)
Content-Type application/json