mEarn
mEarn is a utility for mBnk to track transactions wherein leads are converted at service providers end.
Service providers can create those transactions with mBnk, when leads are coverted in service provider's system. These transactions helps mBnk to track the revenue share disbursal with its distributors and retailers.
Implementation of mBnk mEarn
Step 1
The mBnK mEarn has to initialized 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.50logoThe logo url of the service provider (would be shown to retailer in mBnk mPay UI)productOrServicesA 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
retailerRetailer information must be passed hereidRetailer's ID sent by mBnk
mobileNoRetailer's Mobile No sent by mBnk
Pass either the Retailer's ID or Mobile No, not both the fields in request.
Hash to be generated using SHA512 with | as separator of key,transactionId,amount and salt
URL:- https://callback-integration-gw-a7lt8d4h.an.gateway.dev/api/mbnk-earn/initiate?key=yourUniqueKey
keyKey would be provided by mBnk. The key is authorization for the above Url.
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, retailer: { // Retailer Information needs to be provided id: "", // Retailer's ID mobileNo: "9757000000", // Retailer's Mobile No }}There are two environment wherein Service Provider can invoke mBnk mEarn
Responses :-
TransactionThe transaction object would contain the transaction information
{
amount: "100.00", // The total amount of the transaction
clientTransactionId: "123456789", // The transaction ID provided by you
message: "Transaction Successful", // The transaction message
status: "PENDING" // 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
}
Initialization Failed
{
statusCode: "xxxx",
message: "message" // The error message will be sent in here
}
If the transaction request object is not proper, the 'Initialization Failed' object would be returned.
Hash needs to be 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.