Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(platform): update validate_request to accept Processor instead of Platform (#10405)

Apoorv Dixit85da641109b1
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index 34601958ba..3074a6d6c5 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -580,7 +580,7 @@ where
);
let (operation, validate_result) = operation
.to_validate_request()?
- .validate_request(&req, platform)?;
+ .validate_request(&req, platform.get_processor())?;
tracing::Span::current().record("payment_id", format!("{}", validate_result.payment_id));
// get profile from headers
@@ -1288,7 +1288,7 @@ where
);
let (operation, validate_result) = operation
.to_validate_request()?
- .validate_request(&req, &platform)?;
+ .validate_request(&req, platform.get_processor())?;
tracing::Span::current().record("payment_id", format!("{}", validate_result.payment_id));
diff --git a/crates/router/src/core/payments/operations.rs b/crates/router/src/core/payments/operations.rs
index da9d06ef33..bfacbc39c2 100644
--- a/crates/router/src/core/payments/operations.rs
+++ b/crates/router/src/core/payments/operations.rs
@@ -172,7 +172,7 @@ pub trait ValidateRequest<F, R, D> {
fn validate_request<'b>(
&'b self,
request: &R,
- platform: &domain::Platform,
+ platform: &domain::Processor,
) -> RouterResult<(BoxedOperation<'b, F, R, D>, ValidateResult)>;
}
diff --git a/crates/router/src/core/payments/operations/payment_approve.rs b/crates/router/src/core/payments/operations/payment_approve.rs
index ed76a91089..f153c20fae 100644
--- a/crates/router/src/core/payments/operations/payment_approve.rs
+++ b/crates/router/src/core/payments/operations/payment_approve.rs
@@ -286,24 +286,21 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsCaptureRequest, Pay
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsCaptureRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentApproveOperation<'b, F>, operations::ValidateResult)> {
let request_merchant_id = request.merchant_id.as_ref();
- helpers::validate_merchant_id(
- platform.get_processor().get_account().get_id(),
- request_merchant_id,
- )
- .change_context(errors::ApiErrorResponse::InvalidDataFormat {
- field_name: "merchant_id".to_string(),
- expected_format: "merchant_id from merchant account".to_string(),
- })?;
+ helpers::validate_merchant_id(processor.get_account().get_id(), request_merchant_id)
+ .change_context(errors::ApiErrorResponse::InvalidDataFormat {
+ field_name: "merchant_id".to_string(),
+ expected_format: "merchant_id from merchant account".to_string(),
+ })?;
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(request.payment_id.clone()),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_cancel.rs b/crates/router/src/core/payments/operations/payment_cancel.rs
index 5c591f8190..f6838241da 100644
--- a/crates/router/src/core/payments/operations/payment_cancel.rs
+++ b/crates/router/src/core/payments/operations/payment_cancel.rs
@@ -310,14 +310,14 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsCancelRequest, Paym
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsCancelRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentCancelOperation<'b, F>, operations::ValidateResult)> {
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(request.payment_id.to_owned()),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_cancel_post_capture.rs b/crates/router/src/core/payments/operations/payment_cancel_post_capture.rs
index e359cdecb5..83f924d0ef 100644
--- a/crates/router/src/core/payments/operations/payment_cancel_post_capture.rs
+++ b/crates/router/src/core/payments/operations/payment_cancel_post_capture.rs
@@ -304,7 +304,7 @@ impl<F: Send + Clone + Sync>
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsCancelPostCaptureRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(
PaymentCancelPostCaptureOperation<'b, F>,
operations::ValidateResult,
@@ -312,9 +312,9 @@ impl<F: Send + Clone + Sync>
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(request.payment_id.to_owned()),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_capture.rs b/crates/router/src/core/payments/operations/payment_capture.rs
index 4ec9151b1e..f3513a65a5 100644
--- a/crates/router/src/core/payments/operations/payment_capture.rs
+++ b/crates/router/src/core/payments/operations/payment_capture.rs
@@ -349,14 +349,14 @@ impl<F: Send + Clone + Sync>
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsCaptureRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentCaptureOperation<'b, F>, operations::ValidateResult)> {
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(request.payment_id.to_owned()),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_complete_authorize.rs b/crates/router/src/core/payments/operations/payment_complete_authorize.rs
index 5e6714880b..eee498b1ed 100644
--- a/crates/router/src/core/payments/operations/payment_complete_authorize.rs
+++ b/crates/router/src/core/payments/operations/payment_complete_authorize.rs
@@ -528,7 +528,7 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(
CompleteAuthorizeOperation<'b, F>,
operations::ValidateResult,
@@ -539,14 +539,11 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
.ok_or(report!(errors::ApiErrorResponse::PaymentNotFound))?;
let request_merchant_id = request.merchant_id.as_ref();
- helpers::validate_merchant_id(
- platform.get_processor().get_account().get_id(),
- request_merchant_id,
- )
- .change_context(errors::ApiErrorResponse::InvalidDataFormat {
- field_name: "merchant_id".to_string(),
- expected_format: "merchant_id from merchant account".to_string(),
- })?;
+ helpers::validate_merchant_id(processor.get_account().get_id(), request_merchant_id)
+ .change_context(errors::ApiErrorResponse::InvalidDataFormat {
+ field_name: "merchant_id".to_string(),
+ expected_format: "merchant_id from merchant account".to_string(),
+ })?;
helpers::validate_payment_method_fields_present(request)?;
@@ -562,9 +559,9 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id,
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: matches!(
request.retry_action,
Some(api_models::enums::RetryAction::Requeue)
diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs
index 1a42b4b21e..ca0f2b8528 100644
--- a/crates/router/src/core/payments/operations/payment_confirm.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm.rs
@@ -2181,7 +2181,7 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentConfirmOperation<'b, F>, operations::ValidateResult)> {
helpers::validate_customer_information(request)?;
@@ -2190,14 +2190,11 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
}
let request_merchant_id = request.merchant_id.as_ref();
- helpers::validate_merchant_id(
- platform.get_processor().get_account().get_id(),
- request_merchant_id,
- )
- .change_context(errors::ApiErrorResponse::InvalidDataFormat {
- field_name: "merchant_id".to_string(),
- expected_format: "merchant_id from merchant account".to_string(),
- })?;
+ helpers::validate_merchant_id(processor.get_account().get_id(), request_merchant_id)
+ .change_context(errors::ApiErrorResponse::InvalidDataFormat {
+ field_name: "merchant_id".to_string(),
+ expected_format: "merchant_id from merchant account".to_string(),
+ })?;
helpers::validate_payment_method_fields_present(request)?;
@@ -2234,9 +2231,9 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id,
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: matches!(
request.retry_action,
Some(api_models::enums::RetryAction::Requeue)
diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs
index 1b852285df..47e4bea103 100644
--- a/crates/router/src/core/payments/operations/payment_create.rs
+++ b/crates/router/src/core/payments/operations/payment_create.rs
@@ -960,7 +960,7 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentCreateOperation<'b, F>, operations::ValidateResult)> {
helpers::validate_customer_information(request)?;
@@ -982,11 +982,8 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
))?;
let request_merchant_id = request.merchant_id.as_ref();
- helpers::validate_merchant_id(
- platform.get_processor().get_account().get_id(),
- request_merchant_id,
- )
- .change_context(errors::ApiErrorResponse::MerchantAccountNotFound)?;
+ helpers::validate_merchant_id(processor.get_account().get_id(), request_merchant_id)
+ .change_context(errors::ApiErrorResponse::MerchantAccountNotFound)?;
helpers::validate_request_amount_and_amount_to_capture(
request.amount,
@@ -1081,9 +1078,9 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id,
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: matches!(
request.retry_action,
Some(api_models::enums::RetryAction::Requeue)
diff --git a/crates/router/src/core/payments/operations/payment_post_session_tokens.rs b/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
index 641c8e6a36..4e7933047a 100644
--- a/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
+++ b/crates/router/src/core/payments/operations/payment_post_session_tokens.rs
@@ -281,7 +281,7 @@ impl<F: Send + Clone + Sync>
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsPostSessionTokensRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(
PaymentPostSessionTokensOperation<'b, F>,
operations::ValidateResult,
@@ -292,9 +292,9 @@ impl<F: Send + Clone + Sync>
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(given_payment_id),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_reject.rs b/crates/router/src/core/payments/operations/payment_reject.rs
index 218a196909..1a09e51bc6 100644
--- a/crates/router/src/core/payments/operations/payment_reject.rs
+++ b/crates/router/src/core/payments/operations/payment_reject.rs
@@ -297,14 +297,14 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, PaymentsCancelRequest, PaymentDa
fn validate_request<'a, 'b>(
&'b self,
request: &PaymentsCancelRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentRejectOperation<'b, F>, operations::ValidateResult)> {
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(request.payment_id.to_owned()),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rs
index d1db658680..43f65d3349 100644
--- a/crates/router/src/core/payments/operations/payment_session.rs
+++ b/crates/router/src/core/payments/operations/payment_session.rs
@@ -288,7 +288,7 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsSessionRequest, Pay
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsSessionRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentSessionOperation<'b, F>, operations::ValidateResult)> {
//paymentid is already generated and should be sent in the request
let given_payment_id = request.payment_id.clone();
@@ -296,9 +296,9 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsSessionRequest, Pay
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(given_payment_id),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_start.rs b/crates/router/src/core/payments/operations/payment_start.rs
index b2a7fdb20c..f906206b33 100644
--- a/crates/router/src/core/payments/operations/payment_start.rs
+++ b/crates/router/src/core/payments/operations/payment_start.rs
@@ -255,26 +255,23 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsStartRequest, Payme
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsStartRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentSessionOperation<'b, F>, operations::ValidateResult)> {
let request_merchant_id = Some(&request.merchant_id);
- helpers::validate_merchant_id(
- platform.get_processor().get_account().get_id(),
- request_merchant_id,
- )
- .change_context(errors::ApiErrorResponse::InvalidDataFormat {
- field_name: "merchant_id".to_string(),
- expected_format: "merchant_id from merchant account".to_string(),
- })?;
+ helpers::validate_merchant_id(processor.get_account().get_id(), request_merchant_id)
+ .change_context(errors::ApiErrorResponse::InvalidDataFormat {
+ field_name: "merchant_id".to_string(),
+ expected_format: "merchant_id from merchant account".to_string(),
+ })?;
let payment_id = request.payment_id.clone();
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(payment_id),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs
index a4704e75d2..2324ee4999 100644
--- a/crates/router/src/core/payments/operations/payment_status.rs
+++ b/crates/router/src/core/payments/operations/payment_status.rs
@@ -569,27 +569,24 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRetrieveRequest, Pa
fn validate_request<'b>(
&'b self,
request: &api::PaymentsRetrieveRequest,
- platform: &domain::Platform,
+ processor: &domain::Processor,
) -> RouterResult<(
PaymentStatusOperation<'b, F, api::PaymentsRetrieveRequest>,
operations::ValidateResult,
)> {
let request_merchant_id = request.merchant_id.as_ref();
- helpers::validate_merchant_id(
- platform.get_processor().get_account().get_id(),
- request_merchant_id,
- )
- .change_context(errors::ApiErrorResponse::InvalidDataFormat {
- field_name: "merchant_id".to_string(),
- expected_format: "merchant_id from merchant account".to_string(),
- })?;
+ helpers::validate_merchant_id(processor.get_account().get_id(), request_merchant_id)
+ .change_context(errors::ApiErrorResponse::InvalidDataFormat {
+ field_name: "merchant_id".to_string(),
+ expected_format: "merchant_id from merchant account".to_string(),
+ })?;
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: request.resource_id.clone(),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs
index a9bbc8881b..7f2daa54ea 100644
--- a/crates/router/src/core/payments/operations/payment_update.rs
+++ b/crates/router/src/core/payments/operations/payment_update.rs
@@ -1010,7 +1010,7 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(PaymentUpdateOperation<'b, F>, operations::ValidateResult)> {
helpers::validate_customer_information(request)?;
@@ -1026,14 +1026,11 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
.ok_or(report!(errors::ApiErrorResponse::PaymentNotFound))?;
let request_merchant_id = request.merchant_id.as_ref();
- helpers::validate_merchant_id(
- platform.get_processor().get_account().get_id(),
- request_merchant_id,
- )
- .change_context(errors::ApiErrorResponse::InvalidDataFormat {
- field_name: "merchant_id".to_string(),
- expected_format: "merchant_id from merchant account".to_string(),
- })?;
+ helpers::validate_merchant_id(processor.get_account().get_id(), request_merchant_id)
+ .change_context(errors::ApiErrorResponse::InvalidDataFormat {
+ field_name: "merchant_id".to_string(),
+ expected_format: "merchant_id from merchant account".to_string(),
+ })?;
helpers::validate_request_amount_and_amount_to_capture(
request.amount,
@@ -1067,9 +1064,9 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsRequest, PaymentDat
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id,
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: matches!(
request.retry_action,
Some(api_models::enums::RetryAction::Requeue)
diff --git a/crates/router/src/core/payments/operations/payment_update_metadata.rs b/crates/router/src/core/payments/operations/payment_update_metadata.rs
index 07940cf803..fbc6376e98 100644
--- a/crates/router/src/core/payments/operations/payment_update_metadata.rs
+++ b/crates/router/src/core/payments/operations/payment_update_metadata.rs
@@ -266,7 +266,7 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsUpdateMetadataReque
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsUpdateMetadataRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(
PaymentUpdateMetadataOperation<'b, F>,
operations::ValidateResult,
@@ -277,9 +277,9 @@ impl<F: Send + Clone + Sync> ValidateRequest<F, api::PaymentsUpdateMetadataReque
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(given_payment_id),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payments_extend_authorization.rs b/crates/router/src/core/payments/operations/payments_extend_authorization.rs
index adb3ca5de1..06bef42a18 100644
--- a/crates/router/src/core/payments/operations/payments_extend_authorization.rs
+++ b/crates/router/src/core/payments/operations/payments_extend_authorization.rs
@@ -309,7 +309,7 @@ impl<F: Send + Clone + Sync>
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsExtendAuthorizationRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(
PaymentExtendAuthorizationOperation<'b, F>,
operations::ValidateResult,
@@ -317,9 +317,9 @@ impl<F: Send + Clone + Sync>
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(request.payment_id.to_owned()),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs
index 2c06983e5f..1803fb1858 100644
--- a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs
+++ b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs
@@ -296,7 +296,7 @@ impl<F: Send + Clone + Sync>
fn validate_request<'a, 'b>(
&'b self,
request: &PaymentsIncrementalAuthorizationRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(
PaymentIncrementalAuthorizationOperation<'b, F>,
operations::ValidateResult,
@@ -304,9 +304,9 @@ impl<F: Send + Clone + Sync>
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(request.payment_id.to_owned()),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))
diff --git a/crates/router/src/core/payments/operations/tax_calculation.rs b/crates/router/src/core/payments/operations/tax_calculation.rs
index 9ae32dde05..3f3d0c0daa 100644
--- a/crates/router/src/core/payments/operations/tax_calculation.rs
+++ b/crates/router/src/core/payments/operations/tax_calculation.rs
@@ -454,7 +454,7 @@ impl<F: Send + Clone + Sync>
fn validate_request<'a, 'b>(
&'b self,
request: &api::PaymentsDynamicTaxCalculationRequest,
- platform: &'a domain::Platform,
+ processor: &'a domain::Processor,
) -> RouterResult<(
PaymentSessionUpdateOperation<'b, F>,
operations::ValidateResult,
@@ -465,9 +465,9 @@ impl<F: Send + Clone + Sync>
Ok((
Box::new(self),
operations::ValidateResult {
- merchant_id: platform.get_processor().get_account().get_id().to_owned(),
+ merchant_id: processor.get_account().get_id().to_owned(),
payment_id: api::PaymentIdType::PaymentIntentId(given_payment_id),
- storage_scheme: platform.get_processor().get_account().storage_scheme,
+ storage_scheme: processor.get_account().storage_scheme,
requeue: false,
},
))