mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	fix(connector): [BOA/CYB] Pass ucaf for apple pay mastercard users (#3899)
This commit is contained in:
		| @ -604,7 +604,7 @@ impl | |||||||
|         let processing_information = ProcessingInformation::from(( |         let processing_information = ProcessingInformation::from(( | ||||||
|             item, |             item, | ||||||
|             Some(PaymentSolution::ApplePay), |             Some(PaymentSolution::ApplePay), | ||||||
|             Some(apple_pay_wallet_data.payment_method.network), |             Some(apple_pay_wallet_data.payment_method.network.clone()), | ||||||
|         )); |         )); | ||||||
|         let client_reference_information = ClientReferenceInformation::from(item); |         let client_reference_information = ClientReferenceInformation::from(item); | ||||||
|         let expiration_month = apple_pay_data.get_expiry_month()?; |         let expiration_month = apple_pay_data.get_expiry_month()?; | ||||||
| @ -622,14 +622,29 @@ impl | |||||||
|             item.router_data.request.metadata.clone().map(|metadata| { |             item.router_data.request.metadata.clone().map(|metadata| { | ||||||
|                 Vec::<MerchantDefinedInformation>::foreign_from(metadata.peek().to_owned()) |                 Vec::<MerchantDefinedInformation>::foreign_from(metadata.peek().to_owned()) | ||||||
|             }); |             }); | ||||||
|  |         let ucaf_collection_indicator = match apple_pay_wallet_data | ||||||
|  |             .payment_method | ||||||
|  |             .network | ||||||
|  |             .to_lowercase() | ||||||
|  |             .as_str() | ||||||
|  |         { | ||||||
|  |             "mastercard" => Some("2".to_string()), | ||||||
|  |             _ => None, | ||||||
|  |         }; | ||||||
|         Ok(Self { |         Ok(Self { | ||||||
|             processing_information, |             processing_information, | ||||||
|             payment_information, |             payment_information, | ||||||
|             order_information, |             order_information, | ||||||
|             client_reference_information, |             client_reference_information, | ||||||
|             merchant_defined_information, |             merchant_defined_information, | ||||||
|             consumer_authentication_information: None, |             consumer_authentication_information: Some(BankOfAmericaConsumerAuthInformation { | ||||||
|  |                 ucaf_collection_indicator, | ||||||
|  |                 cavv: None, | ||||||
|  |                 ucaf_authentication_data: None, | ||||||
|  |                 xid: None, | ||||||
|  |                 directory_server_transaction_id: None, | ||||||
|  |                 specification_version: None, | ||||||
|  |             }), | ||||||
|         }) |         }) | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -703,7 +718,7 @@ impl TryFrom<&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>> | |||||||
|                             let processing_information = ProcessingInformation::from(( |                             let processing_information = ProcessingInformation::from(( | ||||||
|                                 item, |                                 item, | ||||||
|                                 Some(PaymentSolution::ApplePay), |                                 Some(PaymentSolution::ApplePay), | ||||||
|                                 Some(apple_pay_data.payment_method.network), |                                 Some(apple_pay_data.payment_method.network.clone()), | ||||||
|                             )); |                             )); | ||||||
|                             let client_reference_information = |                             let client_reference_information = | ||||||
|                                 ClientReferenceInformation::from(item); |                                 ClientReferenceInformation::from(item); | ||||||
| @ -723,13 +738,31 @@ impl TryFrom<&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>> | |||||||
|                                         metadata.peek().to_owned(), |                                         metadata.peek().to_owned(), | ||||||
|                                     ) |                                     ) | ||||||
|                                 }); |                                 }); | ||||||
|  |                             let ucaf_collection_indicator = match apple_pay_data | ||||||
|  |                                 .payment_method | ||||||
|  |                                 .network | ||||||
|  |                                 .to_lowercase() | ||||||
|  |                                 .as_str() | ||||||
|  |                             { | ||||||
|  |                                 "mastercard" => Some("2".to_string()), | ||||||
|  |                                 _ => None, | ||||||
|  |                             }; | ||||||
|                             Ok(Self { |                             Ok(Self { | ||||||
|                                 processing_information, |                                 processing_information, | ||||||
|                                 payment_information, |                                 payment_information, | ||||||
|                                 order_information, |                                 order_information, | ||||||
|                                 merchant_defined_information, |                                 merchant_defined_information, | ||||||
|                                 client_reference_information, |                                 client_reference_information, | ||||||
|                                 consumer_authentication_information: None, |                                 consumer_authentication_information: Some( | ||||||
|  |                                     BankOfAmericaConsumerAuthInformation { | ||||||
|  |                                         ucaf_collection_indicator, | ||||||
|  |                                         cavv: None, | ||||||
|  |                                         ucaf_authentication_data: None, | ||||||
|  |                                         xid: None, | ||||||
|  |                                         directory_server_transaction_id: None, | ||||||
|  |                                         specification_version: None, | ||||||
|  |                                     }, | ||||||
|  |                                 ), | ||||||
|                             }) |                             }) | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|  | |||||||
| @ -850,7 +850,7 @@ impl | |||||||
|         let processing_information = ProcessingInformation::try_from(( |         let processing_information = ProcessingInformation::try_from(( | ||||||
|             item, |             item, | ||||||
|             Some(PaymentSolution::ApplePay), |             Some(PaymentSolution::ApplePay), | ||||||
|             Some(apple_pay_wallet_data.payment_method.network), |             Some(apple_pay_wallet_data.payment_method.network.clone()), | ||||||
|         ))?; |         ))?; | ||||||
|         let client_reference_information = ClientReferenceInformation::from(item); |         let client_reference_information = ClientReferenceInformation::from(item); | ||||||
|         let expiration_month = apple_pay_data.get_expiry_month()?; |         let expiration_month = apple_pay_data.get_expiry_month()?; | ||||||
| @ -868,13 +868,28 @@ impl | |||||||
|             item.router_data.request.metadata.clone().map(|metadata| { |             item.router_data.request.metadata.clone().map(|metadata| { | ||||||
|                 Vec::<MerchantDefinedInformation>::foreign_from(metadata.peek().to_owned()) |                 Vec::<MerchantDefinedInformation>::foreign_from(metadata.peek().to_owned()) | ||||||
|             }); |             }); | ||||||
|  |         let ucaf_collection_indicator = match apple_pay_wallet_data | ||||||
|  |             .payment_method | ||||||
|  |             .network | ||||||
|  |             .to_lowercase() | ||||||
|  |             .as_str() | ||||||
|  |         { | ||||||
|  |             "mastercard" => Some("2".to_string()), | ||||||
|  |             _ => None, | ||||||
|  |         }; | ||||||
|         Ok(Self { |         Ok(Self { | ||||||
|             processing_information, |             processing_information, | ||||||
|             payment_information, |             payment_information, | ||||||
|             order_information, |             order_information, | ||||||
|             client_reference_information, |             client_reference_information, | ||||||
|             consumer_authentication_information: None, |             consumer_authentication_information: Some(CybersourceConsumerAuthInformation { | ||||||
|  |                 ucaf_collection_indicator, | ||||||
|  |                 cavv: None, | ||||||
|  |                 ucaf_authentication_data: None, | ||||||
|  |                 xid: None, | ||||||
|  |                 directory_server_transaction_id: None, | ||||||
|  |                 specification_version: None, | ||||||
|  |             }), | ||||||
|             merchant_defined_information, |             merchant_defined_information, | ||||||
|         }) |         }) | ||||||
|     } |     } | ||||||
| @ -956,7 +971,7 @@ impl TryFrom<&CybersourceRouterData<&types::PaymentsAuthorizeRouterData>> | |||||||
|                                         ProcessingInformation::try_from(( |                                         ProcessingInformation::try_from(( | ||||||
|                                             item, |                                             item, | ||||||
|                                             Some(PaymentSolution::ApplePay), |                                             Some(PaymentSolution::ApplePay), | ||||||
|                                             Some(apple_pay_data.payment_method.network), |                                             Some(apple_pay_data.payment_method.network.clone()), | ||||||
|                                         ))?; |                                         ))?; | ||||||
|                                     let client_reference_information = |                                     let client_reference_information = | ||||||
|                                         ClientReferenceInformation::from(item); |                                         ClientReferenceInformation::from(item); | ||||||
| @ -976,14 +991,31 @@ impl TryFrom<&CybersourceRouterData<&types::PaymentsAuthorizeRouterData>> | |||||||
|                                                 metadata.peek().to_owned(), |                                                 metadata.peek().to_owned(), | ||||||
|                                             ) |                                             ) | ||||||
|                                         }); |                                         }); | ||||||
|  |                                     let ucaf_collection_indicator = match apple_pay_data | ||||||
|  |                                         .payment_method | ||||||
|  |                                         .network | ||||||
|  |                                         .to_lowercase() | ||||||
|  |                                         .as_str() | ||||||
|  |                                     { | ||||||
|  |                                         "mastercard" => Some("2".to_string()), | ||||||
|  |                                         _ => None, | ||||||
|  |                                     }; | ||||||
|                                     Ok(Self { |                                     Ok(Self { | ||||||
|                                         processing_information, |                                         processing_information, | ||||||
|                                         payment_information, |                                         payment_information, | ||||||
|                                         order_information, |                                         order_information, | ||||||
|                                         client_reference_information, |                                         client_reference_information, | ||||||
|                                         merchant_defined_information, |                                         merchant_defined_information, | ||||||
|                                         consumer_authentication_information: None, |                                         consumer_authentication_information: Some( | ||||||
|  |                                             CybersourceConsumerAuthInformation { | ||||||
|  |                                                 ucaf_collection_indicator, | ||||||
|  |                                                 cavv: None, | ||||||
|  |                                                 ucaf_authentication_data: None, | ||||||
|  |                                                 xid: None, | ||||||
|  |                                                 directory_server_transaction_id: None, | ||||||
|  |                                                 specification_version: None, | ||||||
|  |                                             }, | ||||||
|  |                                         ), | ||||||
|                                     }) |                                     }) | ||||||
|                                 } |                                 } | ||||||
|                             } |                             } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 DEEPANSHU BANSAL
					DEEPANSHU BANSAL