Problem/Motivation

We currently use the same "add-payment-method" operation both in checkout and in the user "payment methods" tab.
There is currently no way to skip automatically building the add payment method form in checkout, while still supporting adding a payment method from the user pages.

For several of our gateway plugins (e.g: Stripe, Authorize.net or PayPal), we are manually embedding the add payment method form in the review step.

In order to allow opting out for the logic that builds the add payment method form in checkout, I'm suggesting to introduce a separate operation "checkout-add-payment-method".
For backwards compatibility, we need extra logic that sets the same form class by default from PaymentGatewayBase::create() .

The PaymentInformation pane logic should be updated to check if the payment gateway plugin has a form class defined for the "checkout-add-payment-method" operation.

Issue fork commerce-3583436

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jsacksick created an issue. See original summary.

jsacksick’s picture

Issue tags: +Needs change record
jsacksick’s picture

Status: Active » Needs review
jsacksick’s picture

Title: Allow payment gateway plugins to defer the payment method creation » Use a different form operation for the add payment method form in checkout
Issue summary: View changes
jsacksick’s picture

jsacksick’s picture

Title: Use a different form operation for the add payment method form in checkout » Payment gateway plugins can now opt out of the checkout "add-payment-method" form

  • jsacksick committed 165b39ef on 3.x
    feat: #3583436 Use a different form operation for the add payment method...
jsacksick’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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