Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(payout): use get_string_repr for formatting payout IDs (#8547)
Kashifeb94cfe7e558
diff --git a/config/config.example.toml b/config/config.example.tomlindex 98ef7cf628..3c6da56b24 100644--- a/config/config.example.toml+++ b/config/config.example.toml@@ -908,7 +908,9 @@ card = "credit,debit"#Payout Method Filters Based on Country and Currency[payout_method_filters.adyenplatform]-sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+sepa = { country = "AT,BE,CH,CZ,DE,EE,ES,FI,FR,GB,HU,IE,IT,LT,LV,NL,NO,PL,PT,SE,SK", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+credit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }+debit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }[payout_method_filters.stripe]ach = { country = "US", currency = "USD" }diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.tomlindex 2bb07055e8..495847bd89 100644--- a/config/deployments/integration_test.toml+++ b/config/deployments/integration_test.toml@@ -678,7 +678,9 @@ trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKKklarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" }[payout_method_filters.adyenplatform]-sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH" , currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+sepa = { country = "AT,BE,CH,CZ,DE,EE,ES,FI,FR,GB,HU,IE,IT,LT,LV,NL,NO,PL,PT,SE,SK", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+credit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }+debit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }[payout_method_filters.stripe]ach = { country = "US", currency = "USD" }diff --git a/config/deployments/production.toml b/config/deployments/production.tomlindex 9fa5a62f58..335d7f5ace 100644--- a/config/deployments/production.toml+++ b/config/deployments/production.toml@@ -709,7 +709,9 @@ eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" }pix = { country = "BR", currency = "BRL" }[payout_method_filters.adyenplatform]-sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH" , currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+sepa = { country = "AT,BE,CH,CZ,DE,EE,ES,FI,FR,GB,HU,IE,IT,LT,LV,NL,NO,PL,PT,SE,SK", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+credit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }+debit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }[payout_method_filters.stripe]ach = { country = "US", currency = "USD" }diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.tomlindex adca23f499..721e32b9b8 100644--- a/config/deployments/sandbox.toml+++ b/config/deployments/sandbox.toml@@ -648,7 +648,9 @@ credit = {country = "AU,NZ,CN,HK,IN,LK,KR,MY,SG,GB,BE,FR,DE,IT,ME,NL,PL,ES,ZA,ARdebit = {country = "AU,NZ,CN,HK,IN,LK,KR,MY,SG,GB,BE,FR,DE,IT,ME,NL,PL,ES,ZA,AR,BR,CO,MX,PA,UY,US,CA", currency = "AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BYN,BZD,BMD,BTN,BOB,VES,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XAF,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,CZK,DKK,DJF,DOP,XCD,EGP,ERN,ETB,EUR,FKP,FJD,XPF,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KGS,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,NZD,NIO,NGN,VUV,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SHP,SVC,WST,STN,SAR,RSD,SCR,SLL,SGD,SBD,SOS,ZAR,KRW,SSP,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,UGX,UAH,AED,USD,UYU,UZS,VND,XOF,YER,ZMW,ZWL"}[payout_method_filters.adyenplatform]-sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH" , currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+sepa = { country = "AT,BE,CH,CZ,DE,EE,ES,FI,FR,GB,HU,IE,IT,LT,LV,NL,NO,PL,PT,SE,SK", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+credit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }+debit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }[pm_filters.rapyd]apple_pay = { country = "AL,AS,AD,AR,AM,AU,AT,AZ,BH,BE,BM,BA,BR,BG,CA,KH,KY,CL,CO,CR,HR,CY,CZ,DK,DO,EC,SV,EE,FO,FI,FR,GE,DE,GI,GR,GL,GU,GT,GG,HN,HK,HU,IS,IE,IM,IL,IT,JP,KZ,KG,KW,LV,LI,LT,LU,MO,MY,MT,MX,MD,MC,ME,MA,NL,NZ,NI,MK,MP,NO,PA,PY,PR,PE,PL,PT,QA,RO,SM,RS,SG,SK,SI,ZA,ES,SE,CH,TW,TJ,TH,UA,AE,GB,US,UY,VI,VN", currency = "EUR,GBP,ISK,USD" }diff --git a/config/development.toml b/config/development.tomlindex db64e73099..ab885503c8 100644--- a/config/development.toml+++ b/config/development.toml@@ -1031,7 +1031,9 @@ merchant_name = "HyperSwitch"card = "credit,debit"[payout_method_filters.adyenplatform]-sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+sepa = { country = "AT,BE,CH,CZ,DE,EE,ES,FI,FR,GB,HU,IE,IT,LT,LV,NL,NO,PL,PT,SE,SK", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+credit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }+debit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }[payout_method_filters.stripe]ach = { country = "US", currency = "USD" }diff --git a/config/docker_compose.toml b/config/docker_compose.tomlindex af1fc3ea68..dbfeccf7cd 100644--- a/config/docker_compose.toml+++ b/config/docker_compose.toml@@ -1041,7 +1041,9 @@ merchant_name = "HyperSwitch"card = "credit,debit"[payout_method_filters.adyenplatform]-sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+sepa = { country = "AT,BE,CH,CZ,DE,EE,ES,FI,FR,GB,HU,IE,IT,LT,LV,NL,NO,PL,PT,SE,SK", currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }+credit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }+debit = { country = "AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,HU,IE,IS,IT,LI,LT,LU,LV,MT,NL,NO,PL,PT,RO,SE,SI,SK,US", currency = "EUR,USD,GBP" }[payout_method_filters.stripe]ach = { country = "US", currency = "USD" }diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.tomlindex a5a448fb0a..9966398471 100644--- a/crates/connector_configs/toml/development.toml+++ b/crates/connector_configs/toml/development.toml@@ -367,6 +367,14 @@ required=truetype="Text"[adyenplatform_payout]+[[adyenplatform_payout.credit]]+ payment_method_type = "Mastercard"+[[adyenplatform_payout.credit]]+ payment_method_type = "Visa"+[[adyenplatform_payout.debit]]+ payment_method_type = "Mastercard"+[[adyenplatform_payout.debit]]+ payment_method_type = "Visa"[[adyenplatform_payout.bank_transfer]]payment_method_type = "sepa"[adyenplatform_payout.connector_auth.HeaderKey]diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.tomlindex 09f94adbcd..a7d81b2c22 100644--- a/crates/connector_configs/toml/production.toml+++ b/crates/connector_configs/toml/production.toml@@ -121,6 +121,14 @@ key1="Adyen Account Id"merchant_secret="Source verification key"[adyenplatform_payout]+[[adyenplatform_payout.credit]]+ payment_method_type = "Mastercard"+[[adyenplatform_payout.credit]]+ payment_method_type = "Visa"+[[adyenplatform_payout.debit]]+ payment_method_type = "Mastercard"+[[adyenplatform_payout.debit]]+ payment_method_type = "Visa"[[adyenplatform_payout.bank_transfer]]payment_method_type = "sepa"[adyenplatform_payout.connector_auth.HeaderKey]diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.tomlindex bb02a3197f..2660bd1a36 100644--- a/crates/connector_configs/toml/sandbox.toml+++ b/crates/connector_configs/toml/sandbox.toml@@ -365,6 +365,14 @@ required=truetype="Text"[adyenplatform_payout]+[[adyenplatform_payout.credit]]+ payment_method_type = "Mastercard"+[[adyenplatform_payout.credit]]+ payment_method_type = "Visa"+[[adyenplatform_payout.debit]]+ payment_method_type = "Mastercard"+[[adyenplatform_payout.debit]]+ payment_method_type = "Visa"[[adyenplatform_payout.bank_transfer]]payment_method_type = "sepa"[adyenplatform_payout.connector_auth.HeaderKey]diff --git a/crates/router/src/core/payouts.rs b/crates/router/src/core/payouts.rsindex 66c87086c7..bd0014d205 100644--- a/crates/router/src/core/payouts.rs+++ b/crates/router/src/core/payouts.rs@@ -450,7 +450,10 @@ pub async fn payouts_update_core(// Verify update feasibilityif helpers::is_payout_terminal_state(status) || helpers::is_payout_initiated(status) {return Err(report!(errors::ApiErrorResponse::InvalidRequestData {- message: format!("Payout {payout_id:?} cannot be updated for status {status}"),+ message: format!(+ "Payout {} cannot be updated for status {status}",+ payout_id.get_string_repr()+ ),}));}helpers::update_payouts_and_payout_attempt(&mut payout_data, &merchant_context, &req, &state)@@ -2697,7 +2700,7 @@ pub async fn payout_create_db_entries(let client_secret = utils::generate_id(consts::ID_LENGTH,- format!("payout_{payout_id:?}_secret").as_str(),+ format!("payout_{}_secret", payout_id.get_string_repr()).as_str(),);let amount = MinorUnit::from(req.amount.unwrap_or(api::Amount::Zero));let status = if req.payout_method_data.is_some()@@ -2911,7 +2914,7 @@ pub async fn make_payout_data(.map_err(|err| err.change_context(errors::ApiErrorResponse::InternalServerError)).attach_printable_lazy(|| {format!(- "Failed while fetching optional customer [id - {customer_id:?}] for payout [id - {payout_id:?}]"+ "Failed while fetching optional customer [id - {customer_id:?}] for payout [id - {}]", payout_id.get_string_repr())})})@@ -3179,8 +3182,9 @@ pub async fn create_payout_link(.as_ref().map_or(default_config.expiry, |expiry| *expiry);let url = format!(- "{base_url}/payout_link/{}/{payout_id:?}?locale={}",+ "{base_url}/payout_link/{}/{}?locale={}",merchant_id.get_string_repr(),+ payout_id.get_string_repr(),locale);let link = url::Url::parse(&url)