From e457ccd91e60d5168e0a3283dfa325097f455076 Mon Sep 17 00:00:00 2001 From: awasthi21 <107559116+awasthi21@users.noreply.github.com> Date: Tue, 5 Nov 2024 12:34:47 +0530 Subject: [PATCH] fix(connector): Expiration Year Incorrectly Populated as YYYY Format in Paybox Mandates (#6474) --- crates/router/src/connector/paybox/transformers.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/router/src/connector/paybox/transformers.rs b/crates/router/src/connector/paybox/transformers.rs index 4b9c25f6dba..4e1270f419c 100644 --- a/crates/router/src/connector/paybox/transformers.rs +++ b/crates/router/src/connector/paybox/transformers.rs @@ -1224,14 +1224,12 @@ fn get_card_expiry_month_year_2_digit( card_exp_month: Secret, card_exp_year: Secret, ) -> Result, 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)? ))) }