Перейти до основного вмісту

MPesa

Підключення платіжного методу MPesa вимагає використання direct-інтеграції. Запит на створення платежу повинен містити такі параметри:

ParameterTypeRequiredDescription
pos_idUUIDMerchant's identifier (POS_ID)
modeMODEdirect
methodMETHODPayment method (purchase)
amountNumberTransaction amount. Must be a positive number. The number of decimal digits must be less than or equal to 2 (e.g., 100.00, 250, 50.50)
currencyCURRENCYTransaction currency (ISO_4217)
order_3ds_bypassString3-D Secure flow option
order_idStringUnique identifier of order
descriptionStringPayment description
paywayStringmobile
server_urlURLWebhook notification will be sent to this URL
result_urlURLCustomer will be redirected to this URL after payment.
customer_fnameStringcustomer first name
customer_lnameStringcustomer last name
customer_emailStringcustomer email address
customer_phoneStringcustomer phone number
customer_countryStringCustomer country (ISO 3166-1 (alpha-2)). For instance, UA for Ukraine
properties.networkStringnetwork provider

Приклад запиту:

{
"pos_id": "'$POS_ID'",
"mode": "direct",
"method": "purchase",
"amount": 100,
"currency": "USD",
"payway": "mobile",
"order_id": "'$ORDER_ID'",
"customer_fname": "John",
"customer_lname": "Doe",
"customer_email": "[email protected]",
"customer_phone": "254715303037",
"customer_country": "UA",
"description": "Test description for '$ORDER_ID'# payment",
"order_3ds_bypass": "supported",
"properties": {
"network": "MPESA_KE"
}
}