示例#1
0
        /// <summary>
        /// Install the plugin
        /// </summary>
        public override void Install()
        {
            //settings
            var settings = new ZarinpalPaymentSettings
            {
                UseSandbox    = true,
                MerchantID    = "99999999-9999-9999-9999-999999999999",
                BlockOverseas = false,
                RialToToman   = true
            };

            _settingService.SaveSetting(settings);


            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.ZarinPal.Fields.UseSandbox", "Use Snadbox for testing payment GateWay without real paying.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.ZarinPal.Fields.UseSandbox", "تست درگاه زرین پال بدون پرداخت هزینه", languageCulture: "fa-IR");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.ZarinPal.Fields.MerchantID", "GateWay Merchant ID");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.ZarinPal.Fields.MerchantID", "کد پذیرنده", languageCulture: "fa-IR");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.ZarinPal.Instructions",
                                                                 string.Concat("You can use Zarinpal.com GateWay as a payment gateway. Zarinpal is not a bank but it is an interface which customers can pay with.",
                                                                               "<br/>", "Please consider that if you leave MerchantId field empty the Zarinpal Gateway will be hidden and not choosable when checking out"));
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.ZarinPal.Instructions",
                                                                 string.Concat("شما می توانید از زرین پال به عنوان یک درگاه پرداخت استفاده نمایید، زرین پال یک لانک نیست بلکه یک وسط بانکی است که کاربران میتوانند از طریق آن مبلغ مورد نظر را پرداخت نمایند، باید آگاه باشید که درگاه زرین پال درصدی از پول پرداخت شده کاربران را به عنوان کارمزد دریافت میکند.",
                                                                               "<br/>", "توجه داشته باشید که اگر فیلد کد پذیرنده خالی باشد درگاه زرین پال در هنگام پرداخت مخفی می شود و قابل انتخاب نیست"), languageCulture: "fa-IR");
            _localizationService.AddOrUpdatePluginLocaleResource("plugins.payments.zarinpal.PaymentMethodDescription", "ZarinPal, The Bank Interface");
            _localizationService.AddOrUpdatePluginLocaleResource("plugins.payments.zarinpal.PaymentMethodDescription", "درگاه واسط زرین پال", languageCulture: "fa-IR");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.Zarinpal.Fields.RedirectionTip", "You will be redirected to ZarinPal site to complete the order.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.Zarinpal.Fields.RedirectionTip", "هم اکنون به درگاه بانک زرین پال منتقل می شوید.", languageCulture: "fa-IR");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.Zarinpal.Fields.BlockOverseas", "Block oversease access (block non Iranians)");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.Zarinpal.Fields.BlockOverseas", "قطع دسترسی برای آی پی های خارج از کشور", languageCulture: "fa-IR");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.Zarinpal.Fields.RialToToman", "Convert Rial To Toman");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.Zarinpal.Fields.RialToToman", "تبدیل ریال به تومن", languageCulture: "fa-IR");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.Zarinpal.Fields.RialToToman.Instructions",
                                                                 string.Concat(
                                                                     "The default currency of zarinpal is Toman", "<br/>",
                                                                     "Therefore if your website uses Rial before paying it should be converted to Toman", "<br/>",
                                                                     "please consider that to convert Rial to Toman system divides total to 10, so the last digit will be removed", "<br/>",
                                                                     "To do the stuff check this option"
                                                                     ));
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Payments.Zarinpal.Fields.RialToToman.Instructions",
                                                                 string.Concat(
                                                                     "واحد ارزی پیش فرض درگاه پرداخت زرین پال تومان می باشد.", "<br/>",
                                                                     "لذا در صورتی که وبسایت شما از واحد ارزی ریال استفاده می کند باید قبل از پرداخت مبلغ نهایی به تومان تبدیل گردد", "<br/>",
                                                                     "لطفا در نظر داشته باشید که جهت تبدیل ریال به تومان عدد تقسیم بر 10 شده و در واقع رقم آخر حذف می گردد", "<br/>",
                                                                     "در صورتی که مایل به تغییر از ریال به تومان هنگام پرداخت می باشید این گزینه را فعال نمایید"
                                                                     ), languageCulture: "fa-IR");
            base.Install();
        }
示例#2
0
 public ZarinPalPaymentProcessor(CurrencySettings currencySettings,
                                 IHttpContextAccessor httpContextAccessor,
                                 IPaymentService paymentService,
                                 ICheckoutAttributeParser checkoutAttributeParser,
                                 ICurrencyService currencyService,
                                 IGenericAttributeService genericAttributeService,
                                 ILocalizationService localizationService,
                                 IOrderTotalCalculationService orderTotalCalculationService,
                                 ISettingService settingService,
                                 ITaxService taxService,
                                 IWebHelper webHelper,
                                 ZarinpalPaymentSettings ZarinPalPaymentSettings,
                                 ILanguageService languageService,
                                 IStoreService storeService,
                                 ICustomerService customerService,
                                 IWorkContext workContext,
                                 IStoreContext storeContext
                                 )
 {
     this._paymentService               = paymentService;
     this._httpContextAccessor          = httpContextAccessor;
     this._workContext                  = workContext;
     this._customerService              = customerService;
     this._storeService                 = storeService;
     this._currencySettings             = currencySettings;
     this._checkoutAttributeParser      = checkoutAttributeParser;
     this._currencyService              = currencyService;
     this._genericAttributeService      = genericAttributeService;
     this._localizationService          = localizationService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._settingService               = settingService;
     this._taxService = taxService;
     this._webHelper  = webHelper;
     this._ZarinPalPaymentSettings = ZarinPalPaymentSettings;
     this._storeContext            = storeContext;
     _languageService = languageService;
 }