当在实时模式下使用Stripe时,我得到这个
PHP错误:
No such token tok_fgfhn.. a similar object exists in test mode,but a live mode key was used to make this request
一切都在条纹测试模式下运行良好,而且我已经切换到一个实时API密钥.
我创建了一个这样的新客户:
$token = $_POST['stripeToken']; $email = $_POST['email']; $customer = \Stripe\Customer::create(array( 'email' => $email,'card' => $token )); //charge for user ads $charge = \Stripe\Charge::create(array( 'customer' => $customer->id,'amount' => $amount,'currency' => 'eur' ));
听起来你正在试图向您的测试帐户上存在的客户收取费用,而不是在您的实际账户上收取.确保您使用实时键创建新客户,并使用其令牌创建费用.
原文链接:https://www.f2er.com/php/140122.html