Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(router): changed payment method token TTL to api contract based config from const value #5209

Merged
merged 4 commits into from
Jul 4, 2024

Conversation

sahkal
Copy link
Contributor

@sahkal sahkal commented Jul 4, 2024

Type of Change

  • Bugfix
  • Enhancement

Description

Currently the payment method token TLL calculation was done based on const::TOKEN_TTL - payment_intent.created_at

where TOKEN_TTL was 15mins, but as we have a new contract called session_expiry we can make our payment live for longer time constraint than just 15mins,

due to this, the value const::TOKEN_TTL - payment_intent.created_at might go negative if the payment is done after 15mins. Which causes negative value at redis.

To solve, This problem we have used intent_fulfillment_time in business profile which is set by the merchant.

max value of intent_fulfillment_time can be 30mins and min can be 1min

Please refer PR: #5115

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

…sed config from const value (#5115)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
@sahkal sahkal added A-core Area: Core flows C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jul 4, 2024
@sahkal sahkal added this to the July 2024 Release milestone Jul 4, 2024
@sahkal sahkal self-assigned this Jul 4, 2024
@sahkal sahkal requested review from a team as code owners July 4, 2024 11:34
@sahkal sahkal requested review from Narayanbhat166 and jarnura July 4, 2024 11:34
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jul 4, 2024
@sahkal sahkal removed the request for review from a team July 4, 2024 11:39
@sahkal sahkal changed the base branch from main to hotfix-2024.06.28.0 July 4, 2024 11:39
@sahkal sahkal changed the title fix(router): changed payment method token TTL to api contract based config from const value refactor(router): changed payment method token TTL to api contract based config from const value Jul 4, 2024
@sahkal sahkal changed the title refactor(router): changed payment method token TTL to api contract based config from const value refactor(router): changed payment method token TTL to api contract based config from const value Jul 4, 2024
@SanchithHegde SanchithHegde merged commit 9417bc3 into hotfix-2024.06.28.0 Jul 4, 2024
11 of 12 checks passed
@SanchithHegde SanchithHegde deleted the fix-token-ttl-bug branch July 4, 2024 14:13
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-bug Category: Bug M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants