#Sam Khachatryan
1 messages ยท Page 1 of 1 (latest)
Can you share more details? Which version of the SDK are you currently working with?
Nuget Stripe SDK 41.10.0 (Latest stable)
var service = new ExternalAccountService();
var bankAccountDetails = await service.GetAsync(stripeConnectUserId, bankAccount.Id)
bankAccountDetails.Last4 //Compile time error bcs no such property
Just to be clear, you're attempting to pull the last4 of a connected account's external bank account?
not only, but in this example yes))
Have you tried using RequestOptions for Connect-related requests? https://github.com/stripe/stripe-dotnet#per-request-configuration
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - GitHub - stripe/stripe-dotnet: Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class libr...
just tried, but doesn't help
it returns IExternalAccount in any retrive scenario
`public interface IExternalAccount : IStripeEntity, IHasId, IHasObject
{
Account Account { get; }
string AccountId { get; }
}`
I suppose there would be something like
string Last4 { get; }
which is missing
but for example exists in PaymentMethod retrive model inside sdk
P.S. copied IExternalAccount interface from stripe sdk code
Hi there ๐ taking over.
Give me a few minutes to get caught up.
So are you able to successfully send off the API request and get a response back then?
Yes api works well, for example I am fatching bank account id from external account service to make a payout to that acount
but I need to send last4 and bank name to client (frontend) to display there.
IExternalAccount doen't define that properties
but at the same time I am doing that with PaymentMethods (like attached cards)
Stripe SDK implemented last4, etc.. for that model
Do you have a Request ID for the request that was successful? Just want to do some preliminary debugging first
Also, are you just using this API? https://stripe.com/docs/api/external_account_bank_accounts/retrieve?lang=dotnet
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I see you're using a specific version, but I'm curious if the example here looks similar to what you're using
Sure I can retrive requestId now, I am using List api now from that service
https://stripe.com/docs/api/external_account_bank_accounts/list
but tried also with the one use sent, same model, doens't work
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yeah, send over the Request ID and I'll dig some more
req_uu5xUFjUvYPF1D this is now using list api
also while debugging I can see that missing properties are included in Reponses (even formated with their C# model)
but interface from stripe sdk restricts me from reading
seems like Stripe SDK incapsulated that properties
Hmmm, let me dig a bit more and get back to you in a few minutes
Out of curiosity what does the payload look like for you when you console log it?
all fields are existing, So As I got Stripe has the right model and it beeing casted in to their C#'s model in SDK like for example for payment method
stripe returnes StripeList<PaymentMethod>
For customer list stripe returns
StripeList<Customer>
Idk why only for external account service
Stripe returns
StripeList<IExternalAccount>
And I suppose ExternalAccount class exists just SDK incapsulates most part of properties using this interface, but model exists and beeing casted correctly
Hope this long message will help:D
I'm confused though, you're specifically trying to access specific attributes of the object, can you not do that by iterating through the list of external accounts right now? Like, is the last4 attribute null?
in our domain when our connect account user passes verification form
we are showing them some details from his bank account.
Is there any way to achieve that by using this SDK
from backend side to send to client?
Like maybe manually parseing StripeResponse JSON and casting to to the type we need?
Btw thanks a lot for helping:)
That's what I'm wondering too. Specifically, how do you know that the last4 is not present? You probably need recast the object in order to iterate through it, as it doesn't send back just a single object, it sends back multiple objects despite the fact that you set limit=1
Right, that's because IExternalAccount is an iterable. It's not one instance of an External Account object, so right now you're trying to access the attribute last4 on a list of objects, when what you need to do is first get the External Account object by itself and try to get last4.
Also, I don't think last4 is supposed to be capitalized
same situation here
but works well
why do I need differend approaches for them?)
sorry, can't really get
That's an entirely different API with different return values.
If you look at the return values in the API reference, the Payment Methods API says it returns:
A Dictionary with a data property that contains an array of up to limit PaymentMethods of type type, starting after PaymentMethods starting_after. Each entry in the array is a separate PaymentMethod object. If no more PaymentMethods are available, the resulting array will be empty.
https://stripe.com/docs/api/payment_methods/list?lang=dotnet
But the External Account API returns:
Returns a list of the bank accounts stored on the account.
https://stripe.com/docs/api/external_account_bank_accounts/list?lang=dotnet
When you do Console.WriteLine(bankAccountDetails); , what do you see?
Sure
if (bankAccountDetails is BankAccount) { var c = bankAccountDetails as BankAccount; var last4 = c.Last4; }
I missed this part
thanks a lot))
It works fine now
Huh, that's an interesting solution. Does it ever return last4?
haha:D no I sent it just as an example:DD
noo it works:DDD
thanks you very much
the thing is that I haven't cheched is it BankAccount and casted
so from IExternalAccount it becames BankAccount
and works well
Ahhh, yup! I think that's the first thing I recommended, so glad I was able to help just a little bit ๐