Bug: [FEATURE] [GETNET] Implement Card Flows



Getnet Card Implementation
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index d93208fb665..53af0100c4f 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -7629,6 +7629,7 @@
           "fiservemea",
           "fiuu",
           "forte",
+          "getnet",
           "globalpay",
           "globepay",
           "gocardless",
@@ -9757,6 +9758,12 @@
               "user_card_cvc"
             ]
           },
+          {
+            "type": "string",
+            "enum": [
+              "user_card_network"
+            ]
+          },
           {
             "type": "string",
             "enum": [
@@ -20297,6 +20304,7 @@
           "fiservemea",
           "fiuu",
           "forte",
+          "getnet",
           "globalpay",
           "globepay",
           "gocardless",
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index 6ae46a5ede0..bd328c75a09 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -211,6 +211,7 @@ pub enum FieldType {
     UserCardExpiryMonth,
     UserCardExpiryYear,
     UserCardCvc,
+    UserCardNetwork,
     UserFullName,
     UserEmailAddress,
     UserPhoneNumber,
diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rs
index e58d934a56b..afa6d367ffe 100644
--- a/crates/common_enums/src/connector_enums.rs
+++ b/crates/common_enums/src/connector_enums.rs
@@ -81,7 +81,7 @@ pub enum RoutableConnectors {
     Fiservemea,
     Fiuu,
     Forte,
-    // Getnet,
+    Getnet,
     Globalpay,
     Globepay,
     Gocardless,
@@ -224,7 +224,7 @@ pub enum Connector {
     Fiservemea,
     Fiuu,
     Forte,
-    // Getnet,
+    Getnet,
     Globalpay,
     Globepay,
     Gocardless,
@@ -382,7 +382,7 @@ impl Connector {
             | Self::Fiservemea
             | Self::Fiuu
             | Self::Forte
-            // | Self::Getnet
+            | Self::Getnet
             | Self::Globalpay
             | Self::Globepay
             | Self::Gocardless
@@ -520,6 +520,7 @@ impl From<RoutableConnectors> for Connector {
             RoutableConnectors::Fiservemea => Self::Fiservemea,
             RoutableConnectors::Fiuu => Self::Fiuu,
             RoutableConnectors::Forte => Self::Forte,
+            RoutableConnectors::Getnet => Self::Getnet,
             RoutableConnectors::Globalpay => Self::Globalpay,
             RoutableConnectors::Globepay => Self::Globepay,
             RoutableConnectors::Gocardless => Self::Gocardless,
diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rs
index 2ac83b81e03..de5e4111d4f 100644
--- a/crates/connector_configs/src/connector.rs
+++ b/crates/connector_configs/src/connector.rs
@@ -195,7 +195,7 @@ pub struct ConnectorConfig {
     pub fiservemea: Option<ConnectorTomlConfig>,
     pub fiuu: Option<ConnectorTomlConfig>,
     pub forte: Option<ConnectorTomlConfig>,
-    // pub getnet: Option<ConnectorTomlConfig>,
+    pub getnet: Option<ConnectorTomlConfig>,
     pub globalpay: Option<ConnectorTomlConfig>,
     pub globepay: Option<ConnectorTomlConfig>,
     pub gocardless: Option<ConnectorTomlConfig>,
@@ -366,7 +366,7 @@ impl ConnectorConfig {
             Connector::Fiservemea => Ok(connector_data.fiservemea),
             Connector::Fiuu => Ok(connector_data.fiuu),
             Connector::Forte => Ok(connector_data.forte),
-            // Connector::Getnet => Ok(connector_data.getnet),
+            Connector::Getnet => Ok(connector_data.getnet),
             Connector::Globalpay => Ok(connector_data.globalpay),
             Connector::Globepay => Ok(connector_data.globepay),
             Connector::Gocardless => Ok(connector_data.gocardless),
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index 2708fe11af5..2ec49c5812f 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -1618,6 +1618,30 @@ key2="Location ID"
 [forte.connector_webhook_details]
 merchant_secret="Source verification key"
 
+[getnet]
+[[getnet.credit]]
+  payment_method_type = "Mastercard"
+[[getnet.credit]]
+  payment_method_type = "Visa"
+[[getnet.credit]]
+  payment_method_type = "Interac"
+[[getnet.credit]]
+  payment_method_type = "AmericanExpress"
+[[getnet.credit]]
+  payment_method_type = "JCB"
+[[getnet.credit]]
+  payment_method_type = "DinersClub"
+[[getnet.credit]]
+  payment_method_type = "Discover"
+[[getnet.credit]]
+  payment_method_type = "CartesBancaires"
+[[getnet.credit]]
+  payment_method_type = "UnionPay"
+[[getnet.credit]]
+  payment_method_type = "Rupay"
+[[getnet.credit]]
+  payment_method_type = "Maestro"
+
 [globalpay]
 [[globalpay.credit]]
   payment_method_type = "Mastercard"
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index 52535d57b4a..569f7208ae0 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -1343,6 +1343,30 @@ key2="Location ID"
 merchant_secret="Source verification key"
 
 
+[getnet]
+[[getnet.credit]]
+  payment_method_type = "Mastercard"
+[[getnet.credit]]
+  payment_method_type = "Visa"
+[[getnet.credit]]
+  payment_method_type = "Interac"
+[[getnet.credit]]
+  payment_method_type = "AmericanExpress"
+[[getnet.credit]]
+  payment_method_type = "JCB"
+[[getnet.credit]]
+  payment_method_type = "DinersClub"
+[[getnet.credit]]
+  payment_method_type = "Discover"
+[[getnet.credit]]
+  payment_method_type = "CartesBancaires"
+[[getnet.credit]]
+  payment_method_type = "UnionPay"
+[[getnet.credit]]
+  payment_method_type = "Rupay"
+[[getnet.credit]]
+  payment_method_type = "Maestro"
+
 [globalpay]
 [[globalpay.credit]]
   payment_method_type = "Mastercard"
diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml
index da8f9ba62e5..e83cc9f76f2 100644
--- a/crates/connector_configs/toml/sandbox.toml
+++ b/crates/connector_configs/toml/sandbox.toml
@@ -1568,6 +1568,30 @@ key2="Location ID"
 [forte.connector_webhook_details]
 merchant_secret="Source verification key"
 
+[getnet]
+[[getnet.credit]]
+  payment_method_type = "Mastercard"
+[[getnet.credit]]
+  payment_method_type = "Visa"
+[[getnet.credit]]
+  payment_method_type = "Interac"
+[[getnet.credit]]
+  payment_method_type = "AmericanExpress"
+[[getnet.credit]]
+  payment_method_type = "JCB"
+[[getnet.credit]]
+  payment_method_type = "DinersClub"
+[[getnet.credit]]
+  payment_method_type = "Discover"
+[[getnet.credit]]
+  payment_method_type = "CartesBancaires"
+[[getnet.credit]]
+  payment_method_type = "UnionPay"
+[[getnet.credit]]
+  payment_method_type = "Rupay"
+[[getnet.credit]]
+  payment_method_type = "Maestro"
+
 [globalpay]
 [[globalpay.credit]]
   payment_method_type = "Mastercard"
diff --git a/crates/hyperswitch_connectors/src/connectors/getnet.rs b/crates/hyperswitch_connectors/src/connectors/getnet.rs
index 557dfbeaca3..263b1ad5b46 100644
--- a/crates/hyperswitch_connectors/src/connectors/getnet.rs
+++ b/crates/hyperswitch_connectors/src/connectors/getnet.rs
@@ -1,12 +1,16 @@
 pub mod transformers;
-
+use api_models::webhooks::IncomingWebhookEvent;
+use base64::{self, Engine};
+use common_enums::enums;
 use common_utils::{
+    consts::BASE64_ENGINE,
+    crypto,
     errors::CustomResult,
     ext_traits::BytesExt,
     request::{Method, Request, RequestBuilder, RequestContent},
-    types::{AmountConvertor, StringMinorUnit, StringMinorUnitForConnector},
+    types::{AmountConvertor, FloatMajorUnit, FloatMajorUnitForConnector},
 };
-use error_stack::{report, ResultExt};
+use error_stack::ResultExt;
 use hyperswitch_domain_models::{
     router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData},
     router_flow_types::{
@@ -21,8 +25,8 @@ use hyperswitch_domain_models::{
     },
     router_response_types::{PaymentsResponseData, RefundsResponseData},
     types::{
-        PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,
-        RefundSyncRouterData, RefundsRouterData,
+        PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
+        PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData,
     },
 };
 use hyperswitch_interfaces::{
@@ -31,25 +35,26 @@ use hyperswitch_interfaces::{
         ConnectorValidation,
     },
     configs::Connectors,
-    errors,
+    errors::{self},
     events::connector_api_logs::ConnectorEvent,
     types::{self, Response},
-    webhooks,
+    webhooks::{self},
 };
-use masking::{ExposeInterface, Mask};
+use masking::{Mask, PeekInterface, Secret};
+use ring::hmac;
 use transformers as getnet;
 
 use crate::{constants::headers, types::ResponseRouterData, utils};
 
 #[derive(Clone)]
 pub struct Getnet {
-    amount_converter: &'static (dyn AmountConvertor<Output = StringMinorUnit> + Sync),
+    amount_converter: &'static (dyn AmountConvertor<Output = FloatMajorUnit> + Sync),
 }
 
 impl Getnet {
     pub fn new() -> &'static Self {
         &Self {
-            amount_converter: &StringMinorUnitForConnector,
+            amount_converter: &FloatMajorUnitForConnector,
         }
     }
 }
@@ -82,10 +87,16 @@ where
         req: &RouterData<Flow, Request, Response>,
         _connectors: &Connectors,
     ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
-        let mut header = vec![(
-            headers::CONTENT_TYPE.to_string(),
-            self.get_content_type().to_string().into(),
-        )];
+        let mut header = vec![
+            (
+                headers::CONTENT_TYPE.to_string(),
+                self.get_content_type().to_string().into(),
+            ),
+            (
+                headers::ACCEPT.to_string(),
+                self.get_accept_type().to_string().into(),
+            ),
+        ];
         let mut api_key = self.get_auth_header(&req.connector_auth_type)?;
         header.append(&mut api_key);
         Ok(header)
@@ -99,9 +110,6 @@ impl ConnectorCommon for Getnet {
 
     fn get_currency_unit(&self) -> api::CurrencyUnit {
         api::CurrencyUnit::Base
-        //    TODO! Check connector documentation, on which unit they are processing the currency.
-        //    If the connector accepts amount in lower unit ( i.e cents for USD) then return api::CurrencyUnit::Minor,
-        //    if connector accepts amount in base unit (i.e dollars for USD) then return api::CurrencyUnit::Base
     }
 
     fn common_get_content_type(&self) -> &'static str {
@@ -118,9 +126,12 @@ impl ConnectorCommon for Getnet {
     ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
         let auth = getnet::GetnetAuthType::try_from(auth_type)
             .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+        let encoded_api_key =
+            BASE64_ENGINE.encode(format!("{}:{}", auth.username.peek(), auth.password.peek()));
+
         Ok(vec![(
             headers::AUTHORIZATION.to_string(),
-            auth.api_key.expose().into_masked(),
+            format!("Basic {encoded_api_key}").into_masked(),
         )])
     }
 
@@ -149,16 +160,60 @@ impl ConnectorCommon for Getnet {
 }
 
 impl ConnectorValidation for Getnet {
-    //TODO: implement functions when support enabled
-}
+    fn validate_connector_against_payment_request(
+        &self,
+        capture_method: Option<enums::CaptureMethod>,
+        _payment_method: enums::PaymentMethod,
+        _pmt: Option<enums::PaymentMethodType>,
+    ) -> CustomResult<(), errors::ConnectorError> {
+        let capture_method = capture_method.unwrap_or_default();
+        match capture_method {
+            enums::CaptureMethod::Automatic
+            | enums::CaptureMethod::Manual
+            | enums::CaptureMethod::SequentialAutomatic => Ok(()),
+            enums::CaptureMethod::Scheduled | enums::CaptureMethod::ManualMultiple => Err(
+                utils::construct_not_implemented_error_report(capture_method, self.id()),
+            ),
+        }
+    }
 
-impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Getnet {
-    //TODO: implement sessions flow
+    fn validate_psync_reference_id(
+        &self,
+        data: &PaymentsSyncData,
+        _is_three_ds: bool,
+        _status: enums::AttemptStatus,
+        _connector_meta_data: Option<common_utils::pii::SecretSerdeValue>,
+    ) -> CustomResult<(), errors::ConnectorError> {
+        if data.encoded_data.is_some()
+            || data
+                .connector_transaction_id
+                .get_connector_transaction_id()
+                .is_ok()
+        {
+            return Ok(());
+        }
+
+        Err(errors::ConnectorError::MissingConnectorTransactionID.into())
+    }
 }
 
+impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Getnet {}
+
 impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Getnet {}
 
-impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Getnet {}
+impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Getnet {
+    // Not Implemented (R)
+    fn build_request(
+        &self,
+        _req: &RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponseData>,
+        _connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, errors::ConnectorError> {
+        Err(
+            errors::ConnectorError::NotImplemented("Setup Mandate flow for Getnet".to_string())
+                .into(),
+        )
+    }
+}
 
 impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Getnet {
     fn get_headers(
@@ -176,9 +231,10 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
     fn get_url(
         &self,
         _req: &PaymentsAuthorizeRouterData,
-        _connectors: &Connectors,
+        connectors: &Connectors,
     ) -> CustomResult<String, errors::ConnectorError> {
-        Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
+        let endpoint = self.base_url(connectors);
+        Ok(format!("{endpoint}/payments/"))
     }
 
     fn get_request_body(
@@ -191,10 +247,11 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
             req.request.minor_amount,
             req.request.currency,
         )?;
-
         let connector_router_data = getnet::GetnetRouterData::from((amount, req));
         let connector_req = getnet::GetnetPaymentsRequest::try_from(&connector_router_data)?;
-        Ok(RequestContent::Json(Box::new(connector_req)))
+        let res = RequestContent::Json(Box::new(connector_req));
+
+        Ok(res)
     }
 
     fn build_request(
@@ -262,10 +319,24 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Get
 
     fn get_url(
         &self,
-        _req: &PaymentsSyncRouterData,
-        _connectors: &Connectors,
+        req: &PaymentsSyncRouterData,
+        connectors: &Connectors,
     ) -> CustomResult<String, errors::ConnectorError> {
-        Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
+        let auth = getnet::GetnetAuthType::try_from(&req.connector_auth_type)
+            .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+        let merchant_id = auth.merchant_id.peek();
+
+        let endpoint = self.base_url(connectors);
+        let transaction_id = req
+            .request
+            .connector_transaction_id
+            .get_connector_transaction_id()
+            .change_context(errors::ConnectorError::MissingConnectorTransactionID)?;
+
+        Ok(format!(
+            "{}/merchants/{}/payments/{}",
+            endpoint, merchant_id, transaction_id
+        ))
     }
 
     fn build_request(
@@ -327,17 +398,26 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
     fn get_url(
         &self,
         _req: &PaymentsCaptureRouterData,
-        _connectors: &Connectors,
+        connectors: &Connectors,
     ) -> CustomResult<String, errors::ConnectorError> {
-        Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
+        let endpoint = self.base_url(connectors);
+        Ok(format!("{endpoint}/payments/"))
     }
 
     fn get_request_body(
         &self,
-        _req: &PaymentsCaptureRouterData,
+        req: &PaymentsCaptureRouterData,
         _connectors: &Connectors,
     ) -> CustomResult<RequestContent, errors::ConnectorError> {
-        Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into())
+        let amount = utils::convert_amount(
+            self.amount_converter,
+            req.request.minor_amount_to_capture,
+            req.request.currency,
+        )?;
+
+        let connector_router_data = getnet::GetnetRouterData::from((amount, req));
+        let connector_req = getnet::GetnetCaptureRequest::try_from(&connector_router_data)?;
+        Ok(RequestContent::Json(Box::new(connector_req)))
     }
 
     fn build_request(
@@ -366,7 +446,7 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
         event_builder: Option<&mut ConnectorEvent>,
         res: Response,
     ) -> CustomResult<PaymentsCaptureRouterData, errors::ConnectorError> {
-        let response: getnet::GetnetPaymentsResponse = res
+        let response: getnet::GetnetCaptureResponse = res
             .response
             .parse_struct("Getnet PaymentsCaptureResponse")
             .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
@@ -377,6 +457,7 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
             data: data.clone(),
             http_code: res.status_code,
         })
+        .change_context(errors::ConnectorError::ResponseHandlingFailed)
     }
 
     fn get_error_response(
@@ -388,7 +469,84 @@ impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fo
     }
 }
 
-impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Getnet {}
+impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Getnet {
+    fn get_headers(
+        &self,
+        req: &PaymentsCancelRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
+        self.build_headers(req, connectors)
+    }
+
+    fn get_content_type(&self) -> &'static str {
+        self.common_get_content_type()
+    }
+
+    fn get_url(
+        &self,
+        _req: &PaymentsCancelRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<String, errors::ConnectorError> {
+        let endpoint = self.base_url(connectors);
+        Ok(format!("{endpoint}/payments/"))
+    }
+
+    fn get_request_body(
+        &self,
+        req: &PaymentsCancelRouterData,
+        _connectors: &Connectors,
+    ) -> CustomResult<RequestContent, errors::ConnectorError> {
+        let connector_req = getnet::GetnetCancelRequest::try_from(req)?;
+        Ok(RequestContent::Json(Box::new(connector_req)))
+    }
+
+    fn build_request(
+        &self,
+        req: &PaymentsCancelRouterData,
+        connectors: &Connectors,
+    ) -> CustomResult<Option<Request>, errors::ConnectorError> {
+        Ok(Some(
+            RequestBuilder::new()
+                .method(Method::Post)
+                .url(&types::PaymentsVoidType::get_url(self, req, connectors)?)
+                .attach_default_headers()
+                .headers(types::PaymentsVoidType::get_headers(self, req, connectors)?)
+                .set_body(types::PaymentsVoidType::get_request_body(
+                    self, req, connectors,
+                )?)
+                .build(),
+        ))
+    }
+
+    fn handle_response(
+        &self,
+        data: &PaymentsCancelRouterData,
+        event_builder: Option<&mut ConnectorEvent>,
+        res: Response,
+    ) -> CustomResult<PaymentsCancelRouterData, errors::ConnectorError> {
+        let response: getnet::GetnetCancelResponse = res
+            .response
+            .parse_struct("GetnetPaymentsVoidResponse")
+            .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
+
+        event_builder.map(|i| i.set_response_body(&response));
+        router_env::logger::info!(connector_response=?response);
+
+        RouterData::try_from(ResponseRouterData {
+            response,
+            data: data.clone(),
+            http_code: res.status_code,
+        })
+    }
+
+    fn get_error_response(
+        &self,
+        res: Response,
+        event_builder: Option<&mut ConnectorEvent>,
+    ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
+        self.build_error_response(res, event_builder)
+    }
+}
 
 impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Getnet {
     fn get_headers(
@@ -406,9 +564,10 @@ impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Getnet
     fn get_url(
         &self,
         _req: &RefundsRouterData<Execute>,
-        _connectors: &Connectors,
+        connectors: &Connectors,
     ) -> CustomResult<String, errors::ConnectorError> {
-        Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
+        let endpoint = self.base_url(connectors);
+        Ok(format!("{endpoint}/payments/"))
     }
 
     fn get_request_body(
@@ -489,10 +648,19 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Getnet {
 
     fn get_url(
         &self,
-        _req: &RefundSyncRouterData,
-        _connectors: &Connectors,
+        req: &RefundSyncRouterData,
+        connectors: &Connectors,
     ) -> CustomResult<String, errors::ConnectorError> {
-        Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
+        let auth = getnet::GetnetAuthType::try_from(&req.connector_auth_type)
+            .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+        let merchant_id = auth.merchant_id.peek();
+        let endpoint = self.base_url(connectors);
+        let transaction_id = req.request.connector_transaction_id.clone();
+
+        Ok(format!(
+            "{}/merchants/{}/payments/{}",
+            endpoint, merchant_id, transaction_id
+        ))
     }
 
     fn build_request(
@@ -543,25 +711,118 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Getnet {
 
 #[async_trait::async_trait]
 impl webhooks::IncomingWebhook for Getnet {
-    fn get_webhook_object_reference_id(
+    fn get_webhook_source_verification_algorithm(
         &self,
         _request: &webhooks::IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<Box<dyn crypto::VerifySignature + Send>, errors::ConnectorError> {
+        Ok(Box::new(crypto::HmacSha256))
+    }
+
+    fn get_webhook_source_verification_signature(
+        &self,
+        request: &webhooks::IncomingWebhookRequestDetails<'_>,
+        _connector_webhook_secrets: &api_models::webhooks::ConnectorWebhookSecrets,
+    ) -> CustomResult<Vec<u8>, errors::ConnectorError> {
+        let notif_item = getnet::get_webhook_response(request.body)
+            .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?;
+        let response_base64 = &notif_item.response_base64.peek().clone();
+        BASE64_ENGINE
+            .decode(response_base64)
+            .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)
+    }
+
+    fn get_webhook_source_verification_message(
+        &self,
+        request: &webhooks::IncomingWebhookRequestDetails<'_>,
+        _merchant_id: &common_utils::id_type::MerchantId,
+        _connector_webhook_secrets: &api_models::webhooks::ConnectorWebhookSecrets,
+    ) -> CustomResult<Vec<u8>, errors::ConnectorError> {
+        let notif = getnet::get_webhook_response(request.body)
+            .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?;
+
+        Ok(notif.response_base64.peek().clone().into_bytes())
+    }
+
+    fn get_webhook_object_reference_id(
+        &self,
+        request: &webhooks::IncomingWebhookRequestDetails<'_>,
     ) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> {
-        Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+        let notif = getnet::get_webhook_object_from_body(request.body)
+            .change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?;
+        let transaction_type = &notif.payment.transaction_type;
+        if getnet::is_refund_event(transaction_type) {
+            Ok(api_models::webhooks::ObjectReferenceId::RefundId(
+                api_models::webhooks::RefundIdType::ConnectorRefundId(
+                    notif.payment.transaction_id.to_string(),
+                ),
+            ))
+        } else {
+            Ok(api_models::webhooks::ObjectReferenceId::PaymentId(
+                api_models::payments::PaymentIdType::ConnectorTransactionId(
+                    notif.payment.transaction_id.to_string(),
+                ),
+            ))
+        }
     }
 
     fn get_webhook_event_type(
         &self,
-        _request: &webhooks::IncomingWebhookRequestDetails<'_>,
-    ) -> CustomResult<api_models::webhooks::IncomingWebhookEvent, errors::ConnectorError> {
-        Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+        request: &webhooks::IncomingWebhookRequestDetails<'_>,
+    ) -> CustomResult<IncomingWebhookEvent, errors::ConnectorError> {
+        let notif = getnet::get_webhook_object_from_body(request.body)
+            .change_context(errors::ConnectorError::WebhookEventTypeNotFound)?;
+        let incoming_webhook_event = getnet::get_incoming_webhook_event(
+            notif.payment.transaction_type,
+            notif.payment.transaction_state,
+        );
+        Ok(incoming_webhook_event)
     }
 
     fn get_webhook_resource_object(
         &self,
-        _request: &webhooks::IncomingWebhookRequestDetails<'_>,
+        request: &webhooks::IncomingWebhookRequestDetails<'_>,
     ) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
-        Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+        let notif = getnet::get_webhook_object_from_body(request.body)
+            .change_context(errors::ConnectorError::WebhookResourceObjectNotFound)?;
+        Ok(Box::new(notif))
+    }
+
+    async fn verify_webhook_source(
+        &self,
+        request: &webhooks::IncomingWebhookRequestDetails<'_>,
+        merchant_id: &common_utils::id_type::MerchantId,
+        connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
+        _connector_account_details: crypto::Encryptable<Secret<serde_json::Value>>,
+        connector_name: &str,
+    ) -> CustomResult<bool, errors::ConnectorError> {
+        let notif_item = getnet::get_webhook_response(request.body)
+            .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?;
+
+        let connector_webhook_secrets = self
+            .get_webhook_source_verification_merchant_secret(
+                merchant_id,
+                connector_name,
+                connector_webhook_details,
+            )
+            .await?;
+
+        let signature = notif_item.response_signature_base64.peek().clone();
+
+        let message = self.get_webhook_source_verification_message(
+            request,
+            merchant_id,
+            &connector_webhook_secrets,
+        )?;
+
+        let secret = connector_webhook_secrets.secret;
+
+        let key = hmac::Key::new(hmac::HMAC_SHA256, &secret);
+        let result = hmac::sign(&key, &message);
+
+        let computed_signature = BASE64_ENGINE.encode(result.as_ref());
+
+        let normalized_computed_signature = computed_signature.replace("+", " ");
+        Ok(signature == normalized_computed_signature)
     }
 }
 
diff --git a/crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
index a6dd52d83f5..31aef0a4b1e 100644
--- a/crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
@@ -1,31 +1,47 @@
-use common_enums::enums;
-use common_utils::types::StringMinorUnit;
+use api_models::webhooks::IncomingWebhookEvent;
+use base64::Engine;
+use cards::CardNumber;
+use common_enums::{enums, AttemptStatus, CaptureMethod, CountryAlpha2};
+use common_utils::{
+    consts::BASE64_ENGINE,
+    errors::CustomResult,
+    pii::{Email, IpAddress},
+    types::FloatMajorUnit,
+};
+use error_stack::ResultExt;
 use hyperswitch_domain_models::{
     payment_method_data::PaymentMethodData,
     router_data::{ConnectorAuthType, RouterData},
     router_flow_types::refunds::{Execute, RSync},
-    router_request_types::ResponseId,
+    router_request_types::{
+        PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData, ResponseId,
+    },
     router_response_types::{PaymentsResponseData, RefundsResponseData},
-    types::{PaymentsAuthorizeRouterData, RefundsRouterData},
+    types::{
+        PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,
+        PaymentsSyncRouterData, RefundsRouterData,
+    },
 };
 use hyperswitch_interfaces::errors;
-use masking::Secret;
+use masking::{PeekInterface, Secret};
 use serde::{Deserialize, Serialize};
 
 use crate::{
-    types::{RefundsResponseRouterData, ResponseRouterData},
-    utils::PaymentsAuthorizeRequestData,
+    connectors::paybox::transformers::parse_url_encoded_to_struct,
+    types::{PaymentsSyncResponseRouterData, RefundsResponseRouterData, ResponseRouterData},
+    utils::{
+        BrowserInformationData, PaymentsAuthorizeRequestData, PaymentsSyncRequestData,
+        RouterData as _,
+    },
 };
 
-//TODO: Fill the struct with respective fields
 pub struct GetnetRouterData<T> {
-    pub amount: StringMinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc.
+    pub amount: FloatMajorUnit,
     pub router_data: T,
 }
 
-impl<T> From<(StringMinorUnit, T)> for GetnetRouterData<T> {
-    fn from((amount, item): (StringMinorUnit, T)) -> Self {
-        //Todo :  use utils to convert the amount to the type of amount that a connector accepts
+impl<T> From<(FloatMajorUnit, T)> for GetnetRouterData<T> {
+    fn from((amount, item): (FloatMajorUnit, T)) -> Self {
         Self {
             amount,
             router_data: item,
@@ -33,39 +49,226 @@ impl<T> From<(StringMinorUnit, T)> for GetnetRouterData<T> {
     }
 }
 
-//TODO: Fill the struct with respective fields
+#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct Amount {
+    pub value: FloatMajorUnit,
+    pub currency: enums::Currency,
+}
+#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct Address {
+    #[serde(rename = "street1")]
+    pub street1: Option<Secret<String>>,
+    pub city: Option<String>,
+    pub state: Option<Secret<String>>,
+    pub country: Option<CountryAlpha2>,
+}
+
+#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct AccountHolder {
+    #[serde(rename = "first-name")]
+    pub first_name: Option<Secret<String>>,
+    #[serde(rename = "last-name")]
+    pub last_name: Option<Secret<String>>,
+    pub email: Option<Email>,
+    pub phone: Option<Secret<String>>,
+    pub address: Option<Address>,
+}
+
 #[derive(Default, Debug, Serialize, PartialEq)]
+pub struct Card {
+    #[serde(rename = "account-number")]
+    pub account_number: CardNumber,
+    #[serde(rename = "expiration-month")]
+    pub expiration_month: Secret<String>,
+    #[serde(rename = "expiration-year")]
+    pub expiration_year: Secret<String>,
+    #[serde(rename = "card-security-code")]
+    pub card_security_code: Secret<String>,
+    #[serde(rename = "card-type")]
+    pub card_type: String,
+}
+
+#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
+#[serde(rename_all = "lowercase")]
+pub enum GetnetPaymentMethods {
+    CreditCard,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct PaymentMethod {
+    pub name: GetnetPaymentMethods,
+}
+
+#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct Notification {
+    pub url: Option<String>,
+}
+
+#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct PaymentMethodContainer {
+    #[serde(rename = "payment-method")]
+    pub payment_method: Vec<PaymentMethod>,
+}
+
+#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
+#[serde(rename_all = "lowercase")]
+pub enum NotificationFormat {
+    #[serde(rename = "application/json-signed")]
+    JsonSigned,
+    #[serde(rename = "application/json")]
+    Json,
+    #[serde(rename = "application/xml")]
+    Xml,
+    #[serde(rename = "application/html")]
+    Html,
+    #[serde(rename = "application/x-www-form-urlencoded")]
+    Urlencoded,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct NotificationContainer {
+    pub notification: Vec<Notification>,
+    pub format: NotificationFormat,
+}
+
+#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)]
+pub struct MerchantAccountId {
+    pub value: Secret<String>,
+}
+
+#[derive(Debug, Serialize, PartialEq)]
+pub struct PaymentData {
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "requested-amount")]
+    pub requested_amount: Amount,
+    #[serde(rename = "account-holder")]
+    pub account_holder: Option<AccountHolder>,
+    pub card: Card,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+    #[serde(rename = "payment-methods")]
+    pub payment_methods: PaymentMethodContainer,
+    pub notifications: Option<NotificationContainer>,
+}
+
+#[derive(Debug, Serialize)]
 pub struct GetnetPaymentsRequest {
-    amount: StringMinorUnit,
-    card: GetnetCard,
+    payment: PaymentData,
 }
 
 #[derive(Default, Debug, Serialize, Eq, PartialEq)]
 pub struct GetnetCard {
-    number: cards::CardNumber,
+    number: CardNumber,
     expiry_month: Secret<String>,
     expiry_year: Secret<String>,
     cvc: Secret<String>,
     complete: bool,
 }
 
+impl TryFrom<enums::PaymentMethodType> for PaymentMethodContainer {
+    type Error = error_stack::Report<errors::ConnectorError>;
+
+    fn try_from(payment_method_type: enums::PaymentMethodType) -> Result<Self, Self::Error> {
+        match payment_method_type {
+            enums::PaymentMethodType::Credit => Ok(Self {
+                payment_method: vec![PaymentMethod {
+                    name: GetnetPaymentMethods::CreditCard,
+                }],
+            }),
+            _ => Err(errors::ConnectorError::NotSupported {
+                message: "Payment method type not supported".to_string(),
+                connector: "Getnet",
+            }
+            .into()),
+        }
+    }
+}
+
 impl TryFrom<&GetnetRouterData<&PaymentsAuthorizeRouterData>> for GetnetPaymentsRequest {
     type Error = error_stack::Report<errors::ConnectorError>;
     fn try_from(
         item: &GetnetRouterData<&PaymentsAuthorizeRouterData>,
     ) -> Result<Self, Self::Error> {
         match item.router_data.request.payment_method_data.clone() {
-            PaymentMethodData::Card(req_card) => {
-                let card = GetnetCard {
-                    number: req_card.card_number,
-                    expiry_month: req_card.card_exp_month,
-                    expiry_year: req_card.card_exp_year,
-                    cvc: req_card.card_cvc,
-                    complete: item.router_data.request.is_auto_capture()?,
+            PaymentMethodData::Card(ref req_card) => {
+                if item.router_data.is_three_ds() {
+                    return Err(errors::ConnectorError::NotSupported {
+                        message: "3DS payments".to_string(),
+                        connector: "Getnet",
+                    }
+                    .into());
+                }
+                let request = &item.router_data.request;
+                let auth_type = GetnetAuthType::try_from(&item.router_data.connector_auth_type)
+                    .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+                let merchant_account_id = MerchantAccountId {
+                    value: auth_type.merchant_id,
                 };
-                Ok(Self {
-                    amount: item.amount.clone(),
+
+                let requested_amount = Amount {
+                    value: item.amount,
+                    currency: request.currency,
+                };
+
+                let account_holder = AccountHolder {
+                    first_name: item.router_data.get_optional_billing_first_name(),
+                    last_name: item.router_data.get_optional_billing_last_name(),
+                    email: item.router_data.request.get_optional_email(),
+                    phone: item.router_data.get_optional_billing_phone_number(),
+                    address: Some(Address {
+                        street1: item.router_data.get_optional_billing_line2(),
+                        city: item.router_data.get_optional_billing_city(),
+                        state: item.router_data.get_optional_billing_state(),
+                        country: item.router_data.get_optional_billing_country(),
+                    }),
+                };
+
+                let card = Card {
+                    account_number: req_card.card_number.clone(),
+                    expiration_month: req_card.card_exp_month.clone(),
+                    expiration_year: req_card.card_exp_year.clone(),
+                    card_security_code: req_card.card_cvc.clone(),
+                    card_type: req_card
+                        .card_network
+                        .as_ref()
+                        .map(|network| network.to_string().to_lowercase())
+                        .unwrap_or_default(),
+                };
+
+                let pmt = item.router_data.request.get_payment_method_type()?;
+                let payment_method = PaymentMethodContainer::try_from(pmt)?;
+
+                let notifications: NotificationContainer = NotificationContainer {
+                    format: NotificationFormat::JsonSigned,
+
+                    notification: vec![Notification {
+                        url: Some(item.router_data.request.get_webhook_url()?),
+                    }],
+                };
+                let transaction_type = if request.is_auto_capture()? {
+                    GetnetTransactionType::Purchase
+                } else {
+                    GetnetTransactionType::Authorization
+                };
+                let payment_data = PaymentData {
+                    merchant_account_id,
+                    request_id: item.router_data.payment_id.clone(),
+                    transaction_type,
+                    requested_amount,
+                    account_holder: Some(account_holder),
                     card,
+                    ip_address: Some(request.get_browser_info()?.get_ip_address()?),
+                    payment_methods: payment_method,
+                    notifications: Some(notifications),
+                };
+
+                Ok(Self {
+                    payment: payment_data,
                 })
             }
             _ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()),
@@ -73,62 +276,382 @@ impl TryFrom<&GetnetRouterData<&PaymentsAuthorizeRouterData>> for GetnetPayments
     }
 }
 
-//TODO: Fill the struct with respective fields
-// Auth Struct
 pub struct GetnetAuthType {
-    pub(super) api_key: Secret<String>,
+    pub username: Secret<String>,
+    pub password: Secret<String>,
+    pub merchant_id: Secret<String>,
 }
 
 impl TryFrom<&ConnectorAuthType> for GetnetAuthType {
     type Error = error_stack::Report<errors::ConnectorError>;
     fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {
         match auth_type {
-            ConnectorAuthType::HeaderKey { api_key } => Ok(Self {
-                api_key: api_key.to_owned(),
+            ConnectorAuthType::SignatureKey {
+                api_key,
+                key1,
+                api_secret,
+            } => Ok(Self {
+                username: key1.to_owned(),
+                password: api_key.to_owned(),
+                merchant_id: api_secret.to_owned(),
             }),
             _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()),
         }
     }
 }
-// PaymentsResponse
-//TODO: Append the remaining status flags
+
 #[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)]
 #[serde(rename_all = "lowercase")]
 pub enum GetnetPaymentStatus {
-    Succeeded,
+    Success,
     Failed,
     #[default]
-    Processing,
+    InProgress,
 }
 
-impl From<GetnetPaymentStatus> for common_enums::AttemptStatus {
+impl From<GetnetPaymentStatus> for AttemptStatus {
     fn from(item: GetnetPaymentStatus) -> Self {
         match item {
-            GetnetPaymentStatus::Succeeded => Self::Charged,
+            GetnetPaymentStatus::Success => Self::Charged,
             GetnetPaymentStatus::Failed => Self::Failure,
-            GetnetPaymentStatus::Processing => Self::Authorizing,
+            GetnetPaymentStatus::InProgress => Self::Pending,
+        }
+    }
+}
+
+#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct Status {
+    pub code: String,
+    pub description: String,
+    pub severity: String,
+}
+
+#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct Statuses {
+    pub status: Vec<Status>,
+}
+
+#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct CardToken {
+    #[serde(rename = "token-id")]
+    pub token_id: Secret<String>,
+    #[serde(rename = "masked-account-number")]
+    pub masked_account_number: Secret<String>,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
+pub struct PaymentResponseData {
+    pub statuses: Statuses,
+    pub descriptor: Option<String>,
+    pub notifications: NotificationContainer,
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "transaction-id")]
+    pub transaction_id: String,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "transaction-state")]
+    pub transaction_state: GetnetPaymentStatus,
+    #[serde(rename = "completion-time-stamp")]
+    pub completion_time_stamp: Option<i64>,
+    #[serde(rename = "requested-amount")]
+    pub requested_amount: Amount,
+    #[serde(rename = "account-holder")]
+    pub account_holder: Option<AccountHolder>,
+    #[serde(rename = "card-token")]
+    pub card_token: CardToken,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+    #[serde(rename = "payment-methods")]
+    pub payment_methods: PaymentMethodContainer,
+    #[serde(rename = "api-id")]
+    pub api_id: String,
+    #[serde(rename = "self")]
+    pub self_url: String,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct PaymentsResponse {
+    payment: PaymentResponseData,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum GetnetPaymentsResponse {
+    PaymentsResponse(Box<PaymentsResponse>),
+    GetnetWebhookNotificationResponse(Box<GetnetWebhookNotificationResponseBody>),
+}
+
+pub fn authorization_attempt_status_from_transaction_state(
+    getnet_status: GetnetPaymentStatus,
+    is_auto_capture: bool,
+) -> AttemptStatus {
+    match getnet_status {
+        GetnetPaymentStatus::Success => {
+            if is_auto_capture {
+                AttemptStatus::Charged
+            } else {
+                AttemptStatus::Authorized
+            }
+        }
+        GetnetPaymentStatus::InProgress => AttemptStatus::Pending,
+        GetnetPaymentStatus::Failed => AttemptStatus::Failure,
+    }
+}
+
+impl<F>
+    TryFrom<
+        ResponseRouterData<F, GetnetPaymentsResponse, PaymentsAuthorizeData, PaymentsResponseData>,
+    > for RouterData<F, PaymentsAuthorizeData, PaymentsResponseData>
+{
+    type Error = error_stack::Report<errors::ConnectorError>;
+    fn try_from(
+        item: ResponseRouterData<
+            F,
+            GetnetPaymentsResponse,
+            PaymentsAuthorizeData,
+            PaymentsResponseData,
+        >,
+    ) -> Result<Self, Self::Error> {
+        match item.response {
+            GetnetPaymentsResponse::PaymentsResponse(ref payment_response) => Ok(Self {
+                status: authorization_attempt_status_from_transaction_state(
+                    payment_response.payment.transaction_state.clone(),
+                    item.data.request.is_auto_capture()?,
+                ),
+                response: Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::ConnectorTransactionId(
+                        payment_response.payment.transaction_id.clone(),
+                    ),
+                    redirection_data: Box::new(None),
+                    mandate_reference: Box::new(None),
+                    connector_metadata: None,
+                    network_txn_id: None,
+                    connector_response_reference_id: None,
+                    incremental_authorization_allowed: None,
+                    charges: None,
+                }),
+                ..item.data
+            }),
+
+            _ => Err(error_stack::Report::new(
+                errors::ConnectorError::ResponseHandlingFailed,
+            )),
+        }
+    }
+}
+
+pub fn psync_attempt_status_from_transaction_state(
+    getnet_status: GetnetPaymentStatus,
+    is_auto_capture: bool,
+    transaction_type: GetnetTransactionType,
+) -> AttemptStatus {
+    match getnet_status {
+        GetnetPaymentStatus::Success => {
+            if is_auto_capture && transaction_type == GetnetTransactionType::CaptureAuthorization {
+                AttemptStatus::Charged
+            } else {
+                AttemptStatus::Authorized
+            }
+        }
+        GetnetPaymentStatus::InProgress => AttemptStatus::Pending,
+        GetnetPaymentStatus::Failed => AttemptStatus::Failure,
+    }
+}
+
+impl TryFrom<PaymentsSyncResponseRouterData<GetnetPaymentsResponse>> for PaymentsSyncRouterData {
+    type Error = error_stack::Report<errors::ConnectorError>;
+    fn try_from(
+        item: PaymentsSyncResponseRouterData<GetnetPaymentsResponse>,
+    ) -> Result<Self, Self::Error> {
+        match item.response {
+            GetnetPaymentsResponse::PaymentsResponse(ref payment_response) => Ok(Self {
+                status: authorization_attempt_status_from_transaction_state(
+                    payment_response.payment.transaction_state.clone(),
+                    item.data.request.is_auto_capture()?,
+                ),
+                response: Ok(PaymentsResponseData::TransactionResponse {
+                    resource_id: ResponseId::ConnectorTransactionId(
+                        payment_response.payment.transaction_id.clone(),
+                    ),
+                    redirection_data: Box::new(None),
+                    mandate_reference: Box::new(None),
+                    connector_metadata: None,
+                    network_txn_id: None,
+                    connector_response_reference_id: None,
+                    incremental_authorization_allowed: None,
+                    charges: None,
+                }),
+                ..item.data
+            }),
+
+            GetnetPaymentsResponse::GetnetWebhookNotificationResponse(ref webhook_response) => {
+                Ok(Self {
+                    status: psync_attempt_status_from_transaction_state(
+                        webhook_response.payment.transaction_state.clone(),
+                        item.data.request.is_auto_capture()?,
+                        webhook_response.payment.transaction_type.clone(),
+                    ),
+                    response: Ok(PaymentsResponseData::TransactionResponse {
+                        resource_id: ResponseId::ConnectorTransactionId(
+                            webhook_response.payment.transaction_id.clone(),
+                        ),
+                        redirection_data: Box::new(None),
+                        mandate_reference: Box::new(None),
+                        connector_metadata: None,
+                        network_txn_id: None,
+                        connector_response_reference_id: None,
+                        incremental_authorization_allowed: None,
+                        charges: None,
+                    }),
+                    ..item.data
+                })
+            }
         }
     }
 }
 
-//TODO: Fill the struct with respective fields
-#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)]
-pub struct GetnetPaymentsResponse {
-    status: GetnetPaymentStatus,
-    id: String,
+#[derive(Debug, Serialize, PartialEq)]
+pub struct CapturePaymentData {
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "parent-transaction-id")]
+    pub parent_transaction_id: String,
+    #[serde(rename = "requested-amount")]
+    pub requested_amount: Amount,
+    pub notifications: NotificationContainer,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+}
+
+#[derive(Debug, Serialize)]
+pub struct GetnetCaptureRequest {
+    pub payment: CapturePaymentData,
+}
+impl TryFrom<&GetnetRouterData<&PaymentsCaptureRouterData>> for GetnetCaptureRequest {
+    type Error = error_stack::Report<errors::ConnectorError>;
+    fn try_from(item: &GetnetRouterData<&PaymentsCaptureRouterData>) -> Result<Self, Self::Error> {
+        let request = &item.router_data.request;
+        let auth_type = GetnetAuthType::try_from(&item.router_data.connector_auth_type)
+            .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+        let merchant_account_id = MerchantAccountId {
+            value: auth_type.merchant_id,
+        };
+
+        let requested_amount = Amount {
+            value: item.amount,
+            currency: request.currency,
+        };
+        let req = &item.router_data.request;
+        let webhook_url = &req.webhook_url;
+        let notifications = NotificationContainer {
+            format: NotificationFormat::JsonSigned,
+
+            notification: vec![Notification {
+                url: webhook_url.clone(),
+            }],
+        };
+        let transaction_type = GetnetTransactionType::CaptureAuthorization;
+        let ip_address = req
+            .browser_info
+            .as_ref()
+            .and_then(|info| info.ip_address.as_ref())
+            .map(|ip| Secret::new(ip.to_string()));
+        let request_id = item.router_data.connector_request_reference_id.clone();
+        let parent_transaction_id = item.router_data.request.connector_transaction_id.clone();
+        let capture_payment_data = CapturePaymentData {
+            merchant_account_id,
+            request_id,
+            transaction_type,
+            parent_transaction_id,
+            requested_amount,
+            notifications,
+            ip_address,
+        };
+
+        Ok(Self {
+            payment: capture_payment_data,
+        })
+    }
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
+pub struct CaptureResponseData {
+    pub statuses: Statuses,
+    pub descriptor: String,
+    pub notifications: NotificationContainer,
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "transaction-id")]
+    pub transaction_id: String,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "transaction-state")]
+    pub transaction_state: GetnetPaymentStatus,
+    #[serde(rename = "completion-time-stamp")]
+    pub completion_time_stamp: Option<i64>,
+    #[serde(rename = "requested-amount")]
+    pub requested_amount: Amount,
+    #[serde(rename = "parent-transaction-id")]
+    pub parent_transaction_id: String,
+    #[serde(rename = "account-holder")]
+    pub account_holder: Option<AccountHolder>,
+    #[serde(rename = "card-token")]
+    pub card_token: CardToken,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+    #[serde(rename = "payment-methods")]
+    pub payment_methods: PaymentMethodContainer,
+    #[serde(rename = "parent-transaction-amount")]
+    pub parent_transaction_amount: Amount,
+    #[serde(rename = "authorization-code")]
+    pub authorization_code: String,
+    #[serde(rename = "api-id")]
+    pub api_id: String,
+    #[serde(rename = "self")]
+    pub self_url: String,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct GetnetCaptureResponse {
+    payment: CaptureResponseData,
+}
+
+pub fn capture_status_from_transaction_state(getnet_status: GetnetPaymentStatus) -> AttemptStatus {
+    match getnet_status {
+        GetnetPaymentStatus::Success => AttemptStatus::Charged,
+        GetnetPaymentStatus::InProgress => AttemptStatus::Pending,
+        GetnetPaymentStatus::Failed => AttemptStatus::Authorized,
+    }
 }
 
-impl<F, T> TryFrom<ResponseRouterData<F, GetnetPaymentsResponse, T, PaymentsResponseData>>
-    for RouterData<F, T, PaymentsResponseData>
+impl<F>
+    TryFrom<ResponseRouterData<F, GetnetCaptureResponse, PaymentsCaptureData, PaymentsResponseData>>
+    for RouterData<F, PaymentsCaptureData, PaymentsResponseData>
 {
     type Error = error_stack::Report<errors::ConnectorError>;
     fn try_from(
-        item: ResponseRouterData<F, GetnetPaymentsResponse, T, PaymentsResponseData>,
+        item: ResponseRouterData<
+            F,
+            GetnetCaptureResponse,
+            PaymentsCaptureData,
+            PaymentsResponseData,
+        >,
     ) -> Result<Self, Self::Error> {
         Ok(Self {
-            status: common_enums::AttemptStatus::from(item.response.status),
+            status: capture_status_from_transaction_state(item.response.payment.transaction_state),
             response: Ok(PaymentsResponseData::TransactionResponse {
-                resource_id: ResponseId::ConnectorTransactionId(item.response.id),
+                resource_id: ResponseId::ConnectorTransactionId(
+                    item.response.payment.transaction_id,
+                ),
                 redirection_data: Box::new(None),
                 mandate_reference: Box::new(None),
                 connector_metadata: None,
@@ -142,50 +665,140 @@ impl<F, T> TryFrom<ResponseRouterData<F, GetnetPaymentsResponse, T, PaymentsResp
     }
 }
 
-//TODO: Fill the struct with respective fields
-// REFUND :
-// Type definition for RefundRequest
-#[derive(Default, Debug, Serialize)]
+#[derive(Debug, Serialize, PartialEq)]
+pub struct RefundPaymentData {
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "parent-transaction-id")]
+    pub parent_transaction_id: String,
+    pub notifications: NotificationContainer,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+}
+#[derive(Debug, Serialize)]
 pub struct GetnetRefundRequest {
-    pub amount: StringMinorUnit,
+    pub payment: RefundPaymentData,
 }
 
 impl<F> TryFrom<&GetnetRouterData<&RefundsRouterData<F>>> for GetnetRefundRequest {
     type Error = error_stack::Report<errors::ConnectorError>;
     fn try_from(item: &GetnetRouterData<&RefundsRouterData<F>>) -> Result<Self, Self::Error> {
+        let request = &item.router_data.request;
+        let auth_type = GetnetAuthType::try_from(&item.router_data.connector_auth_type)
+            .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+        let url = request.webhook_url.clone();
+
+        let merchant_account_id = MerchantAccountId {
+            value: auth_type.merchant_id,
+        };
+        let notifications = NotificationContainer {
+            format: NotificationFormat::JsonSigned,
+            notification: vec![Notification { url }],
+        };
+        let capture_method = request.capture_method;
+        let transaction_type = match capture_method {
+            Some(CaptureMethod::Automatic) => GetnetTransactionType::RefundPurchase,
+            Some(CaptureMethod::Manual) => GetnetTransactionType::RefundCapture,
+            Some(CaptureMethod::ManualMultiple)
+            | Some(CaptureMethod::Scheduled)
+            | Some(CaptureMethod::SequentialAutomatic)
+            | None => {
+                return Err(errors::ConnectorError::CaptureMethodNotSupported {}.into());
+            }
+        };
+        let ip_address = request
+            .browser_info
+            .as_ref()
+            .and_then(|browser_info| browser_info.ip_address.as_ref())
+            .map(|ip| Secret::new(ip.to_string()));
+        let request_id = item
+            .router_data
+            .refund_id
+            .clone()
+            .ok_or(errors::ConnectorError::MissingConnectorRefundID)?;
+
+        let parent_transaction_id = item.router_data.request.connector_transaction_id.clone();
+        let refund_payment_data = RefundPaymentData {
+            merchant_account_id,
+            request_id,
+            transaction_type,
+            parent_transaction_id,
+            notifications,
+            ip_address,
+        };
+
         Ok(Self {
-            amount: item.amount.to_owned(),
+            payment: refund_payment_data,
         })
     }
 }
 
-// Type definition for Refund Response
-
 #[allow(dead_code)]
-#[derive(Debug, Serialize, Default, Deserialize, Clone)]
+#[derive(Debug, Serialize, Default, Deserialize, Clone, PartialEq)]
+#[serde(rename_all = "lowercase")]
 pub enum RefundStatus {
-    Succeeded,
+    Success,
     Failed,
     #[default]
-    Processing,
+    InProgress,
 }
 
 impl From<RefundStatus> for enums::RefundStatus {
     fn from(item: RefundStatus) -> Self {
         match item {
-            RefundStatus::Succeeded => Self::Success,
+            RefundStatus::Success => Self::Success,
             RefundStatus::Failed => Self::Failure,
-            RefundStatus::Processing => Self::Pending,
-            //TODO: Review mapping
+            RefundStatus::InProgress => Self::Pending,
         }
     }
 }
 
-//TODO: Fill the struct with respective fields
-#[derive(Default, Debug, Clone, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
+pub struct RefundResponseData {
+    pub statuses: Statuses,
+    pub descriptor: String,
+    pub notifications: NotificationContainer,
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "transaction-id")]
+    pub transaction_id: String,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "transaction-state")]
+    pub transaction_state: RefundStatus,
+    #[serde(rename = "completion-time-stamp")]
+    pub completion_time_stamp: Option<i64>,
+    #[serde(rename = "requested-amount")]
+    pub requested_amount: Amount,
+    #[serde(rename = "parent-transaction-id")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub parent_transaction_id: Option<String>,
+    #[serde(rename = "account-holder")]
+    pub account_holder: Option<AccountHolder>,
+    #[serde(rename = "card-token")]
+    pub card_token: CardToken,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+    #[serde(rename = "payment-methods")]
+    pub payment_methods: PaymentMethodContainer,
+    #[serde(rename = "parent-transaction-amount")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub parent_transaction_amount: Option<Amount>,
+    #[serde(rename = "api-id")]
+    pub api_id: String,
+    #[serde(rename = "self")]
+    pub self_url: String,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
 pub struct RefundResponse {
-    id: String,
-    status: RefundStatus,
+    payment: RefundResponseData,
 }
 
 impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute> {
@@ -195,8 +808,8 @@ impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRout
     ) -> Result<Self, Self::Error> {
         Ok(Self {
             response: Ok(RefundsResponseData {
-                connector_refund_id: item.response.id.to_string(),
-                refund_status: enums::RefundStatus::from(item.response.status),
+                connector_refund_id: item.response.payment.transaction_id,
+                refund_status: enums::RefundStatus::from(item.response.payment.transaction_state),
             }),
             ..item.data
         })
@@ -210,15 +823,181 @@ impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouter
     ) -> Result<Self, Self::Error> {
         Ok(Self {
             response: Ok(RefundsResponseData {
-                connector_refund_id: item.response.id.to_string(),
-                refund_status: enums::RefundStatus::from(item.response.status),
+                connector_refund_id: item.response.payment.transaction_id,
+                refund_status: enums::RefundStatus::from(item.response.payment.transaction_state),
+            }),
+            ..item.data
+        })
+    }
+}
+
+#[derive(Debug, Serialize, PartialEq)]
+pub struct CancelPaymentData {
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "parent-transaction-id")]
+    pub parent_transaction_id: String,
+    pub notifications: NotificationContainer,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+}
+
+#[derive(Debug, Serialize)]
+pub struct GetnetCancelRequest {
+    pub payment: CancelPaymentData,
+}
+
+impl TryFrom<&PaymentsCancelRouterData> for GetnetCancelRequest {
+    type Error = error_stack::Report<errors::ConnectorError>;
+    fn try_from(item: &PaymentsCancelRouterData) -> Result<Self, Self::Error> {
+        let request = &item.request;
+        let auth_type = GetnetAuthType::try_from(&item.connector_auth_type)
+            .change_context(errors::ConnectorError::FailedToObtainAuthType)?;
+
+        let merchant_account_id = MerchantAccountId {
+            value: auth_type.merchant_id,
+        };
+        let webhook_url = &item.request.webhook_url;
+        let notifications = NotificationContainer {
+            format: NotificationFormat::JsonSigned,
+
+            notification: vec![Notification {
+                url: webhook_url.clone(),
+            }],
+        };
+        let capture_method = &item.request.capture_method;
+        let transaction_type = match capture_method {
+            Some(CaptureMethod::Automatic) => GetnetTransactionType::VoidPurchase,
+            Some(CaptureMethod::Manual) => GetnetTransactionType::VoidAuthorization,
+            Some(CaptureMethod::ManualMultiple)
+            | Some(CaptureMethod::Scheduled)
+            | Some(CaptureMethod::SequentialAutomatic) => {
+                return Err(errors::ConnectorError::CaptureMethodNotSupported {}.into());
+            }
+            None => {
+                return Err(errors::ConnectorError::CaptureMethodNotSupported {}.into());
+            }
+        };
+        let ip_address = request
+            .browser_info
+            .as_ref()
+            .and_then(|browser_info| browser_info.ip_address.as_ref())
+            .map(|ip| Secret::new(ip.to_string()));
+        let request_id = &item.connector_request_reference_id.clone();
+        let parent_transaction_id = item.request.connector_transaction_id.clone();
+        let cancel_payment_data = CancelPaymentData {
+            merchant_account_id,
+            request_id: request_id.to_string(),
+            transaction_type,
+            parent_transaction_id,
+            notifications,
+            ip_address,
+        };
+        Ok(Self {
+            payment: cancel_payment_data,
+        })
+    }
+}
+
+#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
+#[serde(rename_all = "lowercase")]
+pub enum GetnetTransactionType {
+    Purchase,
+    #[serde(rename = "capture-authorization")]
+    CaptureAuthorization,
+    #[serde(rename = "refund-purchase")]
+    RefundPurchase,
+    #[serde(rename = "refund-capture")]
+    RefundCapture,
+    #[serde(rename = "void-authorization")]
+    VoidAuthorization,
+    #[serde(rename = "void-purchase")]
+    VoidPurchase,
+    Authorization,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
+#[serde(rename_all = "lowercase")]
+pub struct CancelResponseData {
+    pub statuses: Statuses,
+    pub descriptor: String,
+    pub notifications: NotificationContainer,
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "transaction-id")]
+    pub transaction_id: String,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "transaction-state")]
+    pub transaction_state: GetnetPaymentStatus,
+    #[serde(rename = "completion-time-stamp")]
+    pub completion_time_stamp: Option<i64>,
+    #[serde(rename = "requested-amount")]
+    pub requested_amount: Amount,
+    #[serde(rename = "parent-transaction-id")]
+    pub parent_transaction_id: String,
+    #[serde(rename = "account-holder")]
+    pub account_holder: Option<AccountHolder>,
+    #[serde(rename = "card-token")]
+    pub card_token: CardToken,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+    #[serde(rename = "payment-methods")]
+    pub payment_methods: PaymentMethodContainer,
+    #[serde(rename = "parent-transaction-amount")]
+    pub parent_transaction_amount: Amount,
+    #[serde(rename = "api-id")]
+    pub api_id: String,
+    #[serde(rename = "self")]
+    pub self_url: String,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct GetnetCancelResponse {
+    payment: CancelResponseData,
+}
+
+pub fn cancel_status_from_transaction_state(getnet_status: GetnetPaymentStatus) -> AttemptStatus {
+    match getnet_status {
+        GetnetPaymentStatus::Success => AttemptStatus::Voided,
+        GetnetPaymentStatus::InProgress => AttemptStatus::Pending,
+        GetnetPaymentStatus::Failed => AttemptStatus::VoidFailed,
+    }
+}
+
+impl<F>
+    TryFrom<ResponseRouterData<F, GetnetCancelResponse, PaymentsCancelData, PaymentsResponseData>>
+    for RouterData<F, PaymentsCancelData, PaymentsResponseData>
+{
+    type Error = error_stack::Report<errors::ConnectorError>;
+    fn try_from(
+        item: ResponseRouterData<F, GetnetCancelResponse, PaymentsCancelData, PaymentsResponseData>,
+    ) -> Result<Self, Self::Error> {
+        Ok(Self {
+            status: cancel_status_from_transaction_state(item.response.payment.transaction_state),
+            response: Ok(PaymentsResponseData::TransactionResponse {
+                resource_id: ResponseId::ConnectorTransactionId(
+                    item.response.payment.transaction_id,
+                ),
+                redirection_data: Box::new(None),
+                mandate_reference: Box::new(None),
+                connector_metadata: None,
+                network_txn_id: None,
+                connector_response_reference_id: None,
+                incremental_authorization_allowed: None,
+                charges: None,
             }),
             ..item.data
         })
     }
 }
 
-//TODO: Fill the struct with respective fields
 #[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
 pub struct GetnetErrorResponse {
     pub status_code: u16,
@@ -226,3 +1005,150 @@ pub struct GetnetErrorResponse {
     pub message: String,
     pub reason: Option<String>,
 }
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct GetnetWebhookNotificationResponse {
+    #[serde(rename = "response-signature-base64")]
+    pub response_signature_base64: Secret<String>,
+    #[serde(rename = "response-signature-algorithm")]
+    pub response_signature_algorithm: Secret<String>,
+    #[serde(rename = "response-base64")]
+    pub response_base64: Secret<String>,
+}
+
+#[derive(Debug, Serialize, Deserialize, PartialEq)]
+pub struct WebhookResponseData {
+    pub statuses: Statuses,
+    pub descriptor: String,
+    pub notifications: NotificationContainer,
+    #[serde(rename = "merchant-account-id")]
+    pub merchant_account_id: MerchantAccountId,
+    #[serde(rename = "transaction-id")]
+    pub transaction_id: String,
+    #[serde(rename = "request-id")]
+    pub request_id: String,
+    #[serde(rename = "transaction-type")]
+    pub transaction_type: GetnetTransactionType,
+    #[serde(rename = "transaction-state")]
+    pub transaction_state: GetnetPaymentStatus,
+    #[serde(rename = "completion-time-stamp")]
+    pub completion_time_stamp: u64,
+    #[serde(rename = "requested-amount")]
+    pub requested_amount: Amount,
+    #[serde(rename = "parent-transaction-id")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub parent_transaction_id: Option<String>,
+    #[serde(rename = "account-holder")]
+    pub account_holder: Option<AccountHolder>,
+    #[serde(rename = "card-token")]
+    pub card_token: CardToken,
+    #[serde(rename = "ip-address")]
+    pub ip_address: Option<Secret<String, IpAddress>>,
+    #[serde(rename = "payment-methods")]
+    pub payment_methods: PaymentMethodContainer,
+    #[serde(rename = "parent-transaction-amount")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub parent_transaction_amount: Option<Amount>,
+    #[serde(rename = "authorization-code")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub authorization_code: Option<String>,
+    #[serde(rename = "api-id")]
+    pub api_id: String,
+    #[serde(rename = "provider-account-id")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub provider_account_id: Option<String>,
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct GetnetWebhookNotificationResponseBody {
+    pub payment: WebhookResponseData,
+}
+
+pub fn is_refund_event(transaction_type: &GetnetTransactionType) -> bool {
+    matches!(
+        transaction_type,
+        GetnetTransactionType::RefundPurchase | GetnetTransactionType::RefundCapture
+    )
+}
+
+pub fn get_webhook_object_from_body(
+    body: &[u8],
+) -> CustomResult<GetnetWebhookNotificationResponseBody, errors::ConnectorError> {
+    let body_bytes = bytes::Bytes::copy_from_slice(body);
+    let parsed_param: GetnetWebhookNotificationResponse =
+        parse_url_encoded_to_struct(body_bytes)
+            .change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
+    let response_base64 = &parsed_param.response_base64.peek();
+    let decoded_response = BASE64_ENGINE
+        .decode(response_base64)
+        .change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
+
+    let getnet_webhook_notification_response: GetnetWebhookNotificationResponseBody =
+        match serde_json::from_slice::<GetnetWebhookNotificationResponseBody>(&decoded_response) {
+            Ok(response) => response,
+            Err(_e) => {
+                return Err(errors::ConnectorError::WebhookBodyDecodingFailed)?;
+            }
+        };
+
+    Ok(getnet_webhook_notification_response)
+}
+
+pub fn get_webhook_response(
+    body: &[u8],
+) -> CustomResult<GetnetWebhookNotificationResponse, errors::ConnectorError> {
+    let body_bytes = bytes::Bytes::copy_from_slice(body);
+    let parsed_param: GetnetWebhookNotificationResponse =
+        parse_url_encoded_to_struct(body_bytes)
+            .change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
+    Ok(parsed_param)
+}
+
+pub fn get_incoming_webhook_event(
+    transaction_type: GetnetTransactionType,
+    transaction_status: GetnetPaymentStatus,
+) -> IncomingWebhookEvent {
+    match transaction_type {
+        GetnetTransactionType::Purchase => match transaction_status {
+            GetnetPaymentStatus::Success => IncomingWebhookEvent::PaymentIntentSuccess,
+            GetnetPaymentStatus::Failed => IncomingWebhookEvent::PaymentIntentFailure,
+            GetnetPaymentStatus::InProgress => IncomingWebhookEvent::PaymentIntentProcessing,
+        },
+
+        GetnetTransactionType::Authorization => match transaction_status {
+            GetnetPaymentStatus::Success => IncomingWebhookEvent::PaymentIntentAuthorizationSuccess,
+            GetnetPaymentStatus::Failed => IncomingWebhookEvent::PaymentIntentAuthorizationFailure,
+            GetnetPaymentStatus::InProgress => IncomingWebhookEvent::PaymentIntentProcessing,
+        },
+
+        GetnetTransactionType::CaptureAuthorization => match transaction_status {
+            GetnetPaymentStatus::Success => IncomingWebhookEvent::PaymentIntentCaptureSuccess,
+            GetnetPaymentStatus::Failed => IncomingWebhookEvent::PaymentIntentCaptureFailure,
+            GetnetPaymentStatus::InProgress => IncomingWebhookEvent::PaymentIntentCaptureFailure,
+        },
+
+        GetnetTransactionType::RefundPurchase => match transaction_status {
+            GetnetPaymentStatus::Success => IncomingWebhookEvent::RefundSuccess,
+            GetnetPaymentStatus::Failed => IncomingWebhookEvent::RefundFailure,
+            GetnetPaymentStatus::InProgress => IncomingWebhookEvent::RefundFailure,
+        },
+
+        GetnetTransactionType::RefundCapture => match transaction_status {
+            GetnetPaymentStatus::Success => IncomingWebhookEvent::RefundSuccess,
+            GetnetPaymentStatus::Failed => IncomingWebhookEvent::RefundFailure,
+            GetnetPaymentStatus::InProgress => IncomingWebhookEvent::RefundFailure,
+        },
+
+        GetnetTransactionType::VoidAuthorization => match transaction_status {
+            GetnetPaymentStatus::Success => IncomingWebhookEvent::PaymentIntentCancelled,
+            GetnetPaymentStatus::Failed => IncomingWebhookEvent::PaymentIntentCancelFailure,
+            GetnetPaymentStatus::InProgress => IncomingWebhookEvent::PaymentIntentCancelFailure,
+        },
+
+        GetnetTransactionType::VoidPurchase => match transaction_status {
+            GetnetPaymentStatus::Success => IncomingWebhookEvent::PaymentIntentCancelled,
+            GetnetPaymentStatus::Failed => IncomingWebhookEvent::PaymentIntentCancelFailure,
+            GetnetPaymentStatus::InProgress => IncomingWebhookEvent::PaymentIntentCancelFailure,
+        },
+    }
+}
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index ce40e373462..93eca2a1bfa 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -1836,6 +1836,7 @@ pub trait PaymentsCaptureRequestData {
     fn get_optional_language_from_browser_info(&self) -> Option<String>;
     fn is_multiple_capture(&self) -> bool;
     fn get_browser_info(&self) -> Result<BrowserInformation, Error>;
+    fn get_webhook_url(&self) -> Result<String, Error>;
 }
 
 impl PaymentsCaptureRequestData for PaymentsCaptureData {
@@ -1852,6 +1853,11 @@ impl PaymentsCaptureRequestData for PaymentsCaptureData {
             .clone()
             .and_then(|browser_info| browser_info.language)
     }
+    fn get_webhook_url(&self) -> Result<String, Error> {
+        self.webhook_url
+            .clone()
+            .ok_or_else(missing_field_err("webhook_url"))
+    }
 }
 
 pub trait PaymentsSyncRequestData {
@@ -1889,6 +1895,7 @@ pub trait PaymentsCancelRequestData {
     fn get_currency(&self) -> Result<enums::Currency, Error>;
     fn get_cancellation_reason(&self) -> Result<String, Error>;
     fn get_browser_info(&self) -> Result<BrowserInformation, Error>;
+    fn get_webhook_url(&self) -> Result<String, Error>;
 }
 
 impl PaymentsCancelRequestData for PaymentsCancelData {
@@ -1913,6 +1920,11 @@ impl PaymentsCancelRequestData for PaymentsCancelData {
             .clone()
             .and_then(|browser_info| browser_info.language)
     }
+    fn get_webhook_url(&self) -> Result<String, Error> {
+        self.webhook_url
+            .clone()
+            .ok_or_else(missing_field_err("webhook_url"))
+    }
 }
 
 pub trait RefundsRequestData {
diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs
index 6c1e11ced4e..ff5534dcebc 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types.rs
@@ -125,6 +125,7 @@ pub struct PaymentsCaptureData {
     pub minor_payment_amount: MinorUnit,
     pub minor_amount_to_capture: MinorUnit,
     pub integrity_object: Option<CaptureIntegrityObject>,
+    pub webhook_url: Option<String>,
 }
 
 #[derive(Debug, Clone, PartialEq)]
@@ -467,6 +468,8 @@ pub struct PaymentsCancelData {
 
     // minor amount data for amount framework
     pub minor_amount: Option<MinorUnit>,
+    pub webhook_url: Option<String>,
+    pub capture_method: Option<storage_enums::CaptureMethod>,
 }
 
 #[derive(Debug, Default, Clone)]
@@ -643,6 +646,7 @@ pub struct RefundsData {
     pub refund_status: storage_enums::RefundStatus,
     pub merchant_account_id: Option<Secret<String>>,
     pub merchant_config_currency: Option<storage_enums::Currency>,
+    pub capture_method: Option<storage_enums::CaptureMethod>,
 }
 
 #[derive(Debug, Clone, PartialEq)]
diff --git a/crates/hyperswitch_interfaces/src/api.rs b/crates/hyperswitch_interfaces/src/api.rs
index b70d326feb6..cf9b2ff9764 100644
--- a/crates/hyperswitch_interfaces/src/api.rs
+++ b/crates/hyperswitch_interfaces/src/api.rs
@@ -100,6 +100,11 @@ pub trait ConnectorIntegration<T, Req, Resp>:
         mime::APPLICATION_JSON.essence_str()
     }
 
+    /// fn get_content_type
+    fn get_accept_type(&self) -> &'static str {
+        mime::APPLICATION_JSON.essence_str()
+    }
+
     /// primarily used when creating signature based on request method of payment flow
     fn get_http_method(&self) -> Method {
         Method::Post
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 3849054045c..9b912ce00ba 100644
--- a/crates/router/src/configs/defaults/payment_connector_required_fields.rs
+++ b/crates/router/src/configs/defaults/payment_connector_required_fields.rs
@@ -5303,6 +5303,62 @@ impl Default for settings::RequiredFields {
                                     common:HashMap::new(),
                                 }
                             ),
+                            (
+                                enums::Connector::Getnet,
+                                RequiredFieldFinal {
+                                    mandate: HashMap::new(),
+                                    non_mandate: HashMap::new(),
+                                    common: HashMap::from(
+                                        [
+                                            (
+                                                "payment_method_data.card.card_number".to_string(),
+                                                RequiredFieldInfo {
+                                                    required_field: "payment_method_data.card.card_number".to_string(),
+                                                    display_name: "card_number".to_string(),
+                                                    field_type: enums::FieldType::UserCardNumber,
+                                                    value: None,
+                                                }
+                                            ),
+                                            (
+                                                "payment_method_data.card.card_exp_month".to_string(),
+                                                RequiredFieldInfo {
+                                                    required_field: "payment_method_data.card.card_exp_month".to_string(),
+                                                    display_name: "card_exp_month".to_string(),
+                                                    field_type: enums::FieldType::UserCardExpiryMonth,
+                                                    value: None,
+                                                }
+                                            ),
+                                            (
+                                                "payment_method_data.card.card_exp_year".to_string(),
+                                                RequiredFieldInfo {
+                                                    required_field: "payment_method_data.card.card_exp_year".to_string(),
+                                                    display_name: "card_exp_year".to_string(),
+                                                    field_type: enums::FieldType::UserCardExpiryYear,
+                                                    value: None,
+                                                }
+                                            ),
+                                            (
+                                                "payment_method_data.card.card_cvc".to_string(),
+                                                RequiredFieldInfo {
+                                                    required_field: "payment_method_data.card.card_cvc".to_string(),
+                                                    display_name: "card_cvc".to_string(),
+                                                    field_type: enums::FieldType::UserCardCvc,
+                                                    value: None,
+                                                }
+                                            ),
+                                            (
+                                                "payment_method_data.card.card_network".to_string(),
+                                                RequiredFieldInfo {
+                                                    required_field: "payment_method_data.card.card_network".to_string(),
+                                                    display_name: "card_network".to_string(),
+                                                    field_type: enums::FieldType::UserCardNetwork,
+                                                    value: None,
+                                                }
+                                            ),
+                                        ]
+                                    ),
+                                }
+                            ),
                             (
                                 enums::Connector::Globalpay,
                                 RequiredFieldFinal {
diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs
index c5fb803ef97..271da3f4e21 100644
--- a/crates/router/src/core/admin.rs
+++ b/crates/router/src/core/admin.rs
@@ -1381,10 +1381,10 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> {
                 forte::transformers::ForteAuthType::try_from(self.auth_type)?;
                 Ok(())
             }
-            // api_enums::Connector::Getnet => {
-            //     getnet::transformers::GetnetAuthType::try_from(self.auth_type)?;
-            //     Ok(())
-            // }
+            api_enums::Connector::Getnet => {
+                getnet::transformers::GetnetAuthType::try_from(self.auth_type)?;
+                Ok(())
+            }
             api_enums::Connector::Globalpay => {
                 globalpay::transformers::GlobalpayAuthType::try_from(self.auth_type)?;
                 Ok(())
diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rs
index b5104391ab8..308a3f2ede3 100644
--- a/crates/router/src/core/payments/flows/authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/authorize_flow.rs
@@ -627,6 +627,7 @@ impl<F>
             minor_amount_to_capture: item.request.minor_amount,
             integrity_object: None,
             split_payments: item.request.split_payments,
+            webhook_url: item.request.webhook_url,
         })
     }
 }
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 6e8152716d0..54dca9b2e41 100644
--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs
@@ -319,6 +319,7 @@ impl<F>
             minor_amount_to_capture: item.request.minor_amount,
             integrity_object: None,
             split_payments: None,
+            webhook_url: None,
         })
     }
 }
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index 9647a277b0e..36b3586ae67 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -473,6 +473,7 @@ pub async fn construct_payment_router_data_for_capture<'a>(
         metadata: payment_data.payment_intent.metadata.expose_option(),
         integrity_object: None,
         split_payments: None,
+        webhook_url: None,
     };
 
     // TODO: evaluate the fields in router data, if they are required or not
@@ -3440,6 +3441,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureD
             metadata: payment_data.payment_intent.metadata.expose_option(),
             integrity_object: None,
             split_payments: None,
+            webhook_url: None,
         })
     }
 }
@@ -3470,6 +3472,21 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureD
                 field_name: "browser_info",
             })?;
         let amount = payment_data.payment_attempt.get_total_amount();
+
+        let router_base_url = &additional_data.router_base_url;
+        let attempt = &payment_data.payment_attempt;
+
+        let merchant_connector_account_id = payment_data
+            .payment_attempt
+            .merchant_connector_id
+            .as_ref()
+            .map(|mca_id| mca_id.get_string_repr())
+            .ok_or(errors::ApiErrorResponse::MerchantAccountNotFound)?;
+        let webhook_url: Option<_> = Some(helpers::create_webhook_url(
+            router_base_url,
+            &attempt.merchant_id,
+            merchant_connector_account_id,
+        ));
         Ok(Self {
             capture_method: payment_data.get_capture_method(),
             amount_to_capture: amount_to_capture.get_amount_as_i64(), // This should be removed once we start moving to connector module
@@ -3496,6 +3513,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureD
             metadata: payment_data.payment_intent.metadata,
             integrity_object: None,
             split_payments: payment_data.payment_intent.split_payments,
+            webhook_url,
         })
     }
 }
@@ -3531,6 +3549,22 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCancelDa
                 field_name: "browser_info",
             })?;
         let amount = payment_data.payment_attempt.get_total_amount();
+
+        let router_base_url = &additional_data.router_base_url;
+        let attempt = &payment_data.payment_attempt;
+
+        let merchant_connector_account_id = payment_data
+            .payment_attempt
+            .merchant_connector_id
+            .as_ref()
+            .map(|mca_id| mca_id.get_string_repr())
+            .ok_or(errors::ApiErrorResponse::MerchantAccountNotFound)?;
+        let webhook_url: Option<_> = Some(helpers::create_webhook_url(
+            router_base_url,
+            &attempt.merchant_id,
+            merchant_connector_account_id,
+        ));
+        let capture_method = payment_data.payment_attempt.capture_method;
         Ok(Self {
             amount: Some(amount.get_amount_as_i64()), // This should be removed once we start moving to connector module
             minor_amount: Some(amount),
@@ -3543,6 +3577,8 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCancelDa
             connector_meta: payment_data.payment_attempt.connector_metadata,
             browser_info,
             metadata: payment_data.payment_intent.metadata,
+            webhook_url,
+            capture_method,
         })
     }
 }
diff --git a/crates/router/src/core/relay/utils.rs b/crates/router/src/core/relay/utils.rs
index 969566c098e..b4d70038c67 100644
--- a/crates/router/src/core/relay/utils.rs
+++ b/crates/router/src/core/relay/utils.rs
@@ -109,6 +109,7 @@ pub async fn construct_relay_refund_router_data<F>(
             refund_status: common_enums::RefundStatus::from(relay_record.status),
             merchant_account_id: None,
             merchant_config_currency: None,
+            capture_method: None,
         },
 
         response: Err(ErrorResponse::default()),
diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs
index 537f67871ea..d9467d19ced 100644
--- a/crates/router/src/core/utils.rs
+++ b/crates/router/src/core/utils.rs
@@ -337,6 +337,7 @@ pub async fn construct_refund_router_data<'a, F>(
         })?;
 
     let connector_refund_id = refund.get_optional_connector_refund_id().cloned();
+    let capture_method = payment_attempt.capture_method;
 
     let braintree_metadata = payment_intent
         .connector_metadata
@@ -395,6 +396,7 @@ pub async fn construct_refund_router_data<'a, F>(
             refund_status: refund.refund_status,
             merchant_account_id,
             merchant_config_currency,
+            capture_method,
         },
 
         response: Ok(types::RefundsResponseData {
diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs
index 99d577c657b..ff60cfbb442 100644
--- a/crates/router/src/types/api.rs
+++ b/crates/router/src/types/api.rs
@@ -440,9 +440,9 @@ impl ConnectorData {
                 enums::Connector::Forte => {
                     Ok(ConnectorEnum::Old(Box::new(connector::Forte::new())))
                 }
-                // enums::Connector::Getnet => {
-                //     Ok(ConnectorEnum::Old(Box::new(connector::Getnet::new())))
-                // }
+                enums::Connector::Getnet => {
+                    Ok(ConnectorEnum::Old(Box::new(connector::Getnet::new())))
+                }
                 enums::Connector::Globalpay => {
                     Ok(ConnectorEnum::Old(Box::new(connector::Globalpay::new())))
                 }
diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs
index 5baf491cb33..da2fc35e823 100644
--- a/crates/router/src/types/transformers.rs
+++ b/crates/router/src/types/transformers.rs
@@ -246,7 +246,7 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {
             api_enums::Connector::Fiservemea => Self::Fiservemea,
             api_enums::Connector::Fiuu => Self::Fiuu,
             api_enums::Connector::Forte => Self::Forte,
-            // api_enums::Connector::Getnet => Self::Getnet,
+            api_enums::Connector::Getnet => Self::Getnet,
             api_enums::Connector::Globalpay => Self::Globalpay,
             api_enums::Connector::Globepay => Self::Globepay,
             api_enums::Connector::Gocardless => Self::Gocardless,
diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs
index ead0173ed56..c8747225513 100644
--- a/crates/router/tests/connectors/utils.rs
+++ b/crates/router/tests/connectors/utils.rs
@@ -408,6 +408,7 @@ pub trait ConnectorActions: Connector {
                 refund_status: enums::RefundStatus::Pending,
                 merchant_account_id: None,
                 merchant_config_currency: None,
+                capture_method: None,
             }),
             payment_info,
         );
@@ -1075,6 +1076,7 @@ impl Default for PaymentRefundType {
             refund_status: enums::RefundStatus::Pending,
             merchant_account_id: None,
             merchant_config_currency: None,
+            capture_method: None,
         };
         Self(data)
     }

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->

Added `no-3ds cards` flow for new connector `Getnet`

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1) No-3DS AutoCapture
<img width="1725" alt="Screenshot 2025-02-17 at 9 29 29 PM" src="https://github.com/user-attachments/assets/5041b6b8-53c6-48e3-9c8e-587e3ffdbee1" />

2) 3DS AutoCapture
<img width="1728" alt="Screenshot 2025-02-17 at 9 30 03 PM" src="https://github.com/user-attachments/assets/ade93c4c-246f-48d4-bbda-ad1adf5d4568" />

3) No-3DS ManualCapture
<img width="1728" alt="Screenshot 2025-02-17 at 9 42 43 PM" src="https://github.com/user-attachments/assets/f6ce18d5-c292-4967-b208-e28c25fdf4af" />

4) 3DS ManualCapture
<img width="1728" alt="Screenshot 2025-02-17 at 9 30 38 PM" src="https://github.com/user-attachments/assets/69783c0f-ced4-4449-941d-d5c2670d8bcf" />

5) Void Payment
<img width="1723" alt="Screenshot 2025-02-17 at 9 30 57 PM" src="https://github.com/user-attachments/assets/bcb00a2c-89c6-4f9b-8d9e-5963b0442a2c" />

6) PSync
<img width="1728" alt="Screenshot 2025-02-17 at 9 31 11 PM" src="https://github.com/user-attachments/assets/3fb06a38-8e2f-4448-b56e-dbfde69e6409" />

7) Refund Payment
<img width="1726" alt="Screenshot 2025-02-17 at 9 32 08 PM" src="https://github.com/user-attachments/assets/b70d6e76-1ef1-4f0d-810f-328e583bdc3b" />

8) RSync
<img width="1728" alt="Screenshot 2025-02-17 at 9 32 20 PM" src="https://github.com/user-attachments/assets/ff0c432b-cad5-45fb-a568-060703aa1173" />


Webhook snapshot
<img width="1064" alt="Screenshot 2025-03-03 at 4 43 19 PM" src="https://github.com/user-attachments/assets/1c202674-f78d-4ba7-9baf-68c7a8de38df" />


1. Connector create

```
curl --location 'http://localhost:8080/account/merchant_1739434149/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
    "connector_type": "payment_processor",
    "connector_name": "getnet",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "4cHLRE-Q7YcAP", 
        "key1":  "515225-GetnetEuropeTEST",
        "api_secret": "5c4a8a42-04a8-4970-a595-262f0ba0a108" 
    },
    "test_mode": true,
    "disabled": false,
    "payment_methods_enabled": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true,
                    "accepted_countries": {
                        "type": "disable_only",
                        "list": [
                            "HK"
                        ]
                    },
                    "accepted_currencies": {
                        "type": "enable_only",
                        "list": [
                            "GBP"
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "city": "NY",
        "unit": "245"
    },
    "connector_webhook_details": {
        "merchant_secret": "5ac555d4-e7f7-409f-8147-d82c8c10ed53"
    },
    "business_country": "US",
    "business_label": "default"
}'
```

Response
```
{
    "connector_type": "payment_processor",
    "connector_name": "getnet",
    "connector_label": "getnet_US_default",
    "merchant_connector_id": "mca_lB9movtztBkl8qeLFQj8",
    "profile_id": "pro_A7ujgD1s1bxz7eYEXSiy",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "4c*********AP",
        "key1": "51*******************ST",
        "api_secret": "5c********************************08"
    },
    "payment_methods_enabled": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "payment_experience": null,
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "accepted_currencies": {
                        "type": "enable_only",
                        "list": [
                            "GBP"
                        ]
                    },
                    "accepted_countries": {
                        "type": "disable_only",
                        "list": [
                            "HK"
                        ]
                    },
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "connector_webhook_details": {
        "merchant_secret": "5ac555d4-e7f7-409f-8147-d82c8c10ed53",
        "additional_secret": null
    },
    "metadata": {
        "city": "NY",
        "unit": "245"
    },
    "test_mode": true,
    "disabled": false,
    "frm_configs": null,
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "applepay_verified_domains": null,
    "pm_auth_config": null,
    "status": "active",
    "additional_merchant_data": null,
    "connector_wallets_details": null
}
```

2. Manual Capture

```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_t9KANvghHomlbRfaxACFCdFQaMNiJbq2EpxojRA0OHbh9Kx5HqGJANqXGUnOk0Gr' \
--data-raw '{
    "amount": 6540,
    "currency": "GBP",
    "amount_to_capture": 6540,
    "confirm": true,
    "profile_id": null,
    "capture_method": "manual",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "on_session", 
    "customer": {
        "id": "customer123",
        "name": "John Doe",
        "email": "customer@gmail.com",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "customer_id": "customer123",
    
    
    
    "phone_country_code": "+1",
    "routing": { 
        "type": "single",
        "data": "stripe"
    },
    "description": "Its my first payment request",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": { 
        "card": {
            "card_number": "5413330300001006",
            "card_exp_month": "02",
            "card_exp_year": "2025",
            "card_holder_name": "joseph Doe",
            "card_cvc": "006",
            "card_network": "Visa"
        }
    },
    
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 6540,
            "account_name": "transaction_processing"
        }
    ],
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "browser_info": {
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
        "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "128.0.0.1"
    },
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "125.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    
    "connector_metadata": {
        "noon": {
            "order_category": "pay"
        }
    },
    "payment_link": false,
    "payment_link_config": {
        "theme": "",
        "logo": "",
        "seller_name": "",
        "sdk_layout": "",
        "display_sdk_only": false,
        "enabled_saved_payment_method": false
    },
    "payment_type": "normal", 
    "request_incremental_authorization": false,
    "merchant_order_reference_id": "test_ord",
    "session_expiry": 900 
}

'
```

Response
```
{
    "payment_id": "pay_yeIQORCXdgimJRzZTCVw",
    "merchant_id": "merchant_1739434149",
    "status": "requires_capture",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 6540,
    "amount_received": null,
    "connector": "getnet",
    "client_secret": "pay_yeIQORCXdgimJRzZTCVw_secret_u9VvAVWDu490Tj2lA7Zr",
    "created": "2025-02-13T08:11:07.353Z",
    "currency": "GBP",
    "customer_id": "customer123",
    "customer": {
        "id": "customer123",
        "name": "John Doe",
        "email": "customer@gmail.com",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1006",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "541333",
            "card_extended_bin": null,
            "card_exp_month": "02",
            "card_exp_year": "2025",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6540,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "customer@gmail.com",
    "name": "John Doe",
    "phone": "9999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "customer123",
        "created_at": 1739434267,
        "expires": 1739437867,
        "secret": "epk_667d69df4d134fc39f0a61703d75481e"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "068e3efc-4163-4020-96f7-7ed306bffa92",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "pay"
        }
    },
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_A7ujgD1s1bxz7eYEXSiy",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_lB9movtztBkl8qeLFQj8",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-13T08:26:07.353Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "128.0.0.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-13T08:11:12.236Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": "test_ord",
    "order_tax_amount": null,
    "connector_mandate_id": null
}
```

```
curl --location 'http://localhost:8080/payments/pay_yeIQORCXdgimJRzZTCVw/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_t9KANvghHomlbRfaxACFCdFQaMNiJbq2EpxojRA0OHbh9Kx5HqGJANqXGUnOk0Gr' \
--data '{
  "amount_to_capture": 6000,
  "statement_descriptor_name": "Joseph",
  "statement_descriptor_prefix" :"joseph",
  "statement_descriptor_suffix": "JS"
}'
```

Response
```
{
    "payment_id": "pay_yeIQORCXdgimJRzZTCVw",
    "merchant_id": "merchant_1739434149",
    "status": "partially_captured",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6000,
    "connector": "getnet",
    "client_secret": "pay_yeIQORCXdgimJRzZTCVw_secret_u9VvAVWDu490Tj2lA7Zr",
    "created": "2025-02-13T08:11:07.353Z",
    "currency": "GBP",
    "customer_id": "customer123",
    "customer": {
        "id": "customer123",
        "name": "John Doe",
        "email": "customer@gmail.com",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1006",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "541333",
            "card_extended_bin": null,
            "card_exp_month": "02",
            "card_exp_year": "2025",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6540,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "customer@gmail.com",
    "name": "John Doe",
    "phone": "9999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "51cff4a6-6a2b-43f4-8496-9979e55d1621",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "pay"
        }
    },
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_A7ujgD1s1bxz7eYEXSiy",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_lB9movtztBkl8qeLFQj8",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-13T08:26:07.353Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "128.0.0.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": "pm_wSdofMDXLzBUvjp1kh4i",
    "payment_method_status": null,
    "updated": "2025-02-13T08:12:03.769Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": "test_ord",
    "order_tax_amount": null,
    "connector_mandate_id": null
}
```

3. Automatic capture
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_t9KANvghHomlbRfaxACFCdFQaMNiJbq2EpxojRA0OHbh9Kx5HqGJANqXGUnOk0Gr' \
--data-raw '{
    "amount": 6540,
    "currency": "GBP",
    "amount_to_capture": 6540,
    "confirm": true,
    "profile_id": null,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "on_session", 
    "customer": {
        "id": "customer123",
        "name": "John Doe",
        "email": "customer@gmail.com",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "customer_id": "customer123",
    
    
    
    "phone_country_code": "+1",
    "routing": { 
        "type": "single",
        "data": "stripe"
    },
    "description": "Its my first payment request",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": { 
        "card": {
            "card_number": "5413330300001006",
            "card_exp_month": "02",
            "card_exp_year": "2025",
            "card_holder_name": "joseph Doe",
            "card_cvc": "006",
            "card_network": "Visa"
        }
    },
    
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 6540,
            "account_name": "transaction_processing"
        }
    ],
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "browser_info": {
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
        "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "128.0.0.1"
    },
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "125.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    
    "connector_metadata": {
        "noon": {
            "order_category": "pay"
        }
    },
    "payment_link": false,
    "payment_link_config": {
        "theme": "",
        "logo": "",
        "seller_name": "",
        "sdk_layout": "",
        "display_sdk_only": false,
        "enabled_saved_payment_method": false
    },
    "payment_type": "normal", 
    "request_incremental_authorization": false,
    "merchant_order_reference_id": "test_ord",
    "session_expiry": 900   
}

'
```

Response
```
{
    "payment_id": "pay_VMzczCzFIwowXXE9w8OS",
    "merchant_id": "merchant_1739434149",
    "status": "succeeded",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6540,
    "connector": "getnet",
    "client_secret": "pay_VMzczCzFIwowXXE9w8OS_secret_vuIqC7LndTSFj11rDMV7",
    "created": "2025-02-13T08:13:27.282Z",
    "currency": "GBP",
    "customer_id": "customer123",
    "customer": {
        "id": "customer123",
        "name": "John Doe",
        "email": "customer@gmail.com",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1006",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "541333",
            "card_extended_bin": null,
            "card_exp_month": "02",
            "card_exp_year": "2025",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6540,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "customer@gmail.com",
    "name": "John Doe",
    "phone": "9999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "customer123",
        "created_at": 1739434407,
        "expires": 1739438007,
        "secret": "epk_3dd3731f7cc24c7f8a7df6e8eeae7535"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "839fc50f-02ba-4314-83a6-056595d0bac0",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "pay"
        }
    },
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_A7ujgD1s1bxz7eYEXSiy",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_lB9movtztBkl8qeLFQj8",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-13T08:28:27.282Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "128.0.0.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-13T08:13:30.109Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": "test_ord",
    "order_tax_amount": null,
    "connector_mandate_id": null
}
```

Refund
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_t9KANvghHomlbRfaxACFCdFQaMNiJbq2EpxojRA0OHbh9Kx5HqGJANqXGUnOk0Gr' \
--data '{
    "payment_id": "pay_VMzczCzFIwowXXE9w8OS",
    
    "amount": 600,
    "reason": "Customer returned product",
    "refund_type": "instant",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
    
}'
```

Response
```
{
    "refund_id": "ref_SCNfNPs3TV8wEk1pVvoS",
    "payment_id": "pay_VMzczCzFIwowXXE9w8OS",
    "amount": 600,
    "currency": "GBP",
    "status": "succeeded",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "unified_code": null,
    "unified_message": null,
    "created_at": "2025-02-13T08:14:13.071Z",
    "updated_at": "2025-02-13T08:14:14.387Z",
    "connector": "getnet",
    "profile_id": "pro_A7ujgD1s1bxz7eYEXSiy",
    "merchant_connector_id": "mca_lB9movtztBkl8qeLFQj8",
    "split_refunds": null
}
```

Void
```
curl --location 'http://localhost:8080/payments/pay_LQ2EiF97FKn0yt0jgmk5/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_t9KANvghHomlbRfaxACFCdFQaMNiJbq2EpxojRA0OHbh9Kx5HqGJANqXGUnOk0Gr' \
--data '{
  "cancellation_reason": "requested_by_customer"
}'
```

Response
```
{
    "payment_id": "pay_LQ2EiF97FKn0yt0jgmk5",
    "merchant_id": "merchant_1739434149",
    "status": "cancelled",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "getnet",
    "client_secret": "pay_LQ2EiF97FKn0yt0jgmk5_secret_C1NVCNguIV0C3f508eM7",
    "created": "2025-02-13T08:15:07.592Z",
    "currency": "GBP",
    "customer_id": "customer123",
    "customer": {
        "id": "customer123",
        "name": "John Doe",
        "email": "customer@gmail.com",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1006",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "541333",
            "card_extended_bin": null,
            "card_exp_month": "02",
            "card_exp_year": "2025",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6540,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "customer@gmail.com",
    "name": "John Doe",
    "phone": "9999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": "requested_by_customer",
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "d89b3a2f-3d0d-4654-91f9-0f2e67f40b49",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "pay"
        }
    },
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_A7ujgD1s1bxz7eYEXSiy",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_lB9movtztBkl8qeLFQj8",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-13T08:30:07.592Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "128.0.0.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": "pm_8qg5T41lSXYx0qs5KU86",
    "payment_method_status": null,
    "updated": "2025-02-13T08:15:17.782Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": "test_ord",
    "order_tax_amount": null,
    "connector_mandate_id": null
}
```


PSync
```
curl --location 'http://localhost:8080/payments/pay_LQ2EiF97FKn0yt0jgmk5?force_sync=true&expand_captures=true&expand_attempts=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_6HkhcQvkti3OGp1PFsRSwRzKaPnitoH7k854sEOKfOkRypAq1PCNScAYw7VrDBcJ'
```

Response
```
{
    "payment_id": "pay_qXgED4jGf5ncCz2EO3q8",
    "merchant_id": "merchant_1739379077",
    "status": "succeeded",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6540,
    "connector": "getnet",
    "client_secret": "pay_qXgED4jGf5ncCz2EO3q8_secret_tiBwvvMYD4dIUewZe8H9",
    "created": "2025-02-12T19:02:54.488Z",
    "currency": "USD",
    "customer_id": "customer123",
    "customer": {
        "id": "customer123",
        "name": "John Doe",
        "email": "customer@gmail.com",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": [
        {
            "refund_id": "ref_FXURRXerycqpduKOCtP2",
            "payment_id": "pay_qXgED4jGf5ncCz2EO3q8",
            "amount": 600,
            "currency": "USD",
            "status": "succeeded",
            "reason": "Customer returned product",
            "metadata": {
                "udf1": "value1",
                "new_customer": "true",
                "login_date": "2019-09-10T10:11:12Z"
            },
            "error_message": null,
            "error_code": null,
            "unified_code": null,
            "unified_message": null,
            "created_at": "2025-02-12T19:02:59.241Z",
            "updated_at": "2025-02-12T19:03:02.765Z",
            "connector": "getnet",
            "profile_id": "pro_srQZ4vZCTrjK1XhWzA7t",
            "merchant_connector_id": "mca_UcS43Fo5dQL631cFT4V3",
            "split_refunds": null
        }
    ],
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_qXgED4jGf5ncCz2EO3q8_1",
            "status": "charged",
            "amount": 6540,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "getnet",
            "error_message": null,
            "payment_method": "card",
            "connector_transaction_id": "b0c93eb0-d018-42e0-ac36-bf4a6e47f51d",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-02-12T19:02:54.488Z",
            "modified_at": "2025-02-12T19:02:56.271Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": null,
            "payment_method_type": "credit",
            "reference_id": null,
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1006",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "541333",
            "card_extended_bin": null,
            "card_exp_month": "02",
            "card_exp_year": "2025",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest@example.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6540,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "customer@gmail.com",
    "name": "John Doe",
    "phone": "9999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "b0c93eb0-d018-42e0-ac36-bf4a6e47f51d",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "pay"
        }
    },
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_srQZ4vZCTrjK1XhWzA7t",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_UcS43Fo5dQL631cFT4V3",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-12T19:17:54.488Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "128.0.0.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": "pm_r8XyBKhMfwgSeu9RMRxt",
    "payment_method_status": "active",
    "updated": "2025-02-12T19:02:56.256Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": "test_ord",
    "order_tax_amount": null,
    "connector_mandate_id": null
}
```

RSync
```
curl --location 'http://localhost:8080/refunds/ref_SCNfNPs3TV8wEk1pVvoS' \
--header 'Accept: application/json' \
--header 'api-key: dev_6HkhcQvkti3OGp1PFsRSwRzKaPnitoH7k854sEOKfOkRypAq1PCNScAYw7VrDBcJ'
```

Response
```
{
    "refund_id": "ref_FXURRXerycqpduKOCtP2",
    "payment_id": "pay_qXgED4jGf5ncCz2EO3q8",
    "amount": 600,
    "currency": "USD",
    "status": "succeeded",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "unified_code": null,
    "unified_message": null,
    "created_at": "2025-02-12T19:02:59.241Z",
    "updated_at": "2025-02-12T19:03:02.765Z",
    "connector": "getnet",
    "profile_id": "pro_srQZ4vZCTrjK1XhWzA7t",
    "merchant_connector_id": "mca_UcS43Fo5dQL631cFT4V3",
    "split_refunds": null
}
```

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
