feat(worldpay): migrate to v7 (#6109)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Kashif
2024-10-17 15:51:59 +05:30
committed by GitHub
parent df2501ceaf
commit 962afbd084
66 changed files with 1492 additions and 752 deletions

View File

@ -12,7 +12,7 @@ use common_utils::{crypto::Encryptable, pii::Email};
use common_utils::{
errors::CustomResult,
ext_traits::AsyncExt,
types::{keymanager::KeyManagerState, MinorUnit},
types::{keymanager::KeyManagerState, ConnectorTransactionIdTrait, MinorUnit},
};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::{
@ -325,6 +325,8 @@ pub async fn construct_refund_router_data<'a, F>(
field_name: "browser_info",
})?;
let connector_refund_id = refund.get_optional_connector_refund_id().cloned();
let router_data = types::RouterData {
flow: PhantomData,
merchant_id: merchant_account.get_id().clone(),
@ -349,7 +351,7 @@ pub async fn construct_refund_router_data<'a, F>(
minor_amount_captured: payment_intent.amount_captured,
request: types::RefundsData {
refund_id: refund.refund_id.clone(),
connector_transaction_id: refund.connector_transaction_id.clone(),
connector_transaction_id: refund.get_connector_transaction_id().clone(),
refund_amount: refund.refund_amount.get_amount_as_i64(),
minor_refund_amount: refund.refund_amount,
currency,
@ -358,14 +360,14 @@ pub async fn construct_refund_router_data<'a, F>(
webhook_url,
connector_metadata: payment_attempt.connector_metadata.clone(),
reason: refund.refund_reason.clone(),
connector_refund_id: refund.connector_refund_id.clone(),
connector_refund_id: connector_refund_id.clone(),
browser_info,
charges,
integrity_object: None,
},
response: Ok(types::RefundsResponseData {
connector_refund_id: refund.connector_refund_id.clone().unwrap_or_default(),
connector_refund_id: connector_refund_id.unwrap_or_default(),
refund_status: refund.refund_status,
}),
access_token: None,