mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(connector): [Adyen] implement Momo for Adyen (#1583)
Co-authored-by: Sangamesh Kulkarni <59434228+Sangamesh26@users.noreply.github.com>
This commit is contained in:
@ -246,6 +246,7 @@ bizum = {country = "ES", currency = "EUR"}
|
||||
go_pay = {country = "ID", currency = "IDR"}
|
||||
kakao_pay = {country = "KR", currency = "KRW"}
|
||||
gcash = {country = "PH", currency = "PHP"}
|
||||
momo = {country = "VN", currency = "VND"}
|
||||
|
||||
[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" }
|
||||
|
||||
@ -952,6 +952,8 @@ pub enum WalletData {
|
||||
AliPayRedirect(AliPayRedirection),
|
||||
/// The wallet data for Ali Pay HK redirect
|
||||
AliPayHkRedirect(AliPayHkRedirection),
|
||||
/// The wallet data for Momo redirect
|
||||
MomoRedirect(MomoRedirection),
|
||||
/// The wallet data for KakaoPay redirect
|
||||
KakaoPayRedirect(KakaoPayRedirection),
|
||||
/// The wallet data for GoPay redirect
|
||||
@ -1046,6 +1048,9 @@ pub struct AliPayRedirection {}
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct AliPayHkRedirection {}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct MomoRedirection {}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct KakaoPayRedirection {}
|
||||
|
||||
|
||||
@ -270,6 +270,7 @@ pub enum Currency {
|
||||
USD,
|
||||
UYU,
|
||||
UZS,
|
||||
VND,
|
||||
YER,
|
||||
ZAR,
|
||||
}
|
||||
@ -381,6 +382,7 @@ impl Currency {
|
||||
Self::USD => "840",
|
||||
Self::UYU => "858",
|
||||
Self::UZS => "860",
|
||||
Self::VND => "704",
|
||||
Self::YER => "886",
|
||||
Self::ZAR => "710",
|
||||
}
|
||||
@ -578,6 +580,7 @@ pub enum PaymentMethodType {
|
||||
KakaoPay,
|
||||
MbWay,
|
||||
MobilePay,
|
||||
Momo,
|
||||
Multibanco,
|
||||
OnlineBankingCzechRepublic,
|
||||
OnlineBankingFinland,
|
||||
|
||||
@ -1561,6 +1561,7 @@ impl From<PaymentMethodType> for PaymentMethod {
|
||||
PaymentMethodType::KakaoPay => Self::Wallet,
|
||||
PaymentMethodType::MbWay => Self::Wallet,
|
||||
PaymentMethodType::MobilePay => Self::Wallet,
|
||||
PaymentMethodType::Momo => Self::Wallet,
|
||||
PaymentMethodType::Multibanco => Self::BankTransfer,
|
||||
PaymentMethodType::Interac => Self::BankRedirect,
|
||||
PaymentMethodType::OnlineBankingCzechRepublic => Self::BankRedirect,
|
||||
|
||||
@ -295,6 +295,8 @@ pub enum AdyenPaymentMethod<'a> {
|
||||
Mandate(Box<AdyenMandate>),
|
||||
Mbway(Box<MbwayData>),
|
||||
MobilePay(Box<MobilePayData>),
|
||||
#[serde(rename = "momo_wallet")]
|
||||
Momo(Box<MomoData>),
|
||||
OnlineBankingCzechRepublic(Box<OnlineBankingCzechRepublicData>),
|
||||
OnlineBankingFinland(Box<OnlineBankingFinlandData>),
|
||||
OnlineBankingPoland(Box<OnlineBankingPolandData>),
|
||||
@ -653,6 +655,9 @@ pub struct KakaoPayData {}
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct GcashData {}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MomoData {}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct AdyenGPay {
|
||||
#[serde(rename = "type")]
|
||||
@ -735,6 +740,8 @@ pub enum PaymentType {
|
||||
Kakaopay,
|
||||
Mbway,
|
||||
MobilePay,
|
||||
#[serde(rename = "momo_wallet")]
|
||||
Momo,
|
||||
#[serde(rename = "onlineBanking_CZ")]
|
||||
OnlineBankingCzechRepublic,
|
||||
#[serde(rename = "ebanking_FI")]
|
||||
@ -1218,6 +1225,10 @@ impl<'a> TryFrom<&api::WalletData> for AdyenPaymentMethod<'a> {
|
||||
let gcash_data = GcashData {};
|
||||
Ok(AdyenPaymentMethod::Gcash(Box::new(gcash_data)))
|
||||
}
|
||||
api_models::payments::WalletData::MomoRedirect(_) => {
|
||||
let momo_data = MomoData {};
|
||||
Ok(AdyenPaymentMethod::Momo(Box::new(momo_data)))
|
||||
}
|
||||
api_models::payments::WalletData::MbWayRedirect(data) => {
|
||||
let mbway_data = MbwayData {
|
||||
payment_type: PaymentType::Mbway,
|
||||
|
||||
@ -170,6 +170,7 @@ Never share your secret api keys. Keep them guarded and secure.
|
||||
api_models::payments::BankDebitData,
|
||||
api_models::payments::AliPayQr,
|
||||
api_models::payments::AliPayRedirection,
|
||||
api_models::payments::MomoRedirection,
|
||||
api_models::payments::GcashRedirection,
|
||||
api_models::payments::KakaoPayRedirection,
|
||||
api_models::payments::AliPayHkRedirection,
|
||||
|
||||
@ -179,6 +179,7 @@ impl ForeignFrom<api_enums::PaymentMethodType> for api_enums::PaymentMethod {
|
||||
| api_enums::PaymentMethodType::WeChatPay
|
||||
| api_enums::PaymentMethodType::GoPay
|
||||
| api_enums::PaymentMethodType::Gcash
|
||||
| api_enums::PaymentMethodType::Momo
|
||||
| api_enums::PaymentMethodType::KakaoPay => Self::Wallet,
|
||||
api_enums::PaymentMethodType::Affirm
|
||||
| api_enums::PaymentMethodType::AfterpayClearpay
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
SELECT 1;
|
||||
@ -0,0 +1,2 @@
|
||||
-- Your SQL goes here
|
||||
ALTER TYPE "Currency" ADD VALUE IF NOT EXISTS 'VND' AFTER 'UZS';
|
||||
@ -3607,6 +3607,7 @@
|
||||
"USD",
|
||||
"UYU",
|
||||
"UZS",
|
||||
"VND",
|
||||
"YER",
|
||||
"ZAR"
|
||||
]
|
||||
@ -5775,6 +5776,9 @@
|
||||
"MobilePayRedirection": {
|
||||
"type": "object"
|
||||
},
|
||||
"MomoRedirection": {
|
||||
"type": "object"
|
||||
},
|
||||
"MultibancoBillingDetails": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@ -6824,6 +6828,7 @@
|
||||
"kakao_pay",
|
||||
"mb_way",
|
||||
"mobile_pay",
|
||||
"momo",
|
||||
"multibanco",
|
||||
"online_banking_czech_republic",
|
||||
"online_banking_finland",
|
||||
@ -8925,6 +8930,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"momo_redirect"
|
||||
],
|
||||
"properties": {
|
||||
"momo_redirect": {
|
||||
"$ref": "#/components/schemas/MomoRedirection"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
Reference in New Issue
Block a user