Skip to content
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

Closed
wants to merge 20 commits into from

Conversation

AkshayaFoiger
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

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

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

How did you test it?

Can't be tested as Elavon has a closed sandbox.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@AkshayaFoiger AkshayaFoiger added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Oct 30, 2023
@AkshayaFoiger AkshayaFoiger self-assigned this Oct 30, 2023
@AkshayaFoiger AkshayaFoiger requested review from a team as code owners October 30, 2023 07:07
@AkshayaFoiger AkshayaFoiger requested a review from a team as a November 2, 2023 08:13
Base automatically changed from update/request_body to main November 8, 2023 10:38
@AkshayaFoiger AkshayaFoiger added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Nov 17, 2023
@@ -142,6 +142,7 @@ impl<const T: u8>
}

default_imp_for_complete_authorize!(
connector::Elavon,
Copy link
Contributor

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)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put in alphabetical order

Comment on lines +195 to +196
api_key="API Key"
key1 = "transaction key"
Copy link
Contributor

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()),
Copy link
Contributor

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(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
number: Secret<String>,
number: cards::CardNumber,

Comment on lines +341 to +346
Ok(format!(
"{}/{}/{}",
self.base_url(connectors),
"transactions",
req.request.connector_transaction_id
))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>,
Copy link
Contributor

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

Comment on lines +208 to +209
#[default]
Unknown,
Copy link
Contributor

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?

Comment on lines +293 to +304
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,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
}

@AkshayaFoiger AkshayaFoiger added S-blocked Status: Blocked on something else or other implementation work and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 30, 2023
@AkshayaFoiger
Copy link
Contributor Author

AkshayaFoiger commented Nov 30, 2023

Blocking this Pull Request as Elavon converge, no more supports REST API integration.

@JacobHayes
Copy link

JacobHayes commented Jan 9, 2024

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?

@AkshayaFoiger
Copy link
Contributor Author

Connector contract changed

@SanchithHegde SanchithHegde deleted the connector/Elavon branch June 2, 2024 17:57
@SanchithHegde SanchithHegde removed the S-blocked Status: Blocked on something else or other implementation work label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants