Stripe 抛出未知错误 - 状态 400
Stripe throwing an unknown error - Status 400
我使用 Stripe 设置了支付网关。但由于某些未知原因,它抛出了一个错误。
未捕获(状态 400)(请求 req_0TGBfaSh8o6dTn)在 stripe-php-master\lib\Exception\ApiErrorException 中抛出无效对象。php
这是我的代码
<?php
require("payment-config.php");
\Stripe\Stripe::setVerifySslCerts(false);
$token = $_POST['stripeToken'];
$customer_name = $_POST['customer_name'];
$customer_email = $_POST['customer_email'];
$customer_address = $_POST['customer_address'];
$customer = \Stripe\Customer::create(array(
"name"=>$customer_name,
"email"=>$customer_email,
"address"=>$customer_address,
"source"=>$token
));
$charge = \Stripe\Charge::create(array(
"amount"=>500,
"currency"=>"usd",
"description"=>"easy-accounting",
"customer"=> $customer->id
));
?>
我做错了什么?
address
参数应具有每个 line1
、city
等的嵌套子参数
https://stripe.com/docs/api/customers/create?lang=php#create_customer-address
我使用 Stripe 设置了支付网关。但由于某些未知原因,它抛出了一个错误。
未捕获(状态 400)(请求 req_0TGBfaSh8o6dTn)在 stripe-php-master\lib\Exception\ApiErrorException 中抛出无效对象。php
这是我的代码
<?php
require("payment-config.php");
\Stripe\Stripe::setVerifySslCerts(false);
$token = $_POST['stripeToken'];
$customer_name = $_POST['customer_name'];
$customer_email = $_POST['customer_email'];
$customer_address = $_POST['customer_address'];
$customer = \Stripe\Customer::create(array(
"name"=>$customer_name,
"email"=>$customer_email,
"address"=>$customer_address,
"source"=>$token
));
$charge = \Stripe\Charge::create(array(
"amount"=>500,
"currency"=>"usd",
"description"=>"easy-accounting",
"customer"=> $customer->id
));
?>
我做错了什么?
address
参数应具有每个 line1
、city
等的嵌套子参数
https://stripe.com/docs/api/customers/create?lang=php#create_customer-address