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(frm): Add support to accept and decline payment when manually reviewed by merchant for risky transaction #2071

Merged
merged 10 commits into from
Sep 4, 2023

Conversation

jagan-jaya
Copy link
Contributor

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

Type of Change

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

Description

When a transaction is marked as Fraud/Risky and the merchant has configured manual review, we need to provide them the functionality to approve/reject the transaction.

Additional Changes

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

Motivation and Context

Adding support to Approve/Reject the transaction incase of review required by the merchant.
Possible Scenarios:

  1. Signifyd marked a transaction as fraud and we send it for merchant_review
  2. Payment processor like stripe has marked a transaction as risky and so merchant has to review it
  3. In Crypto payment the customer may overpay/underpay hence the payment goes for merchant_review.

Only first scenario requires an Approval/Rejection by merchant from hyperswitch dahsboard other two scenarios get resolved from the respective processor dashboard.

How did you test it?

Ran Postman collection of FRM
Screenshot 2023-09-01 at 12 26 19 AM

Testcase 1:

  1. Create a merchant and configure stripe and signifyd with Pre:manual review flow
  2. Make a non-3ds payment with bigger amount(1500000)
  3. The payment status should be 'require_merchant_action'
  4. call /payments/{{payment_id}}/approve , the payment should go to the processor and gets succeeded/failed as per regular flow and merchant_decision field in payment response should be approved

Testcase 2:

  1. Create a merchant and configure stripe and signifyd with Pre:manual review flow
  2. Make a non-3ds payment with bigger amount(1500000)
  3. The payment status should be 'require_merchant_action'
  4. call /payments/{{payment_id}}/reject , the payment should be immediately failed and merchant_decision field in payment response should be rejected

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

@jagan-jaya jagan-jaya requested review from a team, jarnura and ashokkjag as code owners August 31, 2023 18:56
@jagan-jaya jagan-jaya self-assigned this Aug 31, 2023
@jagan-jaya jagan-jaya added the C-feature Category: Feature request or enhancement label Aug 31, 2023
@jagan-jaya jagan-jaya added the M-database-changes Metadata: This PR involves database schema changes label Aug 31, 2023
kashif-m
kashif-m previously approved these changes Sep 1, 2023
@jagan-jaya jagan-jaya added this pull request to the merge queue Sep 4, 2023
Merged via the queue into main with commit 229f111 Sep 4, 2023
10 of 12 checks passed
@jagan-jaya jagan-jaya deleted the frm_manual_review branch September 4, 2023 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants