コード例 #1
0
        public override void Install()
        {
            //settings
            var settings = new PayFastPaymentSettings()
            {
                UseSandbox              = true,
                MerchantId              = "10000100",
                MerchantKey             = "46f0cd694581a",
                IncludeNotifyUrl        = true,
                SandboxProcessorUrl     = "https://sandbox.payfast.co.za/eng/process?",
                SandboxValidateUrl      = "https://sandbox.payfast.co.za/eng/validate?",
                LiveProcessorUrl        = "https://www.payfast.co.za/eng/process?",
                LiveValidateUrl         = "https://www.payfast.co.za/eng/validate?",
                AdditionalFee           = Convert.ToDecimal(2),
                AdditionalFeePercentage = Convert.ToDecimal(4.9)
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.RedirectionTip", "You will be redirected to PayFast site to complete the order.");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.UseSandbox", "Use Sandbox");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment).");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.MerchantId", "Merchant Id");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.MerchantId.Hint", "Specify your PayFast Merchant Id.");

            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.MerchantKey", "Merchant Key");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.MerchantKey.Hint", "Specify your PayFast Merchant Key.");

            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.IncludeNotifyUrl", "Include Notify Url");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.IncludeNotifyUrl.Hint", "");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.SandboxProcessorUrl", "Sandbox Processor Url");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.SandboxProcessorUrl.Hint", "");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.LiveProcessorUrl", "Live Processor Url");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.LiveProcessorUrl.Hint", "");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.SandboxValidateUrl", "Sandbox Validate Url");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.SandboxValidateUrl.Hint", "");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.LiveValidateUrl", "Live Validate Url");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.LiveValidateUrl.Hint", "");

            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.AdditionalFee", "Additional Fixed Fee");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.AdditionalFee.Hint", "");

            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.AdditionalFeePercentage", "Additional Fee %");
            this.AddOrUpdatePluginLocaleResource("NopExtension.Plugins.PayFast.Fields.AdditionalFeePercentage.Hint", "");

            base.Install();
        }
コード例 #2
0
        public PayFastPaymentProcessor(PayFastPaymentSettings payFastPaymentSettings,
                                       ISettingService settingService, ICurrencyService currencyService,
                                       CurrencySettings currencySettings, IWebHelper webHelper,
                                       ICheckoutAttributeParser checkoutAttributeParser,
                                       ITaxService taxService,
                                       ShoppingCartSettings shoppingCartSettings,
                                       HttpContextBase httpContext,
                                       IWorkContext workContext,
                                       PaymentSettings paymentSettings,
                                       IPluginFinder pluginFinder,
                                       IPriceCalculationService priceCalculationService,
                                       IShippingService shippingService,
                                       IDiscountService discountService,
                                       IGiftCardService giftCardService,
                                       IGenericAttributeService genericAttributeService,
                                       TaxSettings taxSettings,
                                       RewardPointsSettings rewardPointsSettings,
                                       ShippingSettings shippingSettings,
                                       CatalogSettings catalogSettings, IStoreContext storeContext)
        {
            _payFastPaymentSettings = payFastPaymentSettings;
            _settingService         = settingService;
            _currencyService        = currencyService;
            _currencySettings       = currencySettings;
            _webHelper = webHelper;
            _checkoutAttributeParser = checkoutAttributeParser;
            _taxService  = taxService;
            _httpContext = httpContext;

            _workContext          = workContext;
            _paymentSettings      = paymentSettings;
            _pluginFinder         = pluginFinder;
            _shoppingCartSettings = shoppingCartSettings;

            _priceCalculationService = priceCalculationService;
            _shippingService         = shippingService;
            _discountService         = discountService;
            _giftCardService         = giftCardService;
            _genericAttributeService = genericAttributeService;
            _taxSettings             = taxSettings;
            _rewardPointsSettings    = rewardPointsSettings;
            _shippingSettings        = shippingSettings;
            _catalogSettings         = catalogSettings;
            _storeContext            = storeContext;
        }
コード例 #3
0
 public PayFastHelper(PayFastPaymentSettings payFastPaymentSettings, ILogger logger)
 {
     _payFastPaymentSettings = payFastPaymentSettings;
     _logger = logger;
 }