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): [EFT] Add EFT as a payment method #7304

Open
wants to merge 5 commits into
base: paystack_template
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -5125,6 +5125,27 @@
"type": "object"
}
}
},
{
"type": "object",
"required": [
"eft"
],
"properties": {
"eft": {
"type": "object",
"required": [
"provider"
],
"properties": {
"provider": {
"type": "string",
"description": "The preferred eft provider",
"example": "ozow"
}
}
}
}
}
]
},
Expand Down Expand Up @@ -6988,6 +7009,7 @@
"payme",
"payone",
"paypal",
"paystack",
"payu",
"placetopay",
"powertranz",
Expand Down Expand Up @@ -14670,6 +14692,7 @@
"debit",
"duit_now",
"efecty",
"eft",
"eps",
"fps",
"evoucher",
Expand Down Expand Up @@ -19268,6 +19291,7 @@
"payme",
"payone",
"paypal",
"paystack",
"payu",
"placetopay",
"powertranz",
Expand Down
24 changes: 24 additions & 0 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -7733,6 +7733,27 @@
"type": "object"
}
}
},
{
"type": "object",
"required": [
"eft"
],
"properties": {
"eft": {
"type": "object",
"required": [
"provider"
],
"properties": {
"provider": {
"type": "string",
"description": "The preferred eft provider",
"example": "ozow"
}
}
}
}
}
]
},
Expand Down Expand Up @@ -9562,6 +9583,7 @@
"payme",
"payone",
"paypal",
"paystack",
"payu",
"placetopay",
"powertranz",
Expand Down Expand Up @@ -17618,6 +17640,7 @@
"debit",
"duit_now",
"efecty",
"eft",
"eps",
"fps",
"evoucher",
Expand Down Expand Up @@ -24362,6 +24385,7 @@
"payme",
"payone",
"paypal",
"paystack",
"payu",
"placetopay",
"powertranz",
Expand Down
2 changes: 2 additions & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
payone.base_url = "https://payment.preprod.payone.com/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
paystack.base_url = "https://api.paystack.co"
payu.base_url = "https://secure.snd.payu.com/"
placetopay.base_url = "https://test.placetopay.com/rest/gateway"
plaid.base_url = "https://sandbox.plaid.com"
Expand Down Expand Up @@ -330,6 +331,7 @@ cards = [
"mollie",
"moneris",
"paypal",
"paystack",
"shift4",
"square",
"stax",
Expand Down
1 change: 1 addition & 0 deletions config/deployments/integration_test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
payone.base_url = "https://payment.preprod.payone.com/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
paystack.base_url = "https://api.paystack.co"
payu.base_url = "https://secure.snd.payu.com/"
placetopay.base_url = "https://test.placetopay.com/rest/gateway"
plaid.base_url = "https://sandbox.plaid.com"
Expand Down
1 change: 1 addition & 0 deletions config/deployments/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ payeezy.base_url = "https://api.payeezy.com/"
payme.base_url = "https://live.payme.io/"
payone.base_url = "https://payment.payone.com/"
paypal.base_url = "https://api-m.paypal.com/"
paystack.base_url = "https://api.paystack.co"
payu.base_url = "https://secure.payu.com/api/"
placetopay.base_url = "https://checkout.placetopay.com/rest/gateway"
plaid.base_url = "https://production.plaid.com"
Expand Down
1 change: 1 addition & 0 deletions config/deployments/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
payone.base_url = "https://payment.preprod.payone.com/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
paystack.base_url = "https://api.paystack.co"
payu.base_url = "https://secure.snd.payu.com/"
placetopay.base_url = "https://test.placetopay.com/rest/gateway"
plaid.base_url = "https://sandbox.plaid.com"
Expand Down
2 changes: 2 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ cards = [
"payme",
"payone",
"paypal",
"paystack",
"payu",
"placetopay",
"plaid",
Expand Down Expand Up @@ -317,6 +318,7 @@ payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
payone.base_url = "https://payment.preprod.payone.com/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
paystack.base_url = "https://api.paystack.co"
payu.base_url = "https://secure.snd.payu.com/"
placetopay.base_url = "https://test.placetopay.com/rest/gateway"
plaid.base_url = "https://sandbox.plaid.com"
Expand Down
2 changes: 2 additions & 0 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
payone.base_url = "https://payment.preprod.payone.com/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
paystack.base_url = "https://api.paystack.co"
payu.base_url = "https://secure.snd.payu.com/"
placetopay.base_url = "https://test.placetopay.com/rest/gateway"
plaid.base_url = "https://sandbox.plaid.com"
Expand Down Expand Up @@ -279,6 +280,7 @@ cards = [
"payme",
"payone",
"paypal",
"paystack",
"payu",
"placetopay",
"plaid",
Expand Down
9 changes: 8 additions & 1 deletion crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@
pub struct MandateData {
/// A way to update the mandate's payment method details
pub update_mandate_id: Option<String>,
/// A concent from the customer to store the payment method

Check warning on line 1685 in crates/api_models/src/payments.rs

View workflow job for this annotation

GitHub Actions / Spell check

"concent" should be "consent".
pub customer_acceptance: Option<CustomerAcceptance>,
/// A way to select the type of mandate used
pub mandate_type: Option<MandateType>,
Expand Down Expand Up @@ -2518,6 +2518,7 @@
Self::BancontactCard { .. } => api_enums::PaymentMethodType::BancontactCard,
Self::Bizum {} => api_enums::PaymentMethodType::Bizum,
Self::Blik { .. } => api_enums::PaymentMethodType::Blik,
Self::Eft { .. } => api_enums::PaymentMethodType::Eft,
Self::Eps { .. } => api_enums::PaymentMethodType::Eps,
Self::Giropay { .. } => api_enums::PaymentMethodType::Giropay,
Self::Ideal { .. } => api_enums::PaymentMethodType::Ideal,
Expand Down Expand Up @@ -2894,6 +2895,11 @@
issuer: common_enums::BankNames,
},
LocalBankRedirect {},
Eft {
/// The preferred eft provider
#[schema(example = "ozow")]
provider: String,
},
}

impl GetAddressFromPaymentMethodData for BankRedirectData {
Expand Down Expand Up @@ -3009,7 +3015,8 @@
| Self::OnlineBankingPoland { .. }
| Self::OnlineBankingSlovakia { .. }
| Self::OnlineBankingCzechRepublic { .. }
| Self::Blik { .. } => None,
| Self::Blik { .. }
| Self::Eft { .. } => None,
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions crates/common_enums/src/connector_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ pub enum RoutableConnectors {
Payme,
Payone,
Paypal,
Paystack,
Payu,
Placetopay,
Powertranz,
Expand Down Expand Up @@ -249,6 +250,7 @@ pub enum Connector {
Payme,
Payone,
Paypal,
Paystack,
Payu,
Placetopay,
Powertranz,
Expand Down Expand Up @@ -394,6 +396,7 @@ impl Connector {
| Self::Payme
| Self::Payone
| Self::Paypal
| Self::Paystack
| Self::Payu
| Self::Placetopay
| Self::Powertranz
Expand Down Expand Up @@ -523,6 +526,7 @@ impl From<RoutableConnectors> for Connector {
RoutableConnectors::Payme => Self::Payme,
RoutableConnectors::Payone => Self::Payone,
RoutableConnectors::Paypal => Self::Paypal,
RoutableConnectors::Paystack => Self::Paystack,
RoutableConnectors::Payu => Self::Payu,
RoutableConnectors::Placetopay => Self::Placetopay,
RoutableConnectors::Powertranz => Self::Powertranz,
Expand Down
1 change: 1 addition & 0 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ pub enum PaymentMethodType {
Debit,
DuitNow,
Efecty,
Eft,
Eps,
Fps,
Evoucher,
Expand Down
1 change: 1 addition & 0 deletions crates/common_enums/src/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1821,6 +1821,7 @@ impl From<PaymentMethodType> for PaymentMethod {
PaymentMethodType::Debit => Self::Card,
PaymentMethodType::Fps => Self::RealTimePayment,
PaymentMethodType::DuitNow => Self::RealTimePayment,
PaymentMethodType::Eft => Self::BankRedirect,
PaymentMethodType::Eps => Self::BankRedirect,
PaymentMethodType::Evoucher => Self::Reward,
PaymentMethodType::Giropay => Self::BankRedirect,
Expand Down
2 changes: 2 additions & 0 deletions crates/connector_configs/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ pub struct ConnectorConfig {
pub paypal: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub paypal_payout: Option<ConnectorTomlConfig>,
pub paystack: Option<ConnectorTomlConfig>,
pub payu: Option<ConnectorTomlConfig>,
pub placetopay: Option<ConnectorTomlConfig>,
pub plaid: Option<ConnectorTomlConfig>,
Expand Down Expand Up @@ -377,6 +378,7 @@ impl ConnectorConfig {
Connector::Payme => Ok(connector_data.payme),
Connector::Payone => Err("Use get_payout_connector_config".to_string()),
Connector::Paypal => Ok(connector_data.paypal),
Connector::Paystack => Ok(connector_data.paystack),
Connector::Payu => Ok(connector_data.payu),
Connector::Placetopay => Ok(connector_data.placetopay),
Connector::Plaid => Ok(connector_data.plaid),
Expand Down
1 change: 1 addition & 0 deletions crates/euclid/src/frontend/dir/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ pub enum BankRedirectType {
Giropay,
Ideal,
Sofort,
Eft,
Eps,
BancontactCard,
Blik,
Expand Down
1 change: 1 addition & 0 deletions crates/euclid/src/frontend/dir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ impl From<enums::BankRedirectType> for global_enums::PaymentMethodType {
enums::BankRedirectType::Giropay => Self::Giropay,
enums::BankRedirectType::Ideal => Self::Ideal,
enums::BankRedirectType::Sofort => Self::Sofort,
enums::BankRedirectType::Eft => Self::Eft,
enums::BankRedirectType::Eps => Self::Eps,
enums::BankRedirectType::BancontactCard => Self::BancontactCard,
enums::BankRedirectType::Blik => Self::Blik,
Expand Down
1 change: 1 addition & 0 deletions crates/euclid/src/frontend/dir/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl IntoDirValue for (global_enums::PaymentMethodType, global_enums::PaymentMet
global_enums::PaymentMethodType::DirectCarrierBilling => {
Ok(dirval!(MobilePaymentType = DirectCarrierBilling))
}
global_enums::PaymentMethodType::Eft => Ok(dirval!(BankRedirectType = Eft)),
}
}
}
9 changes: 5 additions & 4 deletions crates/hyperswitch_connectors/src/connectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub mod novalnet;
pub mod nuvei;
pub mod paybox;
pub mod payeezy;
pub mod paystack;
pub mod payu;
pub mod placetopay;
pub mod powertranz;
Expand Down Expand Up @@ -80,10 +81,10 @@ pub use self::{
iatapay::Iatapay, inespay::Inespay, itaubank::Itaubank, jpmorgan::Jpmorgan, klarna::Klarna,
mifinity::Mifinity, mollie::Mollie, moneris::Moneris, multisafepay::Multisafepay,
nexinets::Nexinets, nexixpay::Nexixpay, nomupay::Nomupay, novalnet::Novalnet, nuvei::Nuvei,
paybox::Paybox, payeezy::Payeezy, payu::Payu, placetopay::Placetopay, powertranz::Powertranz,
prophetpay::Prophetpay, rapyd::Rapyd, razorpay::Razorpay, redsys::Redsys, shift4::Shift4,
square::Square, stax::Stax, taxjar::Taxjar, thunes::Thunes, tsys::Tsys,
unified_authentication_service::UnifiedAuthenticationService, volt::Volt,
paybox::Paybox, payeezy::Payeezy, paystack::Paystack, payu::Payu, placetopay::Placetopay,
powertranz::Powertranz, prophetpay::Prophetpay, rapyd::Rapyd, razorpay::Razorpay,
redsys::Redsys, shift4::Shift4, square::Square, stax::Stax, taxjar::Taxjar, thunes::Thunes,
tsys::Tsys, unified_authentication_service::UnifiedAuthenticationService, volt::Volt,
wellsfargo::Wellsfargo, worldline::Worldline, worldpay::Worldpay, xendit::Xendit, zen::Zen,
zsl::Zsl,
};
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@ impl
merchant_transaction_id: None,
customer_email: None,
})),
BankRedirectData::Eft { .. } => Self::BankRedirect(Box::new(BankRedirectionPMData {
payment_brand: PaymentBrand::Eft,
bank_account_country: Some(item.router_data.get_billing_country()?),
bank_account_bank_name: None,
bank_account_bic: None,
bank_account_iban: None,
billing_country: None,
merchant_customer_id: None,
merchant_transaction_id: None,
customer_email: None,
})),
BankRedirectData::Giropay {
bank_account_bic,
bank_account_iban,
Expand Down Expand Up @@ -326,6 +337,7 @@ pub struct WalletPMData {
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum PaymentBrand {
Eps,
Eft,
Ideal,
Giropay,
Sofortueberweisung,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ impl TryFrom<&FiuuRouterData<&PaymentsAuthorizeRouterData>> for FiuuPaymentReque
BankRedirectData::BancontactCard { .. }
| BankRedirectData::Bizum {}
| BankRedirectData::Blik { .. }
| BankRedirectData::Eft { .. }
| BankRedirectData::Eps { .. }
| BankRedirectData::Giropay { .. }
| BankRedirectData::Ideal { .. }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ impl
BankRedirectData::BancontactCard { .. }
| BankRedirectData::Bizum {}
| BankRedirectData::Blik { .. }
| BankRedirectData::Eft { .. }
| BankRedirectData::Eps { .. }
| BankRedirectData::Giropay { .. }
| BankRedirectData::Interac { .. }
Expand Down
2 changes: 2 additions & 0 deletions crates/hyperswitch_connectors/src/connectors/klarna.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
| common_enums::PaymentMethodType::Debit
| common_enums::PaymentMethodType::DirectCarrierBilling
| common_enums::PaymentMethodType::Efecty
| common_enums::PaymentMethodType::Eft
| common_enums::PaymentMethodType::Eps
| common_enums::PaymentMethodType::Evoucher
| common_enums::PaymentMethodType::Giropay
Expand Down Expand Up @@ -698,6 +699,7 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
| common_enums::PaymentMethodType::Debit
| common_enums::PaymentMethodType::DirectCarrierBilling
| common_enums::PaymentMethodType::Efecty
| common_enums::PaymentMethodType::Eft
| common_enums::PaymentMethodType::Eps
| common_enums::PaymentMethodType::Evoucher
| common_enums::PaymentMethodType::Giropay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>>
BankRedirectData::BancontactCard { .. }
| BankRedirectData::Bizum { .. }
| BankRedirectData::Blik { .. }
| BankRedirectData::Eft { .. }
| BankRedirectData::Eps { .. }
| BankRedirectData::Interac { .. }
| BankRedirectData::OnlineBankingCzechRepublic { .. }
Expand Down Expand Up @@ -590,6 +591,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>>
BankRedirectData::BancontactCard { .. }
| BankRedirectData::Bizum { .. }
| BankRedirectData::Blik { .. }
| BankRedirectData::Eft { .. }
| BankRedirectData::Eps { .. }
| BankRedirectData::Interac { .. }
| BankRedirectData::OnlineBankingCzechRepublic { .. }
Expand Down Expand Up @@ -777,6 +779,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>>
BankRedirectData::BancontactCard { .. }
| BankRedirectData::Bizum { .. }
| BankRedirectData::Blik { .. }
| BankRedirectData::Eft { .. }
| BankRedirectData::Eps { .. }
| BankRedirectData::Giropay { .. }
| BankRedirectData::Interac { .. }
Expand Down
Loading
Loading