Payment
- The user enters the amount and the bKash wallet number in the format of 01ХХХХХХХХХ, where X is a number.
The user is redirected to the bKash payment page.
- The user makes a payment on the bKash side - enters PIN, sends money.
- Paykassma sends a postback to the merchant's side.
- Funds are credited to the user’s balance on the merchant platform.
Payment window integration (plugin)
Example of a link to open a bKash payment window:
https://plugin.{ URL сервера }/? label =label& currency_code =BDT& lang =en& wallet_type =bkash_api& custom_transaction_id =custom_transaction_id& &fixed_amount=fixed_amount &payment_url_fail_id=1 |
---|
wallet_type=bkash_api currency_code=BDT Доступные языки (lang): en, bn
Pay attention to the description of the parameters payment_url_success_id / payment_url_fail_id/ payment_url_pending_id and success_url / fail_url / pending_url.
To use payment_url_success_id / payment_url_fail_id / payment_url_pending_id you need to send the URLs to Paykassma support and use the received IDs in the parameters.
To use success_url / fail_url / pending_url you must use hashing URLs (For more details on hashing click here).
For the description of all the plugin parameters click here.
API integration
Creating payment
http://api.{ URL сервера }/api/v1/payment/create/bkash_api?secret={pluginapi_secret}
Request method:
POST
Format:
JSON
Parameters:
Name | Type | Required | Description |
secret | string | yes | API access key |
Body:
Name | Type | Required | Max Length | Description |
amount | float | yes | limited by min and max. | Amount of payment |
account_number | string | yes | 11 | bKash account number, 11 digts, first - 0 |
currency | string | yes | 3 | Currency code |
label | string | yes | 190 | The unique identifier (ID) of the user who makes the payment. |
custom_transaction_id | string | yes | 190 | Transaction ID in the Client's system. Must be unique. |
success_url | string | yes | not restricted | Redirect URL to the success page after the payment. |
failure_url | string | yes | not restricted | Redirect URL to the fail page after the payment |
cancel_url | string | yes | not restricted | Redirect URL to cancel page |
{ "amount": 1.00, "account_number": "01770618575", "currency": "BDT", "label": "test", "custom_transaction_id": "01abc0095689", "success_url": "https://static5.depositphotos.com/1029663/395/i/600/depositphotos_3955476-stock-photo-green-check-mark.jpg?status=success", "failure_url": "https://top-fon.com/uploads/posts/2021-07/1626870875_29-p-krasnii-krest-fon-32.png?status=failure", "cancel_url": "https://google.com/" }
{ "status": "ok", "data": { "orderId": "1cb4627a420a6e69", "bkashUrl": "https://sandbox.payment.bkash.com/redirect/tokenized/?paymentID=TR00114E1661778153815&hash=dcRq9geuCtjkN6rFpaGxdLAMrmyxIxL*kEN-p41SLL2M!xXy9m2OTUTLwlAGMVWDKyE8xkOHj_N_AHaTxNGT*(V2LXyC5y4zpUsG1661778154005&mode=0011&apiVersion=v1.2.0-beta", "message": "Successful" } }
{ 'status': 'fail' 'message': 'MESSAGE' }
In case of a successful request to create a payment, the Client user must display the page received in the "bkashUrl" parameter.
Payment steps on Bkash page
Step 1: A form will open to enter the user's Bkash account number. You must click on "Confirm" to proceed to the next payment step.
The data on the first Bkash form is filled in automatically, because the Client’s user account number in Bkash has already been sent in the payment creation request.
Step 2. If the account number is valid, the following form will open to enter the OTP code. You must enter the OTP on the form and click on “Confirm”.
Step 3. If the OTP code is correct, the following form will open to enter the PIN. You must enter the data and click on "Confirm".
Step 4. If the PIN is correct, then Bkash will redirect the user to the url that was sent in the payment request.
The example below is for an unsuccessful payment.
After this, the Paykassma download page will be displayed to the user for some time (quite quickly, a few seconds). Example:
The download page will close and the user will be redirected to the correct page depending on the payment status:
In case of successful payment → to success_url;
In case of payment error → to failure_url
In case of payment cancellation (if the user clicked on the "Close" button in steps 1-3) → to cancel_url.
Checking payment status (Optional step)
http://api.{ URL сервера }/api/v1/payment/bkash_api/status?secret={pluginapi_secret}
Request method:
POST
Format:
JSON
Parameters:
Name | Type | Required | Description |
secret | string | yes | API access key |
Body:
Name | Type | Required | Max Length | Description |
order_id | string | yes | 190 | The order number received in response to the payment creation request. |
{ "order_id": "fb6fd9d57a664f61" }
{ "status": "ok", "data": { "status": "success" // доступны "wait" и "fail". } }
{ 'status': 'fail' 'message': 'MESSAGE' }
Deposit postback
For the general documentation on post backs click here.
Example of a postback for a bKash deposit:
{ "signature": "35e54262246adeafd4694e767557945827339a7f", "wallet_type": "bkash_api", "amount": 500, "currency_code": "BDT", "label": "7848747947846", "converted_amount": {"USD": 4.61, "INR": 380, "EUR": 4.2, "IDR": 69702.53, "MYR": 20.81, "VND": 109100.85, "SGD": 6.15, "THB": 158.07, "NGN": 3549.74, "TRY": 124.18, "AED": 16.92, "CAD": 6.11, "AUD": 6.96, "BDT": 500, "AFN": 392.19, "ALL": 427.25, "AMD": 1778.42, "AOA": 3803.37, "ARS": 1271.54, "AWG": 8.3, "AZN": 7.83, "BAM": 8.2, "BBD": 9.21, "BGN": 8.21, "BHD": 1.74, "BIF": 13046.47, "BMD": 4.61, "BND": 6.15, "BOB": 31.84, "BRL": 21.99, "BSD": 4.61, "BTC": 0.00015943, "BTN": 379, "BWP": 60.54, "BYN": 11.63, "BZD": 9.29, "CDF": 11425.29, "CHF": 4.04, "CLF": 0.14, "CLP": 3878.55, "CNH": 33.06, "CNY": 33.02, "COP": 18082.75, "CRC": 2498.95, "CUC": 4.61, "CUP": 118.58, "CVE": 462.56, "CZK": 100.38, "DJF": 820.28, "DKK": 31.27, "DOP": 259.16, "DZD": 624.77, "EGP": 142.3, "ERN": 69.08, "ETB": 253.82, "FJD": 10.22, "FKP": 3.6, "GBP": 3.6, "GEL": 11.9, "GGP": 3.6, "GHS": 52.22, "GIP": 3.6, "GMD": 276.31, "GNF": 39634.5, "GTQ": 36.22, "GYD": 963.87, "HKD": 35.89, "HNL": 113.34, "HRK": 31.62, "HTG": 628.87, "HUF": 1633.77, "ILS": 16.76, "IMP": 3.6, "IQD": 6035.32, "IRR": 194797.68, "ISK": 605.39, "JEP": 3.6, "JMD": 711.75, "JOD": 3.26, "JPY": 659.33, "KES": 657.15, "KGS": 404.25, "KHR": 19027.89, "KMF": 2061.95, "KPW": 4144.63, "KRW": 5933.82, "KWD": 1.42, "KYD": 3.84, "KZT": 2047.77, "LAK": 89252.61, "LBP": 69151.38, "LKR": 1469.64, "LRD": 858.4, "LSL": 81.95, "LYD": 22.02, "MAD": 45.38, "MDL": 82.35, "MGA": 20777.32, "MKD": 258.57, "MMK": 9674.75, "MNT": 15887.75, "MOP": 36.98, "MRO": 0, "MRU": 175.52, "MUR": 208.15, "MVR": 70.69, "MWK": 4853.1, "MXN": 77.35, "MZN": 293.46, "NAD": 82.25, "NIO": 168.55, "NOK": 47.01, "NPR": 606.4, "NZD": 7.49, "OMR": 1.77, "PAB": 4.61, "PEN": 16.61, "PGK": 16.59, "PHP": 252.72, "PKR": 1324.8, "PLN": 18.6, "PYG": 33513, "QAR": 16.79, "RON": 20.69, "RSD": 492.16, "RUB": 424.19, "RWF": 5413.13, "SAR": 17.28, "SBD": 38.44, "SCR": 61.28, "SDG": 2770, "SEK": 48.85, "SHP": 3.6, "SLL": 96567.61, "SOS": 2623.48, "SRD": 177.86, "SSP": 599.87, "STD": 102610.94, "STN": 102.67, "SVC": 40.31, "SYP": 11570.57, "SZL": 81.89, "TJS": 50.47, "TMT": 16.16, "TND": 14.19, "TOP": 10.82, "TTD": 31.29, "TWD": 145.48, "TZS": 11319.27, "UAH": 170.14, "UGX": 16716.57, "UYU": 173.55, "UZS": 53595.22, "VEF": 0, "VES": 135.74, "VUV": 546.73, "WST": 12.52, "XAF": 2752.15, "XAG": 0.19, "XAU": 0, "XCD": 12.45, "XDR": 3.43, "XOF": 2752.15, "XPD": 0, "XPF": 500.67, "XPT": 0, "YER": 1152.67, "ZAR": 83.54, "ZMW": 87.42, "ZWL": 1482.86, "ETH": 0.00251358, "LTC": 0.05065982, "DOGE": 59.80674641, "DASH": 0.14777208, "BCH": 0.01902045, "ZEC": 0.15475058, "ETC": 0.25289799, "XRP": 6.67674578, "TRX": 59.03020283, "XLM": 31.08030456, "WAVES": 2.42673726, "USDT": 4.60787289, "USDTTRC20": 0, "USDT20": 0}, "direction": "ingoing", "created_datetime": "2023-08-01 13:37:42", "access_key": "FQ9jMwrNSkFbyMNqYFf6Ed4xeKmjHK", "additional_data": [ { "activated_datetime": "2023-08-01 16:37:16", "exchanger_identifier": null, "comment": "", "amount": "100", "currency_code": "BDT", "wallet_type": "bkash_api", "stockpiling_id": 963, "transaction_id": "CD0C06E08D", "transaction_type": 1, "plugin_custom_order_id": null, "withdrawal_id": null, "withdrawal_status": null, "account_number": "", "account_name": "", "account_email": "", "bank_details": { "bank_code": "", "branch_code": "" } }, { "activated_datetime": "2023-08-01 16:37:40", "exchanger_identifier": null, "comment": "", "amount": "400", "currency_code": "BDT", "wallet_type": "bkash_api", "stockpiling_id": 963, "transaction_id": "5750E9FBB3", "transaction_type": 1, "plugin_custom_order_id": null, "withdrawal_id": null, "withdrawal_status": null, "account_number": "", "account_name": "", "account_email": "", "bank_details": { "bank_code": "", "branch_code": "" } } ] }
The Paykassma server is waiting for a response in json {"status": "ok"} response code 200, otherwise, when receiving a different response, Paykassma will forward the postback with a certain frequency.
Repeated postbacks must also be answered with {"status":"ok"} response code 200.