Skip to content

Commit

Permalink
feature:FUR-33 Open verify webhook confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhhTien committed Jun 14, 2024
1 parent ff0d87c commit 3abbada
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/payment/controllers/payment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export class PaymentController {
console.log('Handling PAYOS webhook', JSON.stringify(webhookData))
this.paymentService.setStrategy(PaymentMethod.PAY_OS)

// // just skip for confirmWebhook
// if (webhookData.data.orderCode == 123) return true
// just skip for confirmWebhook
if (webhookData.data.orderCode == 123) return true

//1. Validate signature with other data
const result = this.paymentService.verifyPaymentWebhookData(webhookData)
Expand All @@ -68,13 +68,13 @@ export class PaymentController {
return this.paymentService.processWebhook(webhookData)
}

// @ApiOperation({
// summary: 'Confirm Webhook URL for PAYOS'
// })
// @Post('webhook/payos-confirm')
// async verifyWebhook() {
// console.log('Handling Confirm Webhook URL for PAYOS')
@ApiOperation({
summary: 'Confirm Webhook URL for PAYOS'
})
@Post('webhook/payos-confirm')
async verifyWebhook() {
console.log('Handling Confirm Webhook URL for PAYOS')

// await this.paymentService.payOSPaymentStrategy.verifyWebhookUrl()
// }
await this.paymentService.payOSPaymentStrategy.verifyWebhookUrl()
}
}
2 changes: 1 addition & 1 deletion src/payment/services/payment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class PaymentService {
private readonly paymentRepository: PaymentRepository,
private readonly momoPaymentStrategy: MomoPaymentStrategy,
private readonly zaloPayPaymentStrategy: ZaloPayPaymentStrategy,
private readonly payOSPaymentStrategy: PayOSPaymentStrategy
readonly payOSPaymentStrategy: PayOSPaymentStrategy
) {}

public setStrategy(paymentMethod: PaymentMethod) {
Expand Down

0 comments on commit 3abbada

Please sign in to comment.