Created
January 25, 2014 16:51
-
-
Save heyalexej/8619330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://checkout.stripe.com/checkout.js"></script> | |
<button id="btn2" class="btn btn-success btn-lg btn-block"> | |
<span class="text-uppercase"><span class="text-white-dark">Buy now for</span> $<%= "#{settings.price2}" %></span> | |
</button> | |
<script> | |
var handler = StripeCheckout.configure({ | |
key: 'pk_test_1DU6AgiPLPgyzdgvhHy3jTVb', | |
image: '<%= settings.image_link %>', | |
token: function(token, args) { | |
// Use the token to create the charge with a server-side script. | |
} | |
}); | |
document.getElementById('btn2').addEventListener('click', function(e) { | |
// Open Checkout with further options | |
handler.open({ | |
name: '<%= "#{settings.homepage}" %>', | |
description: '<%= "#{settings.price2_value} - Set" %>', | |
amount: <%= "#{settings.price2}" %>, | |
billingAddress: "true", | |
shippingAddress: "true" | |
}); | |
e.preventDefault(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment