Issue:
feat(connector): [Square] Use connector_request_reference_id as reference to connector.

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
Using connector_request_reference_id as reference to the connector. This PR closes https://github.com/juspay/hyperswitch/issues/2318.


### 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)?
-->
Make any Payment for connector Square and see that you are getting "reference_id" field in the logs of payment request.

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable


Resolution:
<think>
PR Context:
- Title: feat(connector): [RISKIFIED] Add support for riskified frm connector
- Merged: 2023-12-12T13:23:22Z
- Files changed: 30 files
- Commits: 30 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
Add support for Riskified FRM Connector.
This PR resolves the problem mentioned in issue [#2453](https://github.com/juspay/hyperswitch-cloud/issues/2453).

## Test Cases
1.Create a Merchant Account with frm enabled
2.Create an API key
3.Create a Stripe MCA
4.Create a Riskified 
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(connector): [RISKIFIED] Add support for riskified frm connector (#2533)
Co-authored-by: github-
Files to modify:


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

**crates/api_models/src/payments.rs**
  Add:
    - enum: pub::ProductType

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

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

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

**crates/router/src/connector/riskified.rs**
  Add:
    - function: pub::generate_authorization_signature
    - function: private::build_headers
    - function: private::id
    - function: private::common_get_content_type
    - function: private::base_url
    - 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::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_webhook_object_reference_id
    - function: private::get_webhook_event_type
    - function: private::get_webhook_resource_object
    - struct: pub::Riskified
    - impl: impl Riskified
    - impl: impl ConnectorCommonExt<Flow, Request, Response> for Riskified
    - impl: impl ConnectorCommon for Riskified
    - impl: impl ConnectorIntegration<
        frm_api::Checkout,
        frm_types::FraudCheckCheckoutData,
        frm_types::FraudCheckResponseData,
    > for Riskified
    - impl: impl api::Payment for Riskified
    - impl: impl api::PaymentAuthorize for Riskified
    - impl: impl api::PaymentSync for Riskified
    - impl: impl api::PaymentVoid for Riskified
    - impl: impl api::PaymentCapture for Riskified
    - impl: impl api::MandateSetup for Riskified
    - impl: impl api::ConnectorAccessToken for Riskified
    - impl: impl api::PaymentToken for Riskified
    - impl: impl api::Refund for Riskified
    - impl: impl api::RefundExecute for Riskified
    - impl: impl api::RefundSync for Riskified
    - impl: impl ConnectorValidation for Riskified
    - impl: impl ConnectorIntegration<
        frm_api::Sale,
        frm_types::FraudCheckSaleData,
        frm_types::FraudCheckResponseData,
    > for Riskified
    - impl: impl ConnectorIntegration<
        frm_api::Transaction,
        frm_types::FraudCheckTransactionData,
        frm_types::FraudCheckResponseData,
    > for Riskified
    - impl: impl ConnectorIntegration<
        frm_api::Fulfillment,
        frm_types::FraudCheckFulfillmentData,
        frm_types::FraudCheckResponseData,
    > for Riskified
    - impl: impl ConnectorIntegration<
        frm_api::RecordReturn,
        frm_types::FraudCheckRecordReturnData,
        frm_types::FraudCheckResponseData,
    > for Riskified
    - impl: impl ConnectorIntegration<
        api::PaymentMethodToken,
        types::PaymentMethodTokenizationData,
        types::PaymentsResponseData,
    > for Riskified
    - impl: impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> for Riskified
    - impl: impl ConnectorIntegration<
        api::SetupMandate,
        types::SetupMandateRequestData,
        types::PaymentsResponseData,
    > for Riskified
    - impl: impl api::PaymentSession for Riskified
    - impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Riskified
    - impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for Riskified
    - impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for Riskified
    - impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for Riskified
    - impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for Riskified
    - impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Riskified
    - impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Riskified
    - impl: impl api::FraudCheck for Riskified
    - impl: impl frm_api::FraudCheckSale for Riskified
    - impl: impl frm_api::FraudCheckCheckout for Riskified
    - impl: impl frm_api::FraudCheckTransaction for Riskified
    - impl: impl frm_api::FraudCheckFulfillment for Riskified
    - impl: impl frm_api::FraudCheckRecordReturn for Riskified
    - impl: impl api::IncomingWebhook for Riskified
    - mod: pub::transformers

**crates/router/src/connector/riskified/transformers.rs**
  Add:
    - mod: pub::api
    - mod: pub::auth

**crates/router/src/connector/riskified/transformers/api.rs**
  Add:
    - function: private::try_from
    - function: private::try_from
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - function: private::get_fulfillment_status
    - struct: pub::RiskifiedPaymentsCheckoutRequest
    - struct: pub::CheckoutRequest
    - struct: pub::PaymentDetails
    - struct: pub::ShippingLines
    - struct: pub::DiscountCodes
    - struct: pub::ClientDetails
    - struct: pub::RiskifiedCustomer
    - struct: pub::OrderAddress
    - struct: pub::LineItem
    - struct: pub::RiskifiedMetadata
    - struct: pub::RiskifiedPaymentsResponse
    - struct: pub::OrderResponse
    - struct: pub::RiskifiedFulfilmentResponse
    - struct: pub::OrderFulfilmentResponse
    - struct: pub::TransactionFailedRequest
    - struct: pub::FailedTransactionData
    - struct: pub::DeclinedPaymentDetails
    - struct: pub::AuthorizationError
    - struct: pub::RiskifiedFailedTransactionResponse
    - struct: pub::TransactionSuccessRequest
    - struct: pub::SuccessfulTransactionData
    - struct: pub::TransactionDecisionData
    - struct: pub::TransactionPaymentDetails
    - struct: pub::RiskifiedFullfillmentRequest
    - struct: pub::OrderFullfillment
    - struct: pub::FulfilmentData
    - struct: pub::ErrorResponse
    - struct: pub::ErrorData
    - enum: pub::CustomerAccountType
    - enum: pub::Source
    - enum: pub::FulfilmentStatus
    - enum: pub::PaymentStatus
    - enum: pub::RiskifiedTransactionResponse
    - enum: pub::TransactionStatus
    - enum: pub::FulfillmentRequestStatus
    - impl: impl TryFrom<&frm_types::FrmCheckoutRouterData> for RiskifiedPaymentsCheckoutRequest
    - impl: impl TryFrom<ResponseRouterData<F, RiskifiedPaymentsResponse, T, frm_types::FraudCheckResponseData>> for types::RouterData<F, T, frm_types::FraudCheckResponseData>
    - impl: impl From<PaymentStatus> for storage_enums::FraudCheckStatus
    - impl: impl TryFrom<&frm_types::FrmTransactionRouterData> for TransactionFailedRequest
    - impl: impl TryFrom<
        ResponseRouterData<
            F,
            RiskifiedFailedTransactionResponse,
            T,
            frm_types::FraudCheckResponseData,
        >,
    > for types::RouterData<F, T, frm_types::FraudCheckResponseData>
    - impl: impl TryFrom<&frm_types::FrmTransactionRouterData> for TransactionSuccessRequest
    - impl: impl TryFrom<&frm_types::FrmFulfillmentRouterData> for RiskifiedFullfillmentRequest
    - impl: impl TryFrom<
        ResponseRouterData<
            Fulfillment,
            RiskifiedFulfilmentResponse,
            frm_types::FraudCheckFulfillmentData,
            frm_types::FraudCheckResponseData,
        >,
    > for types::RouterData<
        Fulfillment,
        frm_types::FraudCheckFulfillmentData,
        frm_types::FraudCheckResponseData,
    >
    - impl: impl TryFrom<&api_models::payments::Address> for OrderAddress

**crates/router/src/connector/riskified/transformers/auth.rs**
  Add:
    - function: private::try_from
    - struct: pub::RiskifiedAuthType
    - impl: impl TryFrom<&types::ConnectorAuthType> for RiskifiedAuthType

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

**crates/router/src/connector/signifyd/transformers/api.rs**
  Modify existing code

**crates/router/src/connector/utils.rs**
  Add:
    - function: private::get_billing_address_with_phone_number
    - function: private::get_shipping_address_with_phone_number
    - function: private::get_browser_info
    - function: private::get_browser_info
    - function: private::is_payment_successful
    - trait: pub::AccessPaymentAttemptInfo
    - trait: pub::PaymentsAttemptData
    - trait: pub::FrmTransactionRouterDataRequest
    - impl: impl AccessPaymentAttemptInfo for PaymentAttempt
    - impl: impl PaymentsAttemptData for PaymentAttempt
    - impl: impl FrmTransactionRouterDataRequest for fraud_check::FrmTransactionRouterData

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

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

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

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

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

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

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

**crates/router/src/core/fraud_check/operation/fraud_check_post.rs**
  Modify existing code

**crates/router/src/core/fraud_check/operation/fraud_check_pre.rs**
  Modify existing code

**crates/router/src/core/fraud_check/types.rs**
  Modify existing code

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

**crates/router/src/core/webhooks/utils.rs**
  Modify existing code

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

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

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

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

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

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

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

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

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

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

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