/// <summary>
        /// Get Authorization header for the request
        /// </summary>
        /// <param name="settings">G2APay payment settings</param>
        /// <returns>Value of header</returns>
        protected string GetAuthHeader(G2APayPaymentSettings settings = null)
        {
            var g2apayPaymentSettings = settings ?? _g2apayPaymentSettings;
            var stringToHash          = string.Format("{0}{1}{2}", g2apayPaymentSettings.ApiHash, g2apayPaymentSettings.MerchantEmail, g2apayPaymentSettings.SecretKey);

            return(string.Format("{0};{1}", g2apayPaymentSettings.ApiHash, GetSHA256Hash(stringToHash)));
        }
        /// <summary>
        /// Get Authorization header for the request
        /// </summary>
        /// <param name="settings">G2A Pay payment settings</param>
        /// <returns>Value of header</returns>
        protected string GetAuthHeader(G2APayPaymentSettings settings = null)
        {
            var g2APayPaymentSettings = settings ?? _g2APayPaymentSettings;
            var stringToHash          = $"{g2APayPaymentSettings.ApiHash}{g2APayPaymentSettings.MerchantEmail}{g2APayPaymentSettings.SecretKey}";

            return($"{g2APayPaymentSettings.ApiHash};{GetSHA256Hash(stringToHash)}");
        }
 public G2APayPaymentProcessor(CurrencySettings currencySettings,
                               G2APayPaymentSettings g2apayPaymentSettings,
                               HttpContextBase httpContext,
                               ICurrencyService currencyService,
                               ILocalizationService localizationService,
                               ILogger logger,
                               IOrderTotalCalculationService orderTotalCalculationService,
                               ISettingService settingService,
                               IWebHelper webHelper)
 {
     this._currencySettings      = currencySettings;
     this._g2apayPaymentSettings = g2apayPaymentSettings;
     this._httpContext           = httpContext;
     this._currencyService       = currencyService;
     this._localizationService   = localizationService;
     this._logger = logger;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._settingService = settingService;
     this._webHelper      = webHelper;
 }
 public G2APayPaymentProcessor(CurrencySettings currencySettings,
                               G2APayPaymentSettings g2APayPaymentSettings,
                               IHttpContextAccessor httpContextAccessor,
                               ICurrencyService currencyService,
                               ILocalizationService localizationService,
                               ILogger logger,
                               IOrderTotalCalculationService orderTotalCalculationService,
                               IPageHeadBuilder pageHeadBuilder,
                               ISettingService settingService,
                               IWebHelper webHelper)
 {
     this._currencySettings      = currencySettings;
     this._g2APayPaymentSettings = g2APayPaymentSettings;
     this._httpContextAccessor   = httpContextAccessor;
     this._currencyService       = currencyService;
     this._localizationService   = localizationService;
     this._logger = logger;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._pageHeadBuilder = pageHeadBuilder;
     this._settingService  = settingService;
     this._webHelper       = webHelper;
 }
        /// <summary>
        /// Gets G2A Pay REST API URL
        /// </summary>
        /// <param name="settings">G2A Pay payment settings</param>
        /// <returns>URL</returns>
        protected string GetG2APayRestUrl(G2APayPaymentSettings settings = null)
        {
            var g2APayPaymentSettings = settings ?? _g2APayPaymentSettings;

            return(g2APayPaymentSettings.UseSandbox ? "https://www.test.pay.g2a.com" : "https://pay.g2a.com");
        }