#matrix - Direct Charges

1 messages · Page 1 of 1 (latest)

dreamy sail
fierce ridge
#

ok

#

I cant find any log. I have this output from my firebase dashboard (server):

#

Unhandled error StripePermissionError: The provided key 'sk_test_51*********************************************************************************************5i7g' does not have access to account '{{acct_1Jpu8gFbYZoKrptz}}' (or that account does not exist). Application access may have been revoked.

#

I can see from the dashboard that account is connected to my account

#

I am using test data

dreamy sail
#

Can you give me a request ID from your platform account? The one associated with that secret key? Can be any request ID.

fierce ridge
#

req_tbqrEZredAPt1Y

#

Can you locate my account?

#

are we still conneted?

dreamy sail
#

Yep, sorry, things are just busy. 🙂

#

Taking a look...

#

You're certain you're using the correct secret key for that request?

#

The one from your platform account?

fierce ridge
#

i think so let me check again

#

yes the secret key is correct

#

I am using test key, not sure if it is has an impact

dreamy sail
#

It shouldn't, no. Hang on...

fierce ridge
#

ok

dreamy sail
#

Can you use the same secret key to retrieve your own account and confirm it's the one you expect it is?

curl https://api.stripe.com/v1/account -u sk_test_123:
fierce ridge
#

i dont have curl, do i need to install it?

dreamy sail
#

You can make the request with whatever tool you have available to make HTTP requests.

fierce ridge
#

like terminal?

dreamy sail
#

Postman would also work fine, for example.

#

Terminal? Not sure what you mean. Like the Terminal app on a Mac or something else?

fierce ridge
#

yes terminal on a mac

#

do i need to put my sk?

dreamy sail
#

Yeah, replace that with the secret key you're using. And it's best to not paste the output of the command once you run it successfully, there may be details in the output you don't want public.

fierce ridge
#

ok I have got a long log

dreamy sail
#

There should be a display_name in there. Is it your platform account's name, the connected account's name, or something else?

fierce ridge
#

it is my company name (the platform)

dreamy sail
#

Okay, try this command to retrieve the connected account and see if it works:
curl https://api.stripe.com/v1/account -u sk_test_123: -H "Stripe-Account: acct_1Jpu8gFbYZoKrptz"

fierce ridge
#

Invalid API Key provided. it is the same error i see in the firebase server

dreamy sail
#

What was the display_name you got back from the previous command?

fierce ridge
#

the legal name of my company

dreamy sail
#

Is it one word or three words?

fierce ridge
#

three words

#

M4xxx Dxx Lxxxxxx

#

i can see that account acct_1Jpu8gFbYZoKrptz in my stripe dashboard with a RESTRICTED status

#

could this be the problem?

dreamy sail
#

It shouldn't be, no.

#

Especially not in test mode.

fierce ridge
#

could it be an issue related to how i connected that account?

dreamy sail
#

I don't think so.

#

Checking some things, hang on...

fierce ridge
#

Actually i see the name of that connected account to be the same as my company...

#

while some other old connected account does not have a name

#

and this connected account is a standard account with a "Platform controls enabled" label (while old ones do not have any labels)

dreamy sail
#

Will you try this command and see if there's a request-id anywhere in the output?

curl -v https://api.stripe.com/v1/account -u sk_test_123: -H "Stripe-Account: acct_1Jpu8gFbYZoKrptz"
#

But with your secret key?

fierce ridge
#

ok

#

nope, there are no request id

#

the only mention is this one:

dreamy sail
#

Can you paste the error message?

fierce ridge
#

it is always the same

#

{
"error": {
"message": "Invalid API Key provided: sk_test_************************************************************************************************i7g3",
"type": "invalid_request_error"
}
}

dreamy sail
#

But curl -v https://api.stripe.com/v1/account -u sk_test_123: does work with your key?

fierce ridge
#

yes, there is a long list of things but no errors

dreamy sail
#

I'm not seeing a reason for these errors. Asking someone else to take a look to make sure I'm not missing anything.

fierce ridge
#

ok thank you so much.

#

I have tried to make a direct payment to my account and it was succesful. here is the request req_cAWwsiIbtFNPev

dreamy sail
#

Ah, okay, so according to our logs the successful request you made to retrieve your own account used a secret key ending in 5i7g but the error above says the key you're using ends in i7g3. Did you use a different key?

#

Or did part of the key get cut off?

#

Or was the 3 at the end a typo?

fierce ridge
#

the sk ends with 5i7g

#

where was the final 3?

dreamy sail
#

From the error you pasted above.

fierce ridge
#

oh sorry my fault. I have done a typo in the sk

dreamy sail
#

Right, but replacing sk_test_123 with your platform's secret key, the one ending in 5i7g, correct?

fierce ridge
#

yes

dreamy sail
#

Looks like it worked!

fierce ridge
#

so now there is no error

dreamy sail
#

Okay, so your platform account can access that connected account as expected.

#

So going back to your original error, can you confirm the secret key and account ID being used there match the key and account ID used in the curl command exactly?

fierce ridge
#

yes now the sk key are the same

dreamy sail
#

Are you still seeing the error or does it work now?

fierce ridge
#

let me now try to do a direct charge

#

Yes it is working!

dreamy sail
#

Yay!

fierce ridge
#

but I am not sure what was the problem at the end (a part from adding a 3 in the code you asked me to run)

#

the sk was correct in the server

#

hey thank you very much and well done for spotting the typo

dreamy sail
#

Did you change the account ID?

fierce ridge
#

nope, the only change i made was to pay for a subscription with a product rather that a single product

#

i mena i user a subscription id for the price instead of hard coding a number

#

*I used

dreamy sail
#

Hm, I dunno.

#

Glad it's working now though!

fierce ridge
#

ok no worry but really many thanks!!!

#

Have a great day @dreamy sail !