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): Revise post FRM core flows #4394

Merged
merged 28 commits into from Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e960e0c
revise post frm core flows
srujanchikke Apr 18, 2024
785ee7f
Merge branch 'main' of github.com:juspay/hyperswitch into frm_core_flows
srujanchikke Apr 18, 2024
1cb716c
chore: run formatter
hyperswitch-bot[bot] Apr 18, 2024
e790e6e
fix clippy
srujanchikke Apr 19, 2024
f99e030
Merge branch 'main' of github.com:juspay/hyperswitch into frm_core_flows
srujanchikke Apr 19, 2024
164fbb8
Merge branch 'frm_core_flows' of github.com:juspay/hyperswitch into f…
srujanchikke Apr 19, 2024
069baca
chore: run formatter
hyperswitch-bot[bot] Apr 19, 2024
b8c5821
refactor approve incase of manual capture
srujanchikke Apr 24, 2024
c975c55
Merge branch 'main' of github.com:juspay/hyperswitch into frm_core_flows
srujanchikke Apr 24, 2024
08da3ea
Merge branch 'frm_core_flows' of github.com:juspay/hyperswitch into f…
srujanchikke Apr 24, 2024
3fa28af
chore: run formatter
hyperswitch-bot[bot] Apr 24, 2024
3190345
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Apr 24, 2024
1ce254c
migrations for fraud_check and payment status
srujanchikke Apr 24, 2024
5405235
Merge branch 'frm_core_flows' of github.com:juspay/hyperswitch into f…
srujanchikke Apr 24, 2024
5f9633c
minor change on down.sql
srujanchikke Apr 24, 2024
296cee1
fix cargo hack by adding frm feature flag
srujanchikke Apr 24, 2024
f12d080
chore: run formatter
hyperswitch-bot[bot] Apr 24, 2024
e72b38b
add transaction flow after checkout flow for pre frm
srujanchikke Apr 25, 2024
c6f46ce
Merge branch 'frm_core_flows' of github.com:juspay/hyperswitch into f…
srujanchikke Apr 25, 2024
3203ffc
Merge branch 'main' of github.com:juspay/hyperswitch into frm_core_flows
srujanchikke Apr 25, 2024
e9fd863
resolve comments
srujanchikke Apr 25, 2024
cd68352
minor changes
srujanchikke Apr 25, 2024
4b290c6
minor refactor
srujanchikke Apr 25, 2024
ff304d6
rename frm_capture_method to payment_capture_method in frm data
srujanchikke Apr 26, 2024
5605ff3
resolve comments and revert frm_requires_merchant_action enum
srujanchikke Apr 26, 2024
8aebbbd
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Apr 26, 2024
91320db
Merge branch 'main' into frm_core_flows
srujanchikke Apr 26, 2024
8cc5265
Merge branch 'main' into frm_core_flows
srujanchikke Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/common_enums/src/enums.rs
Expand Up @@ -2249,7 +2249,7 @@ pub enum FrmSuggestion {
#[default]
FrmCancelTransaction,
FrmManualReview,
FrmAutoRefund,
FrmAuthorizeTransaction, // When manual capture payment which was marked fraud and held, when approved needs to be authorized.
}

#[derive(
Expand Down
1 change: 1 addition & 0 deletions crates/data_models/src/payments/payment_attempt.rs
Expand Up @@ -303,6 +303,7 @@ pub enum PaymentAttemptUpdate {
currency: storage_enums::Currency,
status: storage_enums::AttemptStatus,
authentication_type: Option<storage_enums::AuthenticationType>,
capture_method: Option<storage_enums::CaptureMethod>,
payment_method: Option<storage_enums::PaymentMethod>,
browser_info: Option<serde_json::Value>,
connector: Option<String>,
Expand Down
3 changes: 3 additions & 0 deletions crates/data_models/src/payments/payment_intent.rs
Expand Up @@ -182,6 +182,7 @@ pub enum PaymentIntentUpdate {
updated_by: String,
},
ApproveUpdate {
status: storage_enums::IntentStatus,
merchant_decision: Option<String>,
updated_by: String,
},
Expand Down Expand Up @@ -382,9 +383,11 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
..Default::default()
},
PaymentIntentUpdate::ApproveUpdate {
status,
merchant_decision,
updated_by,
} => Self {
status: Some(status),
merchant_decision,
updated_by,
..Default::default()
Expand Down
7 changes: 7 additions & 0 deletions crates/diesel_models/src/fraud_check.rs
@@ -1,3 +1,4 @@
use common_enums as storage_enums;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable};
use masking::{Deserialize, Serialize};
use time::PrimitiveDateTime;
Expand Down Expand Up @@ -25,6 +26,7 @@ pub struct FraudCheck {
pub metadata: Option<serde_json::Value>,
pub modified_at: PrimitiveDateTime,
pub last_step: FraudCheckLastStep,
pub payment_capture_method: Option<storage_enums::CaptureMethod>, // In postFrm, we are updating capture method from automatic to manual. To store the merchant actual capture method, we are storing the actual capture method in payment_capture_method. It will be useful while approving the FRM decision.
}

#[derive(router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
Expand All @@ -46,6 +48,7 @@ pub struct FraudCheckNew {
pub metadata: Option<serde_json::Value>,
pub modified_at: PrimitiveDateTime,
pub last_step: FraudCheckLastStep,
pub payment_capture_method: Option<storage_enums::CaptureMethod>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand All @@ -59,6 +62,7 @@ pub enum FraudCheckUpdate {
metadata: Option<serde_json::Value>,
modified_at: PrimitiveDateTime,
last_step: FraudCheckLastStep,
payment_capture_method: Option<storage_enums::CaptureMethod>,
},
ErrorUpdate {
status: FraudCheckStatus,
Expand All @@ -76,6 +80,7 @@ pub struct FraudCheckUpdateInternal {
frm_error: Option<Option<String>>,
metadata: Option<serde_json::Value>,
last_step: FraudCheckLastStep,
payment_capture_method: Option<storage_enums::CaptureMethod>,
}

impl From<FraudCheckUpdate> for FraudCheckUpdateInternal {
Expand All @@ -89,13 +94,15 @@ impl From<FraudCheckUpdate> for FraudCheckUpdateInternal {
metadata,
modified_at: _,
last_step,
payment_capture_method,
} => Self {
frm_status: Some(frm_status),
frm_transaction_id,
frm_reason,
frm_score,
metadata,
last_step,
payment_capture_method,
..Default::default()
},
FraudCheckUpdate::ErrorUpdate {
Expand Down
3 changes: 3 additions & 0 deletions crates/diesel_models/src/payment_attempt.rs
Expand Up @@ -209,6 +209,7 @@ pub enum PaymentAttemptUpdate {
currency: storage_enums::Currency,
status: storage_enums::AttemptStatus,
authentication_type: Option<storage_enums::AuthenticationType>,
capture_method: Option<storage_enums::CaptureMethod>,
payment_method: Option<storage_enums::PaymentMethod>,
browser_info: Option<serde_json::Value>,
connector: Option<String>,
Expand Down Expand Up @@ -559,6 +560,7 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
amount,
currency,
authentication_type,
capture_method,
status,
payment_method,
browser_info,
Expand Down Expand Up @@ -610,6 +612,7 @@ impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
payment_method_billing_address_id,
fingerprint_id,
payment_method_id,
capture_method,
..Default::default()
},
PaymentAttemptUpdate::VoidUpdate {
Expand Down
3 changes: 3 additions & 0 deletions crates/diesel_models/src/payment_intent.rs
Expand Up @@ -180,6 +180,7 @@ pub enum PaymentIntentUpdate {
updated_by: String,
},
ApproveUpdate {
status: storage_enums::IntentStatus,
merchant_decision: Option<String>,
updated_by: String,
},
Expand Down Expand Up @@ -456,9 +457,11 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
..Default::default()
},
PaymentIntentUpdate::ApproveUpdate {
status,
merchant_decision,
updated_by,
} => Self {
status: Some(status),
merchant_decision,
updated_by,
..Default::default()
Expand Down
1 change: 1 addition & 0 deletions crates/diesel_models/src/schema.rs
Expand Up @@ -450,6 +450,7 @@ diesel::table! {
modified_at -> Timestamp,
#[max_length = 64]
last_step -> Varchar,
payment_capture_method -> Nullable<CaptureMethod>,
}
}

Expand Down