@@ -348,8 +348,11 @@ pub struct ShipToList {
348
348
#[ derive( Debug , Serialize ) ]
349
349
#[ serde( rename_all = "camelCase" ) ]
350
350
struct Profile {
351
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
351
352
merchant_customer_id : Option < CustomerId > ,
353
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
352
354
description : Option < String > ,
355
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
353
356
email : Option < Email > ,
354
357
#[ serde( skip_serializing_if = "Option::is_none" ) ]
355
358
payment_profiles : Option < PaymentProfiles > ,
@@ -441,7 +444,7 @@ impl TryFrom<&ConnectorCustomerRouterData> for CustomerRequest {
441
444
merchant_authentication,
442
445
profile : Profile {
443
446
merchant_customer_id,
444
- description : item . request . description . clone ( ) ,
447
+ description : None ,
445
448
email : item. request . email . clone ( ) ,
446
449
payment_profiles : None ,
447
450
ship_to_list,
@@ -490,13 +493,23 @@ impl TryFrom<&SetupMandateRouterData> for CreateCustomerPaymentProfileRequest {
490
493
data_value : Secret :: new ( wallet_data. get_encoded_wallet_token ( ) ?) ,
491
494
} ) ,
492
495
} ) ,
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
- } ) ,
496
+ WalletData :: ApplePay ( applepay_token) => {
497
+ let apple_pay_encrypted_data = applepay_token
498
+ . payment_data
499
+ . get_encrypted_apple_pay_payment_data_mandatory ( )
500
+ . change_context ( errors:: ConnectorError :: MissingRequiredField {
501
+ field_name : "Apple pay encrypted data" ,
502
+ } ) ?;
503
+
504
+ Ok ( PaymentProfile {
505
+ bill_to,
506
+ payment : PaymentDetails :: OpaqueData ( WalletDetails {
507
+ data_descriptor : WalletMethod :: Applepay ,
508
+ data_value : Secret :: new ( apple_pay_encrypted_data. clone ( ) ) ,
509
+ } ) ,
510
+ } )
511
+ }
512
+
500
513
WalletData :: AliPayQr ( _)
501
514
| WalletData :: AliPayRedirect ( _)
502
515
| WalletData :: AliPayHkRedirect ( _)
@@ -598,7 +611,7 @@ impl<F, T> TryFrom<ResponseRouterData<F, AuthorizedotnetCustomerResponse, T, Pay
598
611
match item. response . messages . result_code {
599
612
ResultCode :: Ok => Ok ( Self {
600
613
response : Ok ( PaymentsResponseData :: ConnectorCustomerResponse {
601
- connector_customer_id : connector_customer_id ,
614
+ connector_customer_id,
602
615
} ) ,
603
616
..item. data
604
617
} ) ,
0 commit comments