Skip to content

Commit

Permalink
fix(connector): Expiration Year Incorrectly Populated as YYYY Format …
Browse files Browse the repository at this point in the history
…in Paybox Mandates (#6474)
  • Loading branch information
awasthi21 authored Nov 5, 2024
1 parent 2919db8 commit e457ccd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions crates/router/src/connector/paybox/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?
)))
}

0 comments on commit e457ccd

Please sign in to comment.