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(payout): [Payone] add payone connector #4553

Merged
merged 41 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b4474f4
added template code for payone
KiranKBR Apr 25, 2024
7cde54e
feat: added flows
KiranKBR May 6, 2024
c7c1247
refactored
KiranKBR May 6, 2024
b0432a0
chore: run formatter
hyperswitch-bot[bot] May 6, 2024
93c5ce0
clippy issues solved
KiranKBR May 7, 2024
4a9d2b1
resolved conflicts
KiranKBR May 7, 2024
1c4a6ac
Merge branch 'main' of https://github.com/juspay/hyperswitch into pay…
KiranKBR May 8, 2024
e772fd9
chore: run formatter
hyperswitch-bot[bot] May 8, 2024
4b55833
resolved MSRV
KiranKBR May 8, 2024
48b86b2
date functions removed
KiranKBR May 8, 2024
dca4441
Merge branch 'main' of https://github.com/juspay/hyperswitch into pay…
KiranKBR May 9, 2024
adf9868
conflicts removed
KiranKBR May 9, 2024
db1737b
MSRV error resolved
KiranKBR May 9, 2024
1b31b63
MSRV error resolved
KiranKBR May 10, 2024
d9c8711
unwrap error resolved
KiranKBR May 10, 2024
82c8fe4
Merge branch 'main' of https://github.com/juspay/hyperswitch into pay…
KiranKBR May 13, 2024
25a8001
feature config issues solved
KiranKBR May 13, 2024
15ea5e9
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] May 13, 2024
038e0c6
Merge branch 'main' of https://github.com/juspay/hyperswitch into pay…
KiranKBR May 16, 2024
88916a8
comments resolved
KiranKBR May 16, 2024
a064c45
chore: run formatter
hyperswitch-bot[bot] May 16, 2024
18540e1
Merge branch 'main' into payone-payout-flows
KiranKBR May 16, 2024
f4525cc
Merge branch 'main' of https://github.com/juspay/hyperswitch into pay…
KiranKBR May 17, 2024
3ea096a
checks resolved
KiranKBR May 17, 2024
1aa77fb
check issues solved
KiranKBR May 17, 2024
4707994
comments resolved
KiranKBR May 20, 2024
f314bea
error_mapping comments resolved
KiranKBR May 20, 2024
5bced6f
msrv test solved
KiranKBR May 20, 2024
3f722ef
comments resolved
KiranKBR May 21, 2024
b0a57b1
current date time changes
KiranKBR May 21, 2024
8c1cc08
date changes
KiranKBR May 21, 2024
c796cc0
dead code flag removed
KiranKBR May 22, 2024
8b7a35b
comments resolved
KiranKBR May 23, 2024
ce8e06f
ConnectorErrorTypeMapping for payone
KiranKBR May 23, 2024
1e5a738
Merge branch 'main' of https://github.com/juspay/hyperswitch into pay…
KiranKBR May 24, 2024
892f9df
get_formatted_date_time macro defined
KiranKBR May 27, 2024
ee125bb
moved to connector utils from common_utils
KiranKBR May 28, 2024
dc3aadc
add qualified import crate::core::errors::ConnectorError
KiranKBR May 29, 2024
1c6501e
remove qualified import
KiranKBR May 29, 2024
2b419d8
add qualified import crate::core::errors::ConnectorError
KiranKBR May 29, 2024
7b86957
add qualified import
KiranKBR May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub enum Connector {
Opennode,
// Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage
Payme,
// Payone, added as template code for future usage
Payone,
Paypal,
Payu,
Placetopay,
Expand Down Expand Up @@ -221,7 +221,7 @@ impl Connector {
| Self::Nuvei
| Self::Opennode
| Self::Payme
// | Self::Payone Added as a template code for future usage
| Self::Payone
| Self::Paypal
| Self::Payu
| Self::Placetopay
Expand Down Expand Up @@ -292,10 +292,11 @@ pub enum AuthenticationConnectors {
pub enum PayoutConnectors {
Adyen,
Stripe,
Wise,
Payone,
Paypal,
Ebanx,
Cybersource,
Wise,
}

#[cfg(feature = "payouts")]
Expand All @@ -304,10 +305,11 @@ impl From<PayoutConnectors> for RoutableConnectors {
match value {
PayoutConnectors::Adyen => Self::Adyen,
PayoutConnectors::Stripe => Self::Stripe,
PayoutConnectors::Wise => Self::Wise,
PayoutConnectors::Payone => Self::Payone,
PayoutConnectors::Paypal => Self::Paypal,
PayoutConnectors::Ebanx => Self::Ebanx,
PayoutConnectors::Cybersource => Self::Cybersource,
PayoutConnectors::Wise => Self::Wise,
}
}
}
Expand All @@ -318,10 +320,11 @@ impl From<PayoutConnectors> for Connector {
match value {
PayoutConnectors::Adyen => Self::Adyen,
PayoutConnectors::Stripe => Self::Stripe,
PayoutConnectors::Wise => Self::Wise,
PayoutConnectors::Payone => Self::Payone,
PayoutConnectors::Paypal => Self::Paypal,
PayoutConnectors::Ebanx => Self::Ebanx,
PayoutConnectors::Cybersource => Self::Cybersource,
PayoutConnectors::Wise => Self::Wise,
}
}
}
Expand All @@ -337,6 +340,7 @@ impl TryFrom<Connector> for PayoutConnectors {
Connector::Paypal => Ok(Self::Paypal),
Connector::Ebanx => Ok(Self::Ebanx),
Connector::Cybersource => Ok(Self::Cybersource),
Connector::Payone => Ok(Self::Payone),
_ => Err(format!("Invalid payout connector {}", value)),
}
}
Expand Down
4 changes: 4 additions & 0 deletions crates/connector_configs/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ pub struct ConnectorConfig {
pub noon: Option<ConnectorTomlConfig>,
pub nuvei: Option<ConnectorTomlConfig>,
pub payme: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub payone_payout: Option<ConnectorTomlConfig>,
pub paypal: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub paypal_payout: Option<ConnectorTomlConfig>,
Expand Down Expand Up @@ -227,6 +229,7 @@ impl ConnectorConfig {
PayoutConnectors::Paypal => Ok(connector_data.paypal_payout),
PayoutConnectors::Ebanx => Ok(connector_data.ebanx_payout),
PayoutConnectors::Cybersource => Ok(connector_data.cybersource_payout),
PayoutConnectors::Payone => Ok(connector_data.payone_payout),
}
}

Expand Down Expand Up @@ -282,6 +285,7 @@ impl ConnectorConfig {
Connector::Noon => Ok(connector_data.noon),
Connector::Nuvei => Ok(connector_data.nuvei),
Connector::Payme => Ok(connector_data.payme),
Connector::Payone => Err("Use get_payout_connector_config".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the difference between Ebanx and Payone? why are we throwing error here?

Connector::Paypal => Ok(connector_data.paypal),
Connector::Payu => Ok(connector_data.payu),
Connector::Placetopay => Ok(connector_data.placetopay),
Expand Down