Skip to main content

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

  • key will be provided to you by mBnK and will be unique to you
  • hash to be generated using SHA512 with | as separator of key,transactionId,amount and salt
  • transactionId must be unique transactionId provided by you
  • isProductOrService specify whether your are offering a product or service
  • amount the total amount for goods or services e.g. 100.00/100.50
  • productOrServices A list of Product or Service information
    • id Product or Service ID assigned by service provider e.g. SKU, id, key
    • categoryId Category ID would be provided by mBnk to you
    • description Product or Service information
    • amount The Amount or Cost of the Product or Service e.g. 100.00/100.50
  • customer Customer information must be passed here
    • mobileNo Customer's Mobile No
    • name Customer's name
    • email Customer's Email ID
  • redirectUrl Service Provider's url where transaction infromation must be pushed after transaction has been completed on mBnk's system
note

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>
note

There are two environment wherein Service Provider can invoke mBnk mPay

note

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
}
note

Hash needs to verified at server side using SHA512 with | as separator of key, transactionId, clientTransactionId, amount, status and salt

caution

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.

Try mBnk mPay Redirect

Service Provider Information