mPay Redirect
mPay Redirect is a utility for service providers to implement a checkout solution for mBnk retailers.
Service Providers from various sectors can become partners with mBnk for them to promote their goods or services to end customers through mBnk's Retail Distribution Network, a retailer would sell these goods or services to their customers and transact on their behalf on service providers platform wherein they would pay through the mBnk mPay utility.
Implementation of mBnk mPay Redirect
Step 1
The mBnK mPay Object must be created with Payment Information
keywill be provided to you by mBnK and will be unique to youhashto be generated using SHA512 with|as separator ofkey,transactionId,amountandsalttransactionIdmust be unique transactionId provided by youisProductOrServicespecify whether your are offering a product or serviceamountthe total amount for goods or services e.g. 100.00/100.50productOrServicesA list of Product or Service informationidProduct or Service ID assigned by service provider e.g. SKU, id, key
categoryIdCategory ID would be provided by mBnk to you
descriptionProduct or Service information
amountThe Amount or Cost of the Product or Service e.g. 100.00/100.50
customerCustomer information must be passed heremobileNoCustomer's Mobile No
nameCustomer's name
emailCustomer's Email ID
redirectUrlService Provider's url where transaction infromation must be pushed after transaction has been completed on mBnk's system
Hash to be generated using SHA512 with | as separator of key,transactionId,amount and salt
Request Payload
{
key: "your-key", // the key provided by mBnk
hash: "random string", // Hash generated using above logic needs to be set here
transactionId: "123456789", // The unique transaction Id generated by you
isProductOrService: true, // Is it product or service that you are offering
productOrServices: [
{
id: "test", // The Product or Service ID can be a SKU, id, etc.
categoryId: 'test', // Will be provided by mBnk
description: "Test Product", // The information of the Product or Service
amount: "100.00" // The cost of the Product or Service
}
],
customer: { // Optional, if provided would be better
name: "Test Test", // Customer's Name
email: "test@mbnk.com", // Customer's Email ID
mobileNo: "9757000000", // Customer's Mobile No
}
amount: "100.00", // The total amount of the transaction
redirectUrl: "https://www.serviceproviderurl.com/mbnk-mpay-transaction/response" // The service providers url where transaction iformation would be posted (wherein mBnk retailer would be redirected)
}
Step 2
Above json payload must be encoded using Base64.
The encoded payload must be set in html form and submitted to mBnk mPay
<form name="mbnkmpay" id="mbnkmpay" action="https://igw-qa.mbnk.com/api/mbnk-pay/redirect" method="post">
<input type="hidden" name="data" value="encoded payload">
<input type="submit" value="submit">
</form>
There are two environment wherein Service Provider can invoke mBnk mPay
QA(https://igw-qa.mbnk.com)PROD(https://igw.mbnk.com)
Service Provider has to integrate and test the implementation in QA first and once ready mBnK will provide prod credentials and go live
Step 3
Once transaction process is finished on mBnk mPay, retailer is redirected to service providers url.
The response data is posted using post method with data param in form data.
The data param must be decoded using Base64. It would return the transaction information.
Transaction
{
amount: "100.00", // The total amount of the transaction
clientTransactionId: "123456789", // The transaction ID provided by you
message: "Transaction Successful", // The transaction message
status: "SUCCESS" or "FAILED" // The status of transaction
transactionId: "aaaaaaaaa", // The transaction ID provided by mBnk
date: "2021-12-30T06:45:06.320Z", // The date of the transaction in ISO8601 format
hash: "random string", // These hash needs to be verified by service provider
}
Hash needs to verified at server side using SHA512 with | as separator of key, transactionId, clientTransactionId, amount, status and salt
Salt needs to be stored in backend and never to be exposed in client as it is used to verify and generate hash for the transaction.