-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(connector): [Elavon] Implement cards Flow #6485
feat(connector): [Elavon] Implement cards Flow #6485
Conversation
crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
Outdated
Show resolved
Hide resolved
crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
Outdated
Show resolved
Hide resolved
crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
Outdated
Show resolved
Hide resolved
crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
Outdated
Show resolved
Hide resolved
crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
Outdated
Show resolved
Hide resolved
pub fn parse_struct<T: DeserializeOwned>(xml_data: &[u8]) -> Result<T, errors::ConnectorError> { | ||
let response_str = str::from_utf8(xml_data) | ||
.map_err(|e| { | ||
router_env::logger::error!("Error converting response data to UTF-8: {:?}", e); | ||
errors::ConnectorError::ResponseDeserializationFailed | ||
})? | ||
.trim(); | ||
let result: T = from_str(response_str).map_err(|e| { | ||
router_env::logger::error!("Error deserializing XML response: {:?}", e); | ||
errors::ConnectorError::ResponseDeserializationFailed | ||
})?; | ||
|
||
Ok(result) | ||
} | ||
pub fn struct_to_xml<T: Serialize>( | ||
item: &T, | ||
) -> Result<HashMap<String, Secret<String, WithoutType>>, errors::ConnectorError> { | ||
let xml_content = quick_xml::se::to_string_with_root("txn", &item).map_err(|e| { | ||
router_env::logger::error!("Error serializing Struct: {:?}", e); | ||
errors::ConnectorError::ResponseDeserializationFailed | ||
})?; | ||
|
||
let mut result = HashMap::new(); | ||
result.insert( | ||
"xmldata".to_string(), | ||
Secret::<_, WithoutType>::new(xml_content), | ||
); | ||
Ok(result) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to connector utils ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved parse_struct
to the utils, but the struct_to_xml
contains some steps specific to Paybox (such as adding the root item and "xmldata".to_string())
aff742e
to
0791bf8
Compare
0791bf8
to
888ad70
Compare
| Some(SslIssuerResponse::PartialSuccess10) | ||
| Some(SslIssuerResponse::PartialSuccess11) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider transaction as successful if we get PartialSuccess10
or PartialSuccess10
in response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally not , In their docs they say Success is 00 only
Original issuer response
The issuer response returned during the authorization attempt.
An ssl_issuer_response = 00 indicates success.
An ssl_issuer_response = 85 indicates no reason to decline.
An ssl_issuer_response = 10 or 11 indicates partial success.
An ssl_issuer_response not equal to 00, 10, 11, or 85 indicates a decline or failure.
crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
Outdated
Show resolved
Hide resolved
eb6dfbe
to
970e8f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that, looks good to me!
})? | ||
.trim(); | ||
let result: T = quick_xml::de::from_str(response_str).map_err(|e| { | ||
router_env::logger::error!("Error deserializing XML response: {:?}", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a possibility of this logging sensitive information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked the response; we don’t receive any connector credentials or card details in it.
89cec8b
@awasthi21 Why refund and save card flows everything is failing? |
cfdc024
to
abafe4f
Compare
@Gnanasundari24 Some Refund flow are failing as as 3DS is not implemented |
@awasthi21 Even though its not implemented you can map the error code and error message properly |
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Type of Change
Description
Added Cards flow for Elavon (ThreeDs not implemented)
Added Mandates Flow
Void Flow is not available for Elavon
Additional Changes
Motivation and Context
Added Cards flow for Elavon
How did you test it?
Auth +Capture
Auth Only
Capture
Refunds
Psync
Checklist
cargo +nightly fmt --all
cargo clippy