ChargeTokenMobile (V7)
Description
The ChargeTokenMobile request will be used for requesting a payment using mobile payment solutions, API will accept a phone number, MNO (Mobile Operator Name) - like safaricom and the MNO country name. Instructions for the payment process will then be returned, this should be displayed to the customer.
Upon the customer payment, the transaction status would be updated and should be checked in “verifyToken”
verifyToken will also display the status of the mobile request
URL: https://secure1.sandbox.directpay.online/API/v7/
Response
The method will return payment instructions from mobile operator.
Variables to send:
Parameter | Data type | Description | |
Request | Text | ChargeTokenMobile | Mandatory |
CompanyToken | Token | Token you got from 3G to operate this API | Mandatory |
TransactionToken | Token | Transaction token as accepted from the createToken. | Mandatory |
PhoneNumber | Text | Phone number to charge | Mandatory |
MNO | Text | Mobile Network Operator - According to your terminal settings in the system. Ask Directpay team. | Mandatory |
MNOcountry | Text | The country name of MNO - According to your terminal settings in the system. Ask Directpay team. | Mandatory |
Request example:
request example
<?xml version="1.0" encoding="UTF-8"?>
<API3G>
<CompanyToken>90EC1DA4-A7C5-432C-930C-098715D3130E</CompanyToken>
<Request>ChargeTokenMobile</Request>
<TransactionToken>F0C9D5A6-D130-44B7-896C-A0FD701FE132</TransactionToken>
<PhoneNumber>25412345678</PhoneNumber>
<MNO>SafaricomC2B</MNO>
<MNOcountry>kenya</MNOcountry>
</API3G>
Respond:
The server will respond for the ChargeTokenMobile request according to the following results:
Parameter | Data type | Description |
Code | 3/4 digits code | A code will be sent with the result of the request |
| Text | Free text of the result |
| Text | Payment instructions |
| Boolean | If the value is 1 (true), then a redirection to the Mno url is necessary to complete the payment. You'll need to decode the url |
| Text | Transaction |
| Text | Transaction |
| Text | Transaction |
Respond codes:
Code | Explanation |
130 | New invoice |
001 | Authorized |
801 | Request missing company token |
802 | Company token does not exist |
803 | No request or error in Request type name |
804 | Error in XML |
906 |
|
950 | Request missing transaction level mandatory fields |
951 | Data mismatch - Transaction Token |
952 | Request missing mandatory fields - MNO (Mobile Network Operator) |
953 | Request missing mandatory fields - MNOcountry (Mobile Network Operator country name) |
954 | Request missing mandatory fields - PhoneNumber (Phone number of the payer - MSISDN) |
955 | Phone number is invalid |
956 | Terminal not found |
Respond example:
response example
<?xml version="1.0" encoding="UTF-8"?>
<API3G>
<Code>130</Code>
<Explanation>New Invoice</Explanation>
<RedirectUrl>https://redirect.com</RedirectUrl>
<BackUrl></BackUrl>
<declinedUrl></declinedUrl>
<Instructions>1.Go to the M-PESA menu<br>2. Select Lipa na M-PESA<br>3. Select the Paybill
option<br>4. Enter business number 927633<br>5. Enter your account number 1776F0C9D<br>6.
Enter the amount 567<br>7. Press OK to send<br>8. You will receive a confirmation SMS with your
payment reference number.</Instructions>
<RedirectOption>0</RedirectOption>
</API3G>