Issue for PR https://github.com/drupalcommerce/commerce/pull/489

Currently if you go to checkout review, then go back to order information, the newly created payment method is not selected.

Comments

bojanz created an issue. See original summary.

bojanz credited googletorp.

bojanz’s picture

  • bojanz committed 9f451cd on 8.x-2.x
    Issue #2854145 by bojanz, googletorp: Order payment method should be...
bojanz’s picture

Status: Active » Fixed
ransomweaver’s picture

Wow, this little change really blew up my payment gateway module! In causing an existing payment method to be selected by default, an unintended consequence is that the payment gateway doesn't load (at least for my module) the JS libraries in the initial payment information form, because buildCreditCardForm with $element['#attached']['library'][] is not run until ajax does it when you switch to add a new payment method.

This core ajax issue is implicated, I think: https://www.drupal.org/node/1988968

To work around this I have had to move my js library attaching to a hook_form_alter, which is not great since I have different js libs to load depending on test vs production, which is found from the gateway plugin config.

@bojanz you should check if braintree is similarly affected, as should anyone who uses js during checkout.

bojanz’s picture

Status: Fixed » Closed (fixed)

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