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

Disable capturing on Pending Payment Orders #49

Closed
mattallan opened this issue Sep 30, 2020 · 0 comments · Fixed by #51
Closed

Disable capturing on Pending Payment Orders #49

mattallan opened this issue Sep 30, 2020 · 0 comments · Fixed by #51

Comments

@mattallan
Copy link
Contributor

While testing some less common cases for #44 I got the following fatal error when trying to capture a pending payment made through PayPal Checkout:

30-Sep-2020 03:25:46 UTC] PHP Fatal error:  Uncaught Error: Call to a member function authorizations() on null in /Users/matt/local/store/wp-content/plugins/paypal-for-woocommerce/modules/ppcp-wc-gateway/src/Processor/class-authorizedpaymentsprocessor.php:136
Stack trace:
#0 /Users/matt/local/store/wp-content/plugins/paypal-for-woocommerce/modules/ppcp-wc-gateway/src/Processor/class-authorizedpaymentsprocessor.php(86): WooCommerce\PayPalCommerce\WcGateway\Processor\AuthorizedPaymentsProcessor->all_authorizations(Object(WooCommerce\PayPalCommerce\ApiClient\Entity\Order))
#1 /Users/matt/local/store/wp-content/plugins/paypal-for-woocommerce/modules/ppcp-wc-gateway/src/Gateway/class-paypalgateway.php(200): WooCommerce\PayPalCommerce\WcGateway\Processor\AuthorizedPaymentsProcessor->process(Object(Automattic\WooCommerce\Admin\Overrides\Order))
#2 /Users/matt/local/store/wp-content/plugins/paypal-for-woocommerce/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php(278): WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway->capture_authorized_payment(Ob in /Users/matt/local/store/wp-content/plugins/paypal-for-woocommerce/modules/ppcp-wc-gateway/src/Processor/class-authorizedpaymentsprocessor.php on line 136

Steps to reproduce

  1. Set intent to Authorize in: WooCommerce > Settings > Payments > PayPal
  2. Add a product to the cart
  3. Visit the checkout and click on the PayPal button
  4. Once PayPal pop-up appears you can close it
  5. Visit the new Pending Payment order Edit Order page
  6. Try to capture the payment and you'll get the above fatal error

Expected Behaviour

Can we hide the capture action on orders that haven't been paid for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant