mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix(core): make parsing optional for connector_wallet_details in session token flow (#7365)
This commit is contained in:
@ -930,7 +930,7 @@ fn create_gpay_session_token(
|
||||
) -> RouterResult<types::PaymentsSessionRouterData> {
|
||||
// connector_wallet_details is being parse into admin types to check specifically if google_pay field is present
|
||||
// this is being done because apple_pay details from metadata is also being filled into connector_wallets_details
|
||||
let connector_wallets_details = router_data
|
||||
let google_pay_wallets_details = router_data
|
||||
.connector_wallets_details
|
||||
.clone()
|
||||
.parse_value::<admin_types::ConnectorWalletDetails>("ConnectorWalletDetails")
|
||||
@ -939,10 +939,14 @@ fn create_gpay_session_token(
|
||||
"cannot parse connector_wallets_details from the given value {:?}",
|
||||
router_data.connector_wallets_details
|
||||
))
|
||||
.change_context(errors::ApiErrorResponse::InvalidDataFormat {
|
||||
field_name: "connector_wallets_details".to_string(),
|
||||
expected_format: "admin_types_connector_wallets_details_format".to_string(),
|
||||
})?;
|
||||
.map_err(|err| {
|
||||
logger::debug!(
|
||||
"Failed to parse connector_wallets_details for google_pay flow: {:?}",
|
||||
err
|
||||
);
|
||||
})
|
||||
.ok()
|
||||
.and_then(|connector_wallets_details| connector_wallets_details.google_pay);
|
||||
let connector_metadata = router_data.connector_meta_data.clone();
|
||||
let delayed_response = is_session_response_delayed(state, connector);
|
||||
|
||||
@ -996,7 +1000,7 @@ fn create_gpay_session_token(
|
||||
enums::PaymentMethodType::GooglePay,
|
||||
);
|
||||
|
||||
if connector_wallets_details.google_pay.is_some() {
|
||||
if google_pay_wallets_details.is_some() {
|
||||
let gpay_data = router_data
|
||||
.connector_wallets_details
|
||||
.clone()
|
||||
|
||||
Reference in New Issue
Block a user