-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Issue Description
The current callback handler in callback/paymentwall.php fails when users change their payment method after making a payment through Paymentwall. This happens because the handler checks if the current payment method matches Paymentwall before processing the callback.
Current Behavior
- User makes payment through Paymentwall
- User changes payment method to something else
- When Paymentwall sends the callback, it fails because the handler checks:
php $gateway = getGatewayVariables($invoiceData['paymentmethod']); if (!$gateway["type"]) { die($gateway['name'] . " is not activated"); }
| $gateway = getGatewayVariables($invoiceData['paymentmethod']); |
Expected Behavior
The callback should be processed as long as:
- The callback comes from Paymentwall (validated by
$pingback->validate(true)) - The invoice exists and hasn't been paid
- The payment details are valid
Solution
Remove the payment method check and always use Paymentwall gateway config for processing callbacks:
php // Always use Paymentwall gateway config for processing callbacks $gateway = getGatewayVariables('paymentwall');
Rationale
- The callback URL is specific to Paymentwall and can only be triggered by Paymentwall's servers
- The security is maintained through Paymentwall's pingback validation
- If a payment was initiated through Paymentwall, we should honor its callback regardless of current payment method
Additional Context
This issue was discovered when users changed their payment method after payment, causing legitimate callbacks to fail and payments not being properly marked as completed.