mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix(payout): use get_string_repr for formatting payout IDs (#8547)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -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" }
|
||||
|
||||
@ -678,7 +678,9 @@ trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK
|
||||
klarna = { 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" }
|
||||
|
||||
@ -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" }
|
||||
|
||||
@ -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,AR
|
||||
debit = {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" }
|
||||
|
||||
@ -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" }
|
||||
|
||||
@ -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" }
|
||||
|
||||
@ -367,6 +367,14 @@ required=true
|
||||
type="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]
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -365,6 +365,14 @@ required=true
|
||||
type="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]
|
||||
|
||||
@ -450,7 +450,10 @@ pub async fn payouts_update_core(
|
||||
// Verify update feasibility
|
||||
if 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)
|
||||
|
||||
Reference in New Issue
Block a user