Stripe bank account id
So I have spent the last two days looking around on stackoverflow and also the stripe API and I can't seem to find out how to get the banking ID when I add a new bank account for a worker. The account gets added to stripe, but it never seems to return me a bank id token, the ba_****.
Here is my code to add the bank account:
First method I tried:
$bank_account_token = mysqli_real_escape_string($link, $_POST['token']);
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" =>
$bank_account_token]);
$bank_id = $account->external_account->id;
This is the second method I tried:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(array(
"external_account" => array(
"object" => "bank_account",
"account_number" => $account_number,
"routing_number" => $routing_number,
"country" => "US",
"currency" => "USD",)
));
$bank_id = $account->external_account->id;
I have also tried these various other methods to try and capture the bank id after it has been input into stripe and none of them return an id.
$bank_id = $account->bank_account->id;
$bank_id = $account->bank_account->external_account->id;
$bank_id = $account->external_accounts->bank_account->id;
This is the response that stripe says I should get when I add a new bank account:
com.stripe.model.BankAccount JSON:
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new",
"account": "acct_1BS4bBC7941OKJKE"
php stripe-payments
add a comment |
So I have spent the last two days looking around on stackoverflow and also the stripe API and I can't seem to find out how to get the banking ID when I add a new bank account for a worker. The account gets added to stripe, but it never seems to return me a bank id token, the ba_****.
Here is my code to add the bank account:
First method I tried:
$bank_account_token = mysqli_real_escape_string($link, $_POST['token']);
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" =>
$bank_account_token]);
$bank_id = $account->external_account->id;
This is the second method I tried:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(array(
"external_account" => array(
"object" => "bank_account",
"account_number" => $account_number,
"routing_number" => $routing_number,
"country" => "US",
"currency" => "USD",)
));
$bank_id = $account->external_account->id;
I have also tried these various other methods to try and capture the bank id after it has been input into stripe and none of them return an id.
$bank_id = $account->bank_account->id;
$bank_id = $account->bank_account->external_account->id;
$bank_id = $account->external_accounts->bank_account->id;
This is the response that stripe says I should get when I add a new bank account:
com.stripe.model.BankAccount JSON:
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new",
"account": "acct_1BS4bBC7941OKJKE"
php stripe-payments
How is this related to Android ? A Web API can consume by any platform so android tag is irrelevant.
– ADM
Nov 11 '18 at 10:40
@ADM I am getting the tokens from Android stripe api and passing to the web api, so wasn't sure if it is related to that or not, or figured someone else who was doing the same thing might have an answer.
– user2101081
Nov 11 '18 at 10:44
add a comment |
So I have spent the last two days looking around on stackoverflow and also the stripe API and I can't seem to find out how to get the banking ID when I add a new bank account for a worker. The account gets added to stripe, but it never seems to return me a bank id token, the ba_****.
Here is my code to add the bank account:
First method I tried:
$bank_account_token = mysqli_real_escape_string($link, $_POST['token']);
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" =>
$bank_account_token]);
$bank_id = $account->external_account->id;
This is the second method I tried:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(array(
"external_account" => array(
"object" => "bank_account",
"account_number" => $account_number,
"routing_number" => $routing_number,
"country" => "US",
"currency" => "USD",)
));
$bank_id = $account->external_account->id;
I have also tried these various other methods to try and capture the bank id after it has been input into stripe and none of them return an id.
$bank_id = $account->bank_account->id;
$bank_id = $account->bank_account->external_account->id;
$bank_id = $account->external_accounts->bank_account->id;
This is the response that stripe says I should get when I add a new bank account:
com.stripe.model.BankAccount JSON:
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new",
"account": "acct_1BS4bBC7941OKJKE"
php stripe-payments
So I have spent the last two days looking around on stackoverflow and also the stripe API and I can't seem to find out how to get the banking ID when I add a new bank account for a worker. The account gets added to stripe, but it never seems to return me a bank id token, the ba_****.
Here is my code to add the bank account:
First method I tried:
$bank_account_token = mysqli_real_escape_string($link, $_POST['token']);
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" =>
$bank_account_token]);
$bank_id = $account->external_account->id;
This is the second method I tried:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(array(
"external_account" => array(
"object" => "bank_account",
"account_number" => $account_number,
"routing_number" => $routing_number,
"country" => "US",
"currency" => "USD",)
));
$bank_id = $account->external_account->id;
I have also tried these various other methods to try and capture the bank id after it has been input into stripe and none of them return an id.
$bank_id = $account->bank_account->id;
$bank_id = $account->bank_account->external_account->id;
$bank_id = $account->external_accounts->bank_account->id;
This is the response that stripe says I should get when I add a new bank account:
com.stripe.model.BankAccount JSON:
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new",
"account": "acct_1BS4bBC7941OKJKE"
php stripe-payments
php stripe-payments
edited Nov 11 '18 at 17:57
user2101081
asked Nov 11 '18 at 10:29
user2101081user2101081
13615
13615
How is this related to Android ? A Web API can consume by any platform so android tag is irrelevant.
– ADM
Nov 11 '18 at 10:40
@ADM I am getting the tokens from Android stripe api and passing to the web api, so wasn't sure if it is related to that or not, or figured someone else who was doing the same thing might have an answer.
– user2101081
Nov 11 '18 at 10:44
add a comment |
How is this related to Android ? A Web API can consume by any platform so android tag is irrelevant.
– ADM
Nov 11 '18 at 10:40
@ADM I am getting the tokens from Android stripe api and passing to the web api, so wasn't sure if it is related to that or not, or figured someone else who was doing the same thing might have an answer.
– user2101081
Nov 11 '18 at 10:44
How is this related to Android ? A Web API can consume by any platform so android tag is irrelevant.
– ADM
Nov 11 '18 at 10:40
How is this related to Android ? A Web API can consume by any platform so android tag is irrelevant.
– ADM
Nov 11 '18 at 10:40
@ADM I am getting the tokens from Android stripe api and passing to the web api, so wasn't sure if it is related to that or not, or figured someone else who was doing the same thing might have an answer.
– user2101081
Nov 11 '18 at 10:44
@ADM I am getting the tokens from Android stripe api and passing to the web api, so wasn't sure if it is related to that or not, or figured someone else who was doing the same thing might have an answer.
– user2101081
Nov 11 '18 at 10:44
add a comment |
1 Answer
1
active
oldest
votes
Okay so after further digging and reaching out to stripe (waiting on their email replies) I have figured out that their documentation is outdated in some sections. The correct response is:
"external_accounts": {
"object": "list",
"data": [
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account": "acct_2BS4cCb7841ONDLK",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": true,
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new"
],
So to pull the first element (which is the id) I needed to pull it for an array:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" => $bank_account_token]);
$bank_id = $account->external_accounts->data[0]->id;
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53247845%2fstripe-bank-account-id%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Okay so after further digging and reaching out to stripe (waiting on their email replies) I have figured out that their documentation is outdated in some sections. The correct response is:
"external_accounts": {
"object": "list",
"data": [
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account": "acct_2BS4cCb7841ONDLK",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": true,
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new"
],
So to pull the first element (which is the id) I needed to pull it for an array:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" => $bank_account_token]);
$bank_id = $account->external_accounts->data[0]->id;
add a comment |
Okay so after further digging and reaching out to stripe (waiting on their email replies) I have figured out that their documentation is outdated in some sections. The correct response is:
"external_accounts": {
"object": "list",
"data": [
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account": "acct_2BS4cCb7841ONDLK",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": true,
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new"
],
So to pull the first element (which is the id) I needed to pull it for an array:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" => $bank_account_token]);
$bank_id = $account->external_accounts->data[0]->id;
add a comment |
Okay so after further digging and reaching out to stripe (waiting on their email replies) I have figured out that their documentation is outdated in some sections. The correct response is:
"external_accounts": {
"object": "list",
"data": [
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account": "acct_2BS4cCb7841ONDLK",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": true,
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new"
],
So to pull the first element (which is the id) I needed to pull it for an array:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" => $bank_account_token]);
$bank_id = $account->external_accounts->data[0]->id;
Okay so after further digging and reaching out to stripe (waiting on their email replies) I have figured out that their documentation is outdated in some sections. The correct response is:
"external_accounts": {
"object": "list",
"data": [
"id": "ba_1DVFGuC7941OKJKEoBwDlmHc",
"object": "bank_account",
"account": "acct_2BS4cCb7841ONDLK",
"account_holder_name": null,
"account_holder_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": true,
"fingerprint": "bGA06pJMr6Vwreh6",
"last4": "6789",
"metadata":
,
"routing_number": "110000000",
"status": "new"
],
So to pull the first element (which is the id) I needed to pull it for an array:
$account = StripeAccount::retrieve($worker_token);
$account->external_accounts->create(["external_account" => $bank_account_token]);
$bank_id = $account->external_accounts->data[0]->id;
answered Nov 11 '18 at 17:56
user2101081user2101081
13615
13615
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53247845%2fstripe-bank-account-id%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How is this related to Android ? A Web API can consume by any platform so android tag is irrelevant.
– ADM
Nov 11 '18 at 10:40
@ADM I am getting the tokens from Android stripe api and passing to the web api, so wasn't sure if it is related to that or not, or figured someone else who was doing the same thing might have an answer.
– user2101081
Nov 11 '18 at 10:44