Skip to content

Fix pingback issue. #35

@zytakeshi

Description

@zytakeshi

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

  1. User makes payment through Paymentwall
  2. User changes payment method to something else
  3. 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

  1. The callback URL is specific to Paymentwall and can only be triggered by Paymentwall's servers
  2. The security is maintained through Paymentwall's pingback validation
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions