(function() { var stripe = Stripe('pk_test_4g3hM46b9YE9Pj04znRghPA400HnF5xE9j'); var checkoutButton = document.getElementById('checkout-button-plan_HGzrlGtPAl8s5L'); checkoutButton.addEventListener('click', function () { // When the customer clicks on the button, redirect // them to Checkout. stripe.redirectToCheckout({ lineItems: [{price: 'plan_HGzrlGtPAl8s5L', quantity: 1}], mode: 'subscription', // 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/fulfillment successUrl: window.location.protocol + '//www.echocreative.it/success', cancelUrl: window.location.protocol + '//www.echocreative.it/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; } }); }); })();
Torna su

Hai un progetto in mente?

Parliamone.

  • Questo campo serve per la convalida e dovrebbe essere lasciato inalterato.