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(connector): [Worldpayxml] update status mapping (#11749)

Mrudul Vajpayee9d818e2546b0
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs
index 057d66b3f6..36406afc9d 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs
@@ -1454,7 +1454,7 @@ fn get_attempt_status(
match last_event {
LastEvent::Authorised => {
if is_auto_capture {
- Ok(common_enums::AttemptStatus::Pending)
+ Ok(common_enums::AttemptStatus::Charged)
} else if previous_status == Some(&common_enums::AttemptStatus::CaptureInitiated)
&& !is_auto_capture
{
@@ -1498,11 +1498,10 @@ fn get_attempt_status_for_setup_mandate(
fn get_refund_status(last_event: LastEvent) -> Result<enums::RefundStatus, errors::ConnectorError> {
match last_event {
- LastEvent::Refunded => Ok(enums::RefundStatus::Success),
- LastEvent::SentForRefund
- | LastEvent::RefundRequested
- | LastEvent::SentForFastRefund
- | LastEvent::RefundedByMerchant => Ok(enums::RefundStatus::Pending),
+ LastEvent::Refunded | LastEvent::RefundedByMerchant => Ok(enums::RefundStatus::Success),
+ LastEvent::SentForRefund | LastEvent::RefundRequested | LastEvent::SentForFastRefund => {
+ Ok(enums::RefundStatus::Pending)
+ }
LastEvent::RefundFailed => Ok(enums::RefundStatus::Failure),
LastEvent::Captured | LastEvent::Settled => Ok(enums::RefundStatus::Pending),
_ => Err(errors::ConnectorError::UnexpectedResponseError(