https://js.stripe.com/v3 Checkout
(function() { var stripe = Stripe(‘pk_live_51HkdHxDW5k9azYjwperTFnNczWhRHUscXWMzgYKqVrtRgCPY4ObZ1o93HNeWdCb82ofkOQS8wSJajkVNsRq4xi0E00QNb3kuxu’); var checkoutButton = document.getElementById(‘checkout-button-price_1I9N5iDW5k9azYjwltNsc191’); checkoutButton.addEventListener(‘click’, function () { /* * When the customer clicks on the button, redirect * them to Checkout. */ stripe.redirectToCheckout({ lineItems: [{price: ‘price_1I9N5iDW5k9azYjwltNsc191’, quantity: 1}], mode: ‘payment’, /* * Do not rely on the redirect to the successUrl for fulfilling * purchases, customers may not always reach the success_url after * a successful payment. * Instead use one of the strategies described in * https://stripe.com/docs/payments/checkout/fulfill-orders */ successUrl: window.location.protocol + ‘//www.beredioutdoors.com/success’, cancelUrl: window.location.protocol + ‘//www.beredioutdoors.com/canceled’, }) .then(function (result) { if (result.error) { /* * If `redirectToCheckout` fails due to a browser or network * error, display the localized error message to your customer. */ var displayError = document.getElementById(‘error-message’); displayError.textContent = result.error.message; } }); }); })();