function stripe_bank_payment()
{
$this->load->database();
$id = $_GET['user_id'];
$acc_id = $_GET['stripe_account_id'];
$amount = $_GET['amount'];
$get = $this->db->select('*')->where(array('user_id' => $id))->get('bank_detail');
$pay = $get->result_array();
foreach ($pay as $res) {
$token = $res['token'];
}
require_once 'stripe/init.php';
\Stripe\Stripe::setApiKey("sk_test_6zdfZQ6R0Jh7EiFONJTpYaFl");
$account = \Stripe\Account::retrieve($acc_id);
$account->external_accounts->create(array("external_account" => $token));
return $account;
}
以上是我的代码。 我正在尝试创建外部银行帐户。 user_id,stripe_account_id和金额由我给出。 要使用的令牌在bank_details表中。 所以我从那里得到令牌。 然后运行代码。