#minalv_api
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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();
๐ happy to help
would you mind explaining what you're trying to achieve and what issue exactly are you facing?
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]
I have debug the api but it throwing the error
https://connect.stripe.com/oauth/token
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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.
would you mind sharing a screen recording of what's happening?
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
what version are you on now?
you don't actually need to upgrade your account default version
you can use https://docs.stripe.com/api/versioning
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and initialize your Stripe instance with a specific version
okay i am trying it
We have used rest api call to api https://connect.stripe.com/oauth/token
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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
I'm not sure how you're integrating to be honest with you
let me create screencast
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
This morning was the first instance
We've made about 5 requests for the same token, and all have failed in the same way
@dark flame and @pseudo blaze would you mind sharing your Account IDs?
I've got a client id we're using, I'm struggling to find our account id ca_2ljAQ6Mik7Ho2BMS898d4Qgy0my1py8q
basically it's acct_2PcS3wKQhN3UFk6KRUVi
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);
what do you mean by that?
Sorry, I mean that's the stripe version we're using
oh ok, I thought it was forced on you
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
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?
For reference I just did https://docs.stripe.com/connect/oauth-standard-accounts#token-request in a test on my side and it's working fine at least, so trying to get more context from you.
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'
ack, thanks
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]
ack, thanks
for now I'd suggest writing into https://support.stripe.com/?contact=true for updates, we're looking into it internally