Offering Stripe and PayPal on same checkout page

Has anyone put both Stripe and PayPal onto the same checkout page? I currently have Stripe working fine but want to give the customer the option of PayPal instead. I have buttons to show/hide the two options - so if they click Credit Card then the Stripe button shows but it’s a submit button and I have this js on the form to take them to Stripe Checkout:

dmx-on:success="run({runJS:{function:'runStripe'}})

The PayPal Checkout (https://developer.paypal.com/docs/checkout/integrate/) buttons are in place and working nicely but following the successful payment (a popup opens where they log into PayPal or enter their card details and once payment is made the popup closes and shows an alert) I want to change the page to show the ‘complete order’ button which then does the actual completing of the order (database updates, email confirmation, etc.) but the complete order button will submit the same form which will trigger the Stripe process.

Does that make sense?

I’m thinking I just need to tweak my Stripe code slightly so it only runs if that method has been selected.

Can anyone assist me with this?

Community Page
Last updated: