MODULES
...
eCommerce
Payment Gateways

Switching Between Multiple Payment Method Options

3min
steps step 1 use the ecommerce/checkout standard including payment gateways in a form layout docid\ wdxvxmm5wue2tzgd5px 5 include to output multiple payment gateways inside your checkout form liquid layout file step 2 once you have multiple options, you'll need a way to tell the system which to use the following js function will do that for you s e set payment gateway('stripe'); s e set payment gateway('paypal'); pass in the name of the payment gateway you wish to switch to as the only argument this can be applied to any action you like, such as clicking a radio button, or opening an accordion e g html pay with stripe pay with paypalconst paymentgatewaycheckboxes = document queryselectorall('\[name="paymentgateway"]'); paymentgatewaycheckboxes foreach(function(item) { item addeventlistener('change', function(e) { const radio = e currenttarget; s e set payment gateway(radio value); }); }) if the js function is not called, the default payment gateway from the multiple available gteways will be used