Stripe payments 在stripe上创建客户?
我正在尝试这个Stripe payments 在stripe上创建客户?,stripe-payments,Stripe Payments,我正在尝试这个 $customer = Stripe_Customer::create(array( "card" => $token, "plan" => "gold", "email" => "payinguser@example.com") ); 但是到目前为止运气不好。没错:现在保留$customer->id.然后你可以像这样收费: $charge = Stripe_Charge::create(array( "amount" =
$customer = Stripe_Customer::create(array(
"card" => $token,
"plan" => "gold",
"email" => "payinguser@example.com")
);
但是到目前为止运气不好。没错:现在保留
$customer->id.
然后你可以像这样收费:
$charge = Stripe_Charge::create(array(
"amount" => $total, // amount in cents, again
"currency" => "usd",
"customer" => $customer->id,
"description" => "My Charge")
);
请提供更多关于您尝试这一切的环境的详细信息。什么是“不走运”?如果您正确地获得了令牌,那么这就是创建客户的正确语法。是的,我正确地获得了令牌,但是创建客户语法中出现了一些错误……您上面的代码是正确的。你有代币吗?您有可发布的密钥和机密密钥吗?对于初学者,您可以调用
Stripe::setApiKey($Stripe\u secret\u key)代码>在创建客户之前,对吗?