feat(connector): [Bluesnap] Remove wallet call (#1620)

Co-authored-by: Sahkal Poddar <sahkal.poddar@juspay.in>
Co-authored-by: Pa1NarK <69745008+pixincreate@users.noreply.github.com>
This commit is contained in:
Sangamesh Kulkarni
2023-07-18 13:36:39 +05:30
committed by GitHub
parent f932d66c52
commit ec35d55da6
2 changed files with 2 additions and 26 deletions

View File

@ -499,6 +499,7 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme
}
}
// This session code is not used
impl api::PaymentSession for Bluesnap {}
impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData>

View File

@ -388,8 +388,7 @@ where
for (connector, payment_method_type, business_sub_label) in
connector_and_supporting_payment_method_type
{
let connector_type =
get_connector_type_for_session_token(payment_method_type, request, &connector);
let connector_type = api::GetToken::from(payment_method_type);
if let Ok(connector_data) =
api::ConnectorData::get_connector_by_name(connectors, &connector, connector_type)
.map_err(|err| {
@ -420,27 +419,3 @@ impl From<api_models::enums::PaymentMethodType> for api::GetToken {
}
}
}
pub fn get_connector_type_for_session_token(
payment_method_type: api_models::enums::PaymentMethodType,
request: &api::PaymentsSessionRequest,
connector: &str,
) -> api::GetToken {
if payment_method_type == api_models::enums::PaymentMethodType::ApplePay {
if is_apple_pay_get_token_connector(connector, request) {
api::GetToken::Connector
} else {
api::GetToken::ApplePayMetadata
}
} else {
api::GetToken::from(payment_method_type)
}
}
pub fn is_apple_pay_get_token_connector(
connector: &str,
_request: &api::PaymentsSessionRequest,
) -> bool {
// Add connectors here, which all are required to hit connector for session call
matches!(connector, "bluesnap")
}