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

Fix fatal error when payment method ID is missing #3983

Merged
merged 3 commits into from
Feb 26, 2025

Conversation

wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Feb 25, 2025

Fixes #3934

Changes proposed in this Pull Request:

This PR fixes a possible fatal error that might happen when a payment method ID could not be retrieved, by setting some default values during payment information array initialization.

Testing instructions

Code review should be enough.


  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@wjrosa wjrosa self-assigned this Feb 25, 2025
@wjrosa wjrosa marked this pull request as ready for review February 25, 2025 21:23
Copy link
Contributor

@Mayisha Mayisha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding these default values is a good idea and will prevent the fatal error. 👍

@wjrosa wjrosa merged commit bec91d3 into develop Feb 26, 2025
42 checks passed
@wjrosa wjrosa deleted the fix/fatal-error-when-payment-method-id-is-missing branch February 26, 2025 12:16
'payment_method' => '',
'payment_method_details' => [],
'payment_type' => 'single', // single | recurring.
'capture_method' => $capture_method,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjrosa Can we exclude the default capture method at this level? Amazon Pay doesn't like it and complains (when capture method is manual), because it needs to be under payment_method_options?

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