@@ -49,10 +49,17 @@ where
49
49
let debit_routing_config = state. conf . debit_routing_config . clone ( ) ;
50
50
let debit_routing_supported_connectors = debit_routing_config. supported_connectors . clone ( ) ;
51
51
52
- if let Some ( ( call_connector_type, acquirer_country) ) = connector
53
- . clone ( )
54
- . zip ( business_profile. merchant_business_country )
55
- {
52
+ // If the business profile does not have a country set, we cannot perform debit routing,
53
+ // because the merchant_business_country will be treated as the acquirer_country,
54
+ // which is used to determine whether a transaction is local or global in the open router.
55
+ // For now, since debit routing is only implemented for USD, we can safely assume the
56
+ // acquirer_country is US if not provided by the merchant.
57
+
58
+ let acquirer_country = business_profile
59
+ . merchant_business_country
60
+ . unwrap_or_default ( ) ;
61
+
62
+ if let Some ( call_connector_type) = connector. clone ( ) {
56
63
debit_routing_output = match call_connector_type {
57
64
ConnectorCallType :: PreDetermined ( connector_data) => {
58
65
logger:: info!( "Performing debit routing for PreDetermined connector" ) ;
@@ -117,7 +124,6 @@ where
117
124
{
118
125
if business_profile. is_debit_routing_enabled
119
126
&& state. conf . open_router . enabled
120
- && business_profile. merchant_business_country . is_some ( )
121
127
{
122
128
logger:: info!( "Debit routing is enabled for the profile" ) ;
123
129
0 commit comments