mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
fix(connector): [adyen] production endpoints and mappings (#3900)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: AkshayaFoiger <akshaya.shankar@juspay.in>
This commit is contained in:
@ -410,6 +410,10 @@ afterpay_clearpay = { fields = { stripe = [ # payment_method_type = afterpay_cle
|
||||
payout_eligibility = true # Defaults the eligibility of a payout method to true in case connector does not provide checks for payout eligibility
|
||||
|
||||
[pm_filters.adyen]
|
||||
sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
|
||||
paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" }
|
||||
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD"}
|
||||
ideal = { country = "NL", currency = "EUR" }
|
||||
online_banking_fpx = { country = "MY", currency = "MYR" }
|
||||
online_banking_thailand = { country = "TH", currency = "THB" }
|
||||
touch_n_go = { country = "MY", currency = "MYR" }
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[bank_config]
|
||||
eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_tirol_bank_ag,posojilnica_bank_e_gen,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag"
|
||||
eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau"
|
||||
ideal.adyen.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot"
|
||||
ideal.adyen.banks = "abn_amro,asn_bank,bunq,ing,knab,n26,nationale_nederlanden,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot,yoursafe"
|
||||
ideal.stripe.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot"
|
||||
online_banking_czech_republic.adyen.banks = "ceska_sporitelna,komercni_banka,platnosc_online_karta_platnicza"
|
||||
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,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"
|
||||
@ -174,7 +174,7 @@ google_pay = { country = "AU,NZ,JP,HK,SG,MY,TH,VN,BH,AE,KW,BR,ES,GB,SE,NO,SK,AT,
|
||||
ideal = { country = "NL", currency = "EUR" }
|
||||
indomaret = { country = "ID", currency = "IDR" }
|
||||
kakao_pay = { country = "KR", currency = "KRW" }
|
||||
klarna = { country = "AT,ES,GB,SE,NO,AT,NL,DE,CH,BE,FR,DK,FI,PT,IE,IT,PL,CA,US", currency = "USD,GBP,EUR,CHF,DKK,SEK,NOK,AUD,PLN,CAD" }
|
||||
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD"}
|
||||
lawson = { country = "JP", currency = "JPY" }
|
||||
mandiri_va = { country = "ID", currency = "IDR" }
|
||||
mb_way = { country = "PT", currency = "EUR" }
|
||||
@ -193,12 +193,13 @@ oxxo = { country = "MX", currency = "MXN" }
|
||||
pay_bright = { country = "CA", currency = "CAD" }
|
||||
pay_easy = { country = "JP", currency = "JPY" }
|
||||
pay_safe_card = { country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,AE,GB,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU" }
|
||||
paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" }
|
||||
permata_bank_transfer = { country = "ID", currency = "IDR" }
|
||||
seicomart = { country = "JP", currency = "JPY" }
|
||||
sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR" }
|
||||
seven_eleven = { country = "JP", currency = "JPY" }
|
||||
sofort = { country = "ES,GB,SE,AT,NL,DE,CH,BE,FR,FI,IT,PL", currency = "EUR" }
|
||||
sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
|
||||
paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" }
|
||||
|
||||
swish = { country = "SE", currency = "SEK" }
|
||||
touch_n_go = { country = "MY", currency = "MYR" }
|
||||
trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" }
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[bank_config]
|
||||
eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_tirol_bank_ag,posojilnica_bank_e_gen,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag"
|
||||
eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau"
|
||||
ideal.adyen.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot"
|
||||
ideal.adyen.banks = "abn_amro,asn_bank,bunq,ing,knab,n26,nationale_nederlanden,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot,yoursafe"
|
||||
ideal.stripe.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot"
|
||||
online_banking_czech_republic.adyen.banks = "ceska_sporitelna,komercni_banka,platnosc_online_karta_platnicza"
|
||||
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,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"
|
||||
@ -17,8 +17,8 @@ payout_connector_list = "wise"
|
||||
|
||||
[connectors]
|
||||
aci.base_url = "https://eu-test.oppwa.com/"
|
||||
adyen.base_url = "https://checkout-test.adyen.com/"
|
||||
adyen.secondary_base_url = "https://pal-test.adyen.com/"
|
||||
adyen.base_url = "https://{{merchant_endpoint_prefix}}-checkout-live.adyenpayments.com/"
|
||||
adyen.secondary_base_url = "https://{{merchant_endpoint_prefix}}-pal-live.adyenpayments.com/"
|
||||
airwallex.base_url = "https://api-demo.airwallex.com/"
|
||||
applepay.base_url = "https://apple-pay-gateway.apple.com/"
|
||||
authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api"
|
||||
@ -189,7 +189,7 @@ google_pay = { country = "AE,AG,AL,AO,AR,AS,AT,AU,AZ,BE,BG,BH,BR,BY,CA,CH,CL,CO,
|
||||
ideal = { country = "NL", currency = "EUR" }
|
||||
indomaret = { country = "ID", currency = "IDR" }
|
||||
kakao_pay = { country = "KR", currency = "KRW" }
|
||||
klarna = { country = "AT,BE,CA,CH,DE,DK,ES,FI,FR,GB,IE,IT,NL,NO,PL,PT,SE,GB,US", currency = "AUD,CAD,CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD" }
|
||||
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD"}
|
||||
lawson = { country = "JP", currency = "JPY" }
|
||||
mandiri_va = { country = "ID", currency = "IDR" }
|
||||
mb_way = { country = "PT", currency = "EUR" }
|
||||
@ -213,7 +213,7 @@ permata_bank_transfer = { country = "ID", currency = "IDR" }
|
||||
seicomart = { country = "JP", currency = "JPY" }
|
||||
sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR" }
|
||||
seven_eleven = { country = "JP", currency = "JPY" }
|
||||
sofort = { country = "AT,BE,CH,DE,ES,FI,FR,GB,IT,NL,PL,SE,GB", currency = "EUR" }
|
||||
sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
|
||||
swish = { country = "SE", currency = "SEK" }
|
||||
touch_n_go = { country = "MY", currency = "MYR" }
|
||||
trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" }
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[bank_config]
|
||||
eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_tirol_bank_ag,posojilnica_bank_e_gen,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag"
|
||||
eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau"
|
||||
ideal.adyen.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot"
|
||||
ideal.adyen.banks = "abn_amro,asn_bank,bunq,ing,knab,n26,nationale_nederlanden,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot,yoursafe"
|
||||
ideal.stripe.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot"
|
||||
online_banking_czech_republic.adyen.banks = "ceska_sporitelna,komercni_banka,platnosc_online_karta_platnicza"
|
||||
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,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"
|
||||
@ -189,7 +189,7 @@ google_pay = { country = "AU,NZ,JP,HK,SG,MY,TH,VN,BH,AE,KW,BR,ES,GB,SE,NO,SK,AT,
|
||||
ideal = { country = "NL", currency = "EUR" }
|
||||
indomaret = { country = "ID", currency = "IDR" }
|
||||
kakao_pay = { country = "KR", currency = "KRW" }
|
||||
klarna = { country = "AT,ES,GB,SE,NO,AT,NL,DE,CH,BE,FR,DK,FI,PT,IE,IT,PL,CA,US", currency = "USD,GBP,EUR,CHF,DKK,SEK,NOK,AUD,PLN,CAD" }
|
||||
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD"}
|
||||
lawson = { country = "JP", currency = "JPY" }
|
||||
mandiri_va = { country = "ID", currency = "IDR" }
|
||||
mb_way = { country = "PT", currency = "EUR" }
|
||||
@ -213,7 +213,7 @@ permata_bank_transfer = { country = "ID", currency = "IDR" }
|
||||
seicomart = { country = "JP", currency = "JPY" }
|
||||
sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR" }
|
||||
seven_eleven = { country = "JP", currency = "JPY" }
|
||||
sofort = { country = "ES,GB,SE,AT,NL,DE,CH,BE,FR,FI,IT,PL", currency = "EUR" }
|
||||
sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
|
||||
swish = { country = "SE", currency = "SEK" }
|
||||
touch_n_go = { country = "MY", currency = "MYR" }
|
||||
trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" }
|
||||
|
||||
@ -256,7 +256,7 @@ adyen = { banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_ban
|
||||
|
||||
[bank_config.ideal]
|
||||
stripe = { banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot" }
|
||||
adyen = { banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot" }
|
||||
adyen = { banks = "abn_amro,asn_bank,bunq,ing,knab,n26,nationale_nederlanden,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot, yoursafe" }
|
||||
|
||||
[bank_config.online_banking_czech_republic]
|
||||
adyen = { banks = "ceska_sporitelna,komercni_banka,platnosc_online_karta_platnicza" }
|
||||
@ -314,14 +314,14 @@ mobile_pay = { country = "DK,FI", currency = "DKK,SEK,NOK,EUR" }
|
||||
ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" }
|
||||
we_chat_pay = { country = "AU,NZ,CN,JP,HK,SG,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,LI,MT,SI,GR,PT,IT,CA,US", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,NZD,SGD,USD" }
|
||||
mb_way = { country = "PT", currency = "EUR" }
|
||||
klarna = { country = "AT,ES,GB,SE,NO,AT,NL,DE,CH,BE,FR,DK,FI,PT,IE,IT,PL,CA,US", currency = "USD,GBP,EUR,CHF,DKK,SEK,NOK,AUD,PLN,CAD" }
|
||||
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD"}
|
||||
affirm = { country = "US", currency = "USD" }
|
||||
afterpay_clearpay = { country = "AU,NZ,ES,GB,FR,IT,CA,US", currency = "GBP" }
|
||||
pay_bright = { country = "CA", currency = "CAD" }
|
||||
walley = { country = "SE,NO,DK,FI", currency = "DKK,EUR,NOK,SEK" }
|
||||
giropay = { country = "DE", currency = "EUR" }
|
||||
eps = { country = "AT", currency = "EUR" }
|
||||
sofort = { country = "ES,GB,SE,AT,NL,DE,CH,BE,FR,FI,IT,PL", currency = "EUR" }
|
||||
sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
|
||||
ideal = { country = "NL", currency = "EUR" }
|
||||
blik = {country = "PL", currency = "PLN"}
|
||||
trustly = {country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK"}
|
||||
|
||||
@ -306,6 +306,11 @@ family_mart = {country = "JP", currency = "JPY"}
|
||||
seicomart = {country = "JP", currency = "JPY"}
|
||||
pay_easy = {country = "JP", currency = "JPY"}
|
||||
boleto = { country = "BR", currency = "BRL" }
|
||||
ideal = { country = "NL", currency = "EUR" }
|
||||
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD"}
|
||||
paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" }
|
||||
sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
|
||||
|
||||
|
||||
[pm_filters.volt]
|
||||
open_banking_uk = {country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "EUR,GBP,DKK,NOK,PLN,SEK,AUD,BRL"}
|
||||
|
||||
@ -434,6 +434,9 @@ pub enum BankNames {
|
||||
TsbBank,
|
||||
TescoBank,
|
||||
UlsterBank,
|
||||
Yoursafe,
|
||||
N26,
|
||||
NationaleNederlanden,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
|
||||
@ -232,6 +232,8 @@ api_key="Adyen API Key"
|
||||
key1="Adyen Account Id"
|
||||
[adyen.connector_webhook_details]
|
||||
merchant_secret="Source verification key"
|
||||
[adyen.metadata]
|
||||
endpoint_prefix="Live endpoint prefix"
|
||||
[adyen.metadata.google_pay]
|
||||
merchant_name="Google Pay Merchant Name"
|
||||
gateway_merchant_id="Google Pay Merchant Key"
|
||||
@ -2546,6 +2548,8 @@ api_key="Api Key"
|
||||
payment_method_type = "sepa"
|
||||
[[adyen_payout.wallet]]
|
||||
payment_method_type = "paypal"
|
||||
[adyen_payout.metadata]
|
||||
endpoint_prefix="Live endpoint prefix"
|
||||
[adyen_payout.connector_auth.SignatureKey]
|
||||
api_key = "Adyen API Key (Payout creation)"
|
||||
api_secret = "Adyen Key (Payout submission)"
|
||||
|
||||
@ -124,6 +124,9 @@ key1="Adyen Account Id"
|
||||
[adyen.connector_webhook_details]
|
||||
merchant_secret="Source verification key"
|
||||
|
||||
[adyen.metadata]
|
||||
endpoint_prefix="Live endpoint prefix"
|
||||
|
||||
[adyen.metadata.google_pay]
|
||||
merchant_name="Google Pay Merchant Name"
|
||||
gateway_merchant_id="Google Pay Merchant Key"
|
||||
|
||||
@ -232,6 +232,8 @@ api_key="Adyen API Key"
|
||||
key1="Adyen Account Id"
|
||||
[adyen.connector_webhook_details]
|
||||
merchant_secret="Source verification key"
|
||||
[adyen.metadata]
|
||||
endpoint_prefix="Live endpoint prefix"
|
||||
[adyen.metadata.google_pay]
|
||||
merchant_name="Google Pay Merchant Name"
|
||||
gateway_merchant_id="Google Pay Merchant Key"
|
||||
@ -2548,6 +2550,8 @@ api_key="Api Key"
|
||||
payment_method_type = "sepa"
|
||||
[[adyen_payout.wallet]]
|
||||
payment_method_type = "paypal"
|
||||
[adyen_payout.metadata]
|
||||
endpoint_prefix="Live endpoint prefix"
|
||||
[adyen_payout.connector_auth.SignatureKey]
|
||||
api_key = "Adyen API Key (Payout creation)"
|
||||
api_secret = "Adyen Key (Payout submission)"
|
||||
|
||||
@ -33,6 +33,8 @@ use crate::{
|
||||
utils::{crypto, ByteSliceExt, BytesExt, OptionExt},
|
||||
};
|
||||
|
||||
const ADYEN_API_VERSION: &str = "v68";
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Adyen;
|
||||
|
||||
@ -268,6 +270,23 @@ impl
|
||||
// Not Implemented (R)
|
||||
}
|
||||
|
||||
fn build_env_specific_endpoint(
|
||||
base_url: &str,
|
||||
test_mode: Option<bool>,
|
||||
connector_metadata: &Option<common_utils::pii::SecretSerdeValue>,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
if test_mode.unwrap_or(true) {
|
||||
Ok(base_url.to_string())
|
||||
} else {
|
||||
let adyen_connector_metadata_object =
|
||||
transformers::AdyenConnectorMetadataObject::try_from(connector_metadata)?;
|
||||
Ok(base_url.replace(
|
||||
"{{merchant_endpoint_prefix}}",
|
||||
&adyen_connector_metadata_object.endpoint_prefix,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl
|
||||
services::ConnectorIntegration<
|
||||
api::SetupMandate,
|
||||
@ -293,10 +312,15 @@ impl
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
_req: &types::SetupMandateRouterData,
|
||||
req: &types::SetupMandateRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Ok(format!("{}{}", self.base_url(connectors), "v68/payments"))
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
self.base_url(connectors),
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!("{}{}/payments", endpoint, ADYEN_API_VERSION))
|
||||
}
|
||||
fn get_request_body(
|
||||
&self,
|
||||
@ -418,11 +442,15 @@ impl
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
let id = req.request.connector_transaction_id.as_str();
|
||||
Ok(format!(
|
||||
"{}{}/{}/captures",
|
||||
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
self.base_url(connectors),
|
||||
"v68/payments",
|
||||
id
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!(
|
||||
"{}{}/payments/{}/captures",
|
||||
endpoint, ADYEN_API_VERSION, id
|
||||
))
|
||||
}
|
||||
fn get_request_body(
|
||||
@ -560,13 +588,17 @@ impl
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
_req: &types::RouterData<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData>,
|
||||
req: &types::RouterData<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData>,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Ok(format!(
|
||||
"{}{}",
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
self.base_url(connectors),
|
||||
"v68/payments/details"
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!(
|
||||
"{}{}/payments/details",
|
||||
endpoint, ADYEN_API_VERSION
|
||||
))
|
||||
}
|
||||
|
||||
@ -681,10 +713,15 @@ impl
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
_req: &types::PaymentsAuthorizeRouterData,
|
||||
req: &types::PaymentsAuthorizeRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Ok(format!("{}{}", self.base_url(connectors), "v68/payments"))
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
self.base_url(connectors),
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!("{}{}/payments", endpoint, ADYEN_API_VERSION))
|
||||
}
|
||||
|
||||
fn get_request_body(
|
||||
@ -785,12 +822,17 @@ impl
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
_req: &types::PaymentsPreProcessingRouterData,
|
||||
req: &types::PaymentsPreProcessingRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
self.base_url(connectors),
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!(
|
||||
"{}v69/paymentMethods/balance",
|
||||
self.base_url(connectors)
|
||||
"{}{}/paymentMethods/balance",
|
||||
endpoint, ADYEN_API_VERSION
|
||||
))
|
||||
}
|
||||
|
||||
@ -911,11 +953,16 @@ impl
|
||||
req: &types::PaymentsCancelRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
let id = req.request.connector_transaction_id.as_str();
|
||||
Ok(format!(
|
||||
"{}v68/payments/{}/cancels",
|
||||
let id = req.request.connector_transaction_id.clone();
|
||||
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
self.base_url(connectors),
|
||||
id
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!(
|
||||
"{}{}/payments/{}/cancels",
|
||||
endpoint, ADYEN_API_VERSION, id
|
||||
))
|
||||
}
|
||||
|
||||
@ -991,12 +1038,17 @@ impl services::ConnectorIntegration<api::PoCancel, types::PayoutsData, types::Pa
|
||||
{
|
||||
fn get_url(
|
||||
&self,
|
||||
_req: &types::PayoutsRouterData<api::PoCancel>,
|
||||
req: &types::PayoutsRouterData<api::PoCancel>,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
connectors.adyen.secondary_base_url.as_str(),
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!(
|
||||
"{}pal/servlet/Payout/v68/declineThirdParty",
|
||||
connectors.adyen.secondary_base_url
|
||||
"{}pal/servlet/Payout/{}/declineThirdParty",
|
||||
endpoint, ADYEN_API_VERSION
|
||||
))
|
||||
}
|
||||
|
||||
@ -1083,12 +1135,17 @@ impl services::ConnectorIntegration<api::PoCreate, types::PayoutsData, types::Pa
|
||||
{
|
||||
fn get_url(
|
||||
&self,
|
||||
_req: &types::PayoutsRouterData<api::PoCreate>,
|
||||
req: &types::PayoutsRouterData<api::PoCreate>,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
connectors.adyen.secondary_base_url.as_str(),
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!(
|
||||
"{}pal/servlet/Payout/v68/storeDetailAndSubmitThirdParty",
|
||||
connectors.adyen.secondary_base_url
|
||||
"{}pal/servlet/Payout/{}/storeDetailAndSubmitThirdParty",
|
||||
endpoint, ADYEN_API_VERSION
|
||||
))
|
||||
}
|
||||
|
||||
@ -1180,10 +1237,15 @@ impl
|
||||
{
|
||||
fn get_url(
|
||||
&self,
|
||||
_req: &types::PayoutsRouterData<api::PoEligibility>,
|
||||
req: &types::PayoutsRouterData<api::PoEligibility>,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Ok(format!("{}v68/payments", self.base_url(connectors),))
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
self.base_url(connectors),
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!("{}{}/payments", endpoint, ADYEN_API_VERSION))
|
||||
}
|
||||
|
||||
fn get_headers(
|
||||
@ -1277,9 +1339,15 @@ impl services::ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::P
|
||||
req: &types::PayoutsRouterData<api::PoFulfill>,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
connectors.adyen.secondary_base_url.as_str(),
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!(
|
||||
"{}pal/servlet/Payout/v68/{}",
|
||||
connectors.adyen.secondary_base_url,
|
||||
"{}pal/servlet/Payout/{}/{}",
|
||||
endpoint,
|
||||
ADYEN_API_VERSION,
|
||||
match req.request.payout_type {
|
||||
storage_enums::PayoutType::Bank | storage_enums::PayoutType::Wallet =>
|
||||
"confirmThirdParty".to_string(),
|
||||
@ -1407,10 +1475,15 @@ impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::Ref
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
let connector_payment_id = req.request.connector_transaction_id.clone();
|
||||
Ok(format!(
|
||||
"{}v68/payments/{}/refunds",
|
||||
|
||||
let endpoint = build_env_specific_endpoint(
|
||||
self.base_url(connectors),
|
||||
connector_payment_id
|
||||
req.test_mode,
|
||||
&req.connector_meta_data,
|
||||
)?;
|
||||
Ok(format!(
|
||||
"{}{}/payments/{}/refunds",
|
||||
endpoint, ADYEN_API_VERSION, connector_payment_id
|
||||
))
|
||||
}
|
||||
|
||||
@ -1483,6 +1556,17 @@ impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::Ref
|
||||
impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData>
|
||||
for Adyen
|
||||
{
|
||||
fn build_request(
|
||||
&self,
|
||||
_req: &types::RefundsRouterData<api::RSync>,
|
||||
_connectors: &settings::Connectors,
|
||||
) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::FlowNotSupported {
|
||||
flow: "Rsync".to_owned(),
|
||||
connector: "Adyen".to_owned(),
|
||||
}
|
||||
.into())
|
||||
}
|
||||
}
|
||||
|
||||
fn get_webhook_object_from_body(
|
||||
@ -1591,7 +1675,7 @@ impl api::IncomingWebhook for Adyen {
|
||||
let notif = get_webhook_object_from_body(request.body)
|
||||
.change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?;
|
||||
// for capture_event, original_reference field will have the authorized payment's PSP reference
|
||||
if adyen::is_capture_event(¬if.event_code) {
|
||||
if adyen::is_capture_or_cancel_event(¬if.event_code) {
|
||||
return Ok(api_models::webhooks::ObjectReferenceId::PaymentId(
|
||||
api_models::payments::PaymentIdType::ConnectorTransactionId(
|
||||
notif
|
||||
@ -1630,6 +1714,7 @@ impl api::IncomingWebhook for Adyen {
|
||||
.change_context(errors::ConnectorError::WebhookEventTypeNotFound)?;
|
||||
Ok(IncomingWebhookEvent::foreign_from((
|
||||
notif.event_code,
|
||||
notif.success,
|
||||
notif.additional_data.dispute_status,
|
||||
)))
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
use api_models::payouts::PayoutMethodData;
|
||||
use api_models::{enums, payments, webhooks};
|
||||
use cards::CardNumber;
|
||||
use common_utils::ext_traits::Encode;
|
||||
use common_utils::{ext_traits::Encode, pii};
|
||||
use error_stack::ResultExt;
|
||||
use masking::{ExposeInterface, PeekInterface};
|
||||
use reqwest::Url;
|
||||
@ -61,6 +61,21 @@ impl<T>
|
||||
})
|
||||
}
|
||||
}
|
||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
||||
pub struct AdyenConnectorMetadataObject {
|
||||
pub endpoint_prefix: String,
|
||||
}
|
||||
|
||||
impl TryFrom<&Option<pii::SecretSerdeValue>> for AdyenConnectorMetadataObject {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(meta_data: &Option<pii::SecretSerdeValue>) -> Result<Self, Self::Error> {
|
||||
let metadata: Self = utils::to_connector_meta_from_secret::<Self>(meta_data.clone())
|
||||
.change_context(errors::ConnectorError::InvalidConnectorConfig {
|
||||
config: "metadata",
|
||||
})?;
|
||||
Ok(metadata)
|
||||
}
|
||||
}
|
||||
|
||||
// Adyen Types Definition
|
||||
// Payments Request and Response Types
|
||||
@ -230,7 +245,7 @@ impl ForeignFrom<(bool, AdyenStatus, Option<common_enums::PaymentMethodType>)>
|
||||
) -> Self {
|
||||
match adyen_status {
|
||||
AdyenStatus::AuthenticationFinished => Self::AuthenticationSuccessful,
|
||||
AdyenStatus::AuthenticationNotRequired => Self::Pending,
|
||||
AdyenStatus::AuthenticationNotRequired | AdyenStatus::Received => Self::Pending,
|
||||
AdyenStatus::Authorised => match is_manual_capture {
|
||||
true => Self::Authorized,
|
||||
// In case of Automatic capture Authorized is the final status of the payment
|
||||
@ -245,7 +260,6 @@ impl ForeignFrom<(bool, AdyenStatus, Option<common_enums::PaymentMethodType>)>
|
||||
Some(common_enums::PaymentMethodType::Pix) => Self::AuthenticationPending,
|
||||
_ => Self::Pending,
|
||||
},
|
||||
AdyenStatus::Received => Self::Started,
|
||||
#[cfg(feature = "payouts")]
|
||||
AdyenStatus::PayoutConfirmReceived => Self::Started,
|
||||
#[cfg(feature = "payouts")]
|
||||
@ -281,7 +295,6 @@ pub struct AdyenRefusal {
|
||||
#[derive(Debug, Clone, Serialize, serde::Deserialize, Eq, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AdyenRedirection {
|
||||
#[serde(rename = "redirectResult")]
|
||||
pub redirect_result: String,
|
||||
#[serde(rename = "type")]
|
||||
pub type_of_redirection_result: Option<String>,
|
||||
@ -432,6 +445,7 @@ pub struct Amount {
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum AdyenPaymentMethod<'a> {
|
||||
AdyenAffirm(Box<PmdForPaymentType>),
|
||||
AdyenCard(Box<AdyenCard>),
|
||||
@ -1016,6 +1030,9 @@ impl TryFrom<&api_enums::BankNames> for OpenBankingUKIssuer {
|
||||
| enums::BankNames::KrungsriBank
|
||||
| enums::BankNames::KrungThaiBank
|
||||
| enums::BankNames::TheSiamCommercialBank
|
||||
| enums::BankNames::Yoursafe
|
||||
| enums::BankNames::N26
|
||||
| enums::BankNames::NationaleNederlanden
|
||||
| enums::BankNames::KasikornBank => Err(errors::ConnectorError::NotSupported {
|
||||
message: String::from("BankRedirect"),
|
||||
connector: "Adyen",
|
||||
@ -1079,8 +1096,9 @@ pub struct AdyenCancelRequest {
|
||||
#[derive(Default, Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AdyenCancelResponse {
|
||||
psp_reference: String,
|
||||
payment_psp_reference: String,
|
||||
status: CancelStatus,
|
||||
reference: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Deserialize, Serialize)]
|
||||
@ -1365,16 +1383,17 @@ impl<'a> TryFrom<&api_enums::BankNames> for AdyenTestBankNames<'a> {
|
||||
api_models::enums::BankNames::AbnAmro => Self("1121"),
|
||||
api_models::enums::BankNames::AsnBank => Self("1151"),
|
||||
api_models::enums::BankNames::Bunq => Self("1152"),
|
||||
api_models::enums::BankNames::Handelsbanken => Self("1153"),
|
||||
api_models::enums::BankNames::Ing => Self("1154"),
|
||||
api_models::enums::BankNames::Knab => Self("1155"),
|
||||
api_models::enums::BankNames::Moneyou => Self("1156"),
|
||||
api_models::enums::BankNames::N26 => Self("1156"),
|
||||
api_models::enums::BankNames::NationaleNederlanden => Self("1157"),
|
||||
api_models::enums::BankNames::Rabobank => Self("1157"),
|
||||
api_models::enums::BankNames::Regiobank => Self("1158"),
|
||||
api_models::enums::BankNames::Revolut => Self("1159"),
|
||||
api_models::enums::BankNames::SnsBank => Self("1159"),
|
||||
api_models::enums::BankNames::TriodosBank => Self("1159"),
|
||||
api_models::enums::BankNames::VanLanschot => Self("1159"),
|
||||
api_models::enums::BankNames::Yoursafe => Self("1159"),
|
||||
api_models::enums::BankNames::BankAustria => {
|
||||
Self("e6819e7a-f663-414b-92ec-cf7c82d2f4e5")
|
||||
}
|
||||
@ -1419,6 +1438,34 @@ impl<'a> TryFrom<&api_enums::BankNames> for AdyenTestBankNames<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AdyenBankNames<'a>(&'a str);
|
||||
|
||||
impl<'a> TryFrom<&api_enums::BankNames> for AdyenBankNames<'a> {
|
||||
type Error = Error;
|
||||
fn try_from(bank: &api_enums::BankNames) -> Result<Self, Self::Error> {
|
||||
Ok(match bank {
|
||||
api_models::enums::BankNames::AbnAmro => Self("0031"),
|
||||
api_models::enums::BankNames::AsnBank => Self("0761"),
|
||||
api_models::enums::BankNames::Bunq => Self("0802"),
|
||||
api_models::enums::BankNames::Ing => Self("0721"),
|
||||
api_models::enums::BankNames::Knab => Self("0801"),
|
||||
api_models::enums::BankNames::N26 => Self("0807"),
|
||||
api_models::enums::BankNames::NationaleNederlanden => Self("0808"),
|
||||
api_models::enums::BankNames::Rabobank => Self("0021"),
|
||||
api_models::enums::BankNames::Regiobank => Self("0771"),
|
||||
api_models::enums::BankNames::Revolut => Self("0805"),
|
||||
api_models::enums::BankNames::SnsBank => Self("0751"),
|
||||
api_models::enums::BankNames::TriodosBank => Self("0511"),
|
||||
api_models::enums::BankNames::VanLanschot => Self("0161"),
|
||||
api_models::enums::BankNames::Yoursafe => Self("0806"),
|
||||
_ => Err(errors::ConnectorError::NotSupported {
|
||||
message: String::from("BankRedirect"),
|
||||
connector: "Adyen",
|
||||
})?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&types::ConnectorAuthType> for AdyenAuthType {
|
||||
type Error = Error;
|
||||
fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> {
|
||||
@ -2079,10 +2126,12 @@ impl<'a> TryFrom<(&api::PayLaterData, Option<api_enums::CountryAlpha2>)>
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&api_models::payments::BankRedirectData> for AdyenPaymentMethod<'a> {
|
||||
impl<'a> TryFrom<(&api_models::payments::BankRedirectData, Option<bool>)>
|
||||
for AdyenPaymentMethod<'a>
|
||||
{
|
||||
type Error = Error;
|
||||
fn try_from(
|
||||
bank_redirect_data: &api_models::payments::BankRedirectData,
|
||||
(bank_redirect_data, test_mode): (&api_models::payments::BankRedirectData, Option<bool>),
|
||||
) -> Result<Self, Self::Error> {
|
||||
match bank_redirect_data {
|
||||
api_models::payments::BankRedirectData::BancontactCard {
|
||||
@ -2154,19 +2203,33 @@ impl<'a> TryFrom<&api_models::payments::BankRedirectData> for AdyenPaymentMethod
|
||||
payment_type: PaymentType::Giropay,
|
||||
})))
|
||||
}
|
||||
api_models::payments::BankRedirectData::Ideal { bank_name, .. } => Ok(
|
||||
AdyenPaymentMethod::Ideal(Box::new(BankRedirectionWithIssuer {
|
||||
payment_type: PaymentType::Ideal,
|
||||
issuer: Some(
|
||||
api_models::payments::BankRedirectData::Ideal { bank_name, .. } => {
|
||||
let issuer = if test_mode.unwrap_or(true) {
|
||||
Some(
|
||||
AdyenTestBankNames::try_from(&bank_name.ok_or(
|
||||
errors::ConnectorError::MissingRequiredField {
|
||||
field_name: "ideal.bank_name",
|
||||
},
|
||||
)?)?
|
||||
.0,
|
||||
),
|
||||
})),
|
||||
),
|
||||
)
|
||||
} else {
|
||||
Some(
|
||||
AdyenBankNames::try_from(&bank_name.ok_or(
|
||||
errors::ConnectorError::MissingRequiredField {
|
||||
field_name: "ideal.bank_name",
|
||||
},
|
||||
)?)?
|
||||
.0,
|
||||
)
|
||||
};
|
||||
Ok(AdyenPaymentMethod::Ideal(Box::new(
|
||||
BankRedirectionWithIssuer {
|
||||
payment_type: PaymentType::Ideal,
|
||||
issuer,
|
||||
},
|
||||
)))
|
||||
}
|
||||
api_models::payments::BankRedirectData::OnlineBankingCzechRepublic { issuer } => {
|
||||
Ok(AdyenPaymentMethod::OnlineBankingCzechRepublic(Box::new(
|
||||
OnlineBankingCzechRepublicData {
|
||||
@ -2692,7 +2755,8 @@ impl<'a>
|
||||
let browser_info = get_browser_info(item.router_data)?;
|
||||
let additional_data = get_additional_data(item.router_data);
|
||||
let return_url = item.router_data.request.get_return_url()?;
|
||||
let payment_method = AdyenPaymentMethod::try_from(bank_redirect_data)?;
|
||||
let payment_method =
|
||||
AdyenPaymentMethod::try_from((bank_redirect_data, item.router_data.test_mode))?;
|
||||
let (shopper_locale, country) = get_redirect_extra_details(item.router_data)?;
|
||||
let line_items = Some(get_line_items(item));
|
||||
|
||||
@ -2939,15 +3003,6 @@ impl TryFrom<&types::PaymentsCancelRouterData> for AdyenCancelRequest {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CancelStatus> for storage_enums::AttemptStatus {
|
||||
fn from(status: CancelStatus) -> Self {
|
||||
match status {
|
||||
CancelStatus::Received => Self::Voided,
|
||||
CancelStatus::Processing => Self::Pending,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<types::PaymentsCancelResponseRouterData<AdyenCancelResponse>>
|
||||
for types::PaymentsCancelRouterData
|
||||
{
|
||||
@ -2956,14 +3011,16 @@ impl TryFrom<types::PaymentsCancelResponseRouterData<AdyenCancelResponse>>
|
||||
item: types::PaymentsCancelResponseRouterData<AdyenCancelResponse>,
|
||||
) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
status: item.response.status.into(),
|
||||
status: enums::AttemptStatus::Pending,
|
||||
response: Ok(types::PaymentsResponseData::TransactionResponse {
|
||||
resource_id: types::ResponseId::ConnectorTransactionId(item.response.psp_reference),
|
||||
resource_id: types::ResponseId::ConnectorTransactionId(
|
||||
item.response.payment_psp_reference,
|
||||
),
|
||||
redirection_data: None,
|
||||
mandate_reference: None,
|
||||
connector_metadata: None,
|
||||
network_txn_id: None,
|
||||
connector_response_reference_id: None,
|
||||
connector_response_reference_id: Some(item.response.reference),
|
||||
incremental_authorization_allowed: None,
|
||||
}),
|
||||
..item.data
|
||||
@ -3683,11 +3740,7 @@ impl TryFrom<types::PaymentsCaptureResponseRouterData<AdyenCaptureResponse>>
|
||||
mandate_reference: None,
|
||||
connector_metadata: None,
|
||||
network_txn_id: None,
|
||||
connector_response_reference_id: item
|
||||
.response
|
||||
.merchant_reference
|
||||
.clone()
|
||||
.or(Some(item.response.psp_reference)),
|
||||
connector_response_reference_id: Some(item.response.reference),
|
||||
incremental_authorization_allowed: None,
|
||||
}),
|
||||
amount_captured: Some(item.response.amount.value),
|
||||
@ -3829,7 +3882,9 @@ pub enum WebhookEventCode {
|
||||
Authorisation,
|
||||
Refund,
|
||||
CancelOrRefund,
|
||||
Cancellation,
|
||||
RefundFailed,
|
||||
RefundReversed,
|
||||
NotificationOfChargeback,
|
||||
Chargeback,
|
||||
ChargebackReversed,
|
||||
@ -3846,10 +3901,12 @@ pub fn is_transaction_event(event_code: &WebhookEventCode) -> bool {
|
||||
matches!(event_code, WebhookEventCode::Authorisation)
|
||||
}
|
||||
|
||||
pub fn is_capture_event(event_code: &WebhookEventCode) -> bool {
|
||||
pub fn is_capture_or_cancel_event(event_code: &WebhookEventCode) -> bool {
|
||||
matches!(
|
||||
event_code,
|
||||
WebhookEventCode::Capture | WebhookEventCode::CaptureFailed
|
||||
WebhookEventCode::Capture
|
||||
| WebhookEventCode::CaptureFailed
|
||||
| WebhookEventCode::Cancellation
|
||||
)
|
||||
}
|
||||
|
||||
@ -3859,6 +3916,7 @@ pub fn is_refund_event(event_code: &WebhookEventCode) -> bool {
|
||||
WebhookEventCode::Refund
|
||||
| WebhookEventCode::CancelOrRefund
|
||||
| WebhookEventCode::RefundFailed
|
||||
| WebhookEventCode::RefundReversed
|
||||
)
|
||||
}
|
||||
|
||||
@ -3874,31 +3932,66 @@ pub fn is_chargeback_event(event_code: &WebhookEventCode) -> bool {
|
||||
)
|
||||
}
|
||||
|
||||
impl ForeignFrom<(WebhookEventCode, Option<DisputeStatus>)> for webhooks::IncomingWebhookEvent {
|
||||
fn foreign_from((code, status): (WebhookEventCode, Option<DisputeStatus>)) -> Self {
|
||||
match (code, status) {
|
||||
(WebhookEventCode::Authorisation, _) => Self::PaymentIntentSuccess,
|
||||
(WebhookEventCode::Refund, _) => Self::RefundSuccess,
|
||||
(WebhookEventCode::CancelOrRefund, _) => Self::RefundSuccess,
|
||||
(WebhookEventCode::RefundFailed, _) => Self::RefundFailure,
|
||||
(WebhookEventCode::NotificationOfChargeback, _) => Self::DisputeOpened,
|
||||
(WebhookEventCode::Chargeback, None) => Self::DisputeLost,
|
||||
(WebhookEventCode::Chargeback, Some(DisputeStatus::Won)) => Self::DisputeWon,
|
||||
(WebhookEventCode::Chargeback, Some(DisputeStatus::Lost)) => Self::DisputeLost,
|
||||
(WebhookEventCode::Chargeback, Some(_)) => Self::DisputeOpened,
|
||||
(WebhookEventCode::ChargebackReversed, Some(DisputeStatus::Pending)) => {
|
||||
Self::DisputeChallenged
|
||||
fn is_success_scenario(is_success: String) -> bool {
|
||||
is_success.as_str() == "true"
|
||||
}
|
||||
|
||||
impl ForeignFrom<(WebhookEventCode, String, Option<DisputeStatus>)>
|
||||
for webhooks::IncomingWebhookEvent
|
||||
{
|
||||
fn foreign_from(
|
||||
(code, is_success, dispute_status): (WebhookEventCode, String, Option<DisputeStatus>),
|
||||
) -> Self {
|
||||
match code {
|
||||
WebhookEventCode::Authorisation => {
|
||||
if is_success_scenario(is_success) {
|
||||
Self::PaymentIntentSuccess
|
||||
} else {
|
||||
Self::PaymentIntentFailure
|
||||
}
|
||||
}
|
||||
(WebhookEventCode::ChargebackReversed, _) => Self::DisputeWon,
|
||||
(WebhookEventCode::SecondChargeback, _) => Self::DisputeLost,
|
||||
(WebhookEventCode::PrearbitrationWon, Some(DisputeStatus::Pending)) => {
|
||||
Self::DisputeOpened
|
||||
WebhookEventCode::Refund | WebhookEventCode::CancelOrRefund => {
|
||||
if is_success_scenario(is_success) {
|
||||
Self::RefundSuccess
|
||||
} else {
|
||||
Self::RefundFailure
|
||||
}
|
||||
}
|
||||
(WebhookEventCode::PrearbitrationWon, _) => Self::DisputeWon,
|
||||
(WebhookEventCode::PrearbitrationLost, _) => Self::DisputeLost,
|
||||
(WebhookEventCode::Unknown, _) => Self::EventNotSupported,
|
||||
(WebhookEventCode::Capture, _) => Self::PaymentIntentSuccess,
|
||||
(WebhookEventCode::CaptureFailed, _) => Self::PaymentIntentFailure,
|
||||
WebhookEventCode::Cancellation => {
|
||||
if is_success_scenario(is_success) {
|
||||
Self::PaymentIntentCancelled
|
||||
} else {
|
||||
Self::PaymentIntentCancelFailure
|
||||
}
|
||||
}
|
||||
WebhookEventCode::RefundFailed | WebhookEventCode::RefundReversed => {
|
||||
Self::RefundFailure
|
||||
}
|
||||
WebhookEventCode::NotificationOfChargeback => Self::DisputeOpened,
|
||||
WebhookEventCode::Chargeback => match dispute_status {
|
||||
Some(DisputeStatus::Won) => Self::DisputeWon,
|
||||
Some(DisputeStatus::Lost) | None => Self::DisputeLost,
|
||||
Some(_) => Self::DisputeOpened,
|
||||
},
|
||||
WebhookEventCode::ChargebackReversed => match dispute_status {
|
||||
Some(DisputeStatus::Pending) => Self::DisputeChallenged,
|
||||
_ => Self::DisputeWon,
|
||||
},
|
||||
WebhookEventCode::SecondChargeback => Self::DisputeLost,
|
||||
WebhookEventCode::PrearbitrationWon => match dispute_status {
|
||||
Some(DisputeStatus::Pending) => Self::DisputeOpened,
|
||||
_ => Self::DisputeWon,
|
||||
},
|
||||
WebhookEventCode::PrearbitrationLost => Self::DisputeLost,
|
||||
WebhookEventCode::Capture => {
|
||||
if is_success_scenario(is_success) {
|
||||
Self::PaymentIntentCaptureSuccess
|
||||
} else {
|
||||
Self::PaymentIntentCaptureFailure
|
||||
}
|
||||
}
|
||||
WebhookEventCode::CaptureFailed => Self::PaymentIntentCaptureFailure,
|
||||
WebhookEventCode::Unknown => Self::EventNotSupported,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3949,7 +4042,13 @@ impl From<AdyenNotificationRequestItemWH> for Response {
|
||||
psp_reference: notif.psp_reference,
|
||||
merchant_reference: notif.merchant_reference,
|
||||
result_code: match notif.success.as_str() {
|
||||
"true" => AdyenStatus::Authorised,
|
||||
"true" => {
|
||||
if notif.event_code == WebhookEventCode::Cancellation {
|
||||
AdyenStatus::Cancelled
|
||||
} else {
|
||||
AdyenStatus::Authorised
|
||||
}
|
||||
}
|
||||
_ => AdyenStatus::Refused,
|
||||
},
|
||||
amount: Some(Amount {
|
||||
|
||||
@ -615,6 +615,9 @@ impl TryFrom<api_models::enums::BankNames> for NuveiBIC {
|
||||
| api_models::enums::BankNames::Starling
|
||||
| api_models::enums::BankNames::TsbBank
|
||||
| api_models::enums::BankNames::TescoBank
|
||||
| api_models::enums::BankNames::Yoursafe
|
||||
| api_models::enums::BankNames::N26
|
||||
| api_models::enums::BankNames::NationaleNederlanden
|
||||
| api_models::enums::BankNames::UlsterBank => {
|
||||
Err(errors::ConnectorError::NotImplemented(
|
||||
utils::get_unimplemented_payment_method_error_message("Nuvei"),
|
||||
|
||||
@ -1695,6 +1695,7 @@ pub(crate) fn validate_auth_and_metadata_type(
|
||||
}
|
||||
api_enums::Connector::Adyen => {
|
||||
adyen::transformers::AdyenAuthType::try_from(val)?;
|
||||
adyen::transformers::AdyenConnectorMetadataObject::try_from(connector_meta_data)?;
|
||||
Ok(())
|
||||
}
|
||||
api_enums::Connector::Airwallex => {
|
||||
|
||||
@ -238,7 +238,7 @@ async fn get_tracker_for_sync<
|
||||
operation: Op,
|
||||
storage_scheme: enums::MerchantStorageScheme,
|
||||
) -> RouterResult<operations::GetTrackerResponse<'a, F, api::PaymentsRetrieveRequest, Ctx>> {
|
||||
let (payment_intent, payment_attempt, currency, amount);
|
||||
let (payment_intent, mut payment_attempt, currency, amount);
|
||||
|
||||
(payment_intent, payment_attempt) = get_payment_intent_payment_attempt(
|
||||
db,
|
||||
@ -274,6 +274,8 @@ async fn get_tracker_for_sync<
|
||||
)
|
||||
.await?;
|
||||
|
||||
payment_attempt.encoded_data = request.param.clone();
|
||||
|
||||
let attempts = match request.expand_attempts {
|
||||
Some(true) => {
|
||||
Some(db
|
||||
|
||||
@ -191,6 +191,10 @@ open_banking_uk = {country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT
|
||||
|
||||
[pm_filters.adyen]
|
||||
boleto = { country = "BR", currency = "BRL" }
|
||||
sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
|
||||
paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" }
|
||||
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD"}
|
||||
ideal = { country = "NL", currency = "EUR" }
|
||||
|
||||
[pm_filters.zen]
|
||||
credit = { not_available_flows = { capture_method = "manual" } }
|
||||
|
||||
@ -5136,7 +5136,10 @@
|
||||
"starling",
|
||||
"tsb_bank",
|
||||
"tesco_bank",
|
||||
"ulster_bank"
|
||||
"ulster_bank",
|
||||
"yoursafe",
|
||||
"n26",
|
||||
"nationale_nederlanden"
|
||||
]
|
||||
},
|
||||
"BankRedirectBilling": {
|
||||
|
||||
Reference in New Issue
Block a user