UNPKG

vpn.email

Version:
30 lines (26 loc) 845 B
<script src="https://checkout.stripe.com/checkout.js"></script> <button id="customButton">Purchase</button> <script> var handler = StripeCheckout.configure({ key: 'pk_test_pSOYZa8ABXjatNN5jHb2UTdN', image: 'https://s3.amazonaws.com/stripe-uploads/acct_17rZLXD9Y6UfFoPfmerchant-icon-1462111358896-vpnviaemail.jpg', locale: 'auto', token: function(token) { // You can access the token ID with `token.id`. // Get the token ID to your server-side code for use. } }); $('#customButton').on('click', function(e) { // Open Checkout with further options: handler.open({ name: 'VpnVia.Email', description: '2 widgets', amount: 2000 }); e.preventDefault(); }); // Close Checkout on page navigation: $(window).on('popstate', function() { handler.close(); }); </script>