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
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
Comment #3
jsacksick commentedComment #4
jsacksick commentedComment #5
jsacksick commentedComment #6
jsacksick commentedChange record: https://www.drupal.org/node/3585401.
Comment #7
jsacksick commentedComment #9
jsacksick commented