INTEGRATE YOUR APPLICATION TO DIGIMART ON-DEMAND CHARGING SDK NOW
Step 1 After the admin has approved your Digimart application, you can copy and save the 'API Key' and 'API Secret' allocated for your application. (See below to identify the place where these details are shown on your application)
If you have not created your Digimart application yet, please follow the tutorial for provisioning your Digimart application
Step 2
After you've got your application ready on Digimart, now you can prepare the On-demand
charging SDK request as instructed below.
Endpoint:
The key parameters for this API include:
Sample format with MSISDN is as shown below.
Sample format without MSISDN is as shown below.
Step 3 Once you evoke this GET request after preparing it as above, you should be able to load the below page on a web view in your mobile/web application.
Note : If msisdn is inserted in the URL, above mentioned UI will be skipped, Leading directly to the OTP UI.
Step 4 If the details that are entered is correct, Grameenphone will generate the OTP and send the OTP to the end user.
Step 5 Upon receiving the OTP on the mobile number, end user on your application can enter the received OTP in the below page.
Step 6 Once the OTP is submitted on the above page, end user on your application will be charged through his Grameenphone mobile account and upon a successful charge below page will be shown.
Step 7 If there is any error during the transaction processing journey, below page will be shown to the end user on your application.
Step 8 After clicking the 'Back to Application' button, end user on your application will be redirected to the URL you have mentioned under the parameter 'redirectUrl' in the initial subscription charging SDK GET request
Step 9
Once the end user on your application has clicked on 'Back to Application' button, you will
receive the below as the response for the CaaS charging SDK GET request.
subscriptionStatus | - | Status code for the subscription (Success or Error code). |
subscriberId | - | Masked number corresponding to the subscriber |
requestId | - | The initial request ID allocated when transaction from Charging SDK is triggered for a particular user |
Note: You can store the mapping between the masked msisdn (referred to as subscriberId in the response) and the request id.
Step 10
Further to that, you will receive a notification to the endpoint you have configured under the
'Async charging resp URL' section while you were creating the application on Digimart. Below is a sample
JSON response you will receive on the endpoint you have configured.
{
"balanceDue": 0,
"subscriberId": ": ZjUyMTM1MjlhYmU0ZmJmY2FkYjRkYWI3NzE2ZDg0MjE0NjNjYTM5MGFhZTczOWZlZDUxMTcxN2U3YTVlZTRiNmU=",
"statusDetail": "Request was Successfully processed, Due amount fully paid.",
"version": "2.0",
"timeStamp": "20240703090835",
"totalAmount": "50.95",
"requestId": "123456789012346",
"currency": "BDT",
"applicationId": "APP_000040",
"internalTrxId": "924070309080000043",
"paidAmount": "50.95",
"statusCode": "S1000",
}
Note: From the ‘Subscription Notification URL ‘response, you can map the information based on the ‘masked msisdn’ previously saved from the redirect URL response. This enables you to correlate the notification data with the correct user identity securely and efficiently.
Code | Description |
---|---|
S1000 | Success |
E1001 | Error Occurred. Please Try Again. |
E1002 | Invalid Signature |
E1003 | Invalid Time Format |
E1004 | Request Timeout |
E1005 | Invalid Request Id |
E1006 | Invalid Api Key |
E1007 | Unauthorized |
E1008 | This Service Is Not Allowed For The Application. Please Contact Administrator. |
E1009 | Invalid Request |
E1010 | This Service Is Not Allowed For The SP. Please Contact Administrator |
E1011 | SDK Is Not Enabled For This Application. Please Contact Administrator |
E1012 | Please Start From The Beginning |
Code | Description |
---|---|
E1013 | Internal Error Occurred. Please Try Again. |
E1014 | Sorry, your number of verification attempts exceeded. Please try again in (xx) minutes. |
E1330 | Charging amount too low |
E1329 | Charging amount too high |
E2001 | Request OTP Failed Due to an Internal Error |
E2002 | You Have Exceeded Resend Attempts |
E2003 | OTP Verification Failed Due to an Internal Error |
E2004 | Subscriber MSISDN validation Failed Due to an Internal Error |
E3001 | User Already Registered |
E3002 | Authentication Failure. |
E3003 | Maximum Number of OTP Requests Reached |
E3004 | This Service Is Not Allowed for Your Operator |
E3005 | Your Mobile Number Is Not Whitelisted to Use This Application |
E3006 | Your Mobile Number Is Blacklisted to Use This Application |
E3007 | Your Mobile Number Has Reached Maximum Number of OTP Attempts |
E3009 | Your account balance is too low, recharge and try again |
E3008 | Invalid Mobile Number Format |
E4001 | Invalid OTP, please try again |
For any clarifications please do not hesitate to contact us
Copyrights © 2023. hSenid Mobile Solutions. All Rights Reserved.