Esempio n. 1
0
        public StripeProcessor(ISettingService settingService,
                               ICurrencyService currencyService, ICustomerService customerService,
                               CurrencySettings currencySettings, IWebHelper webHelper,
                               IOrderTotalCalculationService orderTotalCalculationService,
                               IOrderService orderService,
                               StripePaymentSettings stripePaymentSettings,
                               ILocalizationService localizationService,
                               ILogger logger)
        {
            _stripePaymentSettings        = stripePaymentSettings;
            _settingService               = settingService;
            _currencyService              = currencyService;
            _customerService              = customerService;
            _currencySettings             = currencySettings;
            _webHelper                    = webHelper;
            _orderTotalCalculationService = orderTotalCalculationService;
            _orderService                 = orderService;
            _localizationService          = localizationService;
            _logger = logger;

            if (!stripePaymentSettings.IsValid())
            {
                return;
            }

            StripeConfiguration.SetApiKey(stripePaymentSettings.SecretApiKey);
            _chargeService = new StripeChargeService();
            _tokenService  = new StripeTokenService();
            _refundService = new StripeRefundService();

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
        }
Esempio n. 2
0
 public bool HidePaymentMethod(IList <Core.Domain.Orders.ShoppingCartItem> cart)
 {
     return(!_stripePaymentSettings.IsValid());
 }