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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -