Пример #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;
        }
 public StripePaymentProcessor(CurrencySettings currencySettings,
                               ICurrencyService currencyService,
                               ICustomerService customerService,
                               IGenericAttributeService genericAttributeService,
                               ILocalizationService localizationService,
                               ILogger logger,
                               IPaymentService paymentService,
                               IPageHeadBuilder pageHeadBuilder,
                               ISettingService settingService,
                               IScheduleTaskService scheduleTaskService,
                               IWebHelper webHelper,
                               StripePaymentSettings stripePaymentSettings)
 {
     this._currencySettings        = currencySettings;
     this._currencyService         = currencyService;
     this._customerService         = customerService;
     this._genericAttributeService = genericAttributeService;
     this._localizationService     = localizationService;
     this._logger                = logger;
     this._paymentService        = paymentService;
     this._pageHeadBuilder       = pageHeadBuilder;
     this._settingService        = settingService;
     this._scheduleTaskService   = scheduleTaskService;
     this._webHelper             = webHelper;
     this._stripePaymentSettings = stripePaymentSettings;
 }
Пример #3
0
        public override void Install()
        {
            //settings
            var settings = new StripePaymentSettings()
            {
                UseSandbox     = false,
                TransactMode   = TransactMode.AuthorizeAndCapture,
                TransactionKey = StripeApiKey(),
                LoginId        = ""
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Notes", "If you're using this gateway, ensure that your primary store currency is supported by Stripe.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.UseSandbox", "Use Sandbox");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment).");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.TransactModeValues", "Transaction mode");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.TransactModeValues.Hint", "Choose transaction mode");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.TransactionKey", "Transaction key");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.TransactionKey.Hint", "Specify transaction key");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.LoginId", "Login ID");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.LoginId.Hint", "Specify login identifier.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.AdditionalFee", "Additional fee");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers.");

            base.Install();
        }
        public StripePaymentProcessor(CurrencySettings currencySettings,
                                      Services.IPaymentStripeService stripeService,
                                      HttpContextBase httpContext,
                                      ICheckoutAttributeParser checkoutAttributeParser,
                                      ICurrencyService currencyService,
                                      IGenericAttributeService genericAttributeService,
                                      ILocalizationService localizationService,
                                      IOrderTotalCalculationService orderTotalCalculationService,
                                      ISettingService settingService,
                                      ITaxService taxService,
                                      IWebHelper webHelper,
                                      StripePaymentSettings stripePaymentSettings,
                                      PaymentStripeObjectContext objectContext,
                                      IWorkContext workContext)
        {
            _currencySettings             = currencySettings;
            _httpContext                  = httpContext;
            _checkoutAttributeParser      = checkoutAttributeParser;
            _currencyService              = currencyService;
            _genericAttributeService      = genericAttributeService;
            _localizationService          = localizationService;
            _orderTotalCalculationService = orderTotalCalculationService;
            _settingService               = settingService;
            _taxService            = taxService;
            _webHelper             = webHelper;
            _stripePaymentSettings = stripePaymentSettings;
            _stripeService         = stripeService;
            _workContext           = workContext;
            _objectContext         = objectContext;

            // Set your secret key: remember to change this to your live secret key in production
            // See your keys here: https://dashboard.stripe.com/account/apikeys
            StripeConfiguration.SetApiKey(_stripePaymentSettings.StripeFrameworkSecretKey);
        }
Пример #5
0
 public StripePaymentProcessor(StripePaymentSettings stripePaymentSettings,
                               ISettingService settingService, IOrderTotalCalculationService orderTotalCalculationService,
                               ICurrencyService currencyService)
 {
     this._stripePaymentSettings        = stripePaymentSettings;
     this._settingService               = settingService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._currencyService              = currencyService;
 }
Пример #6
0
 public StripePaymentProcessor(StripePaymentSettings stripePaymentSettings,
     ISettingService settingService, ICurrencyService currencyService,
     ICustomerService customerService,
     CurrencySettings currencySettings, IWebHelper webHelper,
     StoreInformationSettings storeInformationSettings)
 {
     this._stripePaymentSettings = stripePaymentSettings;
     this._settingService = settingService;
     this._currencyService = currencyService;
     this._customerService = customerService;
     this._currencySettings = currencySettings;
     this._webHelper = webHelper;
     this._storeInformationSettings = storeInformationSettings;
 }
Пример #7
0
 public StripePaymentProcessor(StripePaymentSettings stripePaymentSettings,
                               ISettingService settingService, ICurrencyService currencyService,
                               ICustomerService customerService,
                               CurrencySettings currencySettings, IWebHelper webHelper,
                               StoreInformationSettings storeInformationSettings)
 {
     this._stripePaymentSettings    = stripePaymentSettings;
     this._settingService           = settingService;
     this._currencyService          = currencyService;
     this._customerService          = customerService;
     this._currencySettings         = currencySettings;
     this._webHelper                = webHelper;
     this._storeInformationSettings = storeInformationSettings;
 }
Пример #8
0
        public override void Install()
        {
            //settings
            var settings = new StripePaymentSettings
            {
                TransactMode = TransactMode.Authorize
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.AdditionalFee", "Additional fee");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.AdditionalFeePercentage", "Additional fee. Use percentage");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.AdditionalFeePercentage.Hint", "Determines whether to apply a percentage additional fee to the order total. If not enabled, a fixed value is used.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.ApiKey", "Public Api Key");


            base.Install();
        }
        /// <summary>
        /// Install the plugin
        /// </summary>
        public override void Install()
        {
            _objectContext.Install();
            //settings
            var settings = new StripePaymentSettings
            {
                StripeFrameworkSecretKey = "", // enter secret key here
                StripeFrameworkPublicKey = "", // enter public key here
                ConnectAccountId         = "",
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.PaymentMethodDescription", "Payment Information");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.ConfigureDescription", "<p>A Standard Stripe account is a conventional Stripe account controlled directly by the account holder (i.e., you). A user with a Standard account has a relationship with Stripe, is able to log in to the Dashboard, can process charges on their own, and can disconnect their account from this platform.</p><br/><p>  <strong>Step 1:</strong> Click the link to connect with Stripe: </p><p>  Click the Connect with Stripe button below to begin the connection.</p><br/><p>  <strong>Step 2:</strong> Create or connect your Stripe account:</p><p>After you click the link, you will be taken to Stripe's website where you will be prompted to allow or deny the connection to your platform.</p><br/><p>  <strong>Step 3:</strong> Return to this configuration page:</p><p>  After you connect your existing or newly created account, you will redirected back to your site.</p><br/><p>  <strong>Step 4:</strong> We process your Stripe account:</p><p>  Assuming no errors occurred, the last step is for us to fetch your Stripe credentials and validate if payments are enabled on your account. If any errors are found review your accounts information at https://stripe.com/, if further errors persist contact  https://support.stripe.com/.</p>");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.AccountId", "Account Id");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.PaymentsEnabled", "Payments Enabled?");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.RedirectionTip", "Payments Enabled?");

            base.Install();
        }
Пример #10
0
        public override void Install()
        {
            //settings
            var settings = new StripePaymentSettings()
            {
                UseSandbox = false,
                TransactMode = TransactMode.AuthorizeAndCapture,
                TransactionKey = StripeApiKey(),
                LoginId = ""
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Notes", "If you're using this gateway, ensure that your primary store currency is supported by Stripe.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.UseSandbox", "Use Sandbox");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment).");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.TransactModeValues", "Transaction mode");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.TransactModeValues.Hint", "Choose transaction mode");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.TransactionKey", "Transaction key");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.TransactionKey.Hint", "Specify transaction key");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.LoginId", "Login ID");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.LoginId.Hint", "Specify login identifier.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.AdditionalFee", "Additional fee");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Stripe.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers.");
            
            base.Install();
        }