diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs index 3beeb9071a29..bf4eeb79fef1 100644 --- a/crates/api_models/src/admin.rs +++ b/crates/api_models/src/admin.rs @@ -913,6 +913,9 @@ pub struct BusinessProfileCreate { /// External 3DS authentication details pub authentication_connector_details: Option, + + /// Whether to use the billing details passed when creating the intent as payment method billing + pub use_billing_as_payment_method_billing: Option, } #[derive(Clone, Debug, ToSchema, Serialize)] @@ -982,6 +985,9 @@ pub struct BusinessProfileResponse { /// External 3DS authentication details pub authentication_connector_details: Option, + + // Whether to use the billing details passed when creating the intent as payment method billing + pub use_billing_as_payment_method_billing: Option, } #[derive(Clone, Debug, Deserialize, ToSchema, Serialize)] @@ -1046,6 +1052,9 @@ pub struct BusinessProfileUpdate { /// Merchant's config to support extended card info feature pub extended_card_info_config: Option, + + // Whether to use the billing details passed when creating the intent as payment method billing + pub use_billing_as_payment_method_billing: Option, } #[derive(Clone, Debug, serde::Deserialize, serde::Serialize, PartialEq, ToSchema)] diff --git a/crates/diesel_models/src/business_profile.rs b/crates/diesel_models/src/business_profile.rs index 1131e9ad674a..41a938d83edc 100644 --- a/crates/diesel_models/src/business_profile.rs +++ b/crates/diesel_models/src/business_profile.rs @@ -38,6 +38,7 @@ pub struct BusinessProfile { pub is_extended_card_info_enabled: Option, pub extended_card_info_config: Option, pub is_connector_agnostic_mit_enabled: Option, + pub use_billing_as_payment_method_billing: Option, } #[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)] @@ -67,6 +68,7 @@ pub struct BusinessProfileNew { pub is_extended_card_info_enabled: Option, pub extended_card_info_config: Option, pub is_connector_agnostic_mit_enabled: Option, + pub use_billing_as_payment_method_billing: Option, } #[derive(Clone, Debug, Default, AsChangeset, router_derive::DebugAsDisplay)] @@ -93,6 +95,7 @@ pub struct BusinessProfileUpdateInternal { pub is_extended_card_info_enabled: Option, pub extended_card_info_config: Option, pub is_connector_agnostic_mit_enabled: Option, + pub use_billing_as_payment_method_billing: Option, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] @@ -116,6 +119,7 @@ pub enum BusinessProfileUpdate { session_expiry: Option, authentication_connector_details: Option, extended_card_info_config: Option, + use_billing_as_payment_method_billing: Option, }, ExtendedCardInfoUpdate { is_extended_card_info_enabled: Option, @@ -147,6 +151,7 @@ impl From for BusinessProfileUpdateInternal { session_expiry, authentication_connector_details, extended_card_info_config, + use_billing_as_payment_method_billing, } => Self { profile_name, modified_at, @@ -166,6 +171,7 @@ impl From for BusinessProfileUpdateInternal { session_expiry, authentication_connector_details, extended_card_info_config, + use_billing_as_payment_method_billing, ..Default::default() }, BusinessProfileUpdate::ExtendedCardInfoUpdate { @@ -210,6 +216,7 @@ impl From for BusinessProfile { is_connector_agnostic_mit_enabled: new.is_connector_agnostic_mit_enabled, is_extended_card_info_enabled: new.is_extended_card_info_enabled, extended_card_info_config: new.extended_card_info_config, + use_billing_as_payment_method_billing: new.use_billing_as_payment_method_billing, } } } @@ -237,6 +244,7 @@ impl BusinessProfileUpdate { is_extended_card_info_enabled, extended_card_info_config, is_connector_agnostic_mit_enabled, + use_billing_as_payment_method_billing, } = self.into(); BusinessProfile { profile_name: profile_name.unwrap_or(source.profile_name), @@ -261,6 +269,7 @@ impl BusinessProfileUpdate { is_extended_card_info_enabled, is_connector_agnostic_mit_enabled, extended_card_info_config, + use_billing_as_payment_method_billing, ..source } } diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs index 810d82d321fd..70a227a310a9 100644 --- a/crates/diesel_models/src/schema.rs +++ b/crates/diesel_models/src/schema.rs @@ -195,6 +195,7 @@ diesel::table! { is_extended_card_info_enabled -> Nullable, extended_card_info_config -> Nullable, is_connector_agnostic_mit_enabled -> Nullable, + use_billing_as_payment_method_billing -> Nullable, } } diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs index e0cfe0dee894..6433a3819f69 100644 --- a/crates/router/src/core/admin.rs +++ b/crates/router/src/core/admin.rs @@ -440,6 +440,7 @@ pub async fn update_business_profile_cascade( session_expiry: None, authentication_connector_details: None, extended_card_info_config: None, + use_billing_as_payment_method_billing: None, }; let update_futures = business_profiles.iter().map(|business_profile| async { @@ -1691,6 +1692,7 @@ pub async fn update_business_profile( field_name: "authentication_connector_details", })?, extended_card_info_config, + use_billing_as_payment_method_billing: request.use_billing_as_payment_method_billing, }; let updated_business_profile = db diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs index 9ae327269cf8..efde37b92a81 100644 --- a/crates/router/src/core/payment_methods/cards.rs +++ b/crates/router/src/core/payment_methods/cards.rs @@ -2135,10 +2135,19 @@ pub async fn list_payment_methods( .to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?; } + // Check for `use_billing_as_payment_method_billing` config under business_profile + // If this is disabled, then the billing details in required fields will be empty and have to be collected by the customer + let billing_address_for_calculating_required_fields = business_profile + .as_ref() + .and_then(|business_profile| business_profile.use_billing_as_payment_method_billing) + .unwrap_or(true) + .then_some(billing_address.as_ref()) + .flatten(); + let req = api_models::payments::PaymentsRequest::foreign_from(( payment_attempt.as_ref(), shipping_address.as_ref(), - billing_address.as_ref(), + billing_address_for_calculating_required_fields, customer.as_ref(), )); let req_val = serde_json::to_value(req).ok(); diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index 0e10c2a54176..578b8d803021 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -2426,23 +2426,28 @@ pub mod payment_address { shipping: Option, billing: Option, payment_method_billing: Option, + should_unify_address: Option, ) -> Self { // billing -> .billing, this is the billing details passed in the root of payments request - // payment_method_billing -> .payment_method_data.billing - - // Merge the billing details field from both `payment.billing` and `payment.payment_method_data.billing` - // The unified payment_method_billing will be used as billing address and passed to the connector module - // This unification is required in order to provide backwards compatibility - // so that if `payment.billing` is passed it should be sent to the connector module - // Unify the billing details with `payment_method_data.billing` - let unified_payment_method_billing = payment_method_billing - .as_ref() - .map(|payment_method_billing| { - payment_method_billing - .clone() - .unify_address(billing.as_ref()) - }) - .or(billing.clone()); + // payment_method_billing -> payment_method_data.billing + + let unified_payment_method_billing = if should_unify_address.unwrap_or(true) { + // Merge the billing details field from both `payment.billing` and `payment.payment_method_data.billing` + // The unified payment_method_billing will be used as billing address and passed to the connector module + // This unification is required in order to provide backwards compatibility + // so that if `payment.billing` is passed it should be sent to the connector module + // Unify the billing details with `payment_method_data.billing` + payment_method_billing + .as_ref() + .map(|payment_method_billing| { + payment_method_billing + .clone() + .unify_address(billing.as_ref()) + }) + .or(billing.clone()) + } else { + payment_method_billing.clone() + }; Self { shipping, diff --git a/crates/router/src/core/payments/operations/payment_approve.rs b/crates/router/src/core/payments/operations/payment_approve.rs index 8dffd8eaec38..bc60d8a35815 100644 --- a/crates/router/src/core/payments/operations/payment_approve.rs +++ b/crates/router/src/core/payments/operations/payment_approve.rs @@ -150,6 +150,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), confirm: None, payment_method_data: None, diff --git a/crates/router/src/core/payments/operations/payment_cancel.rs b/crates/router/src/core/payments/operations/payment_cancel.rs index 32035391fb74..2d05fa215207 100644 --- a/crates/router/src/core/payments/operations/payment_cancel.rs +++ b/crates/router/src/core/payments/operations/payment_cancel.rs @@ -165,6 +165,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), confirm: None, payment_method_data: None, diff --git a/crates/router/src/core/payments/operations/payment_capture.rs b/crates/router/src/core/payments/operations/payment_capture.rs index d4c3f0acad7a..71549a17c2a8 100644 --- a/crates/router/src/core/payments/operations/payment_capture.rs +++ b/crates/router/src/core/payments/operations/payment_capture.rs @@ -207,6 +207,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), confirm: None, payment_method_data: None, diff --git a/crates/router/src/core/payments/operations/payment_complete_authorize.rs b/crates/router/src/core/payments/operations/payment_complete_authorize.rs index d31ec14a7231..f1cb0fa92ef4 100644 --- a/crates/router/src/core/payments/operations/payment_complete_authorize.rs +++ b/crates/router/src/core/payments/operations/payment_complete_authorize.rs @@ -279,6 +279,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), confirm: request.confirm, payment_method_data: request diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs index 3d4f2a3cad82..ee4f499d4265 100644 --- a/crates/router/src/core/payments/operations/payment_confirm.rs +++ b/crates/router/src/core/payments/operations/payment_confirm.rs @@ -609,6 +609,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), token_data, confirm: request.confirm, diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs index 0d241202208e..e90617f5382f 100644 --- a/crates/router/src/core/payments/operations/payment_create.rs +++ b/crates/router/src/core/payments/operations/payment_create.rs @@ -424,6 +424,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing_address.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), token_data: None, confirm: request.confirm, diff --git a/crates/router/src/core/payments/operations/payment_reject.rs b/crates/router/src/core/payments/operations/payment_reject.rs index 8845fe836e27..8ba627dc560d 100644 --- a/crates/router/src/core/payments/operations/payment_reject.rs +++ b/crates/router/src/core/payments/operations/payment_reject.rs @@ -148,6 +148,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), token_data: None, confirm: None, diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rs index 808eb20eb125..485e25c2c9c5 100644 --- a/crates/router/src/core/payments/operations/payment_session.rs +++ b/crates/router/src/core/payments/operations/payment_session.rs @@ -174,6 +174,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), confirm: None, payment_method_data: None, diff --git a/crates/router/src/core/payments/operations/payment_start.rs b/crates/router/src/core/payments/operations/payment_start.rs index c7042908b631..01ab85863540 100644 --- a/crates/router/src/core/payments/operations/payment_start.rs +++ b/crates/router/src/core/payments/operations/payment_start.rs @@ -159,6 +159,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), token_data, confirm: Some(payment_attempt.confirm), diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs index 06ad57346f55..85e7fa2bf515 100644 --- a/crates/router/src/core/payments/operations/payment_status.rs +++ b/crates/router/src/core/payments/operations/payment_status.rs @@ -459,6 +459,7 @@ async fn get_tracker_for_sync< shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), token_data: None, confirm: Some(request.force_sync), diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs index de83b935ff0c..c7479672c754 100644 --- a/crates/router/src/core/payments/operations/payment_update.rs +++ b/crates/router/src/core/payments/operations/payment_update.rs @@ -425,6 +425,7 @@ impl shipping_address.as_ref().map(From::from), billing_address.as_ref().map(From::from), payment_method_billing.as_ref().map(From::from), + business_profile.use_billing_as_payment_method_billing, ), confirm: request.confirm, payment_method_data: request diff --git a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs index ddba82fc04d1..c28e6b35d507 100644 --- a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs +++ b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs @@ -125,7 +125,7 @@ impl customer_acceptance: None, token: None, token_data: None, - address: PaymentAddress::new(None, None, None), + address: PaymentAddress::new(None, None, None, None), confirm: None, payment_method_data: None, payment_method_info: None, diff --git a/crates/router/src/core/routing/helpers.rs b/crates/router/src/core/routing/helpers.rs index 3702498767a8..3449838164bd 100644 --- a/crates/router/src/core/routing/helpers.rs +++ b/crates/router/src/core/routing/helpers.rs @@ -264,7 +264,9 @@ pub async fn update_business_profile_active_algorithm_ref( session_expiry: None, authentication_connector_details: None, extended_card_info_config: None, + use_billing_as_payment_method_billing: None, }; + db.update_business_profile_by_profile_id(current_business_profile, business_profile_update) .await .change_context(errors::ApiErrorResponse::InternalServerError) diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs index ac546ef5e494..ae6dc0e86f94 100644 --- a/crates/router/src/core/utils.rs +++ b/crates/router/src/core/utils.rs @@ -117,7 +117,7 @@ pub async fn construct_payout_router_data<'a, F>( } }); - let address = PaymentAddress::new(None, billing_address, None); + let address = PaymentAddress::new(None, billing_address, None, None); let test_mode: Option = merchant_connector_account.is_test_mode_on(); let payouts = &payout_data.payouts; diff --git a/crates/router/src/types/api/admin.rs b/crates/router/src/types/api/admin.rs index 793d042ea497..262999af9494 100644 --- a/crates/router/src/types/api/admin.rs +++ b/crates/router/src/types/api/admin.rs @@ -79,6 +79,7 @@ impl ForeignTryFrom for BusinessProf authentication_connector_details.parse_value("AuthenticationDetails") }) .transpose()?, + use_billing_as_payment_method_billing: item.use_billing_as_payment_method_billing, }) } } @@ -178,6 +179,9 @@ impl ForeignTryFrom<(domain::MerchantAccount, BusinessProfileCreate)> is_connector_agnostic_mit_enabled: None, is_extended_card_info_enabled: None, extended_card_info_config: None, + use_billing_as_payment_method_billing: request + .use_billing_as_payment_method_billing + .or(Some(true)), }) } } diff --git a/crates/router/src/types/api/verify_connector.rs b/crates/router/src/types/api/verify_connector.rs index af7cb9160b26..d35abd233f1b 100644 --- a/crates/router/src/types/api/verify_connector.rs +++ b/crates/router/src/types/api/verify_connector.rs @@ -89,7 +89,7 @@ impl VerifyConnectorData { recurring_mandate_payment_data: None, payment_method_status: None, connector_request_reference_id: attempt_id, - address: types::PaymentAddress::new(None, None, None), + address: types::PaymentAddress::new(None, None, None, None), payment_id: common_utils::generate_id_with_default_len( consts::VERIFY_CONNECTOR_ID_PREFIX, ), diff --git a/crates/router/tests/connectors/aci.rs b/crates/router/tests/connectors/aci.rs index 2e5e8748f48e..3548bc5e5bdb 100644 --- a/crates/router/tests/connectors/aci.rs +++ b/crates/router/tests/connectors/aci.rs @@ -92,6 +92,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { }), email: None, }), + None, ), connector_meta_data: None, amount_captured: None, diff --git a/crates/router/tests/connectors/adyen.rs b/crates/router/tests/connectors/adyen.rs index d19fff29003a..4d4318064e22 100644 --- a/crates/router/tests/connectors/adyen.rs +++ b/crates/router/tests/connectors/adyen.rs @@ -72,6 +72,7 @@ impl AdyenTest { email: None, }), None, + None, )), ..Default::default() }) @@ -100,6 +101,7 @@ impl AdyenTest { email: None, }), None, + None, )), payout_method_data: match payout_type { enums::PayoutType::Card => Some(types::api::PayoutMethodData::Card( diff --git a/crates/router/tests/connectors/airwallex.rs b/crates/router/tests/connectors/airwallex.rs index 2ef61099ca77..d976aca7ce7d 100644 --- a/crates/router/tests/connectors/airwallex.rs +++ b/crates/router/tests/connectors/airwallex.rs @@ -64,6 +64,7 @@ fn get_default_payment_info() -> Option { phone: None, email: None, }), + None, )), ..Default::default() }) diff --git a/crates/router/tests/connectors/bitpay.rs b/crates/router/tests/connectors/bitpay.rs index 85b388f2fdbd..2dd90e704b9c 100644 --- a/crates/router/tests/connectors/bitpay.rs +++ b/crates/router/tests/connectors/bitpay.rs @@ -58,6 +58,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), ..Default::default() }) diff --git a/crates/router/tests/connectors/bluesnap.rs b/crates/router/tests/connectors/bluesnap.rs index 3a654eda8390..88b6fbec246a 100644 --- a/crates/router/tests/connectors/bluesnap.rs +++ b/crates/router/tests/connectors/bluesnap.rs @@ -58,6 +58,7 @@ fn get_payment_info() -> Option { email: None, }), None, + None, )), ..Default::default() }) diff --git a/crates/router/tests/connectors/cashtocode.rs b/crates/router/tests/connectors/cashtocode.rs index 025d9cdac64b..60620d1b4c41 100644 --- a/crates/router/tests/connectors/cashtocode.rs +++ b/crates/router/tests/connectors/cashtocode.rs @@ -88,6 +88,7 @@ impl CashtocodeTest { email: None, }), None, + None, )), return_url: Some("https://google.com".to_owned()), ..Default::default() diff --git a/crates/router/tests/connectors/coinbase.rs b/crates/router/tests/connectors/coinbase.rs index 0bcb3c705ab2..5dd42a2c97c0 100644 --- a/crates/router/tests/connectors/coinbase.rs +++ b/crates/router/tests/connectors/coinbase.rs @@ -59,6 +59,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), connector_meta_data: Some(json!({"pricing_type": "fixed_price"})), ..Default::default() diff --git a/crates/router/tests/connectors/cryptopay.rs b/crates/router/tests/connectors/cryptopay.rs index 626c05fe1146..c26bad8c5671 100644 --- a/crates/router/tests/connectors/cryptopay.rs +++ b/crates/router/tests/connectors/cryptopay.rs @@ -58,6 +58,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), return_url: Some(String::from("https://google.com")), ..Default::default() diff --git a/crates/router/tests/connectors/cybersource.rs b/crates/router/tests/connectors/cybersource.rs index 700e9a2d9461..bb74e805c3b9 100644 --- a/crates/router/tests/connectors/cybersource.rs +++ b/crates/router/tests/connectors/cybersource.rs @@ -55,6 +55,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), ..Default::default() }) diff --git a/crates/router/tests/connectors/dlocal.rs b/crates/router/tests/connectors/dlocal.rs index b715e20fec4b..2f04904d7b89 100644 --- a/crates/router/tests/connectors/dlocal.rs +++ b/crates/router/tests/connectors/dlocal.rs @@ -438,6 +438,7 @@ pub fn get_payment_info() -> PaymentInfo { email: None, }), None, + None, )), auth_type: None, access_token: None, diff --git a/crates/router/tests/connectors/forte.rs b/crates/router/tests/connectors/forte.rs index 1c99c2ff7b51..d690524bd12b 100644 --- a/crates/router/tests/connectors/forte.rs +++ b/crates/router/tests/connectors/forte.rs @@ -71,6 +71,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), ..Default::default() }) diff --git a/crates/router/tests/connectors/globalpay.rs b/crates/router/tests/connectors/globalpay.rs index 8ca4d6f1ae3f..9472b600a51a 100644 --- a/crates/router/tests/connectors/globalpay.rs +++ b/crates/router/tests/connectors/globalpay.rs @@ -68,6 +68,7 @@ impl Globalpay { ..Default::default() }), None, + None, )), access_token: get_access_token(), connector_meta_data: CONNECTOR.get_connector_meta(), diff --git a/crates/router/tests/connectors/iatapay.rs b/crates/router/tests/connectors/iatapay.rs index dfb8e097be34..4d3904a0c219 100644 --- a/crates/router/tests/connectors/iatapay.rs +++ b/crates/router/tests/connectors/iatapay.rs @@ -75,6 +75,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), access_token: get_access_token(), return_url: Some(String::from("https://hyperswitch.io")), diff --git a/crates/router/tests/connectors/multisafepay.rs b/crates/router/tests/connectors/multisafepay.rs index 606b60b2490f..ba852ea2ebfe 100644 --- a/crates/router/tests/connectors/multisafepay.rs +++ b/crates/router/tests/connectors/multisafepay.rs @@ -56,6 +56,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )); Some(PaymentInfo { address, diff --git a/crates/router/tests/connectors/opennode.rs b/crates/router/tests/connectors/opennode.rs index c91126953deb..1e2cea554e90 100644 --- a/crates/router/tests/connectors/opennode.rs +++ b/crates/router/tests/connectors/opennode.rs @@ -58,6 +58,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), return_url: Some(String::from("https://google.com")), ..Default::default() diff --git a/crates/router/tests/connectors/payeezy.rs b/crates/router/tests/connectors/payeezy.rs index bfc0cb13650a..334b26f0009f 100644 --- a/crates/router/tests/connectors/payeezy.rs +++ b/crates/router/tests/connectors/payeezy.rs @@ -66,6 +66,7 @@ impl PayeezyTest { email: None, }), None, + None, )), ..Default::default() }) diff --git a/crates/router/tests/connectors/payme.rs b/crates/router/tests/connectors/payme.rs index 234f3a0eeb84..6554ddbefbfb 100644 --- a/crates/router/tests/connectors/payme.rs +++ b/crates/router/tests/connectors/payme.rs @@ -60,6 +60,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), auth_type: None, access_token: None, diff --git a/crates/router/tests/connectors/trustpay.rs b/crates/router/tests/connectors/trustpay.rs index fba612863b4f..b8aeefce49f4 100644 --- a/crates/router/tests/connectors/trustpay.rs +++ b/crates/router/tests/connectors/trustpay.rs @@ -84,6 +84,7 @@ fn get_default_payment_info() -> Option { email: None, }), None, + None, )), ..Default::default() }) diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs index 3196c4c763b8..c19fdb26ad63 100644 --- a/crates/router/tests/connectors/utils.rs +++ b/crates/router/tests/connectors/utils.rs @@ -69,6 +69,7 @@ impl PaymentInfo { phone: None, email: None, }), + None, )), ..Default::default() } diff --git a/crates/router/tests/connectors/wise.rs b/crates/router/tests/connectors/wise.rs index fd5bbc109d97..36a16635e0d3 100644 --- a/crates/router/tests/connectors/wise.rs +++ b/crates/router/tests/connectors/wise.rs @@ -68,6 +68,7 @@ impl WiseTest { email: None, }), None, + None, )), payout_method_data: Some(api::PayoutMethodData::Bank(api::payouts::BankPayout::Bacs( api::BacsBankTransfer { diff --git a/crates/router/tests/connectors/worldline.rs b/crates/router/tests/connectors/worldline.rs index 4f8119bfc52c..36d0bba6c468 100644 --- a/crates/router/tests/connectors/worldline.rs +++ b/crates/router/tests/connectors/worldline.rs @@ -56,6 +56,7 @@ impl WorldlineTest { email: None, }), None, + None, )), ..Default::default() }) @@ -179,7 +180,7 @@ async fn should_throw_missing_required_field_for_country() { .make_payment( authorize_data, Some(PaymentInfo { - address: Some(PaymentAddress::new(None, None, None)), + address: Some(PaymentAddress::new(None, None, None, None)), ..Default::default() }), ) diff --git a/migrations/2024-05-06-065226_add_billing_config_to_business_profile/down.sql b/migrations/2024-05-06-065226_add_billing_config_to_business_profile/down.sql new file mode 100644 index 000000000000..9fc70d18d456 --- /dev/null +++ b/migrations/2024-05-06-065226_add_billing_config_to_business_profile/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +ALTER TABLE business_profile DROP COLUMN IF EXISTS use_billing_as_payment_method_billing; diff --git a/migrations/2024-05-06-065226_add_billing_config_to_business_profile/up.sql b/migrations/2024-05-06-065226_add_billing_config_to_business_profile/up.sql new file mode 100644 index 000000000000..de841e4f5e0b --- /dev/null +++ b/migrations/2024-05-06-065226_add_billing_config_to_business_profile/up.sql @@ -0,0 +1,3 @@ +-- Your SQL goes here +ALTER TABLE business_profile +ADD COLUMN IF NOT EXISTS use_billing_as_payment_method_billing BOOLEAN DEFAULT TRUE; diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 201f6582ddae..c330816cea85 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -6668,6 +6668,11 @@ } ], "nullable": true + }, + "use_billing_as_payment_method_billing": { + "type": "boolean", + "description": "Whether to use the billing details passed when creating the intent as payment method billing", + "nullable": true } }, "additionalProperties": false @@ -6787,6 +6792,10 @@ } ], "nullable": true + }, + "use_billing_as_payment_method_billing": { + "type": "boolean", + "nullable": true } } },