Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(Authipay): AuthiPay AuthType Fix (#10246)

Yashasvi Kapil3e6d3ea7c430
diff --git a/crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs
index bc6a1be658..721f268f31 100644
--- a/crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs
@@ -17,7 +17,7 @@ use serde::{Deserialize, Serialize};
use crate::{
types::{RefundsResponseRouterData, ResponseRouterData},
- utils,
+ utils::{self, CardData},
};
// Type definition for router data with amount
@@ -110,7 +110,7 @@ impl TryFrom<&AuthipayRouterData<&PaymentsAuthorizeRouterData>> for AuthipayPaym
PaymentMethodData::Card(req_card) => {
let expiry_date = ExpiryDate {
month: req_card.card_exp_month.clone(),
- year: req_card.card_exp_year.clone(),
+ year: req_card.get_card_expiry_year_2_digit()?,
};
let card = Card {
@@ -170,13 +170,9 @@ impl TryFrom<&ConnectorAuthType> for AuthipayAuthType {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {
match auth_type {
- ConnectorAuthType::SignatureKey {
- api_key,
- api_secret,
- ..
- } => Ok(Self {
+ ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self {
api_key: api_key.to_owned(),
- api_secret: api_secret.to_owned(),
+ api_secret: key1.to_owned(),
}),
_ => Err(errors::ConnectorError::FailedToObtainAuthType.into()),
}