<!– 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. –>
<button id=”checkout-button” role=”link”>Pay</button>
<div id=”error-message”></div>

var stripe = Stripe(‘pk_live_X0RhqDTXBr9EluKcxuBY6xvs’, {
betas: [‘checkout_beta_4’] });

var checkoutButton = document.getElementById(‘checkout-button’);
checkoutButton.addEventListener(‘click’, function () {
// When the customer clicks on the button, redirect
// them to Checkout.
items: [{plan: ‘plan_EiZMfTSbp0UgQ9’, quantity: 1}],

// Note that it is not guaranteed your customers will be redirected to this
// URL *100%* of the time, it’s possible that they could e.g. close the
// tab between form submission and the redirect.
successUrl: ‘http://www.ashmanstrength.com/success’,
cancelUrl: ‘http://www.ashmanstrength.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;