0
我試圖使用條紋結帳自定義但是我似乎無法得到以下信息發佈到相同的頁面,所以信息可以處理,有沒有人知道我在這裏失蹤?條紋不會發布到同一頁
<form action="" method="POST">
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="customButton">Purchase</button>
<script>
var handler = StripeCheckout.configure({
key: 'example_key_123',
image: 'https://stripe.com/img/documentation/checkout/marketplace.png',
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.
}
});
document.getElementById('customButton').addEventListener('click', function(e) {
// Open Checkout with further options:
handler.open({
name: 'Test',
description: '2 widgets',
currency: 'aud',
amount: 2000
});
e.preventDefault();
});
// Close Checkout on page navigation:
window.addEventListener('popstate', function() {
handler.close();
});
</script>
</form>