public PaymentBrainTreeController(ISettingService settingService,
                                   ITranslationService translationService,
                                   BrainTreePaymentSettings brainTreePaymentSettings)
 {
     _settingService           = settingService;
     _translationService       = translationService;
     _brainTreePaymentSettings = brainTreePaymentSettings;
 }
 public PaymentBrainTreeController(ISettingService settingService,
                                   ILocalizationService localizationService,
                                   BrainTreePaymentSettings brainTreePaymentSettings)
 {
     _settingService           = settingService;
     _localizationService      = localizationService;
     _brainTreePaymentSettings = brainTreePaymentSettings;
 }
 public BrainTreeEventConsumer(BrainTreePaymentSettings brainTreePaymentSettings,
                               IBrainTreeService brainTreeService,
                               IPaymentPluginManager paymentPluginManager)
 {
     _brainTreePaymentSettings = brainTreePaymentSettings;
     _brainTreeService         = brainTreeService;
     _paymentPluginManager     = paymentPluginManager;
 }
 public PaymentBrainTreeViewComponent(BrainTreePaymentSettings brainTreePaymentSettings,
                                      IOrderTotalCalculationService orderTotalCalculationService,
                                      IShoppingCartService shoppingCartService,
                                      IStoreContext storeContext,
                                      IWorkContext workContext)
 {
     _brainTreePaymentSettings     = brainTreePaymentSettings;
     _orderTotalCalculationService = orderTotalCalculationService;
     _shoppingCartService          = shoppingCartService;
     _storeContext = storeContext;
     _workContext  = workContext;
 }
Пример #5
0
 public PaymentBrainTreeController(ISettingService settingService,
                                   IStoreContext storeContext,
                                   ILocalizationService localizationService,
                                   IPermissionService permissionService,
                                   IStoreService storeService,
                                   IWorkContext workContext,
                                   BrainTreePaymentSettings brainTreePaymentSettings)
 {
     _storeContext             = storeContext;
     _settingService           = settingService;
     _localizationService      = localizationService;
     _permissionService        = permissionService;
     _storeService             = storeService;
     _workContext              = workContext;
     _brainTreePaymentSettings = brainTreePaymentSettings;
 }
Пример #6
0
        public PaymentInfoValidator(BrainTreePaymentSettings brainTreePaymentSettings, ITranslationService translationService)
        {
            if (brainTreePaymentSettings.Use3DS)
            {
                return;
            }

            //useful links:
            //http://fluentvalidation.codeplex.com/wikipage?title=Custom&referringTitle=Documentation&ANCHOR#CustomValidator
            //http://benjii.me/2010/11/credit-card-validator-attribute-for-asp-net-mvc-3/

            RuleFor(x => x.CardholderName).NotEmpty().WithMessage(translationService.GetResource("Payment.CardholderName.Required"));
            RuleFor(x => x.CardNumber).CreditCard().WithMessage(translationService.GetResource("Payment.CardNumber.Wrong"));
            RuleFor(x => x.CardCode).Matches(@"^[0-9]{3,4}$").WithMessage(translationService.GetResource("Payment.CardCode.Wrong"));
            RuleFor(x => x.ExpireMonth).NotEmpty().WithMessage(translationService.GetResource("Payment.ExpireMonth.Required"));
            RuleFor(x => x.ExpireYear).NotEmpty().WithMessage(translationService.GetResource("Payment.ExpireYear.Required"));
        }