Esempio n. 1
0
        public PaymentInfoValidator(BraintreePaymentSettings braintreePaymentSettings, ILocalizationService localizationService)
        {
            if (braintreePaymentSettings.Use3DS)
            {
                return;
            }

            RuleFor(model => model.CardholderName)
            .NotEmpty()
            .WithMessage(localizationService.GetResource("Payment.CardholderName.Required"));

            RuleFor(model => model.CardNumber)
            .IsCreditCard()
            .WithMessage(localizationService.GetResource("Payment.CardNumber.Wrong"));

            RuleFor(model => model.CardCode)
            .Matches(@"^[0-9]{3,4}$")
            .WithMessage(localizationService.GetResource("Payment.CardCode.Wrong"));

            RuleFor(model => model.ExpireMonth)
            .NotEmpty()
            .WithMessage(localizationService.GetResource("Payment.ExpireMonth.Required"));

            RuleFor(model => model.ExpireYear)
            .NotEmpty()
            .WithMessage(localizationService.GetResource("Payment.ExpireYear.Required"));
        }
Esempio n. 2
0
 public EventConsumer(BraintreeMerchantService braintreeMerchantService,
                      BraintreePaymentSettings braintreePaymentSettings,
                      IPaymentPluginManager paymentPluginManager)
 {
     _braintreeMerchantService = braintreeMerchantService;
     _braintreePaymentSettings = braintreePaymentSettings;
     _paymentPluginManager     = paymentPluginManager;
 }
Esempio n. 3
0
 public PaymentInfoViewComponent(BraintreePaymentSettings braintreePaymentSettings,
                                 INotificationService notificationService,
                                 IOrderTotalCalculationService orderTotalCalculationService,
                                 IShoppingCartService shoppingCartService,
                                 IStoreContext storeContext,
                                 IWorkContext workContext,
                                 OrderSettings orderSettings)
 {
     _braintreePaymentSettings     = braintreePaymentSettings;
     _notificationService          = notificationService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _shoppingCartService          = shoppingCartService;
     _storeContext  = storeContext;
     _workContext   = workContext;
     _orderSettings = orderSettings;
 }