Issue:
feat(connector): add template code for recurly

add a template code for recurly connector

Resolution:
<think>
PR Context:
- Title: feat(connector): add template code for recurly
- Merged: 2025-03-05T10:40:40Z
- Files changed: 24 files
- Commits: 13 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
connector integration template code for recurly.

Issue: This PR closes the issue #7283

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application conf
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(connector): add template code for recurly (#7284)
Co-authored-by: Aniket Burman <aniket.burman@
Files to modify:


**crates/common_enums/src/connector_enums.rs**
  Modify existing code

**crates/hyperswitch_connectors/src/connectors.rs**
  Add:
    - mod: pub::recurly

**crates/hyperswitch_connectors/src/connectors/recurly.rs**
  Add:
    - function: pub::new
    - function: private::build_headers
    - function: private::id
    - function: private::get_currency_unit
    - 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::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_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
    - struct: pub::Recurly
    - impl: impl Recurly
    - impl: impl api::Payment for Recurly
    - impl: impl api::PaymentSession for Recurly
    - impl: impl api::ConnectorAccessToken for Recurly
    - impl: impl api::MandateSetup for Recurly
    - impl: impl api::PaymentAuthorize for Recurly
    - impl: impl api::PaymentSync for Recurly
    - impl: impl api::PaymentCapture for Recurly
    - impl: impl api::PaymentVoid for Recurly
    - impl: impl api::Refund for Recurly
    - impl: impl api::RefundExecute for Recurly
    - impl: impl api::RefundSync for Recurly
    - impl: impl api::PaymentToken for Recurly
    - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Recurly
    - impl: impl ConnectorCommonExt<Flow, Request, Response> for Recurly
    - impl: impl ConnectorCommon for Recurly
    - impl: impl ConnectorValidation for Recurly
    - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Recurly
    - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Recurly
    - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Recurly
    - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Recurly
    - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Recurly
    - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Recurly
    - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Recurly
    - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Recurly
    - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Recurly
    - impl: impl webhooks::IncomingWebhook for Recurly
    - impl: impl ConnectorSpecifications for Recurly
    - mod: pub::transformers

**crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs**
  Add:
    - function: private::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::try_from
    - function: private::try_from
    - struct: pub::RecurlyRouterData
    - struct: pub::RecurlyPaymentsRequest
    - struct: pub::RecurlyCard
    - struct: pub::RecurlyAuthType
    - struct: pub::RecurlyPaymentsResponse
    - struct: pub::RecurlyRefundRequest
    - struct: pub::RefundResponse
    - struct: pub::RecurlyErrorResponse
    - enum: pub::RecurlyPaymentStatus
    - enum: pub::RefundStatus
    - impl: impl From<(StringMinorUnit, T)> for RecurlyRouterData<T>
    - impl: impl TryFrom<&RecurlyRouterData<&PaymentsAuthorizeRouterData>> for RecurlyPaymentsRequest
    - impl: impl TryFrom<&ConnectorAuthType> for RecurlyAuthType
    - impl: impl From<RecurlyPaymentStatus> for common_enums::AttemptStatus
    - impl: impl TryFrom<ResponseRouterData<F, RecurlyPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
    - impl: impl TryFrom<&RecurlyRouterData<&RefundsRouterData<F>>> for RecurlyRefundRequest
    - impl: impl From<RefundStatus> for enums::RefundStatus
    - impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
    - impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>

**crates/hyperswitch_connectors/src/default_implementations.rs**
  Modify existing code

**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
  Modify existing code

**crates/hyperswitch_interfaces/src/configs.rs**
  Modify existing code

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

**crates/router/src/core/payments/connector_integration_v2_impls.rs**
  Modify existing code

**crates/router/src/core/payments/flows.rs**
  Modify existing code

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

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

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

**crates/router/tests/connectors/recurly.rs**
  Add:
    - function: private::get_data
    - function: private::get_auth_token
    - function: private::get_name
    - function: private::get_default_payment_info
    - function: private::payment_method_details
    - function: private::should_only_authorize_payment
    - function: private::should_capture_authorized_payment
    - function: private::should_partially_capture_authorized_payment
    - function: private::should_sync_authorized_payment
    - function: private::should_void_authorized_payment
    - function: private::should_refund_manually_captured_payment
    - function: private::should_partially_refund_manually_captured_payment
    - function: private::should_sync_manually_captured_refund
    - function: private::should_make_payment
    - function: private::should_sync_auto_captured_payment
    - function: private::should_refund_auto_captured_payment
    - function: private::should_partially_refund_succeeded_payment
    - function: private::should_refund_succeeded_payment_multiple_times
    - function: private::should_sync_refund
    - function: private::should_fail_payment_for_incorrect_cvc
    - function: private::should_fail_payment_for_invalid_exp_month
    - function: private::should_fail_payment_for_incorrect_expiry_year
    - function: private::should_fail_void_payment_for_auto_capture
    - function: private::should_fail_capture_for_invalid_payment
    - function: private::should_fail_for_refund_amount_higher_than_payment_amount
    - struct: private::RecurlyTest
    - impl: impl ConnectorActions for RecurlyTest
    - impl: impl utils::Connector for RecurlyTest

**crates/test_utils/src/connector_auth.rs**
  Modify existing code