Skip to content

Commit

Permalink
init-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
awasthi21 committed Nov 20, 2024
1 parent c761235 commit 89cec8b
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 5 deletions.
14 changes: 11 additions & 3 deletions crates/hyperswitch_connectors/src/connectors/elavon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use hyperswitch_domain_models::{
},
router_response_types::{PaymentsResponseData, RefundsResponseData},
types::{
PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,
RefundSyncRouterData, RefundsRouterData,
PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData,
},
};
use hyperswitch_interfaces::{
Expand Down Expand Up @@ -381,7 +381,15 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
}
}

impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Elavon {}
impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Elavon {
fn build_request(
&self,
_req: &PaymentsCancelRouterData,
_connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Err(errors::ConnectorError::NotImplemented("Cancel/Void flow".to_string()).into())
}
}

impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Elavon {
fn get_headers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ fn map_payment_status(
impl From<&ElavonPaymentsResponse> for enums::RefundStatus {
fn from(item: &ElavonPaymentsResponse) -> Self {
if item.is_successful() {
Self::Success
Self::Pending
} else {
Self::Failure
}
Expand Down
69 changes: 68 additions & 1 deletion cypress-tests/cypress/e2e/PaymentUtils/Elavon.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,23 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
status: "succeeded",
status: "pending",
},
},
},
VoidAfterConfirm: {
Request: {},
Response: {
status: 501,
body: {
error: {
type: "invalid_request",
message: "Cancel/Void flow is not implemented",
code: "IR_00"
}
}
},
},
PartialRefund: {
Request: {
payment_method: "card",
Expand Down Expand Up @@ -164,5 +177,59 @@ export const connectorDetails = {
},
},
},
PaymentMethodIdMandateNo3DSAutoCapture: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
billing: {
email: "[email protected]",
},
mandate_data: null,
customer_acceptance: {
acceptance_type: "offline",
accepted_at: "1963-05-03T04:07:52.723Z",
online: {
ip_address: "125.0.0.1",
user_agent: "amet irure esse",
},
},
},
Response: {
status: 200,
body: {
status: "succeeded",
},
},
},
PaymentMethodIdMandateNo3DSManualCapture: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
billing: {
email: "[email protected]",
},
currency: "USD",
mandate_data: null,
customer_acceptance: {
acceptance_type: "offline",
accepted_at: "1963-05-03T04:07:52.723Z",
online: {
ip_address: "125.0.0.1",
user_agent: "amet irure esse",
},
},
},
Response: {
status: 200,
body: {
status: "requires_capture",
},
},
},
},
};

0 comments on commit 89cec8b

Please sign in to comment.