mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
fix(connector): fix wordline tests and visa card issuer support (#688)
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use common_utils::pii;
|
||||
use error_stack::{report, IntoReport, ResultExt};
|
||||
use masking::Secret;
|
||||
use once_cell::sync::Lazy;
|
||||
@ -212,7 +213,11 @@ impl CardData for api::Card {
|
||||
Secret::new(year[year.len() - 2..].to_string())
|
||||
}
|
||||
fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
|
||||
get_card_issuer(self.card_number.peek().clone().as_str())
|
||||
let card: Secret<String, pii::CardNumber> = self
|
||||
.card_number
|
||||
.clone()
|
||||
.map(|card| card.split_whitespace().collect());
|
||||
get_card_issuer(card.peek().clone().as_str())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -127,6 +127,7 @@ impl TryFrom<utils::CardIssuer> for Gateway {
|
||||
utils::CardIssuer::AmericanExpress => Ok(Self::Amex),
|
||||
utils::CardIssuer::Master => Ok(Self::MasterCard),
|
||||
utils::CardIssuer::Discover => Ok(Self::Discover),
|
||||
utils::CardIssuer::Visa => Ok(Self::Visa),
|
||||
_ => Err(errors::ConnectorError::NotSupported {
|
||||
payment_method: format!("{issuer}"),
|
||||
connector: "worldline",
|
||||
|
||||
Reference in New Issue
Block a user