#minalv_api

1 messages ยท Page 1 of 1 (latest)

zealous trellisBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1239503937028231239

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

dark flame
#

HttpRequestWithBody httpRequestWithBody = Unirest.post(stripeConfiguration.getToken_URI())
.queryString("client_secret", stripeConfiguration.getAPI_KEY())
.queryString("grant_type", "authorization_code")
.queryString("client_id", stripeConfiguration.getClientID()).queryString("code", code).asJson();

tribal yacht
#

๐Ÿ‘‹ happy to help

#

would you mind explaining what you're trying to achieve and what issue exactly are you facing?

dark flame
#

above api was exsting api and it was working till yesterday from the morning we are getting error

org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]

#

Something is wrong with your CSRF token. Make sure cookies are enabled in your browser, and try reloading this page. If you continue to see this error message, please let us know at https://support.stripe.com/contact/email.

tribal yacht
#

would you mind sharing a screen recording of what's happening?

dark flame
#

I was to upgread api version to 2020-08-27 in my platerform account so how i can achive that?

#

it ask me to latest insted of specific version

tribal yacht
#

what version are you on now?

dark flame
#

2019-08-14

#

i want to upgrade with 2020-08-27

tribal yacht
#

you don't actually need to upgrade your account default version

#

and initialize your Stripe instance with a specific version

dark flame
#

okay i am trying it

#

HttpRequestWithBody httpRequestWithBody = Unirest.post(stripeConfiguration.getToken_URI())
.queryString("client_secret", stripeConfiguration.getAPI_KEY())
.queryString("grant_type", "authorization_code")
.queryString("client_id", stripeConfiguration.getClientID()).queryString("code", code);
log.info("stripe response==>{}" , httpRequestWithBody);//NOSONAR

tribal yacht
#

I'm not sure how you're integrating to be honest with you

dark flame
#

let me create screencast

pseudo blaze
#

Hi, can I chime in and say we're receiving the same error, and we have stable code that has been in use for months and has only started erroring this morning

#

We haven't changed any api versions on our account

#

We're using the ruby OAuth2 gem

tribal yacht
#

hmmm that's interesting

#

@pseudo blaze when did that start for you?

pseudo blaze
#

This morning was the first instance

#

We've made about 5 requests for the same token, and all have failed in the same way

tribal yacht
#

@dark flame and @pseudo blaze would you mind sharing your Account IDs?

dark flame
#

yes

#

acct_182oJKIkDe2ww12p

pseudo blaze
#

I've got a client id we're using, I'm struggling to find our account id ca_2ljAQ6Mik7Ho2BMS898d4Qgy0my1py8q

tribal yacht
#

basically it's acct_2PcS3wKQhN3UFk6KRUVi

dark flame
#

I have tried and it working for us
RequestOptions requestOptions = RequestOptions.builder().setApiKey(stripeConfiguration.getAPI_KEY()).build();
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "authorization_code");
params.put("code", code);
TokenResponse response1 = OAuth.token(params, requestOptions);

pseudo blaze
#

It looks like we're stuck on Stripe.api_version = "2017-06-05"

#

if that's any help

tribal yacht
#

what do you mean by that?

pseudo blaze
#

Sorry, I mean that's the stripe version we're using

tribal yacht
#

oh ok, I thought it was forced on you

pseudo blaze
#

We have other parts of our system that break if we try to go newer - however, I'm not sure if that's the default api version on the account, and since this is an OAuth request, I suspect it would be using the account default and not the override

woeful flare
#

hi!
let's maybe ignore the API version since that's highly unlikely to matter.

@pseudo blaze what is the exact code you are using to make an API call that is failing, and what is the exact error message you're getting?

zealous trellisBOT
pseudo blaze
#
      Rails.application.credentials.stripe_connect_client_id,
      Rails.application.credentials.stripe_secret_key,
      site: "https://connect.stripe.com",
      authorize_url: "oauth/authorize",
      token_url: "oauth/token",
      auth_scheme: :request_body
    )
  end

    @client.auth_code.get_token(
      code, params: {
        scope: "read_write", state: state
      }
    )
#

As I say, we're using the OAuth2 gem - I see that the docs you linked to, stripe has an OAuth client baked in, I can give that a go if you like

#

Full error is:

OAuth2::Error: Something is wrong with your CSRF token. Make sure cookies are enabled in your browser, and try reloading this page. If you continue to see this error message, please let us know at https://support.stripe.com/contact/email.
from /usr/local/bundle/gems/oauth2-2.0.9/lib/oauth2/client.rb:139:in `request'
woeful flare
#

ack, thanks

pseudo blaze
#

Trying with the baked-in Stripe::OAuth, I get Authorization code expired. I will try to get a new code generated and try again

#

That said, the OAuth2 code still gives the csrf error [even with the expired ac]

woeful flare
#

ack, thanks