mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
fix(connector): Expiration Year Incorrectly Populated as YYYY Format in Paybox Mandates (#6474)
This commit is contained in:
@ -1224,14 +1224,12 @@ fn get_card_expiry_month_year_2_digit(
|
||||
card_exp_month: Secret<String>,
|
||||
card_exp_year: Secret<String>,
|
||||
) -> Result<Secret<String>, errors::ConnectorError> {
|
||||
let year_2_digit = card_exp_year
|
||||
.peek()
|
||||
.get(..2)
|
||||
.ok_or(errors::ConnectorError::RequestEncodingFailed)?
|
||||
.to_string();
|
||||
Ok(Secret::new(format!(
|
||||
"{}{}",
|
||||
card_exp_month.peek(),
|
||||
year_2_digit
|
||||
card_exp_year
|
||||
.peek()
|
||||
.get(card_exp_year.peek().len() - 2..)
|
||||
.ok_or(errors::ConnectorError::RequestEncodingFailed)?
|
||||
)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user