Skip to content

Commit

Permalink
feat(connector): [Adyen] implement Atome for Adyen (#1590)
Browse files Browse the repository at this point in the history
Co-authored-by: Sangamesh Kulkarni <[email protected]>
Co-authored-by: Arjun Karthik <[email protected]>
  • Loading branch information
3 people authored Jul 20, 2023
1 parent 8e45e73 commit 3c5d725
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,10 @@ payout_eligibility = true # Defaults the eligibility of a payout method to tru
online_banking_fpx = {country = "MY", currency = "MYR"}
online_banking_thailand = {country = "TH", currency = "THB"}
touch_n_go = {country = "MY", currency = "MYR"}
atome = {country = "MY,SG", currency = "MYR,SGD"}

[bank_config.online_banking_fpx]
adyen.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,may_bank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"

[bank_config.online_banking_thailand]
adyen.banks = "bangkok_bank,krungsri_bank,krung_thai_bank,the_siam_commercial_bank,kasikorn_bank"
adyen.banks = "bangkok_bank,krungsri_bank,krung_thai_bank,the_siam_commercial_bank,kasikorn_bank"
1 change: 1 addition & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ gcash = {country = "PH", currency = "PHP"}
online_banking_fpx = {country = "MY", currency = "MYR"}
online_banking_thailand = {country = "TH", currency = "THB"}
touch_n_go = {country = "MY", currency = "MYR"}
atome = {country = "MY,SG", currency = "MYR,SGD"}

[pm_filters.braintree]
paypal = { currency = "AUD,BRL,CAD,CNY,CZK,DKK,EUR,HKD,HUF,ILS,JPY,MYR,MXN,TWD,NZD,NOK,PHP,PLN,GBP,RUB,SGD,SEK,CHF,THB,USD" }
Expand Down
3 changes: 2 additions & 1 deletion config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ payout_eligibility = true
online_banking_fpx = {country = "MY", currency = "MYR"}
online_banking_thailand = {country = "TH", currency = "THB"}
touch_n_go = {country = "MY", currency = "MYR"}
atome = {country = "MY,SG", currency = "MYR,SGD"}

[bank_config.online_banking_fpx]
adyen.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,may_bank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"

[bank_config.online_banking_thailand]
adyen.banks = "bangkok_bank,krungsri_bank,krung_thai_bank,the_siam_commercial_bank,kasikorn_bank"
adyen.banks = "bangkok_bank,krungsri_bank,krung_thai_bank,the_siam_commercial_bank,kasikorn_bank"
1 change: 1 addition & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ pub enum PayLaterData {
WalleyRedirect {},
/// For Alma Redirection as PayLater Option
AlmaRedirect {},
AtomeRedirect {},
}

#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]
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 @@ -559,6 +559,7 @@ pub enum PaymentMethodType {
AliPayHk,
Alma,
ApplePay,
Atome,
Bacs,
BancontactCard,
Becs,
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 @@ -1586,6 +1586,7 @@ impl From<PaymentMethodType> for PaymentMethod {
PaymentMethodType::Walley => Self::PayLater,
PaymentMethodType::WeChatPay => Self::Wallet,
PaymentMethodType::TouchNGo => Self::Wallet,
PaymentMethodType::Atome => Self::PayLater,
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions crates/router/src/connector/adyen/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ pub enum AdyenPaymentMethod<'a> {
AliPay(Box<AliPayData>),
AliPayHk(Box<AliPayHkData>),
ApplePay(Box<AdyenApplePay>),
#[serde(rename = "atome")]
Atome(Box<AtomeData>),
BancontactCard(Box<BancontactCardData>),
Bizum(Box<BankRedirectionPMData>),
Blik(Box<BlikRedirectionData>),
Expand Down Expand Up @@ -788,6 +790,9 @@ pub struct VippsWalletData {
payment_type: PaymentType,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AtomeData {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AdyenPayLaterData {
#[serde(rename = "type")]
Expand Down Expand Up @@ -832,6 +837,7 @@ pub enum PaymentType {
Alma,
Applepay,
Bizum,
Atome,
Blik,
ClearPay,
Dana,
Expand Down Expand Up @@ -1506,6 +1512,9 @@ impl<'a> TryFrom<(&api::PayLaterData, Option<api_enums::CountryAlpha2>)>
payment_type: PaymentType::Alma,
})),
),
api_models::payments::PayLaterData::AtomeRedirect { .. } => {
Ok(AdyenPaymentMethod::Atome(Box::new(AtomeData {})))
}
_ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()),
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/router/src/types/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ impl ForeignFrom<api_enums::PaymentMethodType> for api_enums::PaymentMethod {
| api_enums::PaymentMethodType::AfterpayClearpay
| api_enums::PaymentMethodType::Klarna
| api_enums::PaymentMethodType::PayBright
| api_enums::PaymentMethodType::Atome
| api_enums::PaymentMethodType::Walley => Self::PayLater,
api_enums::PaymentMethodType::Giropay
| api_enums::PaymentMethodType::Ideal
Expand Down
12 changes: 12 additions & 0 deletions openapi/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -6545,6 +6545,17 @@
"description": "For Alma Redirection as PayLater Option"
}
}
},
{
"type": "object",
"required": [
"atome_redirect"
],
"properties": {
"atome_redirect": {
"type": "object"
}
}
}
]
},
Expand Down Expand Up @@ -7188,6 +7199,7 @@
"ali_pay_hk",
"alma",
"apple_pay",
"atome",
"bacs",
"bancontact_card",
"becs",
Expand Down

0 comments on commit 3c5d725

Please sign in to comment.