diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml index 84dfabd1c5..9a87e12dc9 100644 --- a/crates/connector_configs/toml/development.toml +++ b/crates/connector_configs/toml/development.toml @@ -7167,9 +7167,9 @@ key1 = "TokenEx ID" [gigadat] [gigadat.connector_auth.SignatureKey] -api_key = "Username" -api_secret = "Password" -key1 = "Compaign Id" +api_key = "Access Token" +api_secret = "Security Token" +key1 = "Campaign ID" [[gigadat.bank_redirect]] payment_method_type = "interac" [gigadat.metadata.site] diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml index b4fcbe8e18..cb699c91fa 100644 --- a/crates/connector_configs/toml/production.toml +++ b/crates/connector_configs/toml/production.toml @@ -5904,9 +5904,9 @@ api_key = "API Key" [gigadat] [gigadat.connector_auth.SignatureKey] -api_key = "Username" -api_secret = "Password" -key1 = "Compaign Id" +api_key = "Access Token" +api_secret = "Security Token" +key1 = "Campaign ID" [[gigadat.bank_redirect]] payment_method_type = "interac" [gigadat.metadata.site] diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml index 02abf6c2a0..89966f8cd0 100644 --- a/crates/connector_configs/toml/sandbox.toml +++ b/crates/connector_configs/toml/sandbox.toml @@ -7145,9 +7145,9 @@ api_key = "API Key" [gigadat] [gigadat.connector_auth.SignatureKey] -api_key = "Username" -api_secret = "Password" -key1 = "Compaign Id" +api_key = "Access Token" +api_secret = "Security Token" +key1 = "Campaign ID" [[gigadat.bank_redirect]] payment_method_type = "interac" [gigadat.metadata.site] diff --git a/crates/hyperswitch_connectors/src/connectors/gigadat.rs b/crates/hyperswitch_connectors/src/connectors/gigadat.rs index 6b566ef3be..973e1ae6f3 100644 --- a/crates/hyperswitch_connectors/src/connectors/gigadat.rs +++ b/crates/hyperswitch_connectors/src/connectors/gigadat.rs @@ -124,7 +124,11 @@ impl ConnectorCommon for Gigadat { ) -> CustomResult)>, errors::ConnectorError> { let auth = gigadat::GigadatAuthType::try_from(auth_type) .change_context(errors::ConnectorError::FailedToObtainAuthType)?; - let auth_key = format!("{}:{}", auth.username.peek(), auth.password.peek()); + let auth_key = format!( + "{}:{}", + auth.access_token.peek(), + auth.security_token.peek() + ); let auth_header = format!("Basic {}", consts::BASE64_ENGINE.encode(auth_key)); Ok(vec![( headers::AUTHORIZATION.to_string(), @@ -448,7 +452,11 @@ impl ConnectorIntegration for Gigadat ) -> CustomResult)>, errors::ConnectorError> { let auth = gigadat::GigadatAuthType::try_from(&req.connector_auth_type) .change_context(errors::ConnectorError::FailedToObtainAuthType)?; - let auth_key = format!("{}:{}", auth.username.peek(), auth.password.peek()); + let auth_key = format!( + "{}:{}", + auth.access_token.peek(), + auth.security_token.peek() + ); let auth_header = format!("Basic {}", consts::BASE64_ENGINE.encode(auth_key)); Ok(vec![ ( diff --git a/crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs b/crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs index d87bb6374e..060628f7a4 100644 --- a/crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs @@ -67,6 +67,7 @@ pub struct GigadatCpiRequest { pub transaction_id: String, #[serde(rename = "type")] pub transaction_type: GidadatTransactionType, + pub sandbox: bool, pub name: Secret, pub email: Email, pub mobile: Secret, @@ -95,9 +96,11 @@ impl TryFrom<&GigadatRouterData<&PaymentsAuthorizeRouterData>> for GigadatCpiReq let email = router_data.get_billing_email()?; let mobile = router_data.get_billing_phone_number()?; let currency = item.router_data.request.currency; - + let sandbox = match item.router_data.test_mode { + Some(true) => true, + Some(false) | None => false, + }; let user_ip = router_data.request.get_browser_info()?.get_ip_address()?; - Ok(Self { user_id: router_data.get_customer_id()?, site: metadata.site, @@ -107,6 +110,7 @@ impl TryFrom<&GigadatRouterData<&PaymentsAuthorizeRouterData>> for GigadatCpiReq transaction_id: router_data.connector_request_reference_id.clone(), transaction_type: GidadatTransactionType::Cpi, name, + sandbox, email, mobile, }) @@ -126,8 +130,8 @@ impl TryFrom<&GigadatRouterData<&PaymentsAuthorizeRouterData>> for GigadatCpiReq #[derive(Debug, Clone)] pub struct GigadatAuthType { pub campaign_id: Secret, - pub username: Secret, - pub password: Secret, + pub access_token: Secret, + pub security_token: Secret, } impl TryFrom<&ConnectorAuthType> for GigadatAuthType { @@ -140,8 +144,8 @@ impl TryFrom<&ConnectorAuthType> for GigadatAuthType { key1, api_secret, } => Ok(Self { - password: api_secret.to_owned(), - username: api_key.to_owned(), + security_token: api_secret.to_owned(), + access_token: api_key.to_owned(), campaign_id: key1.to_owned(), }), _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()), @@ -206,7 +210,7 @@ impl TryFrom