Skip to content

Unhandled charge error #12

@hakiemaul

Description

@hakiemaul

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions