节点/快递相当新,我正在尝试使用Stripe 3.3.2和checkout.js进行简单的虚拟充电.提交结账表单后,令牌会毫无问题地返回后端; 但是,使用该令牌创建费用会导致以下结果:没有ID为tok_xxxxxxxxxxxxxxxxxxxxxxxx的令牌
我在这里错过了什么?
<a id="subscribe" href="#">Pay with Card</a>
<script>
// Define handler to be called when Stripe returns a card token
function onReceiveToken(token, args) {
// Submit token to server so it can charge the card
$.ajax({
url: '/premium/charge',
type: 'POST',
data: {
stripeToken: token
}
});
}
// Configure Checkout
var checkout = StripeCheckout.configure({
key: 'xx_xxxx_xxxxxxxxxxxxxxxxxxxx',
token: onReceiveToken,
image: '/images/logo/stripe.png',
name: 'Test App',
description: 'Premium Sounds',
amount: 500
});
// Open Checkout …Run Code Online (Sandbox Code Playgroud)