コード例 #1
0
 public YenePayPaymentProcessor(YenePayPaymentSettings yenePayPaymentSettings,
     ISettingService settingService, ICurrencyService currencyService,
     CurrencySettings currencySettings, IWebHelper webHelper,
     ICheckoutAttributeParser checkoutAttributeParser, ITaxService taxService, 
     IOrderTotalCalculationService orderTotalCalculationService, HttpContextBase httpContext)
 {
     this._yenePayPaymentSettings = yenePayPaymentSettings;
     this._settingService = settingService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._webHelper = webHelper;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._taxService = taxService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._httpContext = httpContext;
 }
コード例 #2
0
        public override void Install()
        {
            //settings
            var settings = new YenePayPaymentSettings()
            {
                UseSandbox = false,
                MerchantCode = "",
                CheckoutUrl = "https://www.yenepay.com/checkout/",
                PdtUrl = "https://www.yenepay.com/api/verify/pdt",
                PdtToken = "",
                PdtValidateOrderTotal = true,
                EnableIpn = true,
                IpnUrl = "https://www.yenepay.com/api/verify/ipn",
                PassProductNamesAndTotals = true
            };
            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.RedirectionTip", "You will be redirected to YenePay site to complete the order.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.UseSandbox", "Use Sandbox");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.UseSandbox.Hint", "Check to enable Sandbox (testing environment).");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.MerchantCode", "Merchant Code");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.CheckoutUrl", "Checkout endpoint url");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.MerchantCode.Hint", "Specify your YenePay merchant code.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.PDTUrl", "PDT endpoint url");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.PDTToken", "PDT Identity Token");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.PDTToken.Hint", "Specify PDT identity token");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.PDTValidateOrderTotal", "PDT. Validate order total");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.PDTValidateOrderTotal.Hint", "Check if PDT handler should validate order totals.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.AdditionalFee", "Additional fee");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.AdditionalFee.Hint", "Enter additional fee to charge your customers.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.AdditionalFeePercentage", "Additional fee. Use percentage");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.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.YenePayCheckout.Fields.PassProductNamesAndTotals", "Pass product names and order totals to YenePay");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.PassProductNamesAndTotals.Hint", "Check if product names and order totals should be passed to YenePay.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.EnableIpn", "Enable IPN (Instant Payment Notification)");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.EnableIpn.Hint", "Check if IPN is enabled.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.EnableIpn.Hint2", "Leave blank to use the default IPN handler URL.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.IpnUrl", "IPN Handler");
            this.AddOrUpdatePluginLocaleResource("Plugins.Payments.YenePayCheckout.Fields.IpnUrl.Hint", "Specify IPN Handler.");

            base.Install();
        }