refactor(core): make attempt id as mandatory in router_data (#604)

This commit is contained in:
Narayan Bhat
2023-02-19 19:31:47 +05:30
committed by GitHub
parent 66563595df
commit 626e467e54
10 changed files with 12 additions and 23 deletions

View File

@ -22,7 +22,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData {
merchant_id: String::from("aci"),
connector: "aci".to_string(),
payment_id: uuid::Uuid::new_v4().to_string(),
attempt_id: None,
attempt_id: uuid::Uuid::new_v4().to_string(),
status: enums::AttemptStatus::default(),
auth_type: enums::AuthenticationType::NoThreeDs,
payment_method: enums::PaymentMethodType::Card,
@ -72,7 +72,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> {
merchant_id: String::from("aci"),
connector: "aci".to_string(),
payment_id: uuid::Uuid::new_v4().to_string(),
attempt_id: None,
attempt_id: uuid::Uuid::new_v4().to_string(),
status: enums::AttemptStatus::default(),
router_return_url: None,
payment_method: enums::PaymentMethodType::Card,

View File

@ -22,7 +22,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData {
merchant_id: String::from("authorizedotnet"),
connector: "authorizedotnet".to_string(),
payment_id: uuid::Uuid::new_v4().to_string(),
attempt_id: None,
attempt_id: uuid::Uuid::new_v4().to_string(),
status: enums::AttemptStatus::default(),
router_return_url: None,
payment_method: enums::PaymentMethodType::Card,
@ -73,7 +73,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> {
merchant_id: String::from("authorizedotnet"),
connector: "authorizedotnet".to_string(),
payment_id: uuid::Uuid::new_v4().to_string(),
attempt_id: None,
attempt_id: uuid::Uuid::new_v4().to_string(),
status: enums::AttemptStatus::default(),
router_return_url: None,
auth_type: enums::AuthenticationType::NoThreeDs,

View File

@ -19,7 +19,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData {
merchant_id: "checkout".to_string(),
connector: "checkout".to_string(),
payment_id: uuid::Uuid::new_v4().to_string(),
attempt_id: None,
attempt_id: uuid::Uuid::new_v4().to_string(),
status: enums::AttemptStatus::default(),
router_return_url: None,
auth_type: enums::AuthenticationType::NoThreeDs,
@ -70,7 +70,7 @@ fn construct_refund_router_data<F>() -> types::RefundsRouterData<F> {
merchant_id: "checkout".to_string(),
connector: "checkout".to_string(),
payment_id: uuid::Uuid::new_v4().to_string(),
attempt_id: None,
attempt_id: uuid::Uuid::new_v4().to_string(),
status: enums::AttemptStatus::default(),
router_return_url: None,
payment_method: enums::PaymentMethodType::Card,

View File

@ -348,7 +348,7 @@ pub trait ConnectorActions: Connector {
merchant_id: self.get_name(),
connector: self.get_name(),
payment_id: uuid::Uuid::new_v4().to_string(),
attempt_id: Some(uuid::Uuid::new_v4().to_string()),
attempt_id: uuid::Uuid::new_v4().to_string(),
status: enums::AttemptStatus::default(),
router_return_url: info.clone().and_then(|a| a.router_return_url),
auth_type: info