Skip to content

Commit 16e0fd8

Browse files
hyperswitch-bot[bot]swetasharma03
authored andcommitted
chore(cypress): run formatter and address lints
1 parent 8713fb5 commit 16e0fd8

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,23 @@ impl TryFrom<&SetupMandateRouterData> for CreateCustomerPaymentProfileRequest {
490490
data_value: Secret::new(wallet_data.get_encoded_wallet_token()?),
491491
}),
492492
}),
493-
WalletData::ApplePay(applepay_token) => Ok(PaymentProfile {
494-
bill_to,
495-
payment: PaymentDetails::OpaqueData(WalletDetails {
496-
data_descriptor: WalletMethod::Applepay,
497-
data_value: Secret::new(applepay_token.payment_data.clone()),
498-
}),
499-
}),
493+
WalletData::ApplePay(applepay_token) => {
494+
let apple_pay_encrypted_data = applepay_token
495+
.payment_data
496+
.get_encrypted_apple_pay_payment_data_mandatory()
497+
.change_context(errors::ConnectorError::MissingRequiredField {
498+
field_name: "Apple pay encrypted data",
499+
})?;
500+
501+
Ok(PaymentProfile {
502+
bill_to,
503+
payment: PaymentDetails::OpaqueData(WalletDetails {
504+
data_descriptor: WalletMethod::Applepay,
505+
data_value: Secret::new(apple_pay_encrypted_data),
506+
}),
507+
})
508+
}
509+
500510
WalletData::AliPayQr(_)
501511
| WalletData::AliPayRedirect(_)
502512
| WalletData::AliPayHkRedirect(_)
@@ -598,7 +608,7 @@ impl<F, T> TryFrom<ResponseRouterData<F, AuthorizedotnetCustomerResponse, T, Pay
598608
match item.response.messages.result_code {
599609
ResultCode::Ok => Ok(Self {
600610
response: Ok(PaymentsResponseData::ConnectorCustomerResponse {
601-
connector_customer_id: connector_customer_id,
611+
connector_customer_id,
602612
}),
603613
..item.data
604614
}),

cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import {
33
multiUseMandateData,
44
singleUseMandateData,
55
} from "./Commons";
6-
import {
7-
generateRandomEmail,
8-
} from "../../../utils/RequestBodyUtils";
6+
import { generateRandomEmail } from "../../../utils/RequestBodyUtils";
97

108
const successfulNo3DSCardDetails = {
119
card_number: "4111111111111111",

0 commit comments

Comments
 (0)