I’ve been searching the web for hours with no solution in site…
Can anyone help with providing advice on how to add a Stripe Redirect after successful payment in JS below?
<script src="https://checkout.stripe.com/checkout.js"></script>
<a class="nectar-button large regular accent-color has-icon regular-button" style="margin-top: 25px; visibility: visible;" href="" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>Buy Bubble Wrap & Bones – $27</span><i class="fa fa-cc-stripe"></i></a>
<script>
var handler = StripeCheckout.configure({
key: 'pk_test_59cT1EcyoS3kxvZdt1wWGqK2',
image: '/wp-content/uploads/2017/11/snoop_head.jpg',
locale: 'auto',
shippingAddress: 'true',
token: function(token) {
// You can access the token ID with `token.id`.
// Get the token ID to your server-side code for use.
}
});
document.getElementById('customButton').addEventListener('click', function(e) {
// Open Checkout with further options:
handler.open({
name: 'Buy my eBook, hooman!',
description: '…daddy needs some treats',
currency: 'usd',
amount: 2900
});
e.preventDefault();
});
// Close Checkout on page navigation:
window.addEventListener('popstate', function() {
handler.close();
});
</script>