From 3d4fd2f719b38dcbb675de83c0ba384d1573df00 Mon Sep 17 00:00:00 2001 From: Sai Harsha Vardhan <56996463+sai-harsha-vardhan@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:24:50 +0530 Subject: [PATCH] fix(router): change click_to_pay const to snake_case and remove camel_case serde rename for clicktopay metadata (#6852) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> --- api-reference-v2/openapi_spec.json | 36 +++++++++---------- api-reference/openapi_spec.json | 36 +++++++++---------- crates/api_models/src/payments.rs | 1 - .../hyperswitch_domain_models/src/payments.rs | 1 - crates/router/src/consts.rs | 2 +- 5 files changed, 37 insertions(+), 39 deletions(-) diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index 4725e0552f..252174d11f 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -6235,50 +6235,50 @@ "ClickToPaySessionResponse": { "type": "object", "required": [ - "dpaId", - "dpaName", + "dpa_id", + "dpa_name", "locale", - "cardBrands", - "acquirerBin", - "acquirerMerchantId", - "merchantCategoryCode", - "merchantCountryCode", - "transactionAmount", - "transactionCurrencyCode" + "card_brands", + "acquirer_bin", + "acquirer_merchant_id", + "merchant_category_code", + "merchant_country_code", + "transaction_amount", + "transaction_currency_code" ], "properties": { - "dpaId": { + "dpa_id": { "type": "string" }, - "dpaName": { + "dpa_name": { "type": "string" }, "locale": { "type": "string" }, - "cardBrands": { + "card_brands": { "type": "array", "items": { "type": "string" } }, - "acquirerBin": { + "acquirer_bin": { "type": "string" }, - "acquirerMerchantId": { + "acquirer_merchant_id": { "type": "string" }, - "merchantCategoryCode": { + "merchant_category_code": { "type": "string" }, - "merchantCountryCode": { + "merchant_country_code": { "type": "string" }, - "transactionAmount": { + "transaction_amount": { "type": "string", "example": "38.02" }, - "transactionCurrencyCode": { + "transaction_currency_code": { "$ref": "#/components/schemas/Currency" } } diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index 0c8736ce85..6b6147aa90 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -8679,50 +8679,50 @@ "ClickToPaySessionResponse": { "type": "object", "required": [ - "dpaId", - "dpaName", + "dpa_id", + "dpa_name", "locale", - "cardBrands", - "acquirerBin", - "acquirerMerchantId", - "merchantCategoryCode", - "merchantCountryCode", - "transactionAmount", - "transactionCurrencyCode" + "card_brands", + "acquirer_bin", + "acquirer_merchant_id", + "merchant_category_code", + "merchant_country_code", + "transaction_amount", + "transaction_currency_code" ], "properties": { - "dpaId": { + "dpa_id": { "type": "string" }, - "dpaName": { + "dpa_name": { "type": "string" }, "locale": { "type": "string" }, - "cardBrands": { + "card_brands": { "type": "array", "items": { "type": "string" } }, - "acquirerBin": { + "acquirer_bin": { "type": "string" }, - "acquirerMerchantId": { + "acquirer_merchant_id": { "type": "string" }, - "merchantCategoryCode": { + "merchant_category_code": { "type": "string" }, - "merchantCountryCode": { + "merchant_country_code": { "type": "string" }, - "transactionAmount": { + "transaction_amount": { "type": "string", "example": "38.02" }, - "transactionCurrencyCode": { + "transaction_currency_code": { "$ref": "#/components/schemas/Currency" } } diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 2464cdf62d..2f08ba830f 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -6984,7 +6984,6 @@ pub struct ExtendedCardInfoResponse { } #[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema)] -#[serde(rename_all = "camelCase")] pub struct ClickToPaySessionResponse { pub dpa_id: String, pub dpa_name: String, diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs index 075c94c2ea..9488a762a6 100644 --- a/crates/hyperswitch_domain_models/src/payments.rs +++ b/crates/hyperswitch_domain_models/src/payments.rs @@ -521,7 +521,6 @@ pub struct HeaderPayload { } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] -#[serde(rename_all = "camelCase")] pub struct ClickToPayMetaData { pub dpa_id: String, pub dpa_name: String, diff --git a/crates/router/src/consts.rs b/crates/router/src/consts.rs index 6d017d7ed0..823f0a4bf0 100644 --- a/crates/router/src/consts.rs +++ b/crates/router/src/consts.rs @@ -209,4 +209,4 @@ pub const VAULT_GET_FINGERPRINT_FLOW_TYPE: &str = "get_fingerprint_vault"; pub const DYNAMIC_ROUTING_MAX_VOLUME: u8 = 100; /// Click To Pay -pub const CLICK_TO_PAY: &str = "CLICK_TO_PAY"; +pub const CLICK_TO_PAY: &str = "click_to_pay";