Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"main": "./dist/index.js",
"module": "./dist/esm/index.mjs",
"scripts": {
"prepare": "husky install",
"prepare": "husky install && npm run build",
"format": " prettier --ignore-path .gitignore \"**/*.{ts,js,json,mjs,tsx}\" -w",
"lint": "eslint --ignore-path .gitignore \"**/*.{ts,js,json,mjs,tsx}\" --fix",
"build": "tsx scripts/build.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/payment/payment.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export function isPaymentMethod(code: string): code is PaymentMethod {
'QRIS2',
'SHOPEEPAY',
'QRIS_SHOPEEPAY',
'DANA',
'OTHERBANKVA'
].includes(code)
)
}
2 changes: 2 additions & 0 deletions src/payment/payment.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export type PaymentMethod =
| 'DANAMONVA' // Danamon VA payment method
| 'BNCVA' // BNC VA payment method
| 'BSIVAOP' // BSI VA OP payment method
| 'OTHERBANKVA' // Other Bank VA payment method
| 'ALFAMART' // Alfamart payment method
| 'INDOMARET' // Indomaret payment method
| 'ALFAMIDI' // Alfamidi payment method
Expand All @@ -72,3 +73,4 @@ export type PaymentMethod =
| 'QRIS2' // QRIS 2 payment method
| 'SHOPEEPAY' // Shopeepay payment method
| 'QRIS_SHOPEEPAY' // QRIS Shopeepay payment method
| 'DANA' // DANA payment method
2 changes: 1 addition & 1 deletion src/signature/signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Signature {
*/
static callbackSignature(body: ICallback, privateKey: string) {
return createHmac('sha256', privateKey)
.update(Buffer.from(body.toString()))
.update(Buffer.from(JSON.stringify(body)))
.digest('hex')
}
}
Loading