【发布时间】:2016-03-18 01:12:36
【问题描述】:
我有一个页面,用户输入抄送并被收费。
我使用js创建了一个卡片令牌
Stripe.card.createToken(ccData, function stripeResponseHandler(status, response) {
var token = response.id;
// add the cc info to the user using
// charge the cc for an amount
});
添加我正在使用php的cc
$stripeResp = Stripe_Customer::retrieve($stripeUserId);
$stripeResp->sources->create(['source' => $cardToken]);
为了给cc充电,我也在用php
$stripeCharge = Stripe_Charge::create([
'source' => $token,
'amount' => $amount
]);
做这一切我得到You cannot use a Stripe token more than once。
任何想法我如何将抄送保存给该用户$stripeUserId 并充电。
欢迎使用 PHP,但 js 也很棒。
【问题讨论】:
标签: javascript php stripe-payments credit-card