mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	fix(router): make x_merchant_domain as required value only for session call done on web (#6362)
				
					
				
			Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -19162,7 +19162,6 @@ | |||||||
|         "type": "object", |         "type": "object", | ||||||
|         "required": [ |         "required": [ | ||||||
|           "name", |           "name", | ||||||
|           "url", |  | ||||||
|           "country_code" |           "country_code" | ||||||
|         ], |         ], | ||||||
|         "properties": { |         "properties": { | ||||||
| @ -19172,7 +19171,8 @@ | |||||||
|           }, |           }, | ||||||
|           "url": { |           "url": { | ||||||
|             "type": "string", |             "type": "string", | ||||||
|             "description": "Merchant domain that process payments" |             "description": "Merchant domain that process payments, required for web payments", | ||||||
|  |             "nullable": true | ||||||
|           }, |           }, | ||||||
|           "country_code": { |           "country_code": { | ||||||
|             "$ref": "#/components/schemas/CountryAlpha2" |             "$ref": "#/components/schemas/CountryAlpha2" | ||||||
|  | |||||||
| @ -22960,7 +22960,6 @@ | |||||||
|         "type": "object", |         "type": "object", | ||||||
|         "required": [ |         "required": [ | ||||||
|           "name", |           "name", | ||||||
|           "url", |  | ||||||
|           "country_code" |           "country_code" | ||||||
|         ], |         ], | ||||||
|         "properties": { |         "properties": { | ||||||
| @ -22970,7 +22969,8 @@ | |||||||
|           }, |           }, | ||||||
|           "url": { |           "url": { | ||||||
|             "type": "string", |             "type": "string", | ||||||
|             "description": "Merchant domain that process payments" |             "description": "Merchant domain that process payments, required for web payments", | ||||||
|  |             "nullable": true | ||||||
|           }, |           }, | ||||||
|           "country_code": { |           "country_code": { | ||||||
|             "$ref": "#/components/schemas/CountryAlpha2" |             "$ref": "#/components/schemas/CountryAlpha2" | ||||||
|  | |||||||
| @ -5504,8 +5504,8 @@ pub enum SamsungPayProtocolType { | |||||||
| pub struct SamsungPayMerchantPaymentInformation { | pub struct SamsungPayMerchantPaymentInformation { | ||||||
|     /// Merchant name, this will be displayed on the Samsung Pay screen |     /// Merchant name, this will be displayed on the Samsung Pay screen | ||||||
|     pub name: String, |     pub name: String, | ||||||
|     /// Merchant domain that process payments |     /// Merchant domain that process payments, required for web payments | ||||||
|     pub url: String, |     pub url: Option<String>, | ||||||
|     /// Merchant country code |     /// Merchant country code | ||||||
|     #[schema(value_type = CountryAlpha2, example = "US")] |     #[schema(value_type = CountryAlpha2, example = "US")] | ||||||
|     pub country_code: api_enums::CountryAlpha2, |     pub country_code: api_enums::CountryAlpha2, | ||||||
|  | |||||||
| @ -550,10 +550,15 @@ fn create_samsung_pay_session_token( | |||||||
|             message: "Failed to convert amount to string major unit for Samsung Pay".to_string(), |             message: "Failed to convert amount to string major unit for Samsung Pay".to_string(), | ||||||
|         })?; |         })?; | ||||||
|  |  | ||||||
|     let merchant_domain = header_payload |     let merchant_domain = match header_payload.x_client_platform { | ||||||
|  |         Some(common_enums::ClientPlatform::Web) => Some( | ||||||
|  |             header_payload | ||||||
|                 .x_merchant_domain |                 .x_merchant_domain | ||||||
|                 .get_required_value("samsung pay domain") |                 .get_required_value("samsung pay domain") | ||||||
|         .attach_printable("Failed to get domain for samsung pay session call")?; |                 .attach_printable("Failed to get domain for samsung pay session call")?, | ||||||
|  |         ), | ||||||
|  |         _ => None, | ||||||
|  |     }; | ||||||
|  |  | ||||||
|     let samsung_pay_wallet_details = match samsung_pay_session_token_data.data { |     let samsung_pay_wallet_details = match samsung_pay_session_token_data.data { | ||||||
|         payment_types::SamsungPayCombinedMetadata::MerchantCredentials( |         payment_types::SamsungPayCombinedMetadata::MerchantCredentials( | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Shankar Singh C
					Shankar Singh C