Add validation to the set_payment_method_title_for_email method #6951
Labels
category: core
WC Payments core related issues, where it’s obvious.
component: checkout
Issues related to Checkout
component: upe
good first issue
The issue is a good candidate for the first community contribution/for a newcomer to the team.
priority: high
The issue/PR is high priority—it affects lots of customers substantially, but not critically.
type: bug
The issue is a confirmed bug.
Describe the bug
The set_payment_method_title_for_email function lacks proper validation, potentially leading to unexpected behavior or fatal errors when setting payment methods for email notifications. We should ensure that the function gracefully handles invalid or missing data and returns
WooPayments
as a fallback.Additional context
Stack trace of one error that occurred during a pre-orders purchase and release
p1691513753212109-slack-CGGCLBN58
The text was updated successfully, but these errors were encountered: