【发布时间】:2021-07-12 14:28:39
【问题描述】:
我正在尝试使用 Stripe API 和 PHP 将表单中的帐单地址插入到 Stripe 源中。
这是我目前正在尝试的:
if ($_SERVER["REQUEST_METHOD"] == "POST") {
//Get form data and load it into DB and Stripe
$address = stripslashes($_REQUEST['address']);
$city = stripslashes($_REQUEST['city']);
$state = stripslashes($_REQUEST['state']);
$zip = stripslashes($_REQUEST['zip_code']);
\Stripe\Stripe::setApiKey("MY-API-KEY");
$customer = \Stripe\Customer::updateSource(
$ss_customer_id,
$ss_card_id,
[
'billing_address' => [
'line1' => $address,
]
]
);
}
但是,这似乎不起作用,因为 Stripe API 给了我以下响应:
parameter_unknown - billing_address
Received unknown parameter: billing_address
我该如何解决这个问题?
【问题讨论】:
标签: php api stripe-payments