我有一段代码在工作,我想知道是否有可能在结账过程的“成功代币”内进行分条付费?下面的所有代码都在工作,我只是想知道在哪里插入创建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>