#subin_error

1 messages ¡ Page 1 of 1 (latest)

restive mantleBOT
#

👋 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/1362339008876777644

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

white carbon
#

What are the token IDs?

unreal crypt
#

authorization code?

#

or account id?

#

the context is iam tring to connect to my stripe account via oauth.

here iam tring to click the installation link.
https://marketplace.stripe.com/oauth/v2/authorize?client_id=ca_Pl5sdRX9ZIbMhFni2PDjsnkMEERxD3Ye&redirect_uri=https://verify-stripe.webtoffee.com/wp-json/wt-stripe/v1/oauth&state=aHR0cHM6Ly9yaWRnZWJpb21lZC5jb20ubXkvP3djLWFwaT13dF9zdHJpcGVfb2F1dGhfdXBkYXRlJm1vZGU9dGVzdCZuYW1lPWVoX3N0cmlwZV9wYXltZW50X2dhdGV3YXk

and stripe redirect to our server and then our server ssent autorization code to stripe for access token and refresh token.

and this access token is sent to client site for feature use.

Stripe Apps integrate all the tools you use to run your business

#

this is the intented flow.

but in some case if the connection to client site from our server take more than one minutes stripe sent the same response once more and i got the above error.

if the connection to client site is established within one minute i dont get the error.

i

white carbon
unreal crypt
#

sorry this aricle is not helpful.
the issue iam experiencing is not given there

#

$data = [
'code' => filter_input(INPUT_GET, 'code', FILTER_SANITIZE_STRING),
'grant_type' => 'authorization_code',
];
$log_file = DIR . '/oauth-connect-log.txt';
ini_set('error_log', $log_file);
error_log('helloooo');
error_log( $customer_site_url);

error_log(print_r($data,true));

            // First API call to Stripe
            $ch = curl_init($url);
            $curl_options = [
                CURLOPT_POST => true,
                CURLOPT_POSTFIELDS => http_build_query($data),
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_TIMEOUT => 45,
                CURLOPT_HTTPHEADER => [
                    'Authorization: Basic ' . base64_encode($stripe_secret_key . ':')
                ]
            ];
            curl_setopt_array($ch, $curl_options);
            
            $response = curl_exec($ch);
            $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            if ($response === false) {
                throw new Exception('CURL error : ' . curl_error($ch));
            }

i got the same response twice from stripe

white carbon
#

Sorry, not sure what API/endpoint that code calls

#

You need to share a req_xxx ID or the token ID that is returned 'twice' or something

unreal crypt
#

ok,
stripe redirect to our server when connecting.
the url passed in redirection url in the install link.

here my problem is stripe responed twice if the first response take more than one minutes.
why this happense?

white carbon
#

As I said, I don't know without you providing some kind of ID or logs of the responses

unreal crypt
#

authorization code : ac_S95EBYXxakuO2A1zEL3JRhGOa6dQQ9YE

acct_1MgjnPD45tl2P92Z

#

and do you undersatnt the senario?

white carbon
#

So we return the same ac_xxx token to you twice when you make the same request twice?

unreal crypt
#

i only make the request once.
but i got two response if the first response is handeling take more than 1minute

white carbon
#

I don't understand how you can get a 2nd response

unreal crypt
#

i also have the same problem?

#

is there is way check this behaviour?

#

in my end while adding log to the server i got same response twice

white carbon
#

Can you share those logs here?

restive mantleBOT
unreal crypt
#

please wait

#

please remove after viewing
[17-Apr-2025 09:17:11 UTC] Array
(
[code] => ac_S96mcso53gbyMObVTLHpvxmXCibMx7jd
[user_id] => usr_MTMsOxAahaiTvo
[account_id] => acct_1MgjnPD45tl2P92Z
[stripe_user_id] => acct_1MgjnPD45tl2P92Z
[state] => aHR0cHM6Ly93b3JkcHJlc3MtMTA0NjE5OC01MzY1ODYxLmNsb3Vkd2F5c2FwcHMuY29tLz93Yy1hcGk9d3Rfc3RyaXBlX29hdXRoX3VwZGF0ZSZtb2RlPXRlc3QmbmFtZT1laF9zdHJpcGVfcGF5bWVudF9nYXRld2F5
)

[17-Apr-2025 09:18:11 UTC] Array
(
[code] => ac_S96mcso53gbyMObVTLHpvxmXCibMx7jd
[user_id] => usr_MTMsOxAahaiTvo
[account_id] => acct_1MgjnPD45tl2P92Z
[stripe_user_id] => acct_1MgjnPD45tl2P92Z
[state] => aHR0cHM6Ly93b3JkcHJlc3MtMTA0NjE5OC01MzY1ODYxLmNsb3Vkd2F5c2FwcHMuY29tLz93Yy1hcGk9d3Rfc3RyaXBlX29hdXRoX3VwZGF0ZSZtb2RlPXRlc3QmbmFtZT1laF9zdHJpcGVfcGF5bWVudF9nYXRld2F5
)

fossil mauve
#

Where do you get 2 responses from exactly?
HTTP calls only have 1 request and 1 response.

unreal crypt
#

but in the server i got two response

#

So from stripe only one response is sent?
so how counld i get two response with in a time interval of 1minutes?

fossil mauve
#

You probably are sending 2 requests from your app. That seems to be the only possible explanation.