Skip to content

Commit ba8ba8a

Browse files
committed
remove session_surcharge_metadata from PaymentData and pass in function
1 parent 4ac8f95 commit ba8ba8a

13 files changed

+4
-15
lines changed

crates/router/src/core/payments.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ where
214214
&operation,
215215
payment_data,
216216
&customer,
217+
None,
217218
)
218219
.await?
219220
}
@@ -791,6 +792,7 @@ where
791792
router_data_res
792793
}
793794

795+
#[allow(clippy::too_many_arguments)]
794796
pub async fn call_multiple_connectors_service<F, Op, Req, Ctx>(
795797
state: &AppState,
796798
merchant_account: &domain::MerchantAccount,
@@ -799,6 +801,7 @@ pub async fn call_multiple_connectors_service<F, Op, Req, Ctx>(
799801
_operation: &Op,
800802
mut payment_data: PaymentData<F>,
801803
customer: &Option<domain::Customer>,
804+
session_surcharge_metadata: Option<SurchargeMetadata>,
802805
) -> RouterResult<PaymentData<F>>
803806
where
804807
Op: Debug,
@@ -830,8 +833,7 @@ where
830833
false,
831834
)
832835
.await?;
833-
payment_data.surcharge_details = payment_data
834-
.session_surcharge_details
836+
payment_data.surcharge_details = session_surcharge_metadata
835837
.as_ref()
836838
.and_then(|surcharge_metadata| {
837839
surcharge_metadata.surcharge_results.get(
@@ -1477,7 +1479,6 @@ where
14771479
pub ephemeral_key: Option<ephemeral_key::EphemeralKey>,
14781480
pub redirect_response: Option<api_models::payments::RedirectResponse>,
14791481
pub surcharge_details: Option<SurchargeDetailsResponse>,
1480-
pub session_surcharge_details: Option<SurchargeMetadata>,
14811482
pub frm_message: Option<FraudCheck>,
14821483
pub payment_link_data: Option<api_models::payments::PaymentLinkResponse>,
14831484
}

crates/router/src/core/payments/operations/payment_approve.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
252252
multiple_capture_data: None,
253253
redirect_response,
254254
surcharge_details: None,
255-
session_surcharge_details: None,
256255
frm_message: frm_response.ok(),
257256
payment_link_data: None,
258257
},

crates/router/src/core/payments/operations/payment_cancel.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
172172
multiple_capture_data: None,
173173
redirect_response: None,
174174
surcharge_details: None,
175-
session_surcharge_details: None,
176175
frm_message: None,
177176
payment_link_data: None,
178177
},

crates/router/src/core/payments/operations/payment_capture.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
234234
multiple_capture_data,
235235
redirect_response: None,
236236
surcharge_details: None,
237-
session_surcharge_details: None,
238237
frm_message: None,
239238
payment_link_data: None,
240239
},

crates/router/src/core/payments/operations/payment_complete_authorize.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
247247
multiple_capture_data: None,
248248
redirect_response,
249249
surcharge_details: None,
250-
session_surcharge_details: None,
251250
frm_message: None,
252251
payment_link_data: None,
253252
},

crates/router/src/core/payments/operations/payment_confirm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
382382
multiple_capture_data: None,
383383
redirect_response: None,
384384
surcharge_details,
385-
session_surcharge_details: None,
386385
frm_message: None,
387386
payment_link_data: None,
388387
},

crates/router/src/core/payments/operations/payment_create.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
310310
multiple_capture_data: None,
311311
redirect_response: None,
312312
surcharge_details: None,
313-
session_surcharge_details: None,
314313
frm_message: None,
315314
payment_link_data,
316315
},

crates/router/src/core/payments/operations/payment_method_validate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
198198
multiple_capture_data: None,
199199
redirect_response: None,
200200
surcharge_details: None,
201-
session_surcharge_details: None,
202201
frm_message: None,
203202
payment_link_data: None,
204203
},

crates/router/src/core/payments/operations/payment_reject.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
158158
multiple_capture_data: None,
159159
redirect_response: None,
160160
surcharge_details: None,
161-
session_surcharge_details: None,
162161
frm_message: frm_response.ok(),
163162
payment_link_data: None,
164163
},

crates/router/src/core/payments/operations/payment_session.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
200200
multiple_capture_data: None,
201201
redirect_response: None,
202202
surcharge_details: None,
203-
session_surcharge_details: None,
204203
frm_message: None,
205204
payment_link_data: None,
206205
},

0 commit comments

Comments
 (0)