update test webhook

This commit is contained in:
2024-11-08 17:35:40 +07:00
parent 48178cba16
commit 797018ed74

View File

@@ -31,6 +31,12 @@ export class PayosService {
async webhook(data: WebhookType) { async webhook(data: WebhookType) {
Logger.log(`Webhook received: ${JSON.stringify(data)}`) Logger.log(`Webhook received: ${JSON.stringify(data)}`)
// check if orderCode = 123 mean it's a test payment and auto response success
if (data.data.orderCode === 123) {
return {
message: 'Payment received',
}
}
// verify checksum // verify checksum
const paymentData = this.payos.verifyPaymentWebhookData(data) const paymentData = this.payos.verifyPaymentWebhookData(data)
if (!paymentData) { if (!paymentData) {