私はストライプAPI &の機能を試していますが、この1つの問題の周りに私の頭をねじっています - (テスト)支払いが成功した後にフォームを提出する方法?ストライプカスタムチェックアウト - フォーム提出
ここに私の現在のコードです:
<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>
または私がフォームを送信することが出来るのですが?
ありがとうございます!