#Bar-account-capabilities

1 messages ยท Page 1 of 1 (latest)

pulsar ibex
#

Hi there ๐Ÿ‘‹ do you have the ID of the account that you're referring to?

urban summit
#

Yes, but can I just post it here?

pulsar ibex
#

Yeah

urban summit
#

acct_1KO0CLPaTpr8efiv

pulsar ibex
#

The most recent account.updated event does appear to show that charges and payouts are enabled for that account. Can you show me how you're making the request to retrieve the account?

urban summit
#

Yes

#

var stripeAccount = await _accountService.GetAsync(stripeAccountId);

#

_accountService is instance of AccountService

#

The rest of the data is valid - mail, country, type and so on

#

@pulsar ibex

wicked salmon
#

Hey there ๐Ÿ‘‹
Toby had to step away
I can certainly take a look

urban summit
#

Thanks!

wicked salmon
#

can you paste the response object that you get here? Because like toby mentioned I also see its enabled.

urban summit
#

Yes

#

@wicked salmon

wicked salmon
#

thanks give me a few to look into it

urban summit
#

Thanks!

plain dust
#

Hi there! Stepping in for @wicked salmon as he needed to step away. Give me a moment to get caught up.

#

Can you test using cURL to retrieve the account in your Terminal and let me know if you see the same thing?

urban summit
#

I can't do it, I can only do it with stripe api

plain dust
#

You can't because you don't have access to your API key?

#

Or?

urban summit
#

Yes and also I can't really do curl

plain dust
#

Is there a way we can confirm that you aren't seeing stale data? Can you make a small change to the account like add a piece of metadata, retrieve the account again and provide the data you see on your end?

urban summit
#

Yes, I've changed the account id few times

#

(Different account)

plain dust
#

Can you do the above with acct_1KO0CLPaTpr8efiv?

#

Add metadata, re-retrieve the account, show me what you get?

urban summit
#

What do you mean by add metadata?

plain dust
#

Do you have access to your platform Dashboard?

#

If you view the Connected Account you can edit the metadata right in the Dashboard

#

And just add something like test: 123

urban summit
#

I don't really have access to the dashboard(it's complicated), but why would the data be stale?

plain dust
#

Because you could be storing the data and then pulling up old data. You simply provided a screenshot of data in a form. I have no idea how that data was set up.

#

I'm trying to verify whether there is a bug or not.

urban summit
#

I could give you the screenshot of retrieval of other account

#

I think this will help

#

var stripeAccount = await _accountService.GetAsync(stripeAccountId);
_accountService is instance of AccountService

#

@plain dust

plain dust
#

Can you paste that account ID

urban summit
#

Yes of course

#

acct_1KRaVFPWNTXamL6b

plain dust
#

Thanks! Give me another moment to look at this account

urban summit
#

Thanks, I really appreciate the help!

plain dust
#

Oh.. that account is disabled.

#

So that seems correct in this case

#

Like I am seeing charges/payouts disabled for that account as well

urban summit
#

Sorry, I'll check for other account

#

acct_1KWiSmPn4opStRsp

#

It's valid for sure

plain dust
#

Yes that one looks valid.

#

However I don't see a retrieval of that account today

urban summit
#

I'll send the variable in a minute

#

I just did it 2 seconds ago

plain dust
#

Okay thanks, yes I see the retrieval.

#

Let me ask a colleague about this.

urban summit
#

Thanks!

wintry pasture
#

@urban summit can you share your exact code?

urban summit
#

Yes

#

`[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}/[controller]")]
public class RetrieveAccountController : ControllerBase
{
#region Private Fields

    private readonly AccountService _accountService;

    #endregion

    #region Ctor

    public RetrieveAccountController(
        AccountService accountService)
    {
        _accountService = accountService;
    }

    #endregion

    #region API

    [HttpGet("TestRetrieveAccount")]
    public async Task<ActionResult<Stripe.Account>> GetAccount(string stripeAccountId)
    {

        var stripeAccount = await _accountService.GetAsync(stripeAccountId);

        if (stripeAccount == null)
        {
            return StatusCode(StatusCodes.Status500InternalServerError);
        }

        return Ok(stripeAccount);
    }

    #endregion
}`
wintry pasture
urban summit
#

The account service is injected with DI

wintry pasture
#

can you share a non picture of code please

#

what is "with DI"

urban summit
#

Dependency Injection

wintry pasture
#

Can you make a standalone app/code that would be a lot more basic to just retrieve the account directly?

urban summit
#

Yes the non picture is above

wintry pasture
#

ah perfect

#

Okay so first quick thing: can you use curl in a Terminal?

urban summit
#

No the apikey is a secret

wintry pasture
#

what does that mean? Isn't it your own account?

urban summit
#

Yes

wintry pasture
#

So you have the API key right?

urban summit
#

Yes, but I can't really do the curl

wintry pasture
#

why?

urban summit
#

I don't how to do it

#

I configured just the code for retrieval

#

Anyway, why will it help?

wintry pasture
#

Because it's way easier to run one command in a Terminal than try to debug your code with dependency injection and screenshots of the debugger

#

you've never used the command line on Windows or done a curl request there?

urban summit
#

No

#

I don't think the issue is with my code

#

I get the account

#

Just with wrong values in the payouts_enabled and charges_enabled

wintry pasture
#

I understand but that's the part we need to debug exactly

urban summit
#

@plain dust told me that you can see what was retrieved in the account

wintry pasture
#

I work for Stripe, let's focus on just my questions if possible

urban summit
#

ok

#

sorry

wintry pasture
#

all good, just a lot of back and forth, so let's focus on one question at a time

#

1/ Can you explain why you can't do a simple curl call on your Windows machine with your Stripe account's secret API key

urban summit
#

I don't know how to do it.
Can you send me the exact command for the cmd

wintry pasture
#

Sure, but have you ever used the command line and done a curl call?

urban summit
#

no\

wintry pasture
#

Okay so let's try first. Can you run this in your command prompt on windows with your real API key. Don't show me the results yet, just try it and tell me if you get an error or if you seem to get the Account object back

curl https://api.stripe.com/v1/accounts/acct_1KWiSmPn4opStRsp -u sk_test_123

urban summit
#

it's asking for a password after I changed to my key

wintry pasture
#

ah my bad sorry bad copy-paste, you need a : after the key curl https://api.stripe.com/v1/accounts/acct_1KWiSmPn4opStRsp -u sk_test_123:

urban summit
#

ok, I get the account with the right data

#

payout_enabled : true
charges_enabled : true

wintry pasture
#

phew

#

perfect, so now we know this is 100% a bug in your code!

#

Now I know what to focus on to help you debug

urban summit
#

Weird

wintry pasture
#

2/ Can you re-run your code for that exact account acct_1KWiSmPn4opStRsp to confirm that you still see false in your code?

#

(just in case it just changed for some reason)

urban summit
#

Yes

#

Still false

wintry pasture
#

perfect

#

Now we know it's a bug in your code!

#

3/ Let's debug your code together!

#

So before we dive too deep, how easy is it for you to just "run" some dotnet code, independent from your main app?

#

like if I give you some roughly exact Stripe code, can you easily run it?

urban summit
#

I think so

#

But I don't really understand why would the data return with the right values for some fields and wrong values for other fields

wintry pasture
#

you'll see!

#

Perfect! can you run this:

// Put your API key here
StripeConfiguration.ApiKey = "sk_test_123";

// Retrieve the account
var service = new AccountService();
var account = service.Get("acct_1KWiSmPn4opStRsp");

// Print what we care about
Console.WriteLine("Account id: " + account.Id);
Console.WriteLine("payouts_enabled: " + account.PayoutsEnabled);
Console.WriteLine("charges_enabled: " + account.ChargesEnabled);

Can you run ^ end to end and show me the exact output?

#

(sorry its + to concat in .net not ,)

urban summit
#

No data

#

Nevermind I printed the entire object and got the right values

wintry pasture
#

yeah I think it's the comma versus +

#

but okay you have the right values again, so the API works totally fine

#

Now it must be a bug in your own code

#

Can you do the same thing in your own code: print the entire object right at the place you retrieve it, to confirm you are calling that API?

urban summit
#

It's a non console app

wintry pasture
#

sure but usually you have a way to print something somewhere

#

a file, a UI screen, etc.

urban summit
#

But I looked at the object in debug

wintry pasture
#

yeah but clearly what you're looking at is not what you think it is

urban summit
#

What do you mean by that

wintry pasture
#

well in your debugger you see false, you were convinced our API was wrong, we've proven it's not

#

Maybe turn var stripeAccount = await _accountService.GetAsync(stripeAccountId); into var stripeAccount = await _accountService.GetAsync(stripeAccountId); var payoutsEnabled = stripeAccount.PayoutsEnabled; and then do a breakpoint on that line of code

urban summit
#

I checked it even without the debugger

#

in asserts

#

var payouts = account?.Settings?.Payouts;

        var debitNegetiveBalances = payouts?.Debit_negative_balances == true;

        var Interval = payouts?.Schedule?.Interval == "weekly";

        var WeeklyAnchor = payouts?.Schedule?.Weekly_anchor == "tuesday";

I checked other things that are related to the payouts

#

@wintry pasture

wintry pasture
#

that's not really relevant to what I am asking

#

Like just to restate this: it is 100% a bug in your code/logic. I've proven to you that the API responds the right information even with your .NET library

#

I don't know what is causing it yet, I've given you a clear next step though

urban summit
#

But I don't really understand what could cause this.
Why would I get the right data, just with invalid charges and payouts?

#

In which scenarios this is happening?

#

I get status code 200, so this is really weird @wintry pasture

wintry pasture
#

Without being too pushy: I recommend you try the step I told you to try though

#

This can only be a bug on your end, I'm helping you debug. I've given you the best next step, can you try that exact step?

urban summit
#

Yes of course

#

false

#

@wintry pasture

wintry pasture
#

I mean it can't be false

#

I'm sorry, I'm running out of ideas on how to help you here. It's impossible for the exact same code to give false in some case and true in others

#

are you sure the account id is set properly?

urban summit
#

Yes

#

This is really weird

#

Theese are the right values other than the payouts and charges

wintry pasture
#

Yeah I'm fairly convinced it's impossible and you must be mixing your variables somewhere. Like try, right below that code, hardcode what we did earlier and display the exact real values

urban summit
#

I'm sure this 100% something in my code

wintry pasture
#

Try to add more to your code, hardcode the retrieve with the hardcoded id

#

store it in another variable

#

and look at that variable's value

urban summit
#

But for helping me debug this, at what scenario does it send these values differently

#

Already did it

wintry pasture
#

So when you hardcode the exact same lines at the point of your public async Task<ActionResult<Stripe.Account>> GetAccount(string stripeAccountId) it still doesn't do what it should?

urban summit
#

Yes

wintry pasture
#

I'm... dubious that's possible. I wonder if it's a mixup with async/await and it not doing what you think

urban summit
#

I doubt it

#

I use the await properly

#

Anyway, it can't return "half" object

tall basin
#

Hi ๐Ÿ‘‹ I'm stepping for @wintry pasture

#

There's a lot here. Give me a minute to catch up

urban summit
#

Hi

tall basin
#

So what is going on with the GetAccount

urban summit
#

So, it's getting the right values partially

#

I get the right email and country, etc...
But I get false values in the payouts_enabled and charges_enabled

#

Even though in any other way we tried I got true in these values

tall basin
#

What I mean is, our .NET library is set up to start with something like this:

ar service = new AccountService();
service.Get("acct_1JticYIlCeH6bP8R");

Is your function doing this behind the scenes?

urban summit
#

Yes

#

Getasync

#

What could cause this?

#

@tall basin

tall basin
#

Trying to understand but there's a lot going on here.

#

I'm not super familiar with .NET either. Do you have any request IDs?

urban summit
#

don?

#

Do you mean account ID?

#

Can you move me to someone who knows .net?

#

I'm speaking to you for 3 hours

wintry glen
urban summit
#

This is pretty much the last ones

#

Nobody used this account other than me

#

@wintry glen

wintry glen
#

I'm still catching up. What is the account ID that are you making this retrieve call from?

urban summit
#

it's any account Id but we can take this one as an example:acct_1KWiSmPn4opStRsp

#

Please I need you to help me I'm more than 4 hours in this conversation

#

@wintry glen

wintry glen
#

I understand, I was reading through the previous messages.

#

So just to recap, curl and a small application calling get on this account retrieves the right data, but not calls from your applicaiton

urban summit
#

I need to understand in which scenario it's sending this changed data

#

Yes

#

I disagree with the guy I talked with before, something on your end sent me this wrong data

#

This is the data I got from you

wintry glen
#

Can you run this code again and then print the request ID from the last request on the Account object?

Console.WriteLine(stripeAccount.RequestId);```
urban summit
#

Maybe something in my code caused this but this is the data I got from you

#

This is not one of the properties of the object

#

@wintry glen

wintry glen
#

Right. And I want to make sure that the request from your app is matching up with what is expected. The question is still what the difference is between the small snippet that is working and your app where it isn't

urban summit
#

Expected: payouts_enabled : true
charges_enabled : true
Actual: payouts_enabled : false
charges_enabled : false

#

Fixed it

wintry glen
#

That is awesome to hear. What did the difference end up being?

urban summit
#

No I fixed the message๐Ÿ˜†

#

Expected: payouts_enabled : true
charges_enabled : true
Actual: payouts_enabled : false
charges_enabled : false

#

I still get these values

wintry glen
#

Okay that makes more sense. For a second I thought I was remembering the wrong values being false

#

And you made that request from acct_1KWiSmPn4opStRsp? Or is that you retrieving acct_1KWiSmPn4opStRsp itself?

urban summit
#

I'm retrieving this account

wintry glen
#

What is the ID of the account that is making these calls?

#

The one that owns your API key?

#

Oh probably acct_1K9Tr0Bk1m8yYJJk

urban summit
#

Yes

wintry glen
#

I am not seeing a GET request for acct_1KWiSmPn4opStRsp on your account.

#

Can you try this after getting the account? The ID will help me find it var stripeAccount = await _accountService.GetAsync(stripeAccountId); Console.WriteLine(stripeAccount.RequestId);

urban summit
#

As I said the requestID isn't part of the object

#

Anyway, i've just seen the acct You put above

#

acct_1K9Tr0Bk1m8yYJJk

#

I don't know where you got it from

wintry glen
#

That is the platform ID of the account that acct_1KWiSmPn4opStRsp is connected to

#

What version of stripe-dotnet are you using?

urban summit
#

The others that I talked to found these requests

#

39.93.0

#

@wintry glen

#

@wintry glen

wintry glen
#

That version should definitely have the request ID as part of the object. Are you saying that that does not exist at all on your account objects or that it is empty?

#

Also I promise this thread is high priority for me, the pinging me does not get me to respond faster. I have to look for this request ID in slower ways as it is not showing up in the typical ones

urban summit
#

Sorry

#

The type of the object is Stripe.Account

#

As you can see here - the request id isn't one of its properties

wintry glen
#

Checking in to it on my side. Or hopefully I will find the other request ID before then

urban summit
#

Thanks!

wintry glen
#

I am still looking and having trouble finding this. Will need a few more minutes

urban summit
#

All good

wintry glen
#

And just to recap what has already been tried: you have done the standard get instead of awaiting the async one in the exact same place in your code and that got the outdated data?

urban summit
#

Yes

urban summit
#

Any Updates?

wintry glen
#

I've found these requests and they still look fine from our side. Really wracking my brain at what the difference might be between your app and the small piece of code you ran

urban summit
#

Yes, this is really weird

wintry glen
#

Just so I have another clean case on my side, can you run the small snippet of code that works again?

urban summit
#

Yes

#

Working

wintry glen
#

Thank you

urban summit
#

Thank you for the help!

wintry glen
#

The only difference I am seeing on my side is the .NET client version. 39.93.0 vs 39.97.0. As a quick sanity check, can you downgrade your standalone code to 39.93 and see if that is somehow what is making the difference?

#

The changelog doesn't make it sound like this should change but that is one of the few things I can see that are different between them at the moment.

urban summit
#

my version is 39.93

wintry glen
#

Oh and are the two projects the same .NET version?

urban summit
#

Yes

wintry glen
#

Right, the small sample snippet you are doing is 39.97

urban summit
#

So , I don't really get what you mean

#

My version is 39.93, so I shouldn't do anything, right?

wintry glen
# urban summit Working

I can see this call in your logs and it mentions that the call came from the 39.93 version of the libraryhttps://dashboard.stripe.com/test/logs/req_Yv1ygYUFLD76bE

#

It honestly shouldn't as far as I can tell. Capabilities were added in 93 and it doesn't look like there have been changes since.

urban summit
#

Ok

#

So i shouldn't change anything, right?

wintry glen
#

No you shouldn't. And actually don't do that test. It should not affect it at all from what I can tell.

urban summit
#

Ok