Sorry for making you wait.
The previous module had a problem. Stripe ID generated twice for a single order, but I resolved it today and uploaded a new module. Please wait until it is published.![]()
Is there any way to change the payment confirmation page layout from tabs to accordion without radio buttons?
Hi,
Yes it is possible to change the layout of the stripe payment options from tabs to accordion (without radio buttons). The stripe documentation details the various layout options available.
find the following code in checkout.js
then change it to the following:Code:const paymentElementOptions = { layout: "tabs", };
The defaultCollapsed option can be set to true or false depending on what look you prefer. It is also possible to change the order of the payment methods (e.g. to show Apple Pay first).Code:const paymentElementOptions = { layout: { type: 'accordion', defaultCollapsed: true, radios: false, spacedAccordionItems: true } }
Richard
This is not a option as you have put it - as there is only two options on showing/listing of payment methods with stripe:
"Manage payment methods from the Dashboard" or "Manually list payment methods" with only the later having the ability of "changing the order of payment methods" to do this you would have to harded code each method you wish to display and the down side of this is that errors can end up being displayed to your customers if stripe would not of displayed this method if the setting was of "Manage payment methods from the Dashboard" so I would say try your best to use the default setting of "Manage payment methods from the Dashboard" as Stripe uses many factors to decide if a method should or should not be displayed which would be too large to code these within a if statement and at lest one factor is fraud detection.
Last edited by OJ_SIMON; 9 Jul 2024 at 06:39 PM.
This is the best option on this point:
https://docs.stripe.com/payments/pay...ration-options
Use dynamic payment methods
[COLOR=var(--sail-color-text)]Stripe dynamically displays the most relevant payment methods to your customers based on the payment method preferences you set in the Dashboard and eligibility factors such as transaction amount, currency, and payment flow. To enable and manage your payment method preferences, go to the Dashboard. Stripe enables certain payment methods for you by default and might enable additional payment methods after notifying you.[/COLOR]
[COLOR=var(--sail-color-text)]Unless you have to list payment methods manually, we recommend using dynamic payment methods. Dynamic payment methods automatically determines whether to display payment methods according to set rules.[/COLOR]
[COLOR=var(--sail-color-text)]See Dynamic payment methods to learn more.[/COLOR]
Manually list payment methods
[COLOR=var(--sail-color-text)]Listing payment methods manually requires some coding. Every payment method you want your PaymentIntent to accept must be added to payment_method_types. Unless your integration requires that you list payment methods manually, we recommend that you manage payment methods from the Dashboard. Stripe handles the return of eligible payment methods based on factors such as the transaction’s amount, currency, and payment flow.[/COLOR]
Last edited by OJ_SIMON; 9 Jul 2024 at 06:48 PM.