我有一段代碼在工作,我想知道是否有可能在結賬過程的「成功代幣」內進行分條付費?下面的所有代碼都在工作,我只是想知道在哪裏插入創建acctuall費用的代碼。 使用JavaScript創建條紋費用
<script src="https://checkout.stripe.com/checkout.js"></script>
<script src="https://js.stripe.com/v3/"</script>
<button id="payment-button" type="button" class="btn btn-success">Pay With Card</button>
<script>
var handler = StripeCheckout.configure({
key: 'mykeyhere',
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("book-appointment-submit").style.display="block";
document.getElementById("payment-button").style.display="none";
}
});
document.getElementById('payment-button').addEventListener('click', function(e) {
// Open Checkout with further options:
handler.open({
name: 'DenchCodeLTD',
description: '2 widgets',
zipCode: true,
currency: 'gbp',
amount: 2000
});
e.preventDefault();
});
// Close Checkout on page navigation:
window.addEventListener('popstate', function() {
handler.close();
});
</script>
<!-- End Of Stripe Payment -->
<button id="book-appointment-submit" type="button" class="btn btn-success" style="display:none">
<span class="glyphicon glyphicon-ok"></span>
<?php
echo (!$manage_mode) ? $this->lang->line('confirm')
: $this->lang->line('update');
?>
</button>