Aller au contenu

À PRÉSENT, RENDEZ-VOUS DANS TA BOÎTE MAIL POUR CRÉER TON COMPTE ET L’ACTIVER.

À TOUT DE SUITE, DE L’AUTRE CÔTÉ !

<!-- Load Stripe.js on your website. -->
<script src="https://js.stripe.com/v3"></script>

<!-- Create a button that your customers click to complete their purchase. Customize the styling to suit your branding. -->
<button
  style="background-color:#6772E5;color:#FFF;padding:8px 12px;border:0;border-radius:4px;font-size:1em;cursor:pointer"
  id="checkout-button-price_1LXlEmLLZoG4f5Bxe30dWy1b"
  role="link"
  type="button"
>
  Checkout
</button>

<div id="error-message"></div>

<script>
(function() {
  var stripe = Stripe('pk_live_1fgmyPR3F8daQDpvVRXvRffq00vNmW1Q97');

  var checkoutButton = document.getElementById('checkout-button-price_1LXlEmLLZoG4f5Bxe30dWy1b');
  checkoutButton.addEventListener('click', function () {
    /*
     * When the customer clicks on the button, redirect
     * them to Checkout.
     */
    stripe.redirectToCheckout({
      lineItems: [{price: 'price_1LXlEmLLZoG4f5Bxe30dWy1b', 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/fulfill-orders
       */
      successUrl: 'https://www.aurelieverdon.com/success',
      cancelUrl: 'https://www.aurelieverdon.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;
      }
    });
  });
})();
</script>

À

POUR