mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
feat(connector): [PowerTranz] Add cards support for PowerTranz connector (#1687)
Co-authored-by: Kritik Modi <61862301+kritikmodi@users.noreply.github.com>
This commit is contained in:
@ -11,7 +11,7 @@ use common_utils::{
|
||||
pii::{self, Email, IpAddress},
|
||||
};
|
||||
use error_stack::{report, IntoReport, ResultExt};
|
||||
use masking::Secret;
|
||||
use masking::{ExposeInterface, Secret};
|
||||
use once_cell::sync::Lazy;
|
||||
use regex::Regex;
|
||||
use serde::Serializer;
|
||||
@ -514,6 +514,7 @@ pub trait CardData {
|
||||
) -> Secret<String>;
|
||||
fn get_expiry_date_as_yyyymm(&self, delimiter: &str) -> Secret<String>;
|
||||
fn get_expiry_year_4_digit(&self) -> Secret<String>;
|
||||
fn get_expiry_date_as_yymm(&self) -> Secret<String>;
|
||||
}
|
||||
|
||||
impl CardData for api::Card {
|
||||
@ -553,6 +554,11 @@ impl CardData for api::Card {
|
||||
}
|
||||
Secret::new(year)
|
||||
}
|
||||
fn get_expiry_date_as_yymm(&self) -> Secret<String> {
|
||||
let year = self.get_card_expiry_year_2_digit().expose();
|
||||
let month = self.card_exp_month.clone().expose();
|
||||
Secret::new(format!("{year}{month}"))
|
||||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
|
||||
Reference in New Issue
Block a user