无法创建条带管理帐户以向该帐户汇款

时间:2016-09-28 12:53:07

标签: php laravel stripe-payments

我试试这段代码

Stripe::setApiKey("sk_test_eDpXMPqKt0zD1hr55Sw*****");
       Stripe::setApiVersion("2015-02-18");

       $account = Account::create([
           "country" => "US",
           "managed" => true,
           "email" => "gven****@gmail.com",
       ]);

       $account_ret = Account::retrieve($account->id);

       $account_ret->support_phone = '555-666-7777';
       $account_ret->legal_entity->dob = [
          'day' => '10',
          'month' => '01',
          'year' => '1988'
       ];

       $account_ret->legal_entity->address = [
           'city' => 'San Clemente',
           'line1' => '100',
           'line2'=>'Avenida Presidio',
           'postal_code' => '92672',
           'state' => 'CA',
           'country' => 'US'
       ];

       $account_ret->legal_entity->ssn_last_4 = '4242';
       $account_ret->legal_entity->first_name = "Gven";
       $account_ret->legal_entity->last_name = "Pzikyan";
       $account_ret->legal_entity->type = "individual";
       $account_ret->tos_acceptance = [
           'date' => time(),
           'ip' =>  $_SERVER['REMOTE_ADDR']
       ];

       $account_ret->save();

我使用Laravel 5.1和Stripe库进行php strype php

我收到此回复

{
  "status": "success",
  "data": {
    "id": "acct_18ygr2BKalvVkIRU",
    "object": "account",
    "bank_accounts": {
      "object": "list",
      "data": [],
      "has_more": false,
      "total_count": 0,
      "url": "/v1/accounts/acct_18ygr2BKalvVkIRU/bank_accounts"
    },
    "business_logo": null,
    "business_name": null,
    "business_url": null,
    "charges_enabled": true,
    "country": "US",
    "debit_negative_balances": false,
    "decline_charge_on": {
      "avs_failure": false,
      "cvc_failure": false
    },
    "default_currency": "usd",
    "details_submitted": false,
    "display_name": null,
    "email": "gven****@gmail.com",
    "external_accounts": {
      "object": "list",
      "data": [],
      "has_more": false,
      "total_count": 0,
      "url": "/v1/accounts/acct_18ygr2BKalvVkIRU/external_accounts"
    },
    "legal_entity": {
      "additional_owners": null,
      "address": {
        "city": "San Clemente",
        "country": "US",
        "line1": "100",
        "line2": "Avenida Presidio",
        "postal_code": "92672",
        "state": "CA"
      },
      "address_kana": {
        "city": null,
        "country": "US",
        "line1": null,
        "line2": null,
        "postal_code": null,
        "state": null,
        "town": null
      },
      "address_kanji": {
        "city": null,
        "country": "US",
        "line1": null,
        "line2": null,
        "postal_code": null,
        "state": null,
        "town": null
      },
      "business_name": null,
      "business_name_kana": null,
      "business_name_kanji": null,
      "business_tax_id_provided": false,
      "dob": {
        "day": 10,
        "month": 1,
        "year": 1988
      },
      "first_name": "Gven",
      "first_name_kana": null,
      "first_name_kanji": null,
      "gender": null,
      "last_name": "Pzikya",
      "last_name_kana": null,
      "last_name_kanji": null,
      "maiden_name": null,
      "personal_address": {
        "city": null,
        "country": "US",
        "line1": null,
        "line2": null,
        "postal_code": null,
        "state": null
      },
      "personal_address_kana": {
        "city": null,
        "country": "US",
        "line1": null,
        "line2": null,
        "postal_code": null,
        "state": null,
        "town": null
      },
      "personal_address_kanji": {
        "city": null,
        "country": "US",
        "line1": null,
        "line2": null,
        "postal_code": null,
        "state": null,
        "town": null
      },
      "personal_id_number_provided": false,
      "phone_number": null,
      "ssn_last_4_provided": false,
      "type": "individual",
      "verification": {
        "details": null,
        "details_code": null,
        "document": null,
        "status": "unverified"
      }
    },
    "managed": true,
    "metadata": [],
    "product_description": null,
    "statement_descriptor": null,
    "support_email": null,
    "support_phone": "555-666-7777",
    "timezone": "Etc/UTC",
    "tos_acceptance": {
      "date": 1475064486,
      "ip": "127.0.0.1",
      "user_agent": ""
    },
    "transfer_schedule": {
      "delay_days": 2,
      "interval": "daily"
    },
    "transfers_enabled": false,
    "verification": {
      "disabled_reason": null,
      "due_by": null,
      "fields_needed": [
        "legal_entity.personal_id_number",
        "bank_account"
      ],
      "contacted": false
    },
    "currencies_supported": [
      "usd",
      "aed",
      "afn",
      "all",
      "amd",
      "ang",
      "aoa",
      "ars",
      "aud",
      "awg",
      "azn",
      "bam",
      "bbd",
      "bdt",
      "bgn",
      "bif",
      "bmd",
      "bnd",
      "bob",
      "brl",
      "bsd",
      "bwp",
      "bzd",
      "cad",
      "cdf",
      "chf",
      "clp",
      "cny",
      "cop",
      "crc",
      "cve",
      "czk",
      "djf",
      "dkk",
      "dop",
      "dzd",
      "egp",
      "etb",
      "eur",
      "fjd",
      "fkp",
      "gbp",
      "gel",
      "gip",
      "gmd",
      "gnf",
      "gtq",
      "gyd",
      "hkd",
      "hnl",
      "hrk",
      "htg",
      "huf",
      "idr",
      "ils",
      "inr",
      "isk",
      "jmd",
      "jpy",
      "kes",
      "kgs",
      "khr",
      "kmf",
      "krw",
      "kyd",
      "kzt",
      "lak",
      "lbp",
      "lkr",
      "lrd",
      "lsl",
      "ltl",
      "mad",
      "mdl",
      "mga",
      "mkd",
      "mnt",
      "mop",
      "mro",
      "mur",
      "mvr",
      "mwk",
      "mxn",
      "myr",
      "mzn",
      "nad",
      "ngn",
      "nio",
      "nok",
      "npr",
      "nzd",
      "pab",
      "pen",
      "pgk",
      "php",
      "pkr",
      "pln",
      "pyg",
      "qar",
      "ron",
      "rsd",
      "rub",
      "rwf",
      "sar",
      "sbd",
      "scr",
      "sek",
      "sgd",
      "shp",
      "sll",
      "sos",
      "srd",
      "std",
      "svc",
      "szl",
      "thb",
      "tjs",
      "top",
      "try",
      "ttd",
      "twd",
      "tzs",
      "uah",
      "ugx",
      "uyu",
      "uzs",
      "vnd",
      "vuv",
      "wst",
      "xaf",
      "xcd",
      "xof",
      "xpf",
      "yer",
      "zar",
      "zmw"
    ]
  }
}
  1. bank_account在响应中代表什么?
  2. 我可以效仿任何请求示例吗?

1 个答案:

答案 0 :(得分:1)

好问题!当你看到" bank_account"在" fields_needed"下,这表示托管帐户没有附加银行帐户信息。要完成帐户验证,您必须通过"更新帐户提交帐户信息" API调用:

https://stripe.com/docs/api/curl#update_account-external_account

在最新版本的API" bank_account"被称为" external_account",请参阅此处的注释: https://stripe.com/docs/upgrades#2015-10-01

看起来您的Stripe帐户是在不久前创建的,因此其API版本不是最新版本。如果您仍在使用您的解决方案,我会考虑升级您的API版本。 API文档仅涵盖最新的API版本,因此,如果您使用旧版本,则可能会发现一些差异。请务必阅读升级说明: /文档/升级

您可以在此处从信息中心升级API版本: /帐户/ apikeys

希望能够解决问题!如果您有任何其他问题,请告诉我,我很乐意提供帮助。

在您的请求中添加以下行。这将解决您的问题。

    $account_ret->legal_entity->business_name = 'test_business_name ';
    $account_ret->legal_entity->business_tax_id = '000000000';
    $account_ret->legal_entity->type = "sole_prop";
    $account_ret->external_account =  array(
        "object" => "bank_account",
        "country" => "US",
        "currency" => "usd",
        "account_holder_name" => 'Gven Pzikyan',
        "account_holder_type" => 'individual',
        "routing_number" => "110000000",
        "account_number" => "000123456789"
    );
    $file = FileUpload::create([
        "purpose" => "identity_document",
        "file" => fopen('/path/to/file/file.jpeg', 'r')
    ],
    [
        "stripe_account" => $account->id
    ]);

    $account_ret->legal_entity->verification->document = $file->id;

    $account_ret->save();