0
我正在嘗試Stripe API &函數,但我正在扭轉這個問題 - 如何在(測試)付款成功後提交表單?條紋定製結帳 - 表單提交
這裏是我當前的代碼:
<script>
var handler = StripeCheckout.configure({
key: 'pk_test_mykey',
image: 'https://stripe.com/img/documentation/checkout/marketplace.png',
locale: 'sv',
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) {
stripe_spots = document.getElementById("spots").value;
stripe_total = (stripe_spots) * 70;
// Open Checkout with 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>
在哪時我應該提交表單?
謝謝!