我正在使用PHP条带API创建一个银行帐户。
为此,我使用以下PHP代码:
$createBankAcc = \Stripe\Account::create(
array(
"country" => "US",
"managed" => true,
"email" => $email_db,
"legal_entity" => array(
'address' => array(
'city' => $city,
'country' => 'US',
"line1" => $address1,
//"line2" => $address2,
"postal_code" => $zip,
"state" => $state,
),
'business_name' => '',
'business_tax_id' => '',
'dob' => array(
'day' => $day,
'month' => $month,
'year' => $year,
),
'first_name' => $fname_db,
'last_name' => $lname_db,
'personal_id_number' => $pin,
'ssn_last_4' => $ssn,
'type' => 'individual',
),
'tos_acceptance' => array(
'date' => time(),
'ip' => $_SERVER['REMOTE_ADDR']
),
'transfer_schedule' => array(
"interval" => 'weekly',
"weekly_anchor" => 'sunday'
),
'external_account' => $stripeToken,
)
);
现在,在填写完所有表单数据后,它会显示错误消息。
错误讯息:
Missing required param: type.
我不明白我错过了类型 param?
答案 0 :(得分:1)
<?php
$createBankAcc = \Stripe\Account::create(
array(
"country" => "US",
"managed" => true,
"email" => $email_db,
"legal_entity" => array(
'address' => array(
'city' => $city,
'country' => 'US',
"line1" => $address1,
//"line2" => $address2,
"postal_code" => $zip,
"state" => $state,
),
'business_name' => '',
'business_tax_id' => '',
'dob' => array(
'day' => $day,
'month' => $month,
'year' => $year,
),
'first_name' => $fname_db,
'last_name' => $lname_db,
'personal_id_number' => $pin,
'ssn_last_4' => $ssn,
),
'type' => 'individual',
'tos_acceptance' => array(
'date' => time(),
'ip' => $_SERVER['REMOTE_ADDR']
),
'transfer_schedule' => array(
"interval" => 'weekly',
"weekly_anchor" => 'sunday'
),
'external_account' => $stripeToken,
)
);
答案 1 :(得分:0)
您错过了type
字段,这是必需的。您在type
对象中有一个legal_entity
字段。
它不应该在legal_entity
中。它应该在参数的根数组中。
细节为here