Issue:
Add Global Payments for card payments

Resolution:
<think>
PR Context:
- Title: feat(connector): add payment create, sync, capture, refund, void, rsync support for globalpay
- Merged: 2023-01-11T14:03:07Z
- Files changed: 26 files
- Commits: 17 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates

## Description
<!-- Describe your changes in detail -->
- Adding support for [globalpay](https://www.globalpayments.com/en-ap) payment gateway
- Updated connector creation script

**Payment Method:** card
**Supported payment flows**

- [Authorize](https://developer.globalpay.com/api/transactions#create)
- [Capture](https://d
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(connector): add payment create, sync, capture, refund, void, rsync support for globalpay (#322)
Files to modify:


**connector-template/mod.rs**
  Add:
    - function: private::build_request
    - function: private::build_request

**connector-template/test.rs**
  Modify existing code

**connector-template/transformers.rs**
  Modify existing code

**crates/api_models/src/enums.rs**
  Modify existing code

**crates/router/src/configs/settings.rs**
  Modify existing code

**crates/router/src/connector.rs**
  Add:
    - mod: pub::globalpay
    - mod: pub::utils

**crates/router/src/connector/globalpay.rs**
  Add:
    - function: private::build_headers
    - function: private::id
    - function: private::common_get_content_type
    - function: private::base_url
    - function: private::get_auth_header
    - function: private::build_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::build_request
    - function: private::get_request_body
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::build_request
    - function: private::get_error_response
    - function: private::handle_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_webhook_object_reference_id
    - function: private::get_webhook_event_type
    - function: private::get_webhook_resource_object
    - function: private::get_flow_type
    - struct: pub::Globalpay
    - impl: impl ConnectorCommonExt<Flow, Request, Response> for Globalpay
    - impl: impl ConnectorCommon for Globalpay
    - impl: impl api::Payment for Globalpay
    - impl: impl api::PreVerify for Globalpay
    - impl: impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> for Globalpay
    - impl: impl api::PaymentVoid for Globalpay
    - impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for Globalpay
    - impl: impl api::PaymentSync for Globalpay
    - impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for Globalpay
    - impl: impl api::PaymentCapture for Globalpay
    - impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for Globalpay
    - impl: impl api::PaymentSession for Globalpay
    - impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Globalpay
    - impl: impl api::PaymentAuthorize for Globalpay
    - impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for Globalpay
    - impl: impl api::Refund for Globalpay
    - impl: impl api::RefundExecute for Globalpay
    - impl: impl api::RefundSync for Globalpay
    - impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Globalpay
    - impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Globalpay
    - impl: impl api::IncomingWebhook for Globalpay
    - impl: impl services::ConnectorRedirectResponse for Globalpay
    - mod: private::requests
    - mod: private::response
    - mod: private::transformers

**crates/router/src/connector/globalpay/requests.rs**
  Add:
    - struct: pub::GlobalpayPaymentsRequest
    - struct: pub::CurrencyConversion
    - struct: pub::Device
    - struct: pub::Capabilities
    - struct: pub::Lodging
    - struct: pub::LodgingChargeItem
    - struct: pub::Notifications
    - struct: pub::Order
    - struct: pub::PaymentMethod
    - struct: pub::Apm
    - struct: pub::Authentication
    - struct: pub::ThreeDs
    - struct: pub::BankTransfer
    - struct: pub::Bank
    - struct: pub::Address
    - struct: pub::Card
    - struct: pub::DigitalWallet
    - struct: pub::Encryption
    - struct: pub::StoredCredential
    - struct: pub::GlobalpayRefundRequest
    - enum: pub::AuthorizationMode
    - enum: pub::CaptureMode
    - enum: pub::Channel
    - enum: pub::EnabledResponse
    - enum: pub::CapabilitiesEntryMode
    - enum: pub::Mobile
    - enum: pub::PayerVerification
    - enum: pub::DeviceEntryMode
    - enum: pub::GratuityPromptMode
    - enum: pub::PrintReceiptMode
    - enum: pub::GlobalpayPaymentsRequestType
    - enum: pub::Initiator
    - enum: pub::Language
    - enum: pub::PaymentMethodProgramCode
    - enum: pub::TypeElement
    - enum: pub::ApmProvider
    - enum: pub::ExemptStatus
    - enum: pub::NumberType
    - enum: pub::SecCode
    - enum: pub::ChipCondition
    - enum: pub::CvvIndicator
    - enum: pub::Funding
    - enum: pub::DigitalWalletProvider
    - enum: pub::TokenFormat
    - enum: pub::Method
    - enum: pub::PaymentMethodEntryMode
    - enum: pub::FingerprintMode
    - enum: pub::CardStorageMode
    - enum: pub::Model
    - enum: pub::Reason
    - enum: pub::Sequence

**crates/router/src/connector/globalpay/response.rs**
  Add:
    - struct: pub::GlobalpayPaymentsResponse
    - struct: pub::Action
    - struct: pub::CurrencyConversion
    - struct: pub::PaymentMethod
    - struct: pub::Apm
    - struct: pub::Bank
    - struct: pub::Mandate
    - struct: pub::Authentication
    - struct: pub::ThreeDs
    - struct: pub::BankTransfer
    - struct: pub::Card
    - struct: pub::ProviderClass
    - enum: pub::ResultCode
    - enum: pub::FundStatus
    - enum: pub::ApmProvider
    - enum: pub::NumberType
    - enum: pub::AvsAction
    - enum: pub::GlobalPayResult
    - enum: pub::Brand
    - enum: pub::FingerprintPresenceIndicator
    - enum: pub::GlobalpayPaymentStatus

**crates/router/src/connector/globalpay/transformers.rs**
  Add:
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - function: private::from
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - struct: pub::GlobalpayAuthType
    - struct: pub::GlobalpayErrorResponse
    - impl: impl TryFrom<&types::PaymentsAuthorizeRouterData> for GlobalpayPaymentsRequest
    - impl: impl TryFrom<&types::PaymentsCaptureRouterData> for GlobalpayPaymentsRequest
    - impl: impl TryFrom<&types::PaymentsCancelRouterData> for GlobalpayPaymentsRequest
    - impl: impl TryFrom<&types::ConnectorAuthType> for GlobalpayAuthType
    - impl: impl From<GlobalpayPaymentStatus> for enums::AttemptStatus
    - impl: impl From<GlobalpayPaymentStatus> for enums::RefundStatus
    - impl: impl TryFrom<types::ResponseRouterData<F, GlobalpayPaymentsResponse, T, types::PaymentsResponseData>> for types::RouterData<F, T, types::PaymentsResponseData>
    - impl: impl TryFrom<&types::RefundsRouterData<F>> for requests::GlobalpayRefundRequest
    - impl: impl TryFrom<types::RefundsResponseRouterData<api::Execute, GlobalpayPaymentsResponse>> for types::RefundExecuteRouterData
    - impl: impl TryFrom<types::RefundsResponseRouterData<api::RSync, GlobalpayPaymentsResponse>> for types::RefundsRouterData<api::RSync>

**crates/router/src/connector/utils.rs**
  Add:
    - function: pub::missing_field_err
    - function: private::get_card_number
    - function: private::get_card_expiry_month
    - function: private::get_card_expiry_year
    - function: private::get_card_expiry_year_2_digit
    - function: private::get_card_cvc
    - function: private::get_attempt_id
    - function: private::get_billing_country
    - function: private::get_card
    - trait: pub::PaymentsRequestData
    - trait: pub::CardData
    - impl: impl CardData for api::CCard
    - impl: impl PaymentsRequestData for types::PaymentsAuthorizeRouterData

**crates/router/src/types/api.rs**
  Modify existing code

**crates/router/tests/connectors/connector_auth.rs**
  Modify existing code

**crates/router/tests/connectors/globalpay.rs**
  Add:
    - function: private::get_data
    - function: private::get_auth_token
    - function: private::get_name
    - function: private::get_connector_meta
    - function: private::get_default_payment_info
    - function: private::should_only_authorize_payment
    - function: private::should_authorize_and_capture_payment
    - function: private::should_capture_already_authorized_payment
    - function: private::should_sync_payment
    - function: private::should_fail_payment_for_incorrect_cvc
    - function: private::should_refund_succeeded_payment
    - function: private::should_void_already_authorized_payment
    - function: private::should_sync_refund
    - struct: private::Globalpay
    - impl: impl ConnectorActions for Globalpay
    - impl: impl utils::Connector for Globalpay

**crates/router/tests/connectors/main.rs**
  Add:
    - mod: private::globalpay

**crates/router/tests/connectors/shift4.rs**
  Modify existing code

**crates/router/tests/connectors/utils.rs**
  Add:
    - function: private::get_connector_meta
    - struct: pub::PaymentInfo

**crates/router/tests/connectors/worldpay.rs**
  Modify existing code