public ServiceManager(ICheckoutAttributeParser checkoutAttributeParser,
                              ICurrencyService currencyService,
                              IGenericAttributeService genericAttributeService,
                              ILogger logger,
                              IOrderTotalCalculationService orderTotalCalculationService,
                              IPriceCalculationService priceCalculationService,
                              IShippingPluginManager shippingPluginManager,
                              IShoppingCartService shoppingCartService,
                              IStoreContext storeContext,
                              ITaxService taxService,
                              IWorkContext workContext,
                              CurrencySettings currencySettings,
                              PayPalSmartPaymentButtonsSettings settings)
        {
            _checkoutAttributeParser = checkoutAttributeParser;
            _currencyService         = currencyService;
            _genericAttributeService = genericAttributeService;
            _logger = logger;
            _orderTotalCalculationService = orderTotalCalculationService;
            _priceCalculationService      = priceCalculationService;
            _shippingPluginManager        = shippingPluginManager;
            _shoppingCartService          = shoppingCartService;
            _storeContext     = storeContext;
            _taxService       = taxService;
            _workContext      = workContext;
            _currencySettings = currencySettings;
            _settings         = settings;

            _client = _settings.UseSandbox
                ? new PayPalHttpClient(new SandboxEnvironment(_settings.ClientId, _settings.SecretKey))
                : new PayPalHttpClient(new LiveEnvironment(_settings.ClientId, _settings.SecretKey));
        }
Пример #2
0
 public LogoViewComponent(IPaymentPluginManager paymentPluginManager,
                          IStoreContext storeContext,
                          IWorkContext workContext,
                          PayPalSmartPaymentButtonsSettings settings)
 {
     _paymentPluginManager = paymentPluginManager;
     _storeContext         = storeContext;
     _workContext          = workContext;
     _settings             = settings;
 }
 public ScriptViewComponent(IPaymentPluginManager paymentPluginManager,
                            IStoreContext storeContext,
                            IWorkContext workContext,
                            PayPalSmartPaymentButtonsSettings settings,
                            ServiceManager serviceManager)
 {
     _paymentPluginManager = paymentPluginManager;
     _storeContext         = storeContext;
     _workContext          = workContext;
     _settings             = settings;
     _serviceManager       = serviceManager;
 }
 public PaymentInfoViewComponent(ILocalizationService localizationService,
                                 INotificationService notificationService,
                                 IPaymentService paymentService,
                                 OrderSettings orderSettings,
                                 PayPalSmartPaymentButtonsSettings settings,
                                 ServiceManager serviceManager)
 {
     _localizationService = localizationService;
     _notificationService = notificationService;
     _paymentService      = paymentService;
     _orderSettings       = orderSettings;
     _settings            = settings;
     _serviceManager      = serviceManager;
 }
Пример #5
0
 /// <summary>
 /// Check whether the plugin is configured
 /// </summary>
 /// <param name="settings">Plugin settings</param>
 /// <returns>Result</returns>
 private bool IsConfigured(PayPalSmartPaymentButtonsSettings settings)
 {
     //client id and secret are required to request services
     return(!string.IsNullOrEmpty(settings?.ClientId) &&
            (!string.IsNullOrEmpty(settings?.SecretKey) || settings.ClientId.Equals("sb", StringComparison.InvariantCultureIgnoreCase)));
 }
Пример #6
0
 public PayPalSmartPaymentButtonsWebhookController(PayPalSmartPaymentButtonsSettings settings,
                                                   ServiceManager serviceManager)
 {
     _settings       = settings;
     _serviceManager = serviceManager;
 }
 /// <summary>
 /// Check whether the plugin is configured
 /// </summary>
 /// <param name="settings">Settings; pass null to use default values</param>
 /// <returns>Result</returns>
 private bool IsConfigured(PayPalSmartPaymentButtonsSettings settings = null)
 {
     //client id and secret are required to request services
     return(!string.IsNullOrEmpty((settings ?? _settings).ClientId) && !string.IsNullOrEmpty((settings ?? _settings).SecretKey));
 }