feat(frm): Add support to accept and decline payment when manually reviewed by merchant for risky transaction (#2071)

This commit is contained in:
Jagan
2023-09-04 17:44:39 +05:30
committed by GitHub
parent c5003aaa74
commit 229f111f6c
36 changed files with 1381 additions and 77 deletions

View File

@ -9,9 +9,8 @@ pub mod types;
use std::{fmt::Debug, marker::PhantomData, ops::Deref, time::Instant};
use api_models::payments::FrmMessage;
use common_utils::{ext_traits::AsyncExt, pii};
use diesel_models::ephemeral_key;
use diesel_models::{ephemeral_key, fraud_check::FraudCheck};
use error_stack::{IntoReport, ResultExt};
use futures::future::join_all;
use masking::Secret;
@ -19,8 +18,9 @@ use router_env::{instrument, tracing};
use time;
pub use self::operations::{
PaymentCancel, PaymentCapture, PaymentConfirm, PaymentCreate, PaymentMethodValidate,
PaymentResponse, PaymentSession, PaymentStatus, PaymentUpdate,
PaymentApprove, PaymentCancel, PaymentCapture, PaymentConfirm, PaymentCreate,
PaymentMethodValidate, PaymentReject, PaymentResponse, PaymentSession, PaymentStatus,
PaymentUpdate,
};
use self::{
flows::{ConstructFlowSpecificData, Feature},
@ -1146,7 +1146,7 @@ where
pub recurring_mandate_payment_data: Option<RecurringMandatePaymentData>,
pub ephemeral_key: Option<ephemeral_key::EphemeralKey>,
pub redirect_response: Option<api_models::payments::RedirectResponse>,
pub frm_message: Option<FrmMessage>,
pub frm_message: Option<FraudCheck>,
}
#[derive(Debug, Default, Clone)]
@ -1239,6 +1239,7 @@ pub fn should_call_connector<Op: Debug, F: Clone>(
)
}
"CompleteAuthorize" => true,
"PaymentApprove" => true,
"PaymentSession" => true,
_ => false,
}