#franmondey - connect

1 messages · Page 1 of 1 (latest)

worn laurel
#

Hi there!

#

Can you share the code that is throwing that error?

tired chasm
#
            account = stripe.Account.create(
                country="ES",
                api_key=settings.STRIPE_SECRET_KEY,
                type="custom",
                capabilities={
                "card_payments": {"requested": True},
                "transfers": {"requested": True},
                },
                account_token=account_token
            )
#

It's using the python sdk

#

settings.STRIPE_SECRET_KEY has the live api value I have in my account

worn laurel
tired chasm
#

Also did that and doesn’t work

#

Same error

#

That’s why I tried adding it inside the request

#

I believe it might be a problem with account setup in stripe dashboard, as test keys work correctly. Only live doesn’t work

worn laurel
#

Can you triple check that the API key is the correct one? It should look like this sk_xxx.

tired chasm
#

Yes it’s sk_live format

#

I’m printing it before applying it to the request or as a global. I’m seeing in the error response from stripe to and it’s the correct one

#

Should there be a certain match with the publishable key? Or they just have to both be in the live environment?

worn laurel
#

When you switch to live mode, both publishable key and secret keys need to be updated to match.

tired chasm
#

Yes both are in live mode, but will check that again

#

Also will try to run it through curl to remove the possibility of error in library

#

Curl command works without errors

#
curl https://api.stripe.com/v1/accounts \
  -u sk_xxxxx: \
  -d type=custom \
  -d country=ES \
  -d account_token="xxxxxx" \
  -d "capabilities[card_payments][requested]"=true \
  -d "capabilities[transfers][requested]"=true
#

Using the same key used in the .envs declared or printed from the settings method

worn laurel
#

That's odd. Can you share the full code in python you are using and the exact error message? There must be something wrong there.

tired chasm
#

Ok was able to resolve it using the curl command inside python. Not sure why but it now works