#jrfr-connect-externalaccount
1 messages · Page 1 of 1 (latest)
jrfr-connect-externalaccount
@rotund horizon that's mostly correct. The BankAccount API resource can represent either a bank account used for a Customer paying for a service (though this is legacy and deprecated) or used for an Account that is offering a service (to receive money later).
Yeah I guess thats what I'm not sure I'm following correctly - so a BankAccount created either under an external account or a customer would result in a "ba_" bankaccount resource being created?
If you have an Account with an external account ba_1234 then that BankAccount object will be used to receive a Payout which is when money leaves Stripe to go to the bank
right thats what I'm expecting and understanding
and yes both would have a ba_123 id but they are completey separate concepts and really for the "customer" part it's fully deprecated and not really relevant anymore
hrm let me see if i can phrase this another way
I am so far never dealing directly with the Bank Account api, I am creating external accounts with bank accounts
theres a "List all bank accounts" via the BankAccountService in the stripe.net package - would external account bank accounts be listed via this mechanism? Docs: https://stripe.com/docs/api/customer_bank_accounts/list
I'm assuming no
yep ok that is what I'm using when attempting to see the external account bank accounts for a connected account
What type of connected account is this? It only works for Custom accounts
could I ask one followup question - I have created a connect account via the stripe dashboard and have an associated external account bank account also set via the stripe UI. I'm using the Stripe.NET package and the "AccountService" to obtain a connect account and the docs suggest I should be able to see up to 10 external accounts for each account I request details of. I'm pulling several accounts and the shape of the "external accounts" data is much less than what I'm expecting. In each account I try all I see is basically a single item array where the id of the connect account is listed: For example:
"externalAccounts": [
{
"account": null,
"accountId": "acct_1NQeGAPSL7cqpN2i"
}
],
Is this normal? The docs suggest theres many more properties
yeah these are custom accounts
Can you share exact code?
sure one sec
[HttpGet("GetConnectAccount/{connectAccountId}")]
public JsonResult GetConnectAccount(string connectAccountId)
{
//StripeConfiguration.ApiKey = this._configuration["Stripe:PublishableKey"]!;
string stripeApiKey = this._configuration["Stripe:SecretKey"]!;
var service = new AccountService();
var externalAccountService = new ExternalAccountService();
var bankAccountService = new BankAccountService();
try
{
Account account = service.Get(connectAccountId, null, new RequestOptions() { ApiKey = stripeApiKey });
StripeList<IExternalAccount> externalAccounts = externalAccountService.List(connectAccountId, new ExternalAccountListOptions() { Limit = 10 }, new RequestOptions() { ApiKey = stripeApiKey });
var data = new GetConnectAccountResponse.GetConnectAccountResponseData()
{
Account = account,
ExternalAccounts = externalAccounts,
};
var result = new GetConnectAccountResponse(true, data);
return new JsonResult(result);
}
catch (StripeException ex)
{
var stripeErrorMessage = ex.StripeError.Message;
var result = new GetConnectAccountResponse(new[] { stripeErrorMessage });
return new JsonResult(result);
}
catch (Exception ex)
{
// TODO: decide how want to handle exceptions at this point
throw;
}
}
in this case I have Account that im expecting to see the 10 external accounts
you can see I also have ExternalAccountService as I was trying to use the "list external accounts" api to see if i got a differnt result
but it seems just purely using the AccountService.Get() I should see the first 10 external accounts on the Account without having to use the ExternalAccountService
Are you sure that account has bank accounts? Because I see none
that doesn't really mean much
as I mentioned above in case it matters I created these via the stripe dashboard UI
in test mode
I'd recommend to start by doing something way simpler since you're debugging
let me rephrase my question
1/ Create an account with a bank account
2/ Look at the response and confirm the bank account is right there in the response
I have created these accounts in the test stripe dashboad via the stripe UI
are you saying those accounts dont get created with bank accounts even though they get payouts? And the bank account info is shown in the External Accounts section for the connect account
and/or are created in some different way not representative of the real world?
ie: if created via some other means?
every other aspect of the connect account created via the stripe dashboard UI is what I expect
When you say you see none for the connect account are you looking via another mechanism?
I don't really know, I never use the UI
sorry Discord is quite busy, so right now I'm pushing you to carefully test this to understand
ok so potentially this data might look odd because these accounts were created in the stripe dashboard UI instead of via the api?
I can test that, this was just me sort of wanting to make sure i understood the "bank account" concept as I was getting a little confused by the fact it seems to be an overloaded term in the stripe docs
yeah I don't know about the Dashboard for now, hence my recommendation to do a simple test first
ok got it, its the first I've heard of not trusting the state of data created from the stripe UI
but its obviously possible
I'll give that a shot, thanks
sure thing!
I wanted to add for the account we've been talking about and all of the ones I've looked at, while the "external accounts" property is fairly empty when I look at the "stripeResponse.content" property seemingly the raw payload delivered from stripe I see the bank account information that associates to that in the stripe UI for the account.
Portion captured here - you can see the "ba_" and bank account info
\"external_accounts\": {\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"ba_1NQeW4PSL7cqpN2ixhItjiQb\",\n \"object\": \"bank_account\",\n \"account\": \"acct_1NQeGAPSL7cqpN2i\",\n \"account_holder_name\": \"Jenny Rosen\",\n \"account_holder_type\": \"individual\",\n
And the information is exactly what I see in the stripe UI for the external account info of this connect account:
so what's the problem? I'm sorry I'm quite lost
Like if you see a bank account in the response then you should be able to print account.ExternalAccounts.Data[0].Id for example
utilizing the stripe.net package im under the impression the correct/expected way to receive the data is via the returned objects "account.ExternalAccounts" property but that is missing most of the information in these cases vs what I see in the raw response
so I wasnt sure if this was a bug or something weird going on here
What does "missing most of the information" mean though? Earlier you said there was nothing at all
I mentioned it only has:
"externalAccounts": [
{
"account": null,
"accountId": "acct_1NQeGAPSL7cqpN2i"
}
],
ah lol
sorry I didn't really understand that's what you mean at all
ExternalAccount is an interface to other classes. You have to cast first
if(externalAccount.Object == "card")
{
Card card = (Card) account.ExternalAccounts.Data[0];
Console.WriteLine("Card id: " + card.Id);
Console.WriteLine("Card last4: " + card.Last4);
}
else if(externalAccount.Object == "bank_account")
{
BankAccount bankAccount = (BankAccount) account.ExternalAccounts.Data[0];
Console.WriteLine("BankAccount id: " + bankAccount.Id);
Console.WriteLine("BankAccount last4: " + bankAccount.Last4);
}
else
{
Console.WriteLine("External account with unknown type: " + externalAccount.Object);
}```
try something like this ^