-
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] Add card payments, psync, refunds, rsync and void flows #2728
Conversation
692d3c5
to
162a233
Compare
9b47f33
to
162a233
Compare
@@ -142,6 +142,7 @@ impl<const T: u8> | |||
} | |||
|
|||
default_imp_for_complete_authorize!( | |||
connector::Elavon, |
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.
Put all the default_imps
in Alphabetical Order
@@ -389,6 +389,7 @@ impl ConnectorData { | |||
enums::Connector::Tsys => Ok(Box::new(&connector::Tsys)), | |||
enums::Connector::Volt => Ok(Box::new(&connector::Volt)), | |||
enums::Connector::Zen => Ok(Box::new(&connector::Zen)), | |||
enums::Connector::Elavon => Ok(Box::new(&connector::Elavon)), |
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.
Put in alphabetical order
api_key="API Key" | ||
key1 = "transaction key" |
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.
If its a HeaderKey
there should not be 2 keys
headers::CONTENT_TYPE.to_string(), | ||
self.get_content_type().to_string().into(), | ||
), | ||
(headers::ACCEPT_VERSION.to_string(), "1".to_string().into()), |
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.
Declare this "1.to_string().into()"
as a constant on top
(headers::ACCEPT_VERSION.to_string(), "1".to_string().into()), | ||
( | ||
headers::ACCEPT.to_string(), | ||
"application/json;charset=UTF-8".to_string().into(), |
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.
"application/json;charset=UTF-8".to_string().into(), | |
self.get_content_type().to_string().into(), |
#[serde(rename_all = "camelCase")] | ||
pub struct ElavonCardData { | ||
holder_name: Secret<String>, | ||
number: Secret<String>, |
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.
number: Secret<String>, | |
number: cards::CardNumber, |
Ok(format!( | ||
"{}/{}/{}", | ||
self.base_url(connectors), | ||
"transactions", | ||
req.request.connector_transaction_id | ||
)) |
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.
Ok(format!( | |
"{}/{}/{}", | |
self.base_url(connectors), | |
"transactions", | |
req.request.connector_transaction_id | |
)) | |
Ok(format!( | |
"{}/transactions/{}", | |
self.base_url(connectors), | |
req.request.connector_transaction_id | |
)) |
} | ||
|
||
pub struct ElavonAuthType { | ||
pub(super) api_key: Secret<String>, |
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.
if its a BodyKey
2 key fields should be present in this struct
#[default] | ||
Unknown, |
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.
Why have we set default value to unknown?
ElavonStatus::Declined => Self::Failure, | ||
ElavonStatus::Authorized => Self::Pending, | ||
ElavonStatus::Captured => Self::Pending, | ||
ElavonStatus::Voided => Self::Failure, | ||
ElavonStatus::Settled => Self::Success, | ||
ElavonStatus::Expired => Self::Failure, | ||
ElavonStatus::SettlementDelayed => Self::Pending, | ||
ElavonStatus::Rejected => Self::Failure, | ||
ElavonStatus::HeldForReview => Self::ManualReview, | ||
ElavonStatus::Unknown => Self::Pending, // Have to get confirmation from the connector | ||
ElavonStatus::AuthorizationPending => Self::Pending, | ||
} |
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.
ElavonStatus::Declined => Self::Failure, | |
ElavonStatus::Authorized => Self::Pending, | |
ElavonStatus::Captured => Self::Pending, | |
ElavonStatus::Voided => Self::Failure, | |
ElavonStatus::Settled => Self::Success, | |
ElavonStatus::Expired => Self::Failure, | |
ElavonStatus::SettlementDelayed => Self::Pending, | |
ElavonStatus::Rejected => Self::Failure, | |
ElavonStatus::HeldForReview => Self::ManualReview, | |
ElavonStatus::Unknown => Self::Pending, // Have to get confirmation from the connector | |
ElavonStatus::AuthorizationPending => Self::Pending, | |
} | |
ElavonStatus::Declined | ElavonStatus::Voided | ElavonStatus::Expired | ElavonStatus::Rejected => Self::Failure, | |
ElavonStatus::Settled => Self::Success, | |
ElavonStatus::HeldForReview => Self::ManualReview, | |
ElavonStatus::Unknown => Self::Pending, // Have to get confirmation from the connector | |
ElavonStatus::AuthorizationPending | ElavonStatus::SettlementDelayed | ElavonStatus::Captured | ElavonStatus::Authorized => Self::Pending, | |
} |
Blocking this Pull Request as Elavon converge, no more supports REST API integration. |
I'm not sure what the API was before, but it seems they have an XML (😢) API in case that'd be possible to use: https://developer.elavon.com/products/converge/v1/xmlapi edit: ah, but perhaps it's pretty limited to only transactions, but not management? |
Connector contract changed |
Type of Change
Description
Elavon Inc., formerly NOVA, is a processor of card transactions and a subsidiary of U.S. Bancorp. Elavon offers merchant processing in more than 30 countries and supports the payment needs of more than 1,000,000 merchant locations across the globe.
Resolves #2957
Additional Changes
How did you test it?
Can't be tested as Elavon has a closed sandbox.
Checklist
cargo +nightly fmt --all
cargo clippy