/// <summary> /// /// </summary> public override void Install() { //settings var settings = new MellatPaymentSettings { // تنظیمات پیش فرض TerminalId = "", UserName = "", UserPassword = "", OrderId = 1, InstallmentOrderId = 1 }; _settingService.SaveSetting(settings); //locales this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.RedirectionTip", "برای تکمیل سفارش به درگاه پرداخت هدایت خواهید شد"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.BusinessEmail", "Business Email"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.BusinessEmail.Hint", "Specify your Mellat business email."); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.AdditionalFee", "هزینه های اضافی"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.AdditionalFee.Hint", "هزینه های اضافی برای مطالبه از مشتریان خود وارد نمایید"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.AdditionalFeePercentage", "هزینه اضافی. از درصد استفاده نمایید"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.AdditionalFeePercentage.Hint", "تعیین اینکه آیا درصد هزینه های اضافی به کل سفارش اعمال شود. اگر فعال نشود ، یک مقدار ثابت استفاده می شود"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.ReturnFromMellatWithoutPaymentRedirectsToOrderDetailsPage", "بازگشت به صفحه جزئیات سفارش"); this.AddOrUpdatePluginLocaleResource("Plugins.Payments.Mellat.Fields.ReturnFromMellatWithoutPaymentRedirectsToOrderDetailsPage.Hint", "Enable if a customer should be redirected to the order details page when he clicks \"return to store\" link on Mellat site WITHOUT completing a payment"); base.Install(); }
public MellatPaymentProcessor( MellatPaymentSettings mellatPaymentSettings, ISettingService settingService, IWebHelper webHelper, IOrderTotalCalculationService orderTotalCalculationService, IOrderService orderService, IProductService productService, IProductAttributeService productAttributeService, HttpContextBase httpContext) { _mellatPaymentSettings = mellatPaymentSettings; _settingService = settingService; _webHelper = webHelper; _orderTotalCalculationService = orderTotalCalculationService; _orderService = orderService; _productService = productService; _productAttributeService = productAttributeService; _httpContext = httpContext; }
/// <summary> /// /// </summary> /// <param name="orderId"></param> /// <param name="installOrderId"></param> public void UpdateOrderId(int?orderId, int?installOrderId) { //settings var settings = new MellatPaymentSettings { OrderId = orderId ?? _mellatPaymentSettings.OrderId, TerminalId = _mellatPaymentSettings.TerminalId, UserName = _mellatPaymentSettings.UserName, UserPassword = _mellatPaymentSettings.UserPassword, AdditionalFee = _mellatPaymentSettings.AdditionalFee, BusinessEmail = _mellatPaymentSettings.BusinessEmail, AdditionalFeePercentage = _mellatPaymentSettings.AdditionalFeePercentage, ReturnFromMellatWithoutPaymentRedirectsToOrderDetailsPage = _mellatPaymentSettings.ReturnFromMellatWithoutPaymentRedirectsToOrderDetailsPage, InstallmentOrderId = installOrderId ?? _mellatPaymentSettings.InstallmentOrderId }; _settingService.SaveSetting(settings); }