-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(FRM): refactor frm configs #4581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some test coverage for FRM? can be taken up in subsequent PRs
crates/api_models/src/admin.rs
Outdated
///payment method types(credit, debit) that can be used in the payment. This field is deprecated. It has not been removed to provide backward compatibility. | ||
pub payment_method_types: Option<Vec<FrmPaymentMethodType>>, | ||
///frm flow type to be used...can be pre/post | ||
#[schema(value_type = FrmPreferredFlowTypes)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[schema(value_type = FrmPreferredFlowTypes)] | |
#[schema(value_type = Option<FrmPreferredFlowTypes>)] |
crates/api_models/src/admin.rs
Outdated
pub payment_method_types: Vec<FrmPaymentMethodType>, | ||
///payment method types(credit, debit) that can be used in the payment. This field is deprecated. It has not been removed to provide backward compatibility. | ||
pub payment_method_types: Option<Vec<FrmPaymentMethodType>>, | ||
///frm flow type to be used...can be pre/post |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
///frm flow type to be used...can be pre/post | |
///frm flow type to be used, can be pre/post |
@@ -1038,6 +1037,7 @@ impl PaymentCreate { | |||
session_expiry: Some(session_expiry), | |||
request_external_three_ds_authentication: request | |||
.request_external_three_ds_authentication, | |||
frm_metadata: request.frm_metadata.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we validate the value here? or any serde_json::value can be put in the column?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't validate here, validation is there at connector level. Signifyd & Riskified expects few fields from frm_metadata.
@@ -0,0 +1,2 @@ | |||
-- Your SQL goes here | |||
ALTER TABLE payment_intent ADD COLUMN frm_metadata JSONB DEFAULT NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALTER TABLE payment_intent ADD COLUMN frm_metadata JSONB DEFAULT NULL; | |
ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS frm_metadata JSONB DEFAULT NULL; |
@@ -0,0 +1,2 @@ | |||
-- This file should undo anything in `up.sql` | |||
ALTER TABLE payment_intent DROP COLUMN frm_metadata; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALTER TABLE payment_intent DROP COLUMN frm_metadata; | |
ALTER TABLE payment_intent DROP COLUMN IF EXISTS frm_metadata; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dashboard specific changes are fine!
Type of Change
Description
This PR contains
Additional Changes
Previously frm configuration when creating merchant connector for FRM connector used to be like
This has been modified to
Motivation and Context
Frm action is depricated because the levarage of manual review now has been moved to frm connector. We consume webhooks from frm connectors and take appropriate action. We also depricated merchant to configure rules from hyperswitch end since he already sets up rules in frm, so we solely depends on FRM status to take action.
PreAuth flow :
PostAuth flow :
How did you test it?
Test merchant account create with both new and old frm configs.
Checklist
cargo +nightly fmt --all
cargo clippy