People often extend the PaymentInformation pane to customize it. Most just disable the original pane and give the new one a new ID, but that disables the PaymentProcess pane. The PaymentProcess pane hardcodes the payment_information pane ID in 3 places, and if only one is replaced by accident, really odd bugs can happen (sending a user to checkout/:step_id/_disabled for example).

Plan of action:
1) Add a comment to the PaymentInformation docbock to tell people the proper way of replacing the pane (removing the need to override PaymentProcess).
2) Reduce the number of protected methods in PaymentProcess, reduce the number of places payment_information is hardcoded in, to simplify overriding PaymentProcess even if its not needed.
3) Validate the $step_id in CheckoutFlowBase::redirectToStep(), to protect against "_disabled",

CommentFileSizeAuthor
#3 3005796-3.patch6.84 KBbojanz

Comments

bojanz created an issue. See original summary.

bojanz’s picture

Issue summary: View changes
bojanz’s picture

Status: Active » Needs review
StatusFileSize
new6.84 KB

Patch.

  • bojanz committed 837dfed on 8.x-2.x
    Issue #3005796 by bojanz: Improve the DX of overriding the...
bojanz’s picture

Status: Needs review » Fixed

And done.

bojanz’s picture

Issue summary: View changes

  • bojanz committed bf6abe3 on 8.x-2.x
    Issue #3005796 followup: Throw an exception from PaymentProcess::...
bojanz’s picture

Added an additional exception. This one would be triggered each time the PaymentProcess pane is rendered, and not just when the payment method is declined, making it easier to catch & debug.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.