diff --git a/crates/hyperswitch_connectors/src/connectors/elavon.rs b/crates/hyperswitch_connectors/src/connectors/elavon.rs index de86ae80398d..b236e3a604c0 100644 --- a/crates/hyperswitch_connectors/src/connectors/elavon.rs +++ b/crates/hyperswitch_connectors/src/connectors/elavon.rs @@ -263,9 +263,12 @@ impl ConnectorIntegration for Ela ) -> CustomResult, errors::ConnectorError> { Ok(Some( RequestBuilder::new() - .method(Method::Get) + .method(Method::Post) .url(&types::PaymentsSyncType::get_url(self, req, connectors)?) .attach_default_headers() + .set_body(types::PaymentsSyncType::get_request_body( + self, req, connectors, + )?) .headers(types::PaymentsSyncType::get_headers(self, req, connectors)?) .build(), )) @@ -515,7 +518,7 @@ impl ConnectorIntegration for Elavon { ) -> CustomResult, errors::ConnectorError> { Ok(Some( RequestBuilder::new() - .method(Method::Get) + .method(Method::Post) .url(&types::RefundSyncType::get_url(self, req, connectors)?) .attach_default_headers() .headers(types::RefundSyncType::get_headers(self, req, connectors)?) diff --git a/crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs b/crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs index c65176afd122..94f27ade2faf 100644 --- a/crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs @@ -52,6 +52,7 @@ pub enum TransactionType { pub enum SyncTransactionType { Sale, AuthOnly, + Return, } #[derive(Debug, Serialize)] @@ -526,7 +527,7 @@ fn map_payment_status( impl From<&ElavonPaymentsResponse> for enums::RefundStatus { fn from(item: &ElavonPaymentsResponse) -> Self { if item.is_successful() { - Self::Pending + Self::Success } else { Self::Failure } @@ -554,6 +555,7 @@ impl From<&ElavonSyncResponse> for enums::AttemptStatus { TransactionSyncStatus::STL => match item.ssl_transaction_type { SyncTransactionType::Sale => Self::Charged, SyncTransactionType::AuthOnly => Self::Authorized, + SyncTransactionType::Return => Self::Pending, }, TransactionSyncStatus::PST | TransactionSyncStatus::FPR diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Elavon.js b/cypress-tests/cypress/e2e/PaymentUtils/Elavon.js index 41993f5e16dc..f613dd97c571 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Elavon.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Elavon.js @@ -128,7 +128,7 @@ export const connectorDetails = { Response: { status: 200, body: { - status: "pending", + status: "succeeded", }, }, },