Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled charge error #12

Open
hakiemaul opened this issue May 16, 2020 · 0 comments
Open

Unhandled charge error #12

hakiemaul opened this issue May 16, 2020 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@hakiemaul
Copy link
Contributor

Describe the bug
Our plugin throws PHP error in case of error during charge process (e.g. IP whitelist enabled)

Troublesome code

if ($charge['status'] !== 'CAPTURED') {
$message = 'Charge failed. Cancelling order. Charge id: ' . $charge['id'];
return $this->cancel_order($order_id, $message);
}
on all version

Suggestion to fix
Add error_code checker before status checker

How to reproduce?

  1. Add some IP in the dashboard's IP whitelisting feature
  2. Create order
  3. Checkout
@hakiemaul hakiemaul added bug Something isn't working good first issue Good for newcomers labels May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant