update test webhook
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user