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

fix(frm): added fraud_check_last_step field in fraud_check table to support 3DS transaction in frm #1944

Merged
merged 4 commits into from
Aug 16, 2023

Conversation

jagan-jaya
Copy link
Contributor

@jagan-jaya jagan-jaya commented Aug 16, 2023

Type of Change

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

Description

Currently, frm module dosent work for 3ds flow.
It is because, payments operation core is called multiple times in the same request, and so is pre and post frm.
This creates duplicate entries, and also creates discrepencies.
To fix this, we are adding a field fraud_check_last_step in the fraud check table. This is to indicate the last step executed in the frm flow, and we will restrict few actions based on the last_step.

Eg 1: if the last_step is processing, then we can do checkout or sale nothing else
Eg 2: if the last_step is checkout_or_sale, then we can do transaction or refund or fullfillment
Eg 3: if the last_step is transaction_or_record_refund, then we can either only do fullfillment

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables
  • is_terminated is added to table fraud_check.

Motivation and Context

How did you test it?

  • do a 3ds flow, with frm.
  • for both pre and post flow, at the end of the flow, the is_terminated field should be set to true in the fraud_check table.
  • for pre flow, signifyd should be called twice(once before and once after transaction), not 4 times.
  • for post flow, it should be called only hitting the redirection link, and completing the authentication, i.e., only after the transaction is complete,i.e., frm should be called just once, not twice.

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
  • I added a CHANGELOG entry if applicable

@jagan-jaya jagan-jaya added A-core Area: Core flows M-database-changes Metadata: This PR involves database schema changes labels Aug 16, 2023
@jagan-jaya jagan-jaya self-assigned this Aug 16, 2023
@jagan-jaya jagan-jaya requested a review from a team as a code owner August 16, 2023 15:18
@jagan-jaya jagan-jaya changed the title fix(frm): added is_terminated field in fraud_check table to support 3… fix(frm): added fraud_check_last_step field in fraud_check table to support 3DS transaction in frm Aug 16, 2023
jarnura
jarnura previously approved these changes Aug 16, 2023
Narayanbhat166
Narayanbhat166 previously approved these changes Aug 16, 2023
@jagan-jaya jagan-jaya dismissed stale reviews from Narayanbhat166 and jarnura via bb862aa August 16, 2023 16:06
jarnura
jarnura previously approved these changes Aug 16, 2023
Narayanbhat166
Narayanbhat166 previously approved these changes Aug 16, 2023
@jagan-jaya jagan-jaya dismissed stale reviews from Narayanbhat166 and jarnura via ea88b27 August 16, 2023 17:47
@jagan-jaya jagan-jaya added this pull request to the merge queue Aug 16, 2023
Merged via the queue into main with commit 9a39345 Aug 16, 2023
10 of 12 checks passed
@jagan-jaya jagan-jaya deleted the frm_last_step branch August 16, 2023 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows 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.

4 participants