@@ -253,9 +253,12 @@ impl
253
253
| api_models:: payments:: VoucherData :: MiniStop { .. }
254
254
| api_models:: payments:: VoucherData :: FamilyMart { .. }
255
255
| api_models:: payments:: VoucherData :: Seicomart { .. }
256
- | api_models:: payments:: VoucherData :: PayEasy { .. } => Err (
257
- errors:: ConnectorError :: NotImplemented ( "payment method" . to_string ( ) ) ,
258
- ) ?,
256
+ | api_models:: payments:: VoucherData :: PayEasy { .. } => {
257
+ Err ( errors:: ConnectorError :: NotSupported {
258
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
259
+ connector : "Zen" ,
260
+ } ) ?
261
+ }
259
262
} ;
260
263
Ok ( Self :: ApiRequest ( Box :: new ( ApiRequest {
261
264
merchant_transaction_id : item. connector_request_reference_id . clone ( ) ,
@@ -303,8 +306,12 @@ impl
303
306
api_models:: payments:: BankTransferData :: Pse { .. } => {
304
307
ZenPaymentChannels :: PclBoacompraPse
305
308
}
309
+ api_models:: payments:: BankTransferData :: SepaBankTransfer { .. } => {
310
+ Err ( errors:: ConnectorError :: NotImplemented (
311
+ utils:: get_unimplemented_payment_method_error_message ( "Zen" ) ,
312
+ ) ) ?
313
+ }
306
314
api_models:: payments:: BankTransferData :: AchBankTransfer { .. }
307
- | api_models:: payments:: BankTransferData :: SepaBankTransfer { .. }
308
315
| api_models:: payments:: BankTransferData :: BacsBankTransfer { .. }
309
316
| api_models:: payments:: BankTransferData :: PermataBankTransfer { .. }
310
317
| api_models:: payments:: BankTransferData :: BcaBankTransfer { .. }
@@ -313,9 +320,10 @@ impl
313
320
| api_models:: payments:: BankTransferData :: CimbVaBankTransfer { .. }
314
321
| api_models:: payments:: BankTransferData :: DanamonVaBankTransfer { .. }
315
322
| api_models:: payments:: BankTransferData :: MandiriVaBankTransfer { .. } => {
316
- Err ( errors:: ConnectorError :: NotImplemented (
317
- utils:: get_unimplemented_payment_method_error_message ( "zen" ) ,
318
- ) ) ?
323
+ Err ( errors:: ConnectorError :: NotSupported {
324
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
325
+ connector : "Zen" ,
326
+ } ) ?
319
327
}
320
328
} ;
321
329
Ok ( Self :: ApiRequest ( Box :: new ( ApiRequest {
@@ -442,33 +450,38 @@ impl
442
450
. google_pay
443
451
. ok_or ( errors:: ConnectorError :: RequestEncodingFailed ) ?,
444
452
) ,
453
+ api_models:: payments:: WalletData :: WeChatPayRedirect ( _)
454
+ | api_models:: payments:: WalletData :: PaypalRedirect ( _)
455
+ | api_models:: payments:: WalletData :: ApplePay ( _)
456
+ | api_models:: payments:: WalletData :: GooglePay ( _) => {
457
+ Err ( errors:: ConnectorError :: NotImplemented (
458
+ utils:: get_unimplemented_payment_method_error_message ( "Zen" ) ,
459
+ ) ) ?
460
+ }
445
461
api_models:: payments:: WalletData :: AliPayQr ( _)
446
462
| api_models:: payments:: WalletData :: AliPayRedirect ( _)
447
463
| api_models:: payments:: WalletData :: AliPayHkRedirect ( _)
448
464
| api_models:: payments:: WalletData :: MomoRedirect ( _)
449
465
| api_models:: payments:: WalletData :: KakaoPayRedirect ( _)
450
466
| api_models:: payments:: WalletData :: GoPayRedirect ( _)
451
467
| api_models:: payments:: WalletData :: GcashRedirect ( _)
452
- | api_models:: payments:: WalletData :: ApplePay ( _)
453
468
| api_models:: payments:: WalletData :: ApplePayThirdPartySdk ( _)
454
469
| api_models:: payments:: WalletData :: DanaRedirect { }
455
- | api_models:: payments:: WalletData :: GooglePay ( _)
456
470
| api_models:: payments:: WalletData :: GooglePayThirdPartySdk ( _)
457
471
| api_models:: payments:: WalletData :: MbWayRedirect ( _)
458
472
| api_models:: payments:: WalletData :: MobilePayRedirect ( _)
459
- | api_models:: payments:: WalletData :: PaypalRedirect ( _)
460
473
| api_models:: payments:: WalletData :: PaypalSdk ( _)
461
474
| api_models:: payments:: WalletData :: SamsungPay ( _)
462
475
| api_models:: payments:: WalletData :: TwintRedirect { }
463
476
| api_models:: payments:: WalletData :: VippsRedirect { }
464
477
| api_models:: payments:: WalletData :: TouchNGoRedirect ( _)
465
- | api_models:: payments:: WalletData :: WeChatPayRedirect ( _)
466
478
| api_models:: payments:: WalletData :: CashappQr ( _)
467
479
| api_models:: payments:: WalletData :: SwishQr ( _)
468
480
| api_models:: payments:: WalletData :: WeChatPayQr ( _) => {
469
- Err ( errors:: ConnectorError :: NotImplemented (
470
- utils:: get_unimplemented_payment_method_error_message ( "zen" ) ,
471
- ) ) ?
481
+ Err ( errors:: ConnectorError :: NotSupported {
482
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
483
+ connector : "Zen" ,
484
+ } ) ?
472
485
}
473
486
} ;
474
487
let terminal_uuid = session_data
@@ -650,18 +663,143 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for ZenPaymentsRequest {
650
663
api_models:: payments:: PaymentMethodData :: BankTransfer ( bank_transfer_data) => {
651
664
Self :: try_from ( ( item, bank_transfer_data) )
652
665
}
653
- api_models:: payments:: PaymentMethodData :: PayLater ( _)
654
- | api_models:: payments:: PaymentMethodData :: BankRedirect ( _)
655
- | api_models:: payments:: PaymentMethodData :: BankDebit ( _)
656
- | api_models:: payments:: PaymentMethodData :: Crypto ( _)
666
+ api_models:: payments:: PaymentMethodData :: BankRedirect ( bank_redirect_data) => {
667
+ Self :: try_from ( bank_redirect_data)
668
+ }
669
+ api_models:: payments:: PaymentMethodData :: PayLater ( paylater_data) => {
670
+ Self :: try_from ( paylater_data)
671
+ }
672
+ api_models:: payments:: PaymentMethodData :: BankDebit ( bank_debit_data) => {
673
+ Self :: try_from ( bank_debit_data)
674
+ }
675
+ api_models:: payments:: PaymentMethodData :: CardRedirect ( car_redirect_data) => {
676
+ Self :: try_from ( car_redirect_data)
677
+ }
678
+ api_models:: payments:: PaymentMethodData :: GiftCard ( gift_card_data) => {
679
+ Self :: try_from ( gift_card_data. as_ref ( ) )
680
+ }
681
+ api_models:: payments:: PaymentMethodData :: Crypto ( _)
657
682
| api_models:: payments:: PaymentMethodData :: MandatePayment
658
683
| api_models:: payments:: PaymentMethodData :: Reward
659
- | api_models:: payments:: PaymentMethodData :: Upi ( _)
660
- | api_models:: payments:: PaymentMethodData :: CardRedirect ( _)
661
- | api_models:: payments:: PaymentMethodData :: GiftCard ( _) => {
684
+ | api_models:: payments:: PaymentMethodData :: Upi ( _) => {
685
+ Err ( errors:: ConnectorError :: NotSupported {
686
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
687
+ connector : "Zen" ,
688
+ } ) ?
689
+ }
690
+ }
691
+ }
692
+ }
693
+
694
+ impl TryFrom < & api_models:: payments:: BankRedirectData > for ZenPaymentsRequest {
695
+ type Error = error_stack:: Report < errors:: ConnectorError > ;
696
+ fn try_from ( value : & api_models:: payments:: BankRedirectData ) -> Result < Self , Self :: Error > {
697
+ match value {
698
+ api_models:: payments:: BankRedirectData :: Ideal { .. }
699
+ | api_models:: payments:: BankRedirectData :: Sofort { .. }
700
+ | api_models:: payments:: BankRedirectData :: BancontactCard { .. }
701
+ | api_models:: payments:: BankRedirectData :: Blik { .. }
702
+ | api_models:: payments:: BankRedirectData :: Trustly { .. } => {
662
703
Err ( errors:: ConnectorError :: NotImplemented (
663
- utils:: get_unimplemented_payment_method_error_message ( "zen" ) ,
664
- ) ) ?
704
+ utils:: get_unimplemented_payment_method_error_message ( "Zen" ) ,
705
+ )
706
+ . into ( ) )
707
+ }
708
+ api_models:: payments:: BankRedirectData :: Eps { .. }
709
+ | api_models:: payments:: BankRedirectData :: Giropay { .. }
710
+ | api_models:: payments:: BankRedirectData :: Przelewy24 { .. }
711
+ | api_models:: payments:: BankRedirectData :: Bizum { }
712
+ | api_models:: payments:: BankRedirectData :: Interac { .. }
713
+ | api_models:: payments:: BankRedirectData :: OnlineBankingCzechRepublic { .. }
714
+ | api_models:: payments:: BankRedirectData :: OnlineBankingFinland { .. }
715
+ | api_models:: payments:: BankRedirectData :: OnlineBankingPoland { .. }
716
+ | api_models:: payments:: BankRedirectData :: OnlineBankingSlovakia { .. }
717
+ | api_models:: payments:: BankRedirectData :: OpenBankingUk { .. }
718
+ | api_models:: payments:: BankRedirectData :: OnlineBankingFpx { .. }
719
+ | api_models:: payments:: BankRedirectData :: OnlineBankingThailand { .. } => {
720
+ Err ( errors:: ConnectorError :: NotSupported {
721
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
722
+ connector : "Zen" ,
723
+ }
724
+ . into ( ) )
725
+ }
726
+ }
727
+ }
728
+ }
729
+
730
+ impl TryFrom < & api_models:: payments:: PayLaterData > for ZenPaymentsRequest {
731
+ type Error = error_stack:: Report < errors:: ConnectorError > ;
732
+ fn try_from ( value : & api_models:: payments:: PayLaterData ) -> Result < Self , Self :: Error > {
733
+ match value {
734
+ api_models:: payments:: PayLaterData :: KlarnaRedirect { .. }
735
+ | api_models:: payments:: PayLaterData :: KlarnaSdk { .. }
736
+ | api_models:: payments:: PayLaterData :: AffirmRedirect { }
737
+ | api_models:: payments:: PayLaterData :: AfterpayClearpayRedirect { .. }
738
+ | api_models:: payments:: PayLaterData :: PayBrightRedirect { }
739
+ | api_models:: payments:: PayLaterData :: WalleyRedirect { }
740
+ | api_models:: payments:: PayLaterData :: AlmaRedirect { }
741
+ | api_models:: payments:: PayLaterData :: AtomeRedirect { } => {
742
+ Err ( errors:: ConnectorError :: NotSupported {
743
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
744
+ connector : "Zen" ,
745
+ }
746
+ . into ( ) )
747
+ }
748
+ }
749
+ }
750
+ }
751
+
752
+ impl TryFrom < & api_models:: payments:: BankDebitData > for ZenPaymentsRequest {
753
+ type Error = error_stack:: Report < errors:: ConnectorError > ;
754
+ fn try_from ( value : & api_models:: payments:: BankDebitData ) -> Result < Self , Self :: Error > {
755
+ match value {
756
+ api_models:: payments:: BankDebitData :: AchBankDebit { .. }
757
+ | api_models:: payments:: BankDebitData :: SepaBankDebit { .. }
758
+ | api_models:: payments:: BankDebitData :: BecsBankDebit { .. }
759
+ | api_models:: payments:: BankDebitData :: BacsBankDebit { .. } => {
760
+ Err ( errors:: ConnectorError :: NotSupported {
761
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
762
+ connector : "Zen" ,
763
+ }
764
+ . into ( ) )
765
+ }
766
+ }
767
+ }
768
+ }
769
+
770
+ impl TryFrom < & api_models:: payments:: CardRedirectData > for ZenPaymentsRequest {
771
+ type Error = error_stack:: Report < errors:: ConnectorError > ;
772
+ fn try_from ( value : & api_models:: payments:: CardRedirectData ) -> Result < Self , Self :: Error > {
773
+ match value {
774
+ api_models:: payments:: CardRedirectData :: Knet { }
775
+ | api_models:: payments:: CardRedirectData :: Benefit { }
776
+ | api_models:: payments:: CardRedirectData :: MomoAtm { } => {
777
+ Err ( errors:: ConnectorError :: NotSupported {
778
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
779
+ connector : "Zen" ,
780
+ }
781
+ . into ( ) )
782
+ }
783
+ }
784
+ }
785
+ }
786
+
787
+ impl TryFrom < & api_models:: payments:: GiftCardData > for ZenPaymentsRequest {
788
+ type Error = error_stack:: Report < errors:: ConnectorError > ;
789
+ fn try_from ( value : & api_models:: payments:: GiftCardData ) -> Result < Self , Self :: Error > {
790
+ match value {
791
+ api_models:: payments:: GiftCardData :: PaySafeCard { } => {
792
+ Err ( errors:: ConnectorError :: NotImplemented (
793
+ utils:: get_unimplemented_payment_method_error_message ( "Zen" ) ,
794
+ )
795
+ . into ( ) )
796
+ }
797
+ api_models:: payments:: GiftCardData :: Givex ( _) => {
798
+ Err ( errors:: ConnectorError :: NotSupported {
799
+ message : utils:: SELECTED_PAYMENT_METHOD . to_string ( ) ,
800
+ connector : "Zen" ,
801
+ }
802
+ . into ( ) )
665
803
}
666
804
}
667
805
}
0 commit comments