我收到以下代码的错误
$charge = \Stripe\Charge::create( array( 'card' => $myCard,
'amount' => $post['job_cost']*100,
'currency' => 'usd',
'description'=> "Charge from ".$_SESSION['email'] . " (".$_SESSION['organization'].") for job " . $post['job_title'],
'customer' => "cus_7XOlaXPFww6URY"
)
);
如果我包含“cutomer”,那么错误就是
An uncaught Exception was encountered
键入:Stripe \ Error \ InvalidRequest
消息:无效字符串:{“number”=>“424242 ****** 4242”,“exp_month”=>“1”,“exp_year”=>“2016”,“cvc”= >“***”,“object”=>“card”}
答案 0 :(得分:0)
您应该使用'客户'或者'来源'归因于但不是两者。从当前的String create_charge PHP API文档中可以看出' card'不是有效的属性。