Spaces:
Sleeping
Sleeping
Update app.js
Browse files
app.js
CHANGED
|
@@ -106,7 +106,7 @@ app.post('/webhook/paystack', (req, res) => {
|
|
| 106 |
const isRefund = /refund/i.test(event);
|
| 107 |
const isChargeSuccess = /charge\.success/i.test(event);
|
| 108 |
const isInvoiceOrSubscription = /invoice\.(payment_succeeded|paid)|subscription\./i.test(event);
|
| 109 |
-
const isPayment = isChargeSuccess || isInvoiceOrSubscription;
|
| 110 |
|
| 111 |
if (isRefund || isPayment) {
|
| 112 |
console.log('--- PAYSTACK WEBHOOK (INTERESTING EVENT) ---');
|
|
|
|
| 106 |
const isRefund = /refund/i.test(event);
|
| 107 |
const isChargeSuccess = /charge\.success/i.test(event);
|
| 108 |
const isInvoiceOrSubscription = /invoice\.(payment_succeeded|paid)|subscription\./i.test(event);
|
| 109 |
+
const isPayment = isChargeSuccess; // || isInvoiceOrSubscription;
|
| 110 |
|
| 111 |
if (isRefund || isPayment) {
|
| 112 |
console.log('--- PAYSTACK WEBHOOK (INTERESTING EVENT) ---');
|