hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

[REFACTOR]: handle network delays with expiry of access token

Open Narayanbhat166 opened this issue 1 year ago • 0 comments

It may so happen that there might be a slight delay in the network to receive the access token from connector. So when we store the access token with expiry already few seconds would have elapsed. So the key might expire few seconds before than the actual expiry at hyperswitch.

Note - This affects only to those connectors which provide relative expiry i.e expires in 300s.

In order to account for this, when storing the redis expiry key, it can be set by subtracting few seconds from the actual expiry in order to account for the network delays.

Note - This can be done in the core level for all access token in order to be safe. There might also be some network delays when using this access token to create the payment. The token might have not been expired when the request is sent, but once it reaches the processor, it might have been expired.

Narayanbhat166 avatar Apr 25 '24 08:04 Narayanbhat166