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

Order pay: get the last payment error pm or src #2732

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

nicomollet
Copy link
Contributor

@nicomollet nicomollet commented Oct 26, 2023

The order pay page, after a payment failed for authentication_required reason, doesn't get the payment source.

There is a PHP notice:

PHP Notice:  Undefined property: stdClass::$source in /app/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php on line 685

Changes proposed in this Pull Request:

Since the intent from last_payment_error only checks the source $intent->last_payment_error->source, the PR tries to get if it is a payment method or a source using the helper WC_Stripe_Helper::get_payment_method_from_intent.

Testing instructions

Using WooCommerce Subscriptions, make a first payment with a method having 3DS always required.
The renewal should ask for an authentication.
The link to order pay page won't display the Stripe authentication modal, and instead will show the regular checkout form.
With the PR, the checkout form is not displayed, the authentication starts just after loading the page.

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Added changelog entry in both changelog.txt and readme.txt (or does not apply)
  • Tested on mobile (or does not apply)

Post merge

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

Successfully merging this pull request may close these issues.

1 participant