创建 Stripe Charge 时出现以下错误
无效的字符串 id: {"number"=>"401288******1881", "exp_month"=>"02", "exp_year"=>"2015", "cvc"=>"***", "name"=>"Tahir Yasin", "address_line1"=>"lorem ipsum dolar", "address_line2"=>"lorem ipsum dolar", "address_zip"=>"5400", "address_state"=>"Punjab", “address_country”=>“PK”}{“成功”:真,“错误”:假}
条纹费和收款费
try {
$charge = Stripe_Charge::create(array(
'amount' => 500,
'currency' => 'usd',
'card' => array(
'number' => '4012888888881881',
'exp_month' => '02',
'exp_year' => '2015',
'cvc' => '123',
'name' => 'Tahir Yasin',
'address_line1' => 'lorem ipsum dolar',
'address_line2' => 'lorem ipsum dolar',
'address_zip' => '5400',
'address_state' => 'Punjab',
'address_country' => 'PK',
),
'description' => '#100000011, tahiryasin@test.com',
"application_fee" => 5
), 'SECRET_KEY_OF_CUSTOMER_TAKEN_VIA_STRIPE_CONNECT'
);
} catch (Exception $e) {
echo $e->getMessage();
}
进一步挖掘堆栈跟踪显示
[error] => Array
(
[type] => invalid_request_error
[message] => Invalid string id: {"number"=>"401288******1881", "exp_month"=>"02", "exp_year"=>"2015", "cvc"=>"***", "name"=>"Tahir Yasin", "address_line1"=>"lorem ipsum dolar", "address_line2"=>"lorem ipsum dolar", "address_zip"=>"5400", "address_state"=>"Punjab", "address_country"=>"PK"}
[param] => card
)
我认为这可能是由于虚拟卡详细信息造成的,但我注入了我的真实卡详细信息,但仍然是同样的错误。
任何人都可以调查并让我知道我在这里缺少什么吗?