#sinduri_api

1 messages ¡ Page 1 of 1 (latest)

chilly sphinxBOT
#

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

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

pliant void
#

hi! no, as far as I know the old token is revoked immediately.

winter swift
#

So either live or sandbox mode tokens are valid at a time..Its confusing but the tokens are different for sandbox and live mode.

chilly sphinxBOT
vale ferry
#

Its confusing but the tokens are different for sandbox and live mode
yes that's expected

winter swift
#

Then why revoking the tokens in sandbox mode when connecting to live mode ?

vale ferry
#

I'm not sure I understand

winter swift
#

I am connecting stripe app in sandobx mode using OAuth API then received access and refresh token. Then I'm connecting the app in live mode then received another tokens. My concern is the token in sandbox mode is still remains valid or not?

As per your documentation it says access token remains valid for one hour..

vale ferry
#

each environment holds their own access token for an hour since they generated it

winter swift
#

what about the refresh token?

vale ferry
#

I'm pretty sure with sandboxes is different than from test vs live modes

winter swift
#

One of our customer reports that refresh token remains valid in only one environment!!

#

I received access_token1 & refresh_token1 in sandbox

access_token2 & refresh_token2 in live

As per your comment, both set of tokens are valid within one hour..right

vale ferry
#

AFAIK yes

#

are you seeing another behavior?

winter swift
#

One of our plugin customer says so

vale ferry
#

I know that with live and test mode that's expected as my colleague said

#

my understanding is that this shouldn't be the case with sandboxes

winter swift
#

I refertest mode payments as sandbox

vale ferry
#

no

#

test mode is not a sandbox

#

there are few differences between test mode and sandboxes and I think this is one of them

winter swift
#

In my case I'm mentioning this, please see the screenshot there are 2 links one for test mode and another for live mode

#

tokens in these 2 modes remains valid at same time?

vale ferry
#

in this case my colleague's original response is correct

vale ferry
winter swift
#

oh!!!

winter swift
#

So When I first connect in test mode and then switch to live mode, I need to refresh the token in test mode if I switch back again, even if the token was generated within the last hour.?

chilly sphinxBOT
manic crypt
#

Hey! Taking over for my colleague. Let me catch up.

winter swift
#

My case is
App connected in test mode - received access_token_test and refresh_token_test
Then app connected in live mode - received access_token_live and refresh_token_live

As per your colleague, tokens remains alive only in one environment. Thus When I switch back to test mode, I should need to refresh the tokens in test mode right? So can I use the refresh_token_test for refreshing the access token? Or is there any chance the refresh_token_test is expired after generating refresh_token_live?

manic crypt
#

May I understand what is the use case from switching immediately from test/sandbox to live and reverse ?

winter swift
#

We developed a plugin where the OAuth integration is done recently, authentication method migrated from basic keys to OAuth as per Stripe's migration request. So the customer already connected to their Stripe account using publishable and secret key, needs to re authenticate the connection with their Stripe account

#

So customer who updates our new plugin version are trying to re-connect in test and live mode.

manic crypt
#

Great, thank you for the additional details. I still don't get why you need to switch from live to test and from test to live ?

winter swift
#

Its upon the customers,, If ther encounter any issues in live payments they tried to switch to test mode for debugging the case. Or if they want to try new features like new Stripe payment methods our plugin offers, they first it on test mode

#

Its like customer specific cases

manic crypt
#

Ok I see thanks.

#

In this case:

So When I first connect in test mode and then switch to live mode, I need to refresh the token in test mode if I switch back again, even if the token was generated within the last hour.?
Yes you need to refresh the token.

winter swift
#

Okay, understood

#

To refresh the token Can I use the same refresh token generated in test mode?

#

Is there any cases expring refresh token in one environment(test mode) after a new refresh token is generated in another environment(live)