3.Payment Confirmation API Details
This API serves as the channel for payment confirmation from NEPALPAY QR engine after successful QR transaction. It is specifically designed for service providers who have integrated NEPALPAY Dynamic QR as their payment instrument. The respective merchant service providers must have exposed the API according to the following specification.
POST URL: {base_url}/nepalpay/confirm-payment
Authorization : Basic Auth
Request Signature Generation:
The signature string is the combination of response parameters in the following format.
Signature String = <merchantBillNo>+”,” +<merchantId>+”,” +<merchantName>+”,” +<paymentRef>+”,” +<channel>+”,” +<payerMobileNumber>+”,” +<sessionNo>
- Sign the token string using the digital certificate private key (pfx file/keystore). The digital signature algorithm will be the SHA256 with RSA.
- Convert the signed token above in step 2 to base64 encoding.
- Pass this signature string to the “signature” field of the request message
Response Token Generation:
The signature string is the combination of response parameters in the following format.
Token String = < txnDate >+”,” +< status >+”,” +< message >+”,” +< mchantBillNo >+”,” +< paymentRef >
- Sign the token string using the digital certificate private key (pfx file/keystore). The digital signature algorithm will be the SHA256 with RSA.
- Convert the signed token above in step 2 to base64 encoding.
- Pass this signature string to the “signature” field of the request message
Request Parameters:
# | Params | Type | Length | Presence | Description |
---|---|---|---|---|---|
1 | txnDate | String | M | Transaction date. Format (yyyy-MM-dd HH:mm:ss) | |
2 | txnAmount | Numeric | 12,2 | M | Transaction amount |
3 | chargeAmt | Numeric | 12,2 | M | Charge amount |
4 | merchantId | String | 25 | M | Merchant code |
5 | storeLabel | String | 25 | O | Store label of QR code |
6 | terminalId | String | 10 | O | Terminal label of QR code |
7 | merchantName | String | 25 | M | Merchant name |
8 | rpstxnId | Numeric | M | Transaction id from Network side | |
9 | validationTraceId | String | 20 | M | Unique QR validation Id provided by NCHL during QR generation.It will be used for end to end reporting and reconciliation. |
10 | paymentRef | Alpha-Numeric | 35 | M | Unique QR validation Id.It will be used for end to end reporting and reconciliation. i.e (‘NQR-TXN ID’) |
11 | merchantBillNo | String | M | Bill no./ Unique code or Id enough for transaction reconciliation | |
12 | status | String | 10 | M | Transaction status (SUCCESS|PENDING|FAILED) |
13 | statusDesc | String | 50 | M | Transaction status description |
14 | remarks | String | 100 | M | Remarks for transaction |
15 | signature | String | M | SHA256 signature token | |
16 | channel | String | 10 | M | Issuer channel e.g. CIPS|MOB|WAL |
17 | payerMobile | String | 10 | M | Payer Mobile Number |
18 | sessionNo | Numeric | M | Unique session id | |
19 | extraPaymentParams | Map(K,V) | M | Extra parameters to identify transaction. Params can be in the form of key-value pair |
Sample Request
{
"statusDesc": "SUCCESS",
"chargeAmt": 0,
"signature": "axPUj41hD38LeIUzbH2Qq/UQJofo1obu9ZHNEqS7hPAwyV5+/Gco8QTsHJVhnyTce888ZK4xe47bebnD4nlO/f9eKy8quGw32mnyI1cM+MxeQPHoegjptOnbnCnFpoF+TiBu/P9mZpDYqzl2MjzpkJealsgqt24Kt/UexhIgAYc=",
"rpstxnId": "13249559",
"channel": "CIPS",
"terminalId": "Terminal1",
"storeLabel": "Store1",
"sessionNo": "5446",
"issuer": "00001801",
"merchantName": "Quantum Labs",
"merchantBillNo": "NA",
"paymentRef": "2411100000067378ZHU",
"payerMobile": "+977-9843705813",
"extraPaymentParams": {
"address": "NCHL",
"txnCrncy": "NPR",
"customerName": "Bajrang Steels Pvt Ltd"
},
"merchantId": "0010SVQNL9H",
"validationTraceId": "2411100000241841VML",
"instructionId": "CIPS-68109",
"txnDate": "2024-11-10 01:35:31",
"txnAmount": 50,
"remarks": "NEPALPAYQR-512727",
"status": "SUCCESS"
}
Sample Response
{
"txnDate": "2024-11-10 01:35:31",
"status": "SUCCESS",
"message": "TRANSACTION SUCCESSFUL",
"merchantBillNo": "NA",
"paymentRef": "2411100000067378ZHU",
"signature": "Ghxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}