Skip to content

Commit 7ca7109

Browse files
committed
Merge branch 'wallets/add-support-for-applepay-predecrypt' of https://github.com/juspay/hyperswitch into wallets/add-support-for-applepay-predecrypt
2 parents cb77079 + 827950a commit 7ca7109

File tree

7 files changed

+12
-15
lines changed

7 files changed

+12
-15
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,8 +2215,7 @@ impl TryFrom<(&WalletData, &PaymentsAuthorizeRouterData)> for AdyenPaymentMethod
22152215
if let Some(PaymentMethodToken::ApplePayDecrypt(apple_pay_decrypte)) =
22162216
item.payment_method_token.clone()
22172217
{
2218-
let expiry_year_4_digit = apple_pay_decrypte
2219-
.get_four_digit_expiry_year();
2218+
let expiry_year_4_digit = apple_pay_decrypte.get_four_digit_expiry_year();
22202219
let exp_month = apple_pay_decrypte.get_expiry_month();
22212220
let apple_pay_decrypted_data = AdyenApplePayDecryptData {
22222221
number: apple_pay_decrypte.application_primary_account_number,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,11 @@ impl TryFrom<(&WalletData, &Option<PaymentMethodToken>)> for TokenizedCardData {
273273
.application_primary_account_number
274274
.clone();
275275

276-
let expiry_year_2_digit = apple_pay_decrypt_data.get_two_digit_expiry_year().change_context(
277-
errors::ConnectorError::MissingRequiredField {
276+
let expiry_year_2_digit = apple_pay_decrypt_data
277+
.get_two_digit_expiry_year()
278+
.change_context(errors::ConnectorError::MissingRequiredField {
278279
field_name: "Apple pay expiry year",
279-
},
280-
)?;
280+
})?;
281281
let expiry_month = apple_pay_decrypt_data.get_expiry_month();
282282

283283
Ok(Self {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use base64::Engine;
22
use common_enums::{enums, FutureUsage};
3+
use common_types::payments::ApplePayPredecryptData;
34
use common_utils::{consts, ext_traits::OptionExt, pii};
45
use hyperswitch_domain_models::{
56
payment_method_data::{
@@ -21,9 +22,6 @@ use hyperswitch_domain_models::{
2122
RefundsRouterData, SetupMandateRouterData,
2223
},
2324
};
24-
25-
use common_types::payments::ApplePayPredecryptData;
26-
2725
use hyperswitch_interfaces::{api, errors};
2826
use masking::{ExposeInterface, PeekInterface, Secret};
2927
use serde::{Deserialize, Serialize};

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use api_models::payments;
33
use api_models::payouts::PayoutMethodData;
44
use base64::Engine;
55
use common_enums::{enums, FutureUsage};
6+
use common_types::payments::ApplePayPredecryptData;
67
use common_utils::{
78
consts, date_time,
89
ext_traits::{OptionExt, ValueExt},
@@ -45,8 +46,6 @@ use hyperswitch_domain_models::{
4546
PaymentsPreProcessingRouterData, RefundsRouterData, SetupMandateRouterData,
4647
},
4748
};
48-
49-
use common_types::payments::ApplePayPredecryptData;
5049
use hyperswitch_interfaces::{api, errors};
5150
use masking::{ExposeInterface, PeekInterface, Secret};
5251
use serde::{Deserialize, Serialize};

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ impl TryFrom<&PayuRouterData<&types::PaymentsAuthorizeRouterData>> for PayuPayme
133133
PayuWallet {
134134
value: PayuWalletCode::Jp,
135135
wallet_type: WALLET_IDENTIFIER.to_string(),
136-
authorization_code: Secret::new(apple_pay_encrypted_data.to_string()),
136+
authorization_code: Secret::new(
137+
apple_pay_encrypted_data.to_string(),
138+
),
137139
}
138140
}),
139141
})

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,8 +1479,7 @@ impl TryFrom<(&WalletData, Option<PaymentMethodToken>)> for StripePaymentMethodD
14791479
if let Some(PaymentMethodToken::ApplePayDecrypt(decrypt_data)) =
14801480
payment_method_token
14811481
{
1482-
let expiry_year_4_digit = decrypt_data
1483-
.get_four_digit_expiry_year();
1482+
let expiry_year_4_digit = decrypt_data.get_four_digit_expiry_year();
14841483
Some(Self::Wallet(StripeWallet::ApplePayPredecryptToken(
14851484
Box::new(StripeApplePayPredecrypt {
14861485
number: decrypt_data.clone().application_primary_account_number,

crates/hyperswitch_connectors/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use hyperswitch_domain_models::{
5050
network_tokenization::NetworkTokenNumber,
5151
payment_method_data::{self, Card, CardDetailsForNetworkTransactionId, PaymentMethodData},
5252
router_data::{
53-
ErrorResponse, PaymentMethodToken, RecurringMandatePaymentData,
53+
ErrorResponse, PaymentMethodToken, RecurringMandatePaymentData,
5454
RouterData as ConnectorRouterData,
5555
},
5656
router_request_types::{

0 commit comments

Comments
 (0)