fix(connector): Expiration Year Incorrectly Populated as YYYY Format in Paybox Mandates (#6474)

This commit is contained in:
awasthi21
2024-11-05 12:34:47 +05:30
committed by GitHub
parent 2919db874b
commit e457ccd91e

View File

@ -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)?
)))
}