Skip to content

Commit

Permalink
fix(queryDr): remove undefined in string checksum response (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinhbuihong authored Mar 15, 2024
1 parent 2fa8c4a commit faf022d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vnpay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,13 @@ export class VNPay {
};
}

const stringToCheckSumResponse =
let stringToCheckSumResponse =
`${responseData.vnp_ResponseId}|${responseData.vnp_Command}|${responseData.vnp_ResponseCode}` +
`|${responseData.vnp_Message}|${this.defaultConfig.vnp_TmnCode}|${responseData.vnp_TxnRef}` +
`|${responseData.vnp_Amount}|${responseData.vnp_BankCode}|${responseData.vnp_PayDate}` +
`|${responseData.vnp_TransactionNo}|${responseData.vnp_TransactionType}|${responseData.vnp_TransactionStatus}` +
`|${responseData.vnp_OrderInfo}|${responseData.vnp_PromotionCode}|${responseData.vnp_PromotionAmount}`;
stringToCheckSumResponse = stringToCheckSumResponse.replace(/undefined/g, '');

const signedResponse = hash(
this.globalDefaultConfig.secureSecret,
Expand Down

0 comments on commit faf022d

Please sign in to comment.