You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Payment

  1. The user enters the amount.
  2. The user is redirecting to the payment page.
  3. The user makes a payment on the Nagad side - enters wallet number, PIN, sends money.
  4. Paykassma sends a postback to the merchant's side.
  5. Funds are credited to the user’s balance on the merchant platform.

Payment window integration (plugin)

Example of a link to open a Nagad payment window:

https://plugin.{ server URL }/?
label=label&
currency_code=BDT&
lang=en&wallet_type=nagad_api&
custom_transaction_id=custom_transaction_id&
&fixed_amount=fixed_amount
&payment_url_success_id=2
&payment_url_pending_id=3
&payment_url_fail_id=1
&success_url=hash
&fail_url=hash
&pending_url=hash


wallet_type=nagad_api
currency_code=BDT 
Available languages (lang): en, bn

Pay attention to the description of the parameters payment_url_success_id / payment_url_fail_idpayment_url_pending_id and success_url / fail_url pending_url.
To use payment_url_success_id / payment_url_fail_idpayment_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_urlpending_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.{ server URL }/api/v1/payment/create/nagad_api?secret={pluginapi_secret}

Request method:
POST

Format:
JSON

Parameters:

NameTypeRequiredDescription
secretstringyesAPI access key

Body:

Name

Type

Required

Max Length

Description

amount

float 

yes

limited by min and max.
deposit

Payment amount
currencystringyes3Currency code 
labelstring yes190The unique identifier (ID) of the user who makes the payment.
custom_transaction_idstringyes190Transaction ID in the Client's system. Must be unique.
success_urlstringyesno limitRedirect URL to the success page after the payment
fail_urlstringyesno limitRedirect URL to the fail page after the payment
cancel_urlstringyesno limit

Redirect URL to cancel page

Request
{
    "custom_transaction_id": "custom_transaction_1",
    "amount": 100,
    "currency": "BDT",
    "label": "test_user",
    "success_url": "https://success_url.com",
    "fail_url": "https://fail_url.com",
    "cancel_url": "https://cancel_url.com"
}
Response Success
{
    "status": "ok",
	"payment_url": "Nagad_URL"// Nagad payment page
}
Response Fail
{
    'status': 'fail'
    'message': 'MESSAGE'
}

Deposit postback

For the general documentation on post backs click here.

Example of a postback for a Nagad deposit

{
    "signature": "56beb10ead1cd49475f1e16dd668a29fff3d4fb9",
    "wallet_type": "nagad_api",
    "amount": 600,
    "currency_code": "BDT",
    "label": "234",
    "converted_amount": {"USD": 5.5, "INR": 458, "EUR": 5.05, "IDR": 84206.21, "MYR": 25.57, "VND": 131151.4, "SGD": 7.47, "THB": 193.98, "NGN": 4209.6, "TRY": 148.98, "AED": 20.19, "CAD": 7.46, "AUD": 8.62, "BDT": 600, "AFN": 462.19, "ALL": 535.91, "AMD": 2119.43, "AOA": 4550.8, "ARS": 1918.56, "AWG": 9.89, "AZN": 9.34, "BAM": 9.87, "BBD": 10.99, "BGN": 9.9, "BHD": 2.07, "BIF": 15540.93, "BMD": 5.5, "BND": 7.45, "BOB": 37.88, "BRL": 27.32, "BSD": 5.5, "BTC": 0.00021022, "BTN": 455.77, "BWP": 74.58, "BYN": 13.84, "BZD": 11.05, "CDF": 13600.07, "CHF": 4.85, "CLF": 0.17, "CLP": 4753.93, "CNH": 40.18, "CNY": 40.02, "COP": 22536.26, "CRC": 2925.32, "CUC": 5.5, "CUP": 141.53, "CVE": 556.43, "CZK": 121.42, "DJF": 976.05, "DKK": 37.67, "DOP": 311.1, "DZD": 749.34, "EGP": 169.39, "ERN": 82.44, "ETB": 302.52, "FJD": 12.49, "FKP": 4.32, "GBP": 4.32, "GEL": 14.4, "GGP": 4.32, "GHS": 62.02, "GIP": 4.32, "GMD": 332.79, "GNF": 47102.19, "GTQ": 43.03, "GYD": 1148.02, "HKD": 43.04, "HNL": 134.9, "HRK": 38.09, "HTG": 745.53, "HUF": 1939.28, "ILS": 20.81, "IMP": 4.32, "IQD": 7179.8, "IRR": 232348.9, "ISK": 725.15, "JEP": 4.32, "JMD": 846.56, "JOD": 3.89, "JPY": 799.22, "KES": 782.37, "KGS": 485.14, "KHR": 22726.5, "KMF": 2487, "KPW": 4946.52, "KRW": 7365.69, "KWD": 1.69, "KYD": 4.57, "KZT": 2489.17, "LAK": 106934.11, "LBP": 82282.64, "LKR": 1770.53, "LRD": 1023.65, "LSL": 104.54, "LYD": 26.44, "MAD": 54.04, "MDL": 97.44, "MGA": 24817.48, "MKD": 310.95, "MMK": 11511.47, "MNT": 18961.65, "MOP": 44.22, "MRO": 0, "MRU": 207.84, "MUR": 249.7, "MVR": 84.5, "MWK": 5945.5, "MXN": 93.75, "MZN": 351.07, "NAD": 105.03, "NIO": 200.54, "NOK": 58.55, "NPR": 729.23, "NZD": 9.28, "OMR": 2.11, "PAB": 5.5, "PEN": 20.39, "PGK": 19.99, "PHP": 308.95, "PKR": 1628.08, "PLN": 22.54, "PYG": 39804.77, "QAR": 19.98, "RON": 25, "RSD": 591.72, "RUB": 517.19, "RWF": 6485.95, "SAR": 20.61, "SBD": 46, "SCR": 74.05, "SDG": 3303.17, "SEK": 60.26, "SHP": 4.32, "SLL": 115251.1, "SOS": 3121.61, "SRD": 209.95, "SSP": 715.93, "STD": 122463.67, "STN": 123.63, "SVC": 47.96, "SYP": 13809.19, "SZL": 104.52, "TJS": 60.22, "TMT": 19.24, "TND": 16.96, "TOP": 13.14, "TTD": 37.18, "TWD": 175.39, "TZS": 13731.9, "UAH": 202.45, "UGX": 20472.66, "UYU": 207.44, "UZS": 66206.92, "VEF": 0, "VES": 173.52, "VUV": 652.51, "WST": 14.94, "XAF": 3310.73, "XAG": 0.24, "XAU": 0, "XCD": 14.85, "XDR": 4.11, "XOF": 3310.73, "XPD": 0, "XPF": 602.29, "XPT": 0.01, "YER": 1375.96, "ZAR": 104.77, "ZMW": 106.21, "ZWL": 1769.75, "ETH": 0.00327932, "LTC": 0.0848166, "DOGE": 86.06973908, "DASH": 0.20288551, "BCH": 0.02900566, "ZEC": 0.21915246, "ETC": 0.35471858, "XRP": 10.16340924, "TRX": 72.59371303, "XLM": 41.90497255, "WAVES": 3.60487891, "USDT": 5.49542797, "USDTTRC20": 0, "USDT20": 0},
    "direction": "ingoing",
    "created_datetime": "2023-08-20 19:04:08",
    "access_key": "FQ9jMwrNSkFbyMNqYFf6Ed4xeKmjHK",
    "additional_data": [
        {
            "activated_datetime": "2023-08-20 22:04:07",
            "exchanger_identifier": null,
            "comment": "",
            "amount": "600",
            "currency_code": "BDT",
            "wallet_type": "nagad_api",
            "stockpiling_id": 1061,
            "transaction_id": "52AD1EA4",
            "transaction_type": 1,
            "plugin_custom_order_id": "1234",
            "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.