diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rs index da6964fa2b..b729b9186f 100644 --- a/crates/router/src/core/payments/operations/payment_session.rs +++ b/crates/router/src/core/payments/operations/payment_session.rs @@ -209,16 +209,16 @@ where } #[instrument(skip_all)] - async fn make_pm_data<'a>( - &'a self, - _state: &'a AppState, + async fn make_pm_data<'b>( + &'b self, + _state: &'b AppState, _payment_method: Option, _txn_id: &str, _payment_attempt: &storage::PaymentAttempt, _request: &Option, _token: &Option, ) -> RouterResult<( - BoxedOperation<'a, F, api::PaymentsSessionRequest>, + BoxedOperation<'b, F, api::PaymentsSessionRequest>, Option, )> { //No payment method data for this operation diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs index cb34e60793..903116810d 100644 --- a/crates/router/src/types.rs +++ b/crates/router/src/types.rs @@ -110,6 +110,17 @@ pub struct PaymentsCancelData { pub connector_transaction_id: String, pub cancellation_reason: Option, } + +#[derive(Debug, Clone)] +pub struct VerifyRequestData { + pub payment_method_data: payments::PaymentMethod, + pub confirm: bool, + pub statement_descriptor_suffix: Option, + pub mandate_id: Option, + pub setup_future_usage: Option, + pub off_session: Option, + pub setup_mandate_details: Option, +} #[derive(Debug, Clone)] pub struct PaymentsResponseData { pub resource_id: ResponseId, diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs index 3297fa07a3..231cb7fd7d 100644 --- a/crates/router/src/types/api/payments.rs +++ b/crates/router/src/types/api/payments.rs @@ -78,6 +78,24 @@ pub struct PaymentsRedirectRequest { pub param: String, } +#[derive(Default, Debug, serde::Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct VerifyRequest { + pub merchant_id: Option, + pub customer_id: Option, + pub email: Option>, + pub name: Option>, + pub phone: Option>, + pub phone_country_code: Option, + pub payment_method: Option, + pub payment_method_data: Option, + pub payment_token: Option, + pub mandate_data: Option, + pub setup_future_usage: Option, + pub off_session: Option, + pub client_secret: Option, +} + pub enum MandateTxnType { NewMandateTxn, RecurringMandateTxn, @@ -376,6 +394,26 @@ pub struct PaymentListResponse { pub data: Vec, } +#[derive(Setter, Clone, Default, Debug, Eq, PartialEq, serde::Serialize)] +pub struct VerifyResponse { + pub verify_id: Option, + pub merchant_id: Option, + // pub status: enums::VerifyStatus, + pub client_secret: Option>, + pub customer_id: Option, + pub email: Option>, + pub name: Option>, + pub phone: Option>, + pub mandate_id: Option, + #[auth_based] + pub payment_method: Option, + #[auth_based] + pub payment_method_data: Option, + pub payment_token: Option, + pub error_code: Option, + pub error_message: Option, +} + fn default_limit() -> i64 { 10 }