Issue:
Add Worldline for card payments

Resolution:
<think>
PR Context:
- Title: feature(connector): add support for worldline connector
- Merged: 2023-01-16T12:53:44Z
- Files changed: 15 files
- Commits: 12 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates

## Description
Adding support for [worldline](https://epayments-api.developer-ingenico.com/?paymentPlatform=GLOBALCOLLECT) payment gateway

Payment Method: card
Supported payment flows

[Authorize](https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/java/payments/create.html?paymentPlatform=ALL#payments-create)
[PSync
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feature(connector): add support for worldline connector (#374)
Files to modify:


**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::worldline

**crates/router/src/connector/worldline.rs**
  Add:
    - function: pub::generate_authorization_token
    - function: pub::get_current_date_time
    - function: private::id
    - function: private::base_url
    - function: private::build_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_headers
    - 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_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
    - struct: pub::Worldline
    - impl: impl Worldline
    - impl: impl ConnectorCommon for Worldline
    - impl: impl api::Payment for Worldline
    - impl: impl api::PreVerify for Worldline
    - impl: impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> for Worldline
    - impl: impl api::PaymentVoid for Worldline
    - impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for Worldline
    - impl: impl api::PaymentSync for Worldline
    - impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for Worldline
    - impl: impl api::PaymentCapture for Worldline
    - impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for Worldline
    - impl: impl api::PaymentSession for Worldline
    - impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Worldline
    - impl: impl api::PaymentAuthorize for Worldline
    - impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for Worldline
    - impl: impl api::Refund for Worldline
    - impl: impl api::RefundExecute for Worldline
    - impl: impl api::RefundSync for Worldline
    - impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Worldline
    - impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Worldline
    - impl: impl api::IncomingWebhook for Worldline
    - impl: impl services::ConnectorRedirectResponse for Worldline
    - mod: private::transformers

**crates/router/src/connector/worldline/transformers.rs**
  Add:
    - function: private::try_from
    - function: private::make_card_request
    - function: private::get_card_product_id
    - function: private::get_address
    - function: private::build_customer_info
    - function: private::from
    - function: private::from
    - function: private::try_from
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - function: private::from
    - function: private::product_id
    - struct: pub::Card
    - struct: pub::CardPaymentMethod
    - struct: pub::AmountOfMoney
    - struct: pub::Order
    - struct: pub::BillingAddress
    - struct: pub::ContactDetails
    - struct: pub::Customer
    - struct: pub::Name
    - struct: pub::Shipping
    - struct: pub::PaymentsRequest
    - struct: pub::AuthType
    - struct: pub::Payment
    - struct: pub::PaymentResponse
    - struct: pub::WorldlineRefundRequest
    - struct: pub::RefundResponse
    - struct: pub::Error
    - struct: pub::ErrorResponse
    - enum: pub::PaymentStatus
    - enum: pub::RefundStatus
    - enum: pub::CardProduct
    - impl: impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaymentsRequest
    - impl: impl From<api_models::AddressDetails> for BillingAddress
    - impl: impl From<api_models::AddressDetails> for Shipping
    - impl: impl TryFrom<&types::ConnectorAuthType> for AuthType
    - impl: impl From<PaymentStatus> for enums::AttemptStatus
    - impl: impl TryFrom<types::ResponseRouterData<F, Payment, T, types::PaymentsResponseData>> for types::RouterData<F, T, types::PaymentsResponseData>
    - impl: impl TryFrom<types::ResponseRouterData<F, PaymentResponse, T, types::PaymentsResponseData>> for types::RouterData<F, T, types::PaymentsResponseData>
    - impl: impl TryFrom<&types::RefundsRouterData<F>> for WorldlineRefundRequest
    - impl: impl From<RefundStatus> for enums::RefundStatus
    - impl: impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>> for types::RefundsRouterData<api::Execute>
    - impl: impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>> for types::RefundsRouterData<api::RSync>
    - impl: impl From<&PaymentResponse> for enums::AttemptStatus
    - impl: impl CardProduct

**crates/router/src/core/errors.rs**
  Modify existing code

**crates/router/src/lib.rs**
  Modify existing code

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

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

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

**crates/router/tests/connectors/worldline.rs**
  Add:
    - function: private::get_data
    - function: private::get_auth_token
    - function: private::get_name
    - function: private::get_payment_info
    - function: private::get_payment_authorize_data
    - function: private::should_requires_manual_authorization
    - function: private::should_auto_authorize_and_request_capture
    - function: private::should_fail_payment_for_invalid_cvc
    - function: private::should_sync_manual_auth_payment
    - function: private::should_sync_auto_auth_payment
    - function: private::should_fail_capture_payment
    - function: private::should_cancel_unauthorized_payment
    - function: private::should_cancel_uncaptured_payment
    - function: private::should_fail_cancel_with_invalid_payment_id
    - function: private::should_fail_refund_with_invalid_payment_status
    - struct: private::WorldlineTest
    - impl: impl ConnectorActions for WorldlineTest
    - impl: impl utils::Connector for WorldlineTest
    - impl: impl WorldlineTest