fix: introduce net_amount field in payment response (#3115)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2024-01-08 19:57:37 +05:30
committed by GitHub
parent 7d43c5a736
commit 23e0c63541
13 changed files with 104 additions and 6 deletions

View File

@ -3089,8 +3089,8 @@ impl AttemptType {
error_message: None,
offer_amount: old_payment_attempt.offer_amount,
surcharge_amount: old_payment_attempt.surcharge_amount,
tax_amount: old_payment_attempt.tax_amount,
surcharge_amount: None,
tax_amount: None,
payment_method_id: None,
payment_method: None,
capture_method: old_payment_attempt.capture_method,
@ -3133,6 +3133,7 @@ impl AttemptType {
merchant_connector_id: None,
unified_code: None,
unified_message: None,
net_amount: old_payment_attempt.amount,
}
}

View File

@ -565,6 +565,7 @@ where
});
services::ApplicationResponse::JsonWithHeaders((
response
.set_net_amount(payment_attempt.net_amount)
.set_payment_id(Some(payment_attempt.payment_id))
.set_merchant_id(Some(payment_attempt.merchant_id))
.set_status(payment_intent.status)
@ -714,6 +715,7 @@ where
}
None => services::ApplicationResponse::JsonWithHeaders((
api::PaymentsResponse {
net_amount: payment_attempt.net_amount,
payment_id: Some(payment_attempt.payment_id),
merchant_id: Some(payment_attempt.merchant_id),
status: payment_intent.status,