2017-05-28 49 views
0

我正在使用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?

回答

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, 
    ) 
); 
0

您錯過了type必填字段。您在legal_entity對象中有type字段。 它不應該在legal_entity。它應該在參數的根數組中。 詳細信息是here