INTEGRATE YOUR APPLICATION TO DIGIMART SUBSCRIPTION CHARGING SDK NOW
Subscription Charging Without Header Enrichment
Subscription Charging With Header Enrichment
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)
Note: You will see the "Allow Capturing Mobile Number via Header Enrichment" toggle button enabled if the admin has approved your application to proceed with the Header Enrichment flow.
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 subscription
charging SDK request as instructed below.
Endpoint:
The key parameters for this API include:
API Key | - | Displayed in the application you have created on Digimart. See step 1 in this tutorial. |
Request Id | - | A unique 15-digit identifier based on your preference. This value will be used to correlate the response and subscription charging notification received at the endpoint. |
Request Time | - |
Current time in UTC format (Eg: 2024-07-08T10:33:54.929Z). The request time is crucial for validating our end system. If you're using third-party libraries or different time zones, please ensure that the time is secured in the correct time zone: Asia/Dhaka (UTC+06:00). |
Signature | - |
SHA 512 encrypted combination of API Key | API Secret | Request Time. For Eg : API Key: myApiKey123 Request Time: 2024-08-08T12:00:00Z API Secret: mySecretKey456 Concatenated String: myApiKey123|2024-08-08T12:00:00Z|mySecretKey456 Apply SHA-512 Hashing: Use a SHA-512 hashing function to generate the hash of the concatenated string. |
Redirect URL | - | Page for the subscribers to be redirected upon successful/failure subscription. |
MSISDN | - | Mobile number belonging to the subscriber (Optional). |
Amount | - | The amount to be charged. |
Sample format without MSISDN is as shown below.
Note: Despite the fact that you have sent the MSISDN or not, the MSISDN will be captured automatically through Header Enrichment.
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.
Step 4 Upon receiving the OTP on the mobile number, end user on your application can enter the received OTP in the below page.
Step 5 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 6 If there is any error during the transaction processing journey, below page will be shown to the end user on your application.
Step 7 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 8
Once the end user on your application has clicked on 'Back to Application' button, you will
receive the below as the response for the subscription 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 9
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’ ( Example:- +1234*****901 ) 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 the unsubscription, subscriber charging info and subscriber list APIs please visit the
API documentation
For any clarifications please do not hesitate to contact us
Copyrights © 2023. hSenid Mobile Solutions. All Rights Reserved.