php - Stripe custom checkout - form submit -


i'm trying out stripe api & functions, twisting head around 1 issue - how submit form after (test) payment successful?

here's current code:

<script>     var handler = stripecheckout.configure({         key: 'pk_test_mykey',         image: 'https://stripe.com/img/documentation/checkout/marketplace.png',         locale: 'sv',         token: function(token) {             // can access token id `token.id`.             // token id server-side code use.         }     });       document.getelementbyid('custombutton').addeventlistener('click', function(e) {         stripe_spots = document.getelementbyid("spots").value;         stripe_total = (stripe_spots) * 70;         // open checkout further options:         handler.open({             name: 'revy!',             description: stripe_spots + " platser",             zipcode: true,             currency: 'sek',             amount: stripe_total * 100         });          e.preventdefault();      });       // close checkout on page navigation:      window.addeventlistener('popstate', function() {          handler.close();      });  </script> 

where or when supposed submit form?

thanks!

after retrieving stripe token should send data server including token make stripe charge or create subscription

here example tutorial create customer subscription


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -