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")); }
public EventConsumer(BraintreeMerchantService braintreeMerchantService, BraintreePaymentSettings braintreePaymentSettings, IPaymentPluginManager paymentPluginManager) { _braintreeMerchantService = braintreeMerchantService; _braintreePaymentSettings = braintreePaymentSettings; _paymentPluginManager = paymentPluginManager; }
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; }