bKash
PP Integration option
Info
This integration option supports only BDT
currency.
Payment flow
- The customer initiates the cryptocurrency purchase on the merchant's website and selects
bKash
as a payment service. - The merchant sends the payment request to Constantpos.
- Constantpos sends the payment instruction in the response to the merchant. The payment instruction contains the converted amount (the cryptocurrency amount that the customer will get as a result of the payment) and the identifier of the wallet (phone number) to which the payment needs to be made.
- The merchant displays the payment instruction to the customer.
- The customer copies the payment information and makes the payment using the selected service within 20 minutes.
- The customer submits the payment confirmation, for example, the receipt number to the merchant. Optionally, the customer submits a file with the payment confirmation.
- The merchant either sends a confirm request with the receipt number or a proof request with the payment confirmation file to Constantpos.
- Constantpos sends a response to either a confirm or a proof request.
- Constantpos updates the transaction amount if it's different from the amount in the initial payment request and sends a webhook notification with the updated transaction amount.
Payment
Note
The amount
parameter value in the webhook notification and in the response to the transaction status query can be different from the value sent in the initial payment request and will equal the actual paid amount according to the information in the provider's system.
Request
Send a payment request with the following additional parameters:
Parameter | Type | Description |
---|---|---|
request | object | |
return_url * required |
string | URL to return the customer to when the transaction is completed. |
ip * required |
string | The customer's IP address. |
method | object | A section of the payment method information. |
type * required |
string | bkash . |
user_id * required |
string | Unique identifier of the customer. Up to 3 active payment requests are allowed per user_id . |
additional_data | object | |
browser * required |
object | A section of the customer's browser parameters. |
user_agent * required |
string | User agent string for the browser. Equals the navigator.userAgent parameter in JavaScript. |
Request example
{
"request": {
"amount": 420000,
"currency": "BDT",
"description": "test description",
"test": false,
"tracking_id": "your_uniq_number21212",
"ip": "127.00.00.1",
"language": "en",
"return_url": "https://example.com",
"additional_data": {
"browser": {
"user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0"
}
},
"method": {
"type": "bkash",
"user_id": "09fce47f-ae55-402f-a181-cc4fab2f2684"
}
}
}
Response
The response will additionally contain the object with the method name and with the following parameters.
Parameter | Type | Description |
---|---|---|
bkash | object | |
type | string | bkash |
expired_at | string | The time and date until the payment must be made. |
target_card | string | The identifier of the wallet (phone number) that needs to be used for the payment. |
converted_amount | string | The amount in tethers (USDT) according to the exchange rate that the customer will receive if the transaction succeeds. |
need_proof | boolean | Always true . |
Response example
{
"transaction": {
"uid": "c332a926-544b-4596-b84d-6404bc5531ca",
"type": "payment",
"status": "pending",
"amount": 420000,
"currency": "BDT",
"description": "test description",
"created_at": "2024-02-13T10:50:36Z",
"updated_at": "2024-02-13T10:50:39Z",
"method_type": "bkash",
"receipt_url": "https://my.constantpos.com/customer/transactions/c332a926-544b-4596-b84d-6404bc5531ca/ed0e420d4224aba19dbc707328a82f878abd2ff21b9b9fe65953e957f9613d43?language=en",
"payment": {
"status": "pending",
"gateway_id": 3715,
"ref_id": "ELGDH5",
"message": "Transaction was initialized."
},
"bkash": {
"type": "bkash",
"expired_at": "2024-02-13T11:20:38Z",
"target_card": "01789571561",
"converted_amount": "33.523838 USDT",
"need_proof": true
},
"customer": {
"email": "null",
"ip": "127.00.00.1"
},
"manually_corrected_at": null,
"message": "Transaction was initialized.",
"tracking_id": "your_uniq_number21212",
"test": false,
"language": "en",
"additional_data": {
"browser": {
"user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0"
},
"payment_method": {
"type": "alternative"
}
},
"gateway": {
"iframe": false
}
}
}