From 465114796349c219336aa8016e72356013871c96 Mon Sep 17 00:00:00 2001 From: Swangi Kumari <85639103+swangi-kumari@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:46:21 +0530 Subject: [PATCH] refactor(core): make p24 billing_details optional (#5638) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> --- api-reference-v2/openapi_spec.json | 10 ++++++---- api-reference/openapi_spec.json | 10 ++++++---- crates/api_models/src/payments.rs | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index cf8200d67795..4727c205688d 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -1900,9 +1900,6 @@ "properties": { "przelewy24": { "type": "object", - "required": [ - "billing_details" - ], "properties": { "bank_name": { "allOf": [ @@ -1913,7 +1910,12 @@ "nullable": true }, "billing_details": { - "$ref": "#/components/schemas/BankRedirectBilling" + "allOf": [ + { + "$ref": "#/components/schemas/BankRedirectBilling" + } + ], + "nullable": true } } } diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index c479abc8d93c..a91f64daa8a6 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -6378,9 +6378,6 @@ "properties": { "przelewy24": { "type": "object", - "required": [ - "billing_details" - ], "properties": { "bank_name": { "allOf": [ @@ -6391,7 +6388,12 @@ "nullable": true }, "billing_details": { - "$ref": "#/components/schemas/BankRedirectBilling" + "allOf": [ + { + "$ref": "#/components/schemas/BankRedirectBilling" + } + ], + "nullable": true } } } diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 88c915f0e73d..10db6a3c9d13 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -2128,7 +2128,7 @@ pub enum BankRedirectData { bank_name: Option, // The billing details for bank redirect - billing_details: BankRedirectBilling, + billing_details: Option, }, Sofort { /// The billing details for bank redirection @@ -2263,7 +2263,7 @@ impl GetAddressFromPaymentMethodData for BankRedirectData { } Self::Przelewy24 { billing_details, .. - } => get_billing_address_inner(Some(billing_details), None, None), + } => get_billing_address_inner(billing_details.as_ref(), None, None), Self::Trustly { country } => get_billing_address_inner(None, Some(country), None), Self::OnlineBankingFpx { .. } | Self::LocalBankRedirect {}