mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	fix(connector): [Braintree] Consume merchant_account_id and merchant_config_currency in payment requests (#7408)
Co-authored-by: Debarshi Gupta <debarshi.gupta@Debarshi-Gupta-CM92YWDXFD.local>
This commit is contained in:
		| @ -338,6 +338,23 @@ pub async fn construct_refund_router_data<'a, F>( | ||||
|  | ||||
|     let connector_refund_id = refund.get_optional_connector_refund_id().cloned(); | ||||
|  | ||||
|     let braintree_metadata = payment_intent | ||||
|         .connector_metadata | ||||
|         .clone() | ||||
|         .map(|cm| { | ||||
|             cm.parse_value::<api_models::payments::ConnectorMetadata>("ConnectorMetadata") | ||||
|                 .change_context(errors::ApiErrorResponse::InternalServerError) | ||||
|                 .attach_printable("Failed parsing ConnectorMetadata") | ||||
|         }) | ||||
|         .transpose()? | ||||
|         .and_then(|cm| cm.braintree); | ||||
|  | ||||
|     let merchant_account_id = braintree_metadata | ||||
|         .as_ref() | ||||
|         .and_then(|braintree| braintree.merchant_account_id.clone()); | ||||
|     let merchant_config_currency = | ||||
|         braintree_metadata.and_then(|braintree| braintree.merchant_config_currency); | ||||
|  | ||||
|     let router_data = types::RouterData { | ||||
|         flow: PhantomData, | ||||
|         merchant_id: merchant_account.get_id().clone(), | ||||
| @ -376,6 +393,8 @@ pub async fn construct_refund_router_data<'a, F>( | ||||
|             split_refunds, | ||||
|             integrity_object: None, | ||||
|             refund_status: refund.refund_status, | ||||
|             merchant_account_id, | ||||
|             merchant_config_currency, | ||||
|         }, | ||||
|  | ||||
|         response: Ok(types::RefundsResponseData { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 DEEPANSHU BANSAL
					DEEPANSHU BANSAL