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(connectors): [Hipay] Fix 3DS Mandatory Fields (#7603)

awasthi21446716ee2044
diff --git a/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs b/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
index c0cff29184..beb6113f48 100644
--- a/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
@@ -1751,6 +1751,8 @@ fn convert_to_additional_payment_method_connector_response(
AdditionalPaymentMethodConnectorResponse::Card {
authentication_data,
payment_checks,
+ card_network: None,
+ domestic_network: None,
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
index 82539f77bb..b762c63b06 100644
--- a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
@@ -3331,6 +3331,8 @@ impl From<&ClientProcessorInformation> for AdditionalPaymentMethodConnectorRespo
Self::Card {
authentication_data: None,
payment_checks,
+ card_network: None,
+ domestic_network: None,
}
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs
index b121b0698c..a8bb76283e 100644
--- a/crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs
@@ -1,12 +1,19 @@
use std::collections::HashMap;
use common_enums::{enums, CardNetwork};
-use common_utils::{request::Method, types::StringMajorUnit};
+use common_utils::{
+ pii::{self},
+ request::Method,
+ types::StringMajorUnit,
+};
use hyperswitch_domain_models::{
payment_method_data::PaymentMethodData,
- router_data::{ConnectorAuthType, ErrorResponse, PaymentMethodToken, RouterData},
+ router_data::{
+ AdditionalPaymentMethodConnectorResponse, ConnectorAuthType, ConnectorResponseData,
+ ErrorResponse, PaymentMethodToken, RouterData,
+ },
router_flow_types::refunds::{Execute, RSync},
- router_request_types::{PaymentsAuthorizeData, ResponseId},
+ router_request_types::{BrowserInformation, PaymentsAuthorizeData, ResponseId},
router_response_types::{PaymentsResponseData, RedirectForm, RefundsResponseData},
types::{
PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
@@ -26,7 +33,7 @@ use crate::{
PaymentsSyncResponseRouterData, RefundsResponseRouterData, ResponseRouterData,
},
unimplemented_payment_method,
- utils::{self, CardData, PaymentsAuthorizeRequestData, RouterData as _},
+ utils::{self, AddressDetailsData, CardData, PaymentsAuthorizeRequestData, RouterData as _},
};
pub struct HipayRouterData<T> {
@@ -51,6 +58,20 @@ pub enum Operation {
Refund,
Cancel,
}
+#[derive(Debug, Serialize, Deserialize)]
+pub struct HipayBrowserInfo {
+ java_enabled: Option<bool>,
+ javascript_enabled: Option<bool>,
+ ipaddr: Option<std::net::IpAddr>,
+ http_accept: String,
+ http_user_agent: Option<String>,
+ language: Option<String>,
+ color_depth: Option<u8>,
+ screen_height: Option<u32>,
+ screen_width: Option<u32>,
+ timezone: Option<i32>,
+}
+
#[derive(Debug, Serialize, Deserialize)]
pub struct HipayPaymentsRequest {
operation: Operation,
@@ -66,13 +87,54 @@ pub struct HipayPaymentsRequest {
cancel_url: Option<String>,
accept_url: Option<String>,
notify_url: Option<String>,
+ #[serde(flatten)]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ three_ds_data: Option<ThreeDSPaymentData>,
+}
+#[derive(Debug, Serialize, Deserialize)]
+pub struct ThreeDSPaymentData {
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub firstname: Option<Secret<String>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub lastname: Option<Secret<String>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub email: Option<pii::Email>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub streetaddress: Option<Secret<String>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub city: Option<String>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub zipcode: Option<Secret<String>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub state: Option<Secret<String>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub country: Option<enums::CountryAlpha2>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub browser_info: Option<HipayBrowserInfo>,
}
+
#[derive(Debug, Serialize, Deserialize)]
pub struct HipayMaintenanceRequest {
operation: Operation,
currency: Option<enums::Currency>,
amount: Option<StringMajorUnit>,
}
+impl From<BrowserInformation> for HipayBrowserInfo {
+ fn from(browser_info: BrowserInformation) -> Self {
+ Self {
+ java_enabled: browser_info.java_enabled,
+ javascript_enabled: browser_info.java_script_enabled,
+ ipaddr: browser_info.ip_address,
+ http_accept: "*/*".to_string(),
+ http_user_agent: browser_info.user_agent,
+ language: browser_info.language,
+ color_depth: browser_info.color_depth,
+ screen_height: browser_info.screen_height,
+ screen_width: browser_info.screen_width,
+ timezone: browser_info.time_zone,
+ }
+ }
+}
#[derive(Default, Debug, Serialize, Deserialize)]
pub struct HiPayTokenRequest {
@@ -84,44 +146,66 @@ pub struct HiPayTokenRequest {
}
impl TryFrom<&HipayRouterData<&PaymentsAuthorizeRouterData>> for HipayPaymentsRequest {
type Error = error_stack::Report<errors::ConnectorError>;
+
fn try_from(item: &HipayRouterData<&PaymentsAuthorizeRouterData>) -> Result<Self, Self::Error> {
+ let (domestic_card_network, domestic_network) = item
+ .router_data
+ .connector_response
+ .clone()
+ .and_then(|response| match response.additional_payment_method_data {
+ Some(AdditionalPaymentMethodConnectorResponse::Card {
+ card_network,
+ domestic_network,
+ ..
+ }) => Some((card_network, domestic_network)),
+ _ => None,
+ })
+ .unwrap_or_default();
+
match item.router_data.request.payment_method_data.clone() {
PaymentMethodData::Card(req_card) => Ok(Self {
- operation: match item.router_data.request.is_auto_capture()? {
- true => Operation::Sale,
- false => Operation::Authorization,
- },
- authentication_indicator: match item.router_data.is_three_ds() {
- true => 2,
- false => 0,
+ operation: if item.router_data.request.is_auto_capture()? {
+ Operation::Sale
+ } else {
+ Operation::Authorization
},
+ authentication_indicator: if item.router_data.is_three_ds() { 2 } else { 0 },
cardtoken: match item.router_data.get_payment_method_token()? {
PaymentMethodToken::Token(token) => token,
PaymentMethodToken::ApplePayDecrypt(_) => {
- Err(unimplemented_payment_method!("Apple Pay", "Hipay"))?
+ return Err(unimplemented_payment_method!("Apple Pay", "Hipay").into());
}
PaymentMethodToken::PazeDecrypt(_) => {
- Err(unimplemented_payment_method!("Paze", "Hipay"))?
+ return Err(unimplemented_payment_method!("Paze", "Hipay").into());
}
PaymentMethodToken::GooglePayDecrypt(_) => {
- Err(unimplemented_payment_method!("Google Pay", "Hipay"))?
+ return Err(unimplemented_payment_method!("Google Pay", "Hipay").into());
}
},
orderid: item.router_data.connector_request_reference_id.clone(),
currency: item.router_data.request.currency,
- payment_product: match req_card.card_network {
- Some(CardNetwork::Visa) => "visa".to_string(),
- Some(CardNetwork::Mastercard) => "mastercard".to_string(),
- Some(CardNetwork::AmericanExpress) => "american-express".to_string(),
- Some(CardNetwork::JCB) => "jcb".to_string(),
- Some(CardNetwork::DinersClub) => "diners".to_string(),
- Some(CardNetwork::Discover) => "discover".to_string(),
- Some(CardNetwork::CartesBancaires) => "cb".to_string(),
- Some(CardNetwork::UnionPay) => "unionpay".to_string(),
- Some(CardNetwork::Interac) => "interac".to_string(),
- Some(CardNetwork::RuPay) => "rupay".to_string(),
- Some(CardNetwork::Maestro) => "maestro".to_string(),
- None => "".to_string(),
+ payment_product: match (domestic_network, domestic_card_network.as_deref()) {
+ (Some(domestic), _) => domestic,
+ (None, Some("VISA")) => "visa".to_string(),
+ (None, Some("MASTERCARD")) => "mastercard".to_string(),
+ (None, Some("MAESTRO")) => "maestro".to_string(),
+ (None, Some("AMERICAN EXPRESS")) => "american-express".to_string(),
+ (None, Some("CB")) => "cb".to_string(),
+ (None, Some("BCMC")) => "bcmc".to_string(),
+ (None, _) => match req_card.card_network {
+ Some(CardNetwork::Visa) => "visa".to_string(),
+ Some(CardNetwork::Mastercard) => "mastercard".to_string(),
+ Some(CardNetwork::AmericanExpress) => "american-express".to_string(),
+ Some(CardNetwork::JCB) => "jcb".to_string(),
+ Some(CardNetwork::DinersClub) => "diners".to_string(),
+ Some(CardNetwork::Discover) => "discover".to_string(),
+ Some(CardNetwork::CartesBancaires) => "cb".to_string(),
+ Some(CardNetwork::UnionPay) => "unionpay".to_string(),
+ Some(CardNetwork::Interac) => "interac".to_string(),
+ Some(CardNetwork::RuPay) => "rupay".to_string(),
+ Some(CardNetwork::Maestro) => "maestro".to_string(),
+ None => "".to_string(),
+ },
},
amount: item.amount.clone(),
description: item
@@ -134,6 +218,28 @@ impl TryFrom<&HipayRouterData<&PaymentsAuthorizeRouterData>> for HipayPaymentsRe
cancel_url: item.router_data.request.router_return_url.clone(),
accept_url: item.router_data.request.router_return_url.clone(),
notify_url: item.router_data.request.router_return_url.clone(),
+ three_ds_data: if item.router_data.is_three_ds() {
+ let billing_address = item.router_data.get_billing_address()?;
+ Some(ThreeDSPaymentData {
+ firstname: billing_address.get_optional_first_name(),
+ lastname: billing_address.get_optional_last_name(),
+ email: Some(
+ item.router_data
+ .get_billing_email()
+ .or(item.router_data.request.get_email())?,
+ ),
+ city: billing_address.get_optional_city(),
+ streetaddress: billing_address.get_optional_line1(),
+ zipcode: billing_address.get_optional_zip(),
+ state: billing_address.get_optional_state(),
+ country: billing_address.get_optional_country(),
+ browser_info: Some(HipayBrowserInfo::from(
+ item.router_data.request.get_browser_info()?,
+ )),
+ })
+ } else {
+ None
+ },
}),
_ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()),
}
@@ -160,6 +266,19 @@ impl TryFrom<&TokenizationRouterData> for HiPayTokenRequest {
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct HipayTokenResponse {
token: Secret<String>,
+ brand: String,
+ domestic_network: Option<String>,
+}
+
+impl From<&HipayTokenResponse> for AdditionalPaymentMethodConnectorResponse {
+ fn from(hipay_token_response: &HipayTokenResponse) -> Self {
+ Self::Card {
+ authentication_data: None,
+ payment_checks: None,
+ card_network: Some(hipay_token_response.brand.clone()),
+ domestic_network: hipay_token_response.domestic_network.clone(),
+ }
+ }
}
#[derive(Debug, Clone, Deserialize, Serialize)]
@@ -178,8 +297,11 @@ impl<F, T> TryFrom<ResponseRouterData<F, HipayTokenResponse, T, PaymentsResponse
) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(PaymentsResponseData::TokenizationResponse {
- token: item.response.token.expose().clone(),
+ token: item.response.token.clone().expose(),
}),
+ connector_response: Some(ConnectorResponseData::with_additional_payment_method_data(
+ AdditionalPaymentMethodConnectorResponse::from(&item.response),
+ )),
..item.data
})
}
@@ -237,9 +359,20 @@ impl<F>
PaymentsResponseData,
>,
) -> Result<Self, Self::Error> {
- Ok(Self {
- status: common_enums::AttemptStatus::from(item.response.status),
- response: Ok(PaymentsResponseData::TransactionResponse {
+ let status = common_enums::AttemptStatus::from(item.response.status);
+ let response = if status == enums::AttemptStatus::Failure {
+ Err(ErrorResponse {
+ code: NO_ERROR_CODE.to_string(),
+ message: item.response.message.clone(),
+ reason: Some(item.response.message.clone()),
+ attempt_status: None,
+ connector_transaction_id: Some(item.response.transaction_reference),
+ status_code: item.http_code,
+ issuer_error_code: None,
+ issuer_error_message: None,
+ })
+ } else {
+ Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_reference,
),
@@ -257,7 +390,11 @@ impl<F>
connector_response_reference_id: None,
incremental_authorization_allowed: None,
charges: None,
- }),
+ })
+ };
+ Ok(Self {
+ status,
+ response,
..item.data
})
}
@@ -521,7 +658,7 @@ impl TryFrom<PaymentsCancelResponseRouterData<HipayMaintenanceResponse<HipayPaym
#[derive(Debug, Serialize, Deserialize)]
pub struct Reason {
reason: Option<String>,
- code: Option<u8>,
+ code: Option<u64>,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
diff --git a/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs b/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
index 6837a6e2a7..5d87172de2 100644
--- a/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs
@@ -1803,6 +1803,8 @@ impl From<&ClientProcessorInformation> for AdditionalPaymentMethodConnectorRespo
Self::Card {
authentication_data: None,
payment_checks,
+ card_network: None,
+ domestic_network: None,
}
}
}
diff --git a/crates/hyperswitch_domain_models/src/router_data.rs b/crates/hyperswitch_domain_models/src/router_data.rs
index ce73287ef7..c4eeb33430 100644
--- a/crates/hyperswitch_domain_models/src/router_data.rs
+++ b/crates/hyperswitch_domain_models/src/router_data.rs
@@ -388,6 +388,10 @@ pub enum AdditionalPaymentMethodConnectorResponse {
authentication_data: Option<serde_json::Value>,
/// Various payment checks that are done for a payment
payment_checks: Option<serde_json::Value>,
+ /// Card Network returned by the processor
+ card_network: Option<String>,
+ /// Domestic(Co-Branded) Card network returned by the processor
+ domestic_network: Option<String>,
},
PayLater {
klarna_sdk: Option<KlarnaSdkResponse>,
diff --git a/crates/router/src/configs/defaults/payment_connector_required_fields.rs b/crates/router/src/configs/defaults/payment_connector_required_fields.rs
index 8126f02623..fc2e6dc51f 100644
--- a/crates/router/src/configs/defaults/payment_connector_required_fields.rs
+++ b/crates/router/src/configs/defaults/payment_connector_required_fields.rs
@@ -1848,6 +1848,64 @@ impl Default for settings::RequiredFields {
non_mandate: HashMap::new(),
common: HashMap::from(
[
+ (
+ "billing.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.state".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.state".to_string(),
+ display_name: "state".to_string(),
+ field_type: enums::FieldType::UserAddressState,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "ALL".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserAddressLine1,
+ value: None,
+ }
+ ),
(
"payment_method_data.card.card_number".to_string(),
RequiredFieldInfo {
@@ -5487,6 +5545,64 @@ impl Default for settings::RequiredFields {
non_mandate: HashMap::new(),
common: HashMap::from(
[
+ (
+ "billing.address.city".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.city".to_string(),
+ display_name: "city".to_string(),
+ field_type: enums::FieldType::UserAddressCity,
+ value: None,
+ }
+ ),
+ (
+ "billing.email".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.email".to_string(),
+ display_name: "email".to_string(),
+ field_type: enums::FieldType::UserEmailAddress,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.state".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.state".to_string(),
+ display_name: "state".to_string(),
+ field_type: enums::FieldType::UserAddressState,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.zip".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.zip".to_string(),
+ display_name: "zip".to_string(),
+ field_type: enums::FieldType::UserAddressPincode,
+ value: None,
+ }
+ ),
+ (
+ "billing.address.country".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.country".to_string(),
+ display_name: "country".to_string(),
+ field_type: enums::FieldType::UserAddressCountry{
+ options: vec![
+ "ALL".to_string(),
+ ]
+ },
+ value: None,
+ }
+ ),
+ (
+ "billing.address.line1".to_string(),
+ RequiredFieldInfo {
+ required_field: "payment_method_data.billing.address.line1".to_string(),
+ display_name: "line1".to_string(),
+ field_type: enums::FieldType::UserAddressLine1,
+ value: None,
+ }
+ ),
(
"payment_method_data.card.card_number".to_string(),
RequiredFieldInfo {
diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs
index 1cc04dabd7..70471985d9 100644
--- a/crates/router/src/connector/stripe/transformers.rs
+++ b/crates/router/src/connector/stripe/transformers.rs
@@ -2386,6 +2386,8 @@ impl From<AdditionalPaymentMethodDetails> for types::AdditionalPaymentMethodConn
Self::Card {
authentication_data: item.authentication_details,
payment_checks: item.payment_checks,
+ card_network: None,
+ domestic_network: None,
}
}
}
diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs
index 67e1d25b3c..ee0ffe77ca 100644
--- a/crates/router/src/core/payments/flows.rs
+++ b/crates/router/src/core/payments/flows.rs
@@ -138,6 +138,7 @@ pub trait Feature<F, T> {
Ok(types::PaymentMethodTokenResult {
payment_method_token_result: Ok(None),
is_payment_method_tokenization_performed: false,
+ connector_response: None,
})
}
diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
index 54dca9b2e4..672035b1ad 100644
--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
@@ -181,6 +181,7 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>
Ok(types::PaymentMethodTokenResult {
payment_method_token_result: Ok(None),
is_payment_method_tokenization_performed: false,
+ connector_response: None,
})
}
}
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 31ba211a60..5583dcba1e 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -6550,6 +6550,7 @@ pub fn add_connector_response_to_additional_payment_data(
AdditionalPaymentMethodConnectorResponse::Card {
authentication_data,
payment_checks,
+ ..
},
) => api_models::payments::AdditionalPaymentData::Card(Box::new(
api_models::payments::AdditionalCardInfo {
diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rs
index 1bc0152f4d..49f8d7b8eb 100644
--- a/crates/router/src/core/payments/tokenization.rs
+++ b/crates/router/src/core/payments/tokenization.rs
@@ -1161,11 +1161,13 @@ pub async fn add_payment_method_token<F: Clone, T: types::Tokenizable + Clone>(
Ok(types::PaymentMethodTokenResult {
payment_method_token_result: payment_token_resp,
is_payment_method_tokenization_performed: true,
+ connector_response: resp.connector_response.clone(),
})
}
_ => Ok(types::PaymentMethodTokenResult {
payment_method_token_result: Ok(None),
is_payment_method_tokenization_performed: false,
+ connector_response: None,
}),
}
} else {
@@ -1173,6 +1175,7 @@ pub async fn add_payment_method_token<F: Clone, T: types::Tokenizable + Clone>(
Ok(types::PaymentMethodTokenResult {
payment_method_token_result: Ok(None),
is_payment_method_tokenization_performed: false,
+ connector_response: None,
})
}
}
@@ -1191,7 +1194,10 @@ pub fn update_router_data_with_payment_method_token_result<F: Clone, T>(
pm_token,
))
});
-
+ if router_data.connector_response.is_none() {
+ router_data.connector_response =
+ payment_method_token_result.connector_response.clone();
+ }
true
}
Err(err) => {
diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs
index 1e1509f8db..4b506798de 100644
--- a/crates/router/src/types.rs
+++ b/crates/router/src/types.rs
@@ -511,6 +511,7 @@ pub struct AddAccessTokenResult {
pub struct PaymentMethodTokenResult {
pub payment_method_token_result: Result<Option<String>, ErrorResponse>,
pub is_payment_method_tokenization_performed: bool,
+ pub connector_response: Option<ConnectorResponseData>,
}
pub struct PspTokenResult {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Hipay.js b/cypress-tests/cypress/e2e/configs/Payment/Hipay.js
index 665c27bd12..0a9ed82621 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Hipay.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Hipay.js
@@ -7,6 +7,25 @@ const successfulNo3DSCardDetails = {
card_holder_name: "joseph Doe",
card_cvc: "123",
};
+
+const billing_info = {
+ address: {
+ line1: "1467",
+ line2: "CA",
+ line3: "CA",
+ city: "Florence",
+ state: "Tuscany",
+ zip: "12345",
+ country: "IT",
+ first_name: "Max",
+ last_name: "Mustermann",
+ },
+ email: "[email protected]",
+ phone: {
+ number: "9123456789",
+ country_code: "+91",
+ },
+};
const successful3DSCardDetails = {
card_number: "4000000000000002",
card_exp_month: "06",
@@ -40,24 +59,7 @@ export const connectorDetails = {
currency: "EUR",
customer_acceptance: null,
setup_future_usage: "on_session",
- billing: {
- address: {
- line1: "1467",
- line2: "CA",
- line3: "CA",
- city: "Florence",
- state: "Tuscany",
- zip: "12345",
- country: "IT",
- first_name: "Max",
- last_name: "Mustermann",
- },
- email: "[email protected]",
- phone: {
- number: "9123456789",
- country_code: "+91",
- },
- },
+ billing: billing_info,
},
Response: {
status: 200,
@@ -560,9 +562,7 @@ export const connectorDetails = {
card: successful3DSCardDetails,
},
currency: "EUR",
- billing: {
- email: "[email protected]",
- },
+ billing: billing_info,
customer_acceptance: null,
setup_future_usage: "on_session",
},
@@ -582,9 +582,7 @@ export const connectorDetails = {
payment_method_data: {
card: successful3DSCardDetails,
},
- billing: {
- email: "[email protected]",
- },
+ billing: billing_info,
currency: "EUR",
customer_acceptance: null,
setup_future_usage: "on_session",