コード例 #1
0
 public string GenerateSuccessScript()
 {
     if (SuccessUrl.IsNotNullAndEmpty() && SuccessTarget.IsNotNullAndEmpty())
     {
         return(string.Format("$.get('{0}', function(data){{ $('{1}').html(data); }})", SuccessUrl, SuccessTarget));
     }
     else
     {
         return(null);
     }
 }
コード例 #2
0
        public override string ProcessResponse(HttpContext context)
        {
            var req = context.Request;

            Debug.LogError(req.Url.AbsoluteUri);

            if (SuccessUrl.Contains(req.RawUrl))
            {
                return(Resources.Resource.Client_Payment_SuccessfullyPaid);
            }

            // Параметр LMI_SECRET_KEY передается только по https. Без https проверка неполучится. Раскомментировать если требуется проверка.
            if (context.Request.IsSecureConnection && !CheckData(req))
            {
                return(NotificationMessahges.InvalidRequestData);
            }


            var paymentNumber = req["lmi_payment_no"];
            int orderID;

            if (int.TryParse(paymentNumber, out orderID))
            {
                var order = OrderService.GetOrder(orderID);
                if (order != null && req["LMI_PAYMENT_AMOUNT"] == string.Format("{0:0.00}", order.Sum / CurrencyValue).Replace(",", "."))
                {
                    if (req["LMI_PREREQUEST"] == "1")
                    {
                        return("YES");
                    }
                    else
                    {
                        OrderService.PayOrder(orderID, true);
                        return(NotificationMessahges.SuccessfullPayment(order.Number));
                    }
                }
            }
            return(NotificationMessahges.Fail);
        }
コード例 #3
0
ファイル: HttpRequest.cs プロジェクト: DimQ1/URLChecker
        public static async Task BrutForceAsync(string webUrl)
        {
            await Task.Run(() =>
            {
                WebRequest webRequest = WebRequest.Create(webUrl);
                try
                {
                    webRequest.Method = "HEAD";

                    HttpWebResponse webresponse = webRequest.GetResponse() as HttpWebResponse;

                    logger.Info($"ok| {webresponse.StatusCode:D}|{webUrl}");

                    SuccessUrl?.Invoke(webUrl);

                    webresponse.Dispose();
                }
                catch (Exception e)
                {
                    webRequest = null;
                    logger.Error(e, $"{e.Message}|{webUrl}");
                }
            });
        }
コード例 #4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Source != null)
         {
             hashCode = hashCode * 59 + Source.GetHashCode();
         }
         if (Amount != null)
         {
             hashCode = hashCode * 59 + Amount.GetHashCode();
         }
         if (Currency != null)
         {
             hashCode = hashCode * 59 + Currency.GetHashCode();
         }
         if (PaymentType != null)
         {
             hashCode = hashCode * 59 + PaymentType.GetHashCode();
         }
         hashCode = hashCode * 59 + Reference.GetHashCode();
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Customer != null)
         {
             hashCode = hashCode * 59 + Customer.GetHashCode();
         }
         if (BillingDescriptor != null)
         {
             hashCode = hashCode * 59 + BillingDescriptor.GetHashCode();
         }
         if (Shipping != null)
         {
             hashCode = hashCode * 59 + Shipping.GetHashCode();
         }
         if (ThreeDS != null)
         {
             hashCode = hashCode * 59 + ThreeDS.GetHashCode();
         }
         if (PreviousPaymentId != null)
         {
             hashCode = hashCode * 59 + PreviousPaymentId.GetHashCode();
         }
         if (Risk != null)
         {
             hashCode = hashCode * 59 + Risk.GetHashCode();
         }
         if (SuccessUrl != null)
         {
             hashCode = hashCode * 59 + SuccessUrl.GetHashCode();
         }
         if (FailureUrl != null)
         {
             hashCode = hashCode * 59 + FailureUrl.GetHashCode();
         }
         if (PaymentIp != null)
         {
             hashCode = hashCode * 59 + PaymentIp.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #5
0
        /// <summary>
        /// Returns true if PaymentRequest instances are equal
        /// </summary>
        /// <param name="other">Instance of PaymentRequest to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PaymentRequest <TPaymentSource> other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Source == other.Source ||
                     Source != null &&
                     Source.Equals(other.Source)
                     ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     Currency == other.Currency ||
                     Currency != null &&
                     Currency.Equals(other.Currency)
                 ) &&
                 (
                     PaymentType == other.PaymentType ||
                     PaymentType != null &&
                     PaymentType.Equals(other.PaymentType)
                 ) &&
                 (
                     Reference == other.Reference ||
                     Reference != null &&
                     Reference.Equals(other.Reference)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Customer == other.Customer ||
                     Customer != null &&
                     Customer.Equals(other.Customer)
                 ) &&
                 (
                     BillingDescriptor == other.BillingDescriptor ||
                     BillingDescriptor != null &&
                     BillingDescriptor.Equals(other.BillingDescriptor)
                 ) &&
                 (
                     Shipping == other.Shipping ||
                     Shipping != null &&
                     Shipping.Equals(other.Shipping)
                 ) &&
                 (
                     ThreeDS == other.ThreeDS ||
                     ThreeDS != null &&
                     ThreeDS.Equals(other.ThreeDS)
                 ) &&
                 (
                     PreviousPaymentId == other.PreviousPaymentId ||
                     PreviousPaymentId != null &&
                     PreviousPaymentId.Equals(other.PreviousPaymentId)
                 ) &&
                 (
                     Risk == other.Risk ||
                     Risk != null &&
                     Risk.Equals(other.Risk)
                 ) &&
                 (
                     SuccessUrl == other.SuccessUrl ||
                     SuccessUrl != null &&
                     SuccessUrl.Equals(other.SuccessUrl)
                 ) &&
                 (
                     FailureUrl == other.FailureUrl ||
                     FailureUrl != null &&
                     FailureUrl.Equals(other.FailureUrl)
                 ) &&
                 (
                     PaymentIp == other.PaymentIp ||
                     PaymentIp != null &&
                     PaymentIp.Equals(other.PaymentIp)
                 ));
        }