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

feat: expire client secret after a merchant configurable intent fufliment time #956

Merged
merged 26 commits into from
May 3, 2023

Conversation

prajjwalkumar17
Copy link
Contributor

@prajjwalkumar17 prajjwalkumar17 commented Apr 22, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

We have added a new Optional field in MerchantAccount table i.e intent_fulfillment_time that will set by the merchant during the account creation and by default it is of 900secs(15 mins). So If the intent is set then the customer needs to fulfill it within that time limit or else it will expire and throw client_secret_expired

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

How did you test it?

Written 3 tests which verifies

  1. Client secret is itself mismatching or not from req and from payment intent.
  2. intent_filfillment_time once expired should throw error.
  3. intent_fulfillment_time not expired should pass the test.

Checklist

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

@prajjwalkumar17 prajjwalkumar17 added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed M-database-changes Metadata: This PR involves database schema changes A-performance Area: Performance optimisation labels Apr 22, 2023
@prajjwalkumar17 prajjwalkumar17 self-assigned this Apr 22, 2023
@prajjwalkumar17
Copy link
Contributor Author

Need more refactorings

@prajjwalkumar17 prajjwalkumar17 marked this pull request as draft April 22, 2023 07:34
@prajjwalkumar17 prajjwalkumar17 marked this pull request as ready for review April 22, 2023 12:37
crates/api_models/src/admin.rs Outdated Show resolved Hide resolved
crates/router/src/core/payment_methods/cards.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/helpers.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/helpers.rs Outdated Show resolved Hide resolved
crates/router/src/routes/payment_methods.rs Outdated Show resolved Hide resolved
crates/router/src/services/authentication.rs Outdated Show resolved Hide resolved
crates/router/src/services/authentication.rs Outdated Show resolved Hide resolved
crates/router/src/routes/payment_methods.rs Outdated Show resolved Hide resolved
@prajjwalkumar17 prajjwalkumar17 added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 23, 2023
@prajjwalkumar17 prajjwalkumar17 added the R-waiting-on-L2 Review: Waiting on L2 reviewer label May 2, 2023
jarnura
jarnura previously approved these changes May 2, 2023
@jarnura jarnura added S-ready-for-merge and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed R-waiting-on-L2 Review: Waiting on L2 reviewer labels May 2, 2023
@jarnura jarnura added this pull request to the merge queue May 2, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 2, 2023
@jarnura jarnura added this pull request to the merge queue May 3, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 3, 2023
@jarnura jarnura enabled auto-merge May 3, 2023 10:33
@jarnura jarnura added this pull request to the merge queue May 3, 2023
Merged via the queue into main with commit 03a9643 May 3, 2023
@SanchithHegde SanchithHegde removed S-ready-for-merge R-L1-completed Review: L1 Review completed labels May 3, 2023
@SanchithHegde SanchithHegde deleted the feat/client_secret_expiry branch May 3, 2023 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-performance Area: Performance optimisation C-feature Category: Feature request or enhancement M-api-contract-changes Metadata: This PR involves API contract changes M-database-changes Metadata: This PR involves database schema changes
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

[FEATURE] Client Secret Expiry
6 participants