feat(connector): [Adyen] implement Kakao for Adyen (#1558)

Co-authored-by: Sangamesh Kulkarni <59434228+Sangamesh26@users.noreply.github.com>
This commit is contained in:
AkshayaFoiger
2023-07-18 14:13:08 +05:30
committed by GitHub
parent ee1f6ccb4c
commit 11ad9beda8
8 changed files with 37 additions and 2 deletions

View File

@ -243,6 +243,8 @@ bacs = {country = "UK", currency = "GBP"}
sepa = {country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR"} sepa = {country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR"}
ali_pay_hk = {country = "HK", currency = "HKD"} ali_pay_hk = {country = "HK", currency = "HKD"}
bizum = {country = "ES", currency = "EUR"} bizum = {country = "ES", currency = "EUR"}
go_pay = {country = "ID", currency = "IDR"}
kakao_pay = {country = "KR", currency = "KRW"}
[pm_filters.braintree] [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" } 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" }

View File

@ -952,6 +952,8 @@ pub enum WalletData {
AliPayRedirect(AliPayRedirection), AliPayRedirect(AliPayRedirection),
/// The wallet data for Ali Pay HK redirect /// The wallet data for Ali Pay HK redirect
AliPayHkRedirect(AliPayHkRedirection), AliPayHkRedirect(AliPayHkRedirection),
/// The wallet data for KakaoPay redirect
KakaoPayRedirect(KakaoPayRedirection),
/// The wallet data for GoPay redirect /// The wallet data for GoPay redirect
GoPayRedirect(GoPayRedirection), GoPayRedirect(GoPayRedirection),
/// The wallet data for Apple pay /// The wallet data for Apple pay
@ -1040,6 +1042,9 @@ pub struct AliPayRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)] #[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct AliPayHkRedirection {} pub struct AliPayHkRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct KakaoPayRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)] #[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct GoPayRedirection {} pub struct GoPayRedirection {}

View File

@ -574,6 +574,7 @@ pub enum PaymentMethodType {
Ideal, Ideal,
Interac, Interac,
Klarna, Klarna,
KakaoPay,
MbWay, MbWay,
MobilePay, MobilePay,
Multibanco, Multibanco,

View File

@ -1557,6 +1557,7 @@ impl From<PaymentMethodType> for PaymentMethod {
PaymentMethodType::GoPay => Self::Wallet, PaymentMethodType::GoPay => Self::Wallet,
PaymentMethodType::Ideal => Self::BankRedirect, PaymentMethodType::Ideal => Self::BankRedirect,
PaymentMethodType::Klarna => Self::PayLater, PaymentMethodType::Klarna => Self::PayLater,
PaymentMethodType::KakaoPay => Self::Wallet,
PaymentMethodType::MbWay => Self::Wallet, PaymentMethodType::MbWay => Self::Wallet,
PaymentMethodType::MobilePay => Self::Wallet, PaymentMethodType::MobilePay => Self::Wallet,
PaymentMethodType::Multibanco => Self::BankTransfer, PaymentMethodType::Multibanco => Self::BankTransfer,

View File

@ -288,6 +288,7 @@ pub enum AdyenPaymentMethod<'a> {
#[serde(rename = "gopay_wallet")] #[serde(rename = "gopay_wallet")]
GoPay(Box<GoPayData>), GoPay(Box<GoPayData>),
Ideal(Box<BankRedirectionWithIssuer<'a>>), Ideal(Box<BankRedirectionWithIssuer<'a>>),
Kakaopay(Box<KakaoPayData>),
Mandate(Box<AdyenMandate>), Mandate(Box<AdyenMandate>),
Mbway(Box<MbwayData>), Mbway(Box<MbwayData>),
MobilePay(Box<MobilePayData>), MobilePay(Box<MobilePayData>),
@ -643,6 +644,9 @@ pub struct AliPayHkData {
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GoPayData {} pub struct GoPayData {}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct KakaoPayData {}
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AdyenGPay { pub struct AdyenGPay {
#[serde(rename = "type")] #[serde(rename = "type")]
@ -715,6 +719,7 @@ pub enum PaymentType {
GoPay, GoPay,
Ideal, Ideal,
Klarna, Klarna,
Kakaopay,
Mbway, Mbway,
MobilePay, MobilePay,
#[serde(rename = "onlineBanking_CZ")] #[serde(rename = "onlineBanking_CZ")]
@ -1191,6 +1196,10 @@ impl<'a> TryFrom<&api::WalletData> for AdyenPaymentMethod<'a> {
let go_pay_data = GoPayData {}; let go_pay_data = GoPayData {};
Ok(AdyenPaymentMethod::GoPay(Box::new(go_pay_data))) Ok(AdyenPaymentMethod::GoPay(Box::new(go_pay_data)))
} }
api_models::payments::WalletData::KakaoPayRedirect(_) => {
let kakao_pay_data = KakaoPayData {};
Ok(AdyenPaymentMethod::Kakaopay(Box::new(kakao_pay_data)))
}
api_models::payments::WalletData::MbWayRedirect(data) => { api_models::payments::WalletData::MbWayRedirect(data) => {
let mbway_data = MbwayData { let mbway_data = MbwayData {
payment_type: PaymentType::Mbway, payment_type: PaymentType::Mbway,
@ -1685,7 +1694,7 @@ impl<'a> TryFrom<(&types::PaymentsAuthorizeRouterData, &api::WalletData)>
let channel = get_channel_type(&item.request.payment_method_type); let channel = get_channel_type(&item.request.payment_method_type);
let (recurring_processing_model, store_payment_method, shopper_reference) = let (recurring_processing_model, store_payment_method, shopper_reference) =
get_recurring_processing_model(item)?; get_recurring_processing_model(item)?;
let return_url = item.request.get_return_url()?; let return_url = item.request.get_router_return_url()?;
let shopper_email = get_shopper_email(&item.request, store_payment_method.is_some())?; let shopper_email = get_shopper_email(&item.request, store_payment_method.is_some())?;
Ok(AdyenPaymentRequest { Ok(AdyenPaymentRequest {
amount, amount,

View File

@ -170,6 +170,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::BankDebitData, api_models::payments::BankDebitData,
api_models::payments::AliPayQr, api_models::payments::AliPayQr,
api_models::payments::AliPayRedirection, api_models::payments::AliPayRedirection,
api_models::payments::KakaoPayRedirection,
api_models::payments::AliPayHkRedirection, api_models::payments::AliPayHkRedirection,
api_models::payments::GoPayRedirection, api_models::payments::GoPayRedirection,
api_models::payments::MbWayRedirection, api_models::payments::MbWayRedirection,

View File

@ -176,7 +176,8 @@ impl ForeignFrom<api_enums::PaymentMethodType> for api_enums::PaymentMethod {
| api_enums::PaymentMethodType::SamsungPay | api_enums::PaymentMethodType::SamsungPay
| api_enums::PaymentMethodType::Twint | api_enums::PaymentMethodType::Twint
| api_enums::PaymentMethodType::WeChatPay | api_enums::PaymentMethodType::WeChatPay
| api_enums::PaymentMethodType::GoPay => Self::Wallet, | api_enums::PaymentMethodType::GoPay
| api_enums::PaymentMethodType::KakaoPay => Self::Wallet,
api_enums::PaymentMethodType::Affirm api_enums::PaymentMethodType::Affirm
| api_enums::PaymentMethodType::AfterpayClearpay | api_enums::PaymentMethodType::AfterpayClearpay
| api_enums::PaymentMethodType::Klarna | api_enums::PaymentMethodType::Klarna

View File

@ -4627,6 +4627,9 @@
"requires_capture" "requires_capture"
] ]
}, },
"KakaoPayRedirection": {
"type": "object"
},
"KlarnaSessionTokenResponse": { "KlarnaSessionTokenResponse": {
"type": "object", "type": "object",
"required": [ "required": [
@ -6809,6 +6812,7 @@
"ideal", "ideal",
"interac", "interac",
"klarna", "klarna",
"kakao_pay",
"mb_way", "mb_way",
"mobile_pay", "mobile_pay",
"multibanco", "multibanco",
@ -8911,6 +8915,17 @@
} }
} }
}, },
{
"type": "object",
"required": [
"kakao_pay_redirect"
],
"properties": {
"kakao_pay_redirect": {
"$ref": "#/components/schemas/KakaoPayRedirection"
}
}
},
{ {
"type": "object", "type": "object",
"required": [ "required": [