Example #1
0
        public override string ProcessJavascript(Order order)
        {
            int orderItemsCount = 0;
            string orderItems = "";

            var subtotal = order.OrderItems.Sum(item => item.Amount * item.Price);

            // сумма налогов не включенных в стоимость товара
            var taxTotal = TaxServices.GetOrderTaxes(order.OrderID).Where(t => !t.TaxShowInPrice).Sum(t => t.TaxSum);
            var totalDiscount = (float)Math.Round(subtotal / 100 * order.OrderDiscount, 2);

            foreach (var item in order.OrderItems)
            {
                var percent = item.Price * item.Amount * 100 / subtotal;

                item.Price += percent * taxTotal / (100 * item.Amount);
                item.Price -= percent * totalDiscount / (100 * item.Amount);

                orderItemsCount++;
                orderItems += string.Format("&TC_{0}={1}&TPr_{0}={2}&TName_{0}={3}",
                                            orderItemsCount, item.Amount, item.Price.ToString("F"), HttpUtility.UrlEncode(item.Name));
            }

            var shippingCost = order.ShippingCost / order.OrderCurrency.CurrencyValue;

            if (shippingCost > 0)
            {
                orderItemsCount++;
                orderItems += string.Format("&TC_{0}={1}&TPr_{0}={2}&TName_{0}={3}",
                                            orderItemsCount, 1, ((float)Math.Round(shippingCost)).ToString("F"), HttpUtility.UrlEncode("Доставка"));
            }

            var link = String.Format("https://anketa.bank.rs.ru/minipotreb.php?idTpl={0}&TTName={1}&Order={2}&TCount={3}{4}&UserName={5}&UserLastName={6}&UserMail={7}",
                                        PartnerId,
                                        SettingsMain.SiteUrl.Replace("http://", ""),
                                        order.OrderID,
                                        orderItemsCount,
                                        orderItems,
                                        order.OrderCustomer.FirstName,
                                        order.OrderCustomer.LastName,
                                        order.OrderCustomer.Email != "admin" ? order.OrderCustomer.Email : "");

            var sb = new StringBuilder();

            sb.Append("<script type=\"text/javascript\"> ");
            sb.AppendLine("function openrsbcredit() {{");
            sb.AppendFormat("window.open(\"{0}\", \"_blank\");\r\n", link);
            sb.AppendLine("}} ");
            sb.AppendLine("</script>");

            return sb.ToString();
        }
Example #2
0
        public override string ProcessJavascript(Order order)
        {
            var sb = new StringBuilder();
            sb.AppendLine("<script src=\"http://yes-credit.su/crem/js/jquery-ui-1.8.23.custom.min.js\" type=\"text/javascript\"></script>");
            sb.AppendLine("<script src=\"http://yes-credit.su/crem/js/crem.js\" type=\"text/javascript\"></script>");
            sb.AppendLine("<link href=\"http://yes-credit.su/crem/css/blizter.css\" rel=\"stylesheet\" type=\"text/css\" />");

            sb.AppendLine("<script type=\"text/javascript\"> ");
            sb.AppendFormat("var ycProducts = {0};\r\n", GetOrderJson(order));
            sb.AppendFormat("var ycMerchantId = {0};\r\n", MerchantId);
            sb.AppendFormat("var ycOrderId = \"{0}\";\r\n", order.OrderID);
            sb.AppendLine("</script>");

            return sb.ToString();
        }
Example #3
0
 public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
 {
     return new PaymentFormHandler
     {
         Url = "http://www.interkassa.com/lib/payment.php",
         InputValues = new Dictionary<string, string>
                               {
                                   {"ik_shop_id", ShopId},
                                   {"ik_payment_amount", order.Sum.ToString("F2").Replace(",",".")},
                                   {"ik_payment_id", order.OrderID.ToString()},
                                   {"ik_payment_desc", GetOrderDescription(order.Number)},
                                   {"ik_paysystem_alias", ""}
                               }
     }.ProcessRequest();
 }
Example #4
0
 public override void ProcessForm(Order order)
 {
     new PaymentFormHandler
         {
             Url = Sandbox ? "https://au.ewaygateway.com/Request/" : "https://www.eway.com.au/gateway/payment.asp",
             InputValues = new Dictionary<string, string>
                               {
                                   {"ewayCustomerID", CustomerID},
                                   {"eWAYURL", SuccessUrl},
                                   {"ewayTotalAmount", ((order.Sum / CurrencyValue) * 100) .ToString("F0")},
                                   {"ewayCustomerInvoiceDescription", Resources.Resource.Client_OrderConfirmation_PayOrder + " #" + order.OrderID},
                                   {"ewayTrxnNumber", order.Number}
                               }
         }.Post();
 }
Example #5
0
 public override void ProcessForm(Order order)
 {
     new PaymentFormHandler
     {
         Url = "http://www.interkassa.com/lib/payment.php",
         InputValues = new Dictionary<string, string>
                               {
                                   {"ik_shop_id", ShopId},
                                   {"ik_payment_amount", order.Sum.ToString("F2").Replace(",",".")},
                                   {"ik_payment_id", order.OrderID.ToString()},
                                   {"ik_payment_desc", GetOrderDescription(order.Number)},
                                   {"ik_paysystem_alias", ""}
                               }
     }.Post();
 }
Example #6
0
 public override void ProcessForm(Order order)
 {
     new PaymentFormHandler
     {
         Url = "https://bitpay.com/api/invoice/",
         InputValues = new Dictionary<string, string>
                               {
                                   //{"posData", GetPosData(order.OrderItems)},
                                   {"price", order.Sum.ToString("F2").Replace(",", ".")},
                                   {"currency", Currency},
                                   {"orderID", order.OrderID.ToString()},
                                   {"itemDesc", string.Format(Resources.Resource.Payment_OrderDescription, order.Number)},
                                   {"physical", "true"}
                               }
     }.Post();
 }
Example #7
0
        public override void ProcessForm(Order order)
        {
            var sum = (order.Sum / CurrencyValue).ToString("F2").Replace(",", ".");
            string message = "Orderid=" + order.OrderID + "&Amount=" + sum + "&Currency=" + "&PaymentDetails=" + "&Email=" + "&FirstName=" +
                             "&LastName=" + "&MiddleName=none&Phone=" + "&Address=" + "&Language=" + "&return_url=";

            new PaymentFormHandler
             {
                 Url = "https://card.cyberplat.ru/cgi-bin/getform.cgi",
                 InputValues = new Dictionary<string, string>
                                      {
                                          {"version", "2.0"},
                                          {"message", message}
                                      }
             }.Post();
        }
Example #8
0
 public override void ProcessForm(Order order)
 {
     var values = new Dictionary<string, string>
         {
             {"amount", order.Sum.ToString("F2").Replace(',', '.')},
             {"description", GetOrderDescription(order.Number)},
             {"site", Site},
             //{"email", Email},
             {"merchant_order_id", order.OrderID.ToString()}
         };
     values.Add("checksum", GetCheckSum(values));
     new PaymentFormHandler
     {
         FormName = "_xclick",
         Method = FormMethod.POST,
         Url = string.Format("https://{0}/pay", TestMode ? "simpleapi.sandbox.gateline.net:18610" : "simpleapi.gateline.net"),
         InputValues = values
     }.Post();
 }
Example #9
0
        public override void ProcessForm(Order order)
        {
            var formHandler = new PaymentFormHandler
                {
                    Url = "https://sci.interkassa.com/",
                    InputValues = new Dictionary<string, string>
                        {
                            {"ik_co_id", ShopId},
                            {"ik_pm_no", order.OrderID.ToString()},
                            {"ik_am", (order.Sum / order.OrderCurrency.CurrencyValue).ToString("F2").Replace(",", ".")},
                            {"ik_desc", GetOrderDescription(order.Number)},
                            {"ik_cur", order.OrderCurrency.CurrencyCode}
                        }
                };

            if (IsCheckSign)
                formHandler.InputValues.Add("ik_sign", GetSign(formHandler.InputValues));

            formHandler.Post();
        }
Example #10
0
 public override void ProcessForm(Order order)
 {
     new PaymentFormHandler
     {
         FormName = "_xclick",
         Method = FormMethod.POST,
         Url = "https://Merchant.IntellectMoney.ru/",
         InputValues = new Dictionary<string, string>
                               {
                                   {"lmi_payee_purse", MerchantId},
                                   {"LMI_PAYMENT_AMOUNT", order.Sum.ToString("F2").Replace(",", ".")},
                                   {"LMI_PAYMENT_DESC", GetOrderDescription(order.Number) },
                                   {"LMI_PAYMENT_NO", order.OrderID.ToString() },
                                   {"lmi_result_url", NotificationUrl },
                                   {"lmi_success_url", SuccessUrl },
                                   {"lmi_success_method", "1"}, // POST
                                   {"lmi_fail_url", FailUrl },
                                   {"lmi_fail_method", "1"}, // POST
                                   //{"lmi_expire_date", System.DateTime.Now.AddDays(10).ToString("yyyyMMdd hh:MM:ss")}, // Срок действия СКО
                                   //{"lmi_sim_mode", Sandbox ? "1" : "0"},
                                   //{"EMAIL", order.OrderCustomer.Email},
                               }
     }.Post();
 }
Example #11
0
        public override void ProcessForm(Order order)
        {
            Dictionary<string, string> dict = new Dictionary<string, string>
                {
                    {"sid", Sid},
                    {"mode", "2CO"},
                    //{"cart_order_id", order.Number},
                    //{"merchant_order_id", order.Number},
                    //{"total", (order.Sum/CurrencyValue).ToString("F2").Replace(",", ".")},
                    {"demo", Sandbox ? "Y" : "N"},
                    //{"return_url", SuccessUrl},
                    //{"x_receipt_link_url", SuccessUrl},
                    //{"id_type", "1"},
                    //{"lang", "en"}
                };

            for( int i=0; i< order.OrderItems.Count; i++)
            {
                dict.Add("li_" + i + "_type", "product");
                dict.Add("li_" + i + "_name", order.OrderItems[i].Name.Replace(">", "").Replace("<", ""));
                dict.Add("li_" + i + "_quantity", order.OrderItems[i].Amount.ToString());
                dict.Add("li_" + i + "_price", order.OrderItems[i].Price.ToString("F2"));
                dict.Add("li_" + i + "_tangible", "Y");
            }

            new PaymentFormHandler
                {
                    Url = "https://www.2checkout.com/checkout/purchase",
                    InputValues = dict
                }.Post();
        }
Example #12
0
        public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
        {
            var sum = (order.Sum / CurrencyValue).ToString("F2").Replace(",", ".");
            var shopName = Configuration.SettingsMain.ShopName;
            if (shopName.Length > 30)
                shopName = shopName.Substring(0, 26) + "...";
            return new PaymentFormHandler
              {
                  Url = Url,
                  Page = page,
                  InputValues = new Dictionary<string, string>
                                      {
                                          {"pay_to_email", PayToEmai },
                                          {"recipient_description", shopName },
                                          {"transaction_id",order.OrderID.ToString()},
                                          {"return_url", SuccessUrl},
                                          {"cancel_url", CancelUrl},
                                          {"status_url", NotificationUrl},
                                          {"language","en_US" },
                                          {"amount",sum },
                                          {"currency", CurrencyCode },
                                          {"detail1_description", "Order ID:"},
                                          {"detail1_text", order.OrderID.ToString()},

                                      }
              }.ProcessRequest();
        }
Example #13
0
        private string GetOrderJson(Order order)
        {
            var orderItems = order.OrderItems;

            float subtotal = order.OrderItems.Sum(item => item.Amount * item.Price);

            // сумма налогов не включенных в стоимость товара
            var taxTotal = TaxServices.GetOrderTaxes(order.OrderID).Where(t => !t.TaxShowInPrice).Sum(t => t.TaxSum);
            float totalDiscount = (float)Math.Round(subtotal / 100 * order.OrderDiscount, 2);

            foreach (var item in orderItems)
            {
                var percent = item.Price * item.Amount * 100 / subtotal;

                item.Price += percent * taxTotal / (100 * item.Amount);
                item.Price -= percent * totalDiscount / (100 * item.Amount);
            }

            var shopCartItems = orderItems.Select(item => new
            {
                model = item.Name,
                count = item.Amount,
                price = (float)Math.Round(item.Price * item.Amount)
            }).ToList();

            var shippingCost = order.ShippingCost / order.OrderCurrency.CurrencyValue;

            if (shippingCost > 0)
            {
                shopCartItems.Add(new
                {
                    model = "Доставка",
                    count = 1F,
                    price = (float)Math.Round(shippingCost)
                });
            }

            return JsonConvert.SerializeObject(shopCartItems);
        }
Example #14
0
 public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
 {
     var paymentNo = order.OrderID.ToString();
     var sum = string.Format("{0:0.00}", order.Sum / CurrencyValue);
     return new PaymentFormHandler
      {
          Url = Url,
          Page = page,
          InputValues = new Dictionary<string, string>
                         {
                             {"merchant", Merchant},
                             {"trans_id", paymentNo},
                             {"amount", sum},
                             {"callback", SuccessUrl},
                             {"currency", CurrencyCode},
                             {"digest", (paymentNo + sum + Password).Md5()}
                         }
      }.ProcessRequest();
 }
Example #15
0
 public override void ProcessForm(Order order)
 {
     var sum = String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.Sum);
     new PaymentFormHandler
     {
         Url = Url,
         InputValues = new Dictionary<string, string>
                               {
                                   {"product_id", ProductId  },
                                   {"product_name",ProductName },
                                   {"product_price",sum},
                                   {"product_price_currency",order.OrderCurrency.CurrencyCode },
                                   {"cb_url", NotificationUrl},
                                   {"decline_url", CancelUrl},
                                   {"cb_type", "P"},
                                   {"cs1",order.OrderID.ToString()},
                                   {"sign",String.Format("{0}-{1}-{2}", ProductId, sum, SharedSecret).Md5()}
                               }
     }.Post();
 }
Example #16
0
 public override void ProcessForm(Order order)
 {
     var paymentNo = order.OrderID.ToString();
     var sum = (order.Sum / CurrencyValue).ToString("F2").Replace(",", ".");
     new PaymentFormHandler
     {
         Url = Url,
         InputValues = new Dictionary<string, string>
                               {
                                   {"LMI_PAYEE_PURSE", Purse},
                                   {"LMI_PAYMENT_NO", paymentNo},
                                   {"LMI_PAYMENT_DESC", "Order #" + order.OrderID},
                                   {"LMI_PAYMENT_AMOUNT", sum},
                                   {"ZP_SIGN", GetSign(paymentNo,sum)}
                               }
     }.Post();
 }
Example #17
0
 public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
 {
     var paymentNo = order.OrderID.ToString();
     var sum = (order.Sum / CurrencyValue).ToString("F2").Replace(",", ".");
     return new PaymentFormHandler
       {
           Url = Url,
           Page = page,
           InputValues = new Dictionary<string, string>
                               {
                                   {"LMI_PAYEE_PURSE", Purse},
                                   {"LMI_PAYMENT_NO", paymentNo},
                                   {"LMI_PAYMENT_DESC", Resources.Resource.Client_OrderConfirmation_PayOrder + " #" + order.OrderID},
                                   {"LMI_PAYMENT_AMOUNT", sum},
                                   {"ZP_SIGN", GetSign(paymentNo,sum)}
                               }
       }.ProcessRequest(true);
 }
Example #18
0
        public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
        {
            var sum = (order.Sum * CurrencyValue).ToString("F2").Replace(",", ".");
            var description = GetOrderDescription(order.Number);
            var issuer_id = order.OrderID.ToString();

            var inputValues = new Dictionary<string, string>
                                  {
                                      {"shop_id", ShopID},
                                      {"currency", CurrencyCode},
                                      {"sum", sum},
                                      {"description", description},
                                      {"message", description},
                                      {"issuer_id", issuer_id}
                                  };
            if (KeepUnique) inputValues.Add("keep_uniq", "1");
            inputValues.Add("signature", GetSignature(CurrencyCode + description + issuer_id + (KeepUnique ? "1" : string.Empty) + description + ShopID + sum + CryptoHex));

            return new PaymentFormHandler
              {
                  FormName = "_xclick",
                  Method = FormMethod.POST,
                  Page = page,
                  //Url = "https://demoney.mail.ru/pay/light/", test accaunt
                  Url = "https://money.mail.ru/pay/light/",
                  InputValues = inputValues,
              }.ProcessRequest();
        }
Example #19
0
 public override void ProcessForm(Order order)
 {
     var paymentNo = order.OrderID.ToString();
     var sum = string.Format("{0:0.00}", order.Sum / CurrencyValue);
     new PaymentFormHandler
     {
         Url = Url,
         InputValues = new Dictionary<string, string>
                         {
                             {"merchant", Merchant},
                             {"trans_id", paymentNo},
                             {"amount", sum},
                             {"callback", SuccessUrl},
                             {"currency", CurrencyCode},
                             {"digest", (paymentNo + sum + Password).Md5()}
                         }
     }.Post();
 }
Example #20
0
 public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
 {
     var paymentNo = order.OrderID.ToString();
     var sum = (order.Sum / CurrencyValue).ToString("F2").Replace(",", ".");
     var tempRandomString = new Guid().ToString();
     return new PaymentFormHandler
       {
           Url = Url,
           Page = page,
           InputValues = new Dictionary<string, string>
                               {
                                   {"pg_amount", sum},
                                   {"pg_currency", Currency},
                                   {"pg_description",Resources.Resource.Client_OrderConfirmation_PayOrder + " #" +order.OrderID},
                                   {"pg_merchant_id", MerchantId},
                                   {"pg_order_id", paymentNo},
                                   {"pg_salt", tempRandomString},
                                   {"pg_sig", GetSignature("payment.php"+Separator
                                                            + sum + Separator
                                                            + Currency + Separator
                                                            + Resources.Resource.Client_OrderConfirmation_PayOrder + " #" + order.OrderID + Separator
                                                            + MerchantId + Separator
                                                            + paymentNo + Separator
                                                            + tempRandomString )}
                               }
       }.ProcessRequest();
 }
Example #21
0
        public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
        {
            var paymentNo = order.OrderID.ToString();
            var sum = string.Format("{0:0.00}", order.Sum / CurrencyValue);
            var description = string.Format("Order #{0} payment", order.Number);

              return  new PaymentFormHandler
            {
                Url = Url,
                Page = page,
                InputValues = new Dictionary<string, string>
                                {

                                    {"VPSProtocol", "2.23"},
                                    {"TxType", "PAYMENT"},
                                    {"Vendor", Vendor},
                                    {"VendorTxCode", paymentNo},
                                    {"Amount", sum},
                                    {"Currency", CurrencyCode},
                                    {"Description", description},
                                    {"SuccessURL", SuccessUrl},
                                    {"FailureURL", FailUrl},
                                    {"Crypt", GetCrypt(paymentNo, sum, CurrencyCode, description, SuccessUrl, FailUrl)}
                                }
            }.ProcessRequest();
        }
Example #22
0
        public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
        {
            int index = 0;
            if (!string.IsNullOrEmpty(order.BillingContact.Name)) index = order.BillingContact.Name.IndexOf(" ");
            string first_name = string.Empty;
            string last_name = string.Empty;
            if (index > 0)
            {
                first_name = order.BillingContact.Name.Substring(0, index).Trim();
                last_name = order.BillingContact.Name.Substring(index + 1).Trim();
            }
            else
                first_name = order.BillingContact.Name.Trim();

            return new PaymentFormHandler
               {
                   FormName = "_xclick",
                   Method = FormMethod.POST,
                   Url = GetUrl(),
                   Page = page,
                   InputValues = new Dictionary<string, string>
                                      {
                                          {"cmd", Command},
                                          {"business", EMail},
                                          {"charset", "utf-8"},
                                          {"currency_code", CurrencyCode},
                                          {"item_name", string.Format("Order #{0}", order.OrderID)},
                                          {"invoice", order.Number},
                                          {"amount", CurrencyService.ConvertCurrency(ShowTaxAndShipping ? order.Sum - order.TaxCost - order.ShippingCost : order.Sum, CurrencyValue,order.OrderCurrency.CurrencyValue).ToString("F2").Replace(",", ".")},
                                          {"tax", CurrencyService.ConvertCurrency(ShowTaxAndShipping ? order.TaxCost : 0, CurrencyValue,order.OrderCurrency.CurrencyValue).ToString("F2").Replace(",", ".")},
                                          {"shipping", CurrencyService.ConvertCurrency(ShowTaxAndShipping ? order.ShippingCost : 0, CurrencyValue,order.OrderCurrency.CurrencyValue).ToString("F2").Replace(",", ".")},
                                          {"address1", (order.BillingContact.Address ?? string.Empty).Replace("\n", "")},
                                          {"city", order.BillingContact.City ?? string.Empty},
                                          {"country", AdvantShop.Repository.CountryService.GetIso2(order.BillingContact.Country ?? string.Empty) ?? string.Empty},
                                          {"lc", AdvantShop.Repository.CountryService.GetIso2(order.BillingContact.Country ?? string.Empty) ?? string.Empty},
                                          //{"email", order.BillingContact.Email ?? string.Empty},
                                          {"email", order.OrderCustomer .Email ?? string.Empty},
                                          {"first_name", first_name ?? string.Empty},
                                          {"last_name", last_name ?? string.Empty},
                                          {"zip", order.BillingContact.Zip ?? string.Empty},
                                          {"state", order.BillingContact.Zone ?? string.Empty},
                                          {"return", SuccessUrl},
                                          {"notify_url", NotificationUrl},
                                          {"cancel_return", CancelUrl}
                                      }
               }.ProcessRequest();
        }
Example #23
0
 public override string ProcessJavascriptButton(Order order)
 {
     return "yescreditmodul(ycProducts, ycMerchantId, ycOrderId);";
 }
Example #24
0
        public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
        {
            var paymentNo = order.OrderID.ToString();
            var sum = string.Format("{0:0.00}", order.Sum / CurrencyValue);
            var description = string.Format("Order #{0} payment", order.Number);

            return new PaymentFormHandler
              {
                  Url = Url,
                  Page = page,
                  InputValues = new Dictionary<string, string>
                                      {

                                          {"instId", InstID.ToString()},
                                          {"cartId", paymentNo},
                                          {"Amount", sum},
                                          {"currency", CurrencyCode},
                                          {"desc", description},
                                          {"SuccessURL", SuccessUrl},
                                          {"FailureURL", FailUrl},
                                          //FIELDS TO ENCRYPTION instId:amount:currency:cartId
                                          {"signature", (InstID.ToString() + sum + CurrencyCode + paymentNo).Md5()},
                                          {"MC_code", (sum + CurrencyCode + paymentNo).Md5()}
                                      }
              }.ProcessRequest();
        }
Example #25
0
 public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
 {
     return new PaymentFormHandler
      {
          Url = "https://merchant.webmoney.ru/lmi/payment.asp",
          Page = page,
          InputValues = new Dictionary<string, string>
                               {
                                   {"LMI_PAYEE_PURSE", Purse},
                                   {"LMI_PAYMENT_NO", order.OrderID.ToString()},
                                   {"LMI_PAYMENT_DESC", Resources.Resource.Client_OrderConfirmation_PayOrder + " #" + order.OrderID},
                                   {"LMI_PAYMENT_AMOUNT", (order.Sum / CurrencyValue).ToString("F2").Replace(",",".")},
                                   {"LMI_RESULT_URL", NotificationUrl},
                                   {"LMI_SUCCESS_URL", SuccessUrl},
                                   {"LMI_SUCCESS_METHOD", "LINK"},
                                   {"LMI_FAIL_URL", FailUrl},
                                   {"LMI_FAIL_METHOD", "LINK"}
                               }
      }.ProcessRequest(true);
 }
Example #26
0
        public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
        {
            var paymentNo = order.OrderID.ToString();
            var sum = (order.Sum / CurrencyValue).ToString("F2").Replace(",", ".");

            return new PaymentFormHandler
                {
                    Url = Url,
                    Page = page,
                    InputValues = new Dictionary<string, string>
                                      {
                                          {"MerchantId", MerchantId},
                                          {"OrderId", paymentNo},
                                          {"Amount",sum},
                                          {"Currency",Currency},
                                          {"SecurityKey",GetMd5("MerchantId="+MerchantId+"&OrderId="+paymentNo+"&Amount="+sum+"&Currency="+Currency+"&PrivateSecurityKey="+SecretKey) },
                                          {"ReturnUrl", HttpUtility.UrlDecode(SuccessUrl)},
                                          {"FailUrl", HttpUtility.UrlDecode(FailUrl)}
                                         }
                }.ProcessRequest();
        }
Example #27
0
 public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
 {
     string sum = (order.Sum * CurrencyValue).ToString("#0.##").Replace(',', '.');
     // порядок из формата
     var values = new Dictionary<string, string>
         {
             {"AMOUNT", sum},
             {"CURRENCY", CurrencyLabel},
             {"ORDER", GetOrderIdString(order.OrderID)},
             {"DESC", string.Format("order #{0} payment", order.Number)},
             {"MERCH_NAME", MerchName},
             {"MERCH_URL", SettingsMain.SiteUrl.ToLower()},
             {"MERCHANT", Merchant},
             {"TERMINAL", Terminal},
             {"EMAIL", Email},
             {"TRTYPE", "1"},
             {"COUNTRY", Culture.Language == Culture.ListLanguage.Russian ? "RU" : "EN"},
             {"MERCH_GMT", (DateTime.Now - DateTime.UtcNow).Hours.ToString()},
             {"TIMESTAMP", DateTime.UtcNow.ToString("yyyyMMddHHmmss")},
             {"NONCE", GenerateNonce()},
             {"BACKREF", SuccessUrl}
         };
     values.Add("P_SIGN", GetPSign(values));
     return new PaymentFormHandler
     {
         FormName = "_xclick",
         Method = FormMethod.POST,
         Page = page,
         Url = "https://3ds2.mmbank.ru/cgi-bin/cgi_link",
         InputValues = values
     }.ProcessRequest();
 }
Example #28
0
        public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
        {
            int sequence = new Random().Next(0, 1000);

            // a time stamp is generated (using a function from simlib.asp)
            int timeStamp = SQLDataHelper.GetInt((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds);

            //generate a fingerprint
            string fingerprint = HMAC_MD5(TransactionKey,
                                          Login + "^" + sequence + "^" + timeStamp + "^" + order.Sum + "^");

            //TODO deal with POST

              return  new PaymentFormHandler
            {
                FormName = "_xclick",
                Method = FormMethod.POST,
                Page = page,
                Url =
                    string.Format("https://{0}/gateway/transact.dll",
                                  Sandbox ? "test.authorize.net" : "secure.authorize.net"),
                InputValues = new Dictionary<string, string>
                                      {
                                          {"x_login", Login},
                                          {"x_fp_sequence", sequence.ToString()},
                                          {"x_fp_timestamp", timeStamp.ToString()},
                                          {"x_fp_hash", fingerprint},
                                          {"x_relay_url", SuccessUrl},
                                          {"x_invoice_num", order.Number},
                                          {"x_test_request", "false"},
                                          {"x_show_form", "PAYMENT_FORM"},
                                          {"x_description", string.Format("Order #{0}", order.Number)},
                                          {"x_amount", order.Sum.ToString()},
                                          {"x_first_name", order.OrderCustomer.FirstName},
                                          {"x_last_name", order.OrderCustomer.LastName},
                                          {"x_address", order.BillingContact.Address},
                                          {"x_city", order.BillingContact.City},
                                          {"x_zip", order.BillingContact.Zip},
                                          {"x_phone", order.OrderCustomer.MobilePhone},
                                          {"x_email", order.OrderCustomer .Email},
                                      }
            }.ProcessRequest();
        }
Example #29
0
 /*
  * MerchantXid - Идентификатор Партнера в системе Куппи.ру (выдается Куппи.ру)
  * ExternalProjectID - Идентификатор Проекта, для которого Клиент запрашивает оплату услуг
  * ExternalProjectName - Наименование проекта, для которого Клиент запрашивает оплату услуг
  * ExternalUserID - Идентификатор Клиента в Проекте (username, игровой ник и т.п.)
  * CurrencySid - Тип валюты (USD, RUR)
  * MerchantOrderNo - Уникальный номер Заказа в систему Партнера
  * Amount - Сумма заказа
  * NotifyIfFailed - Флаг, указывающий, требуется ли уведомлять (вызовом PayNotification) о неудачной операции или нет (default=False)
  * IsTestMode - Флаг, указывающий, используется ли тестовый режим
  * SecurityKey - md5 в ASCII кодировке от {MerchantOrderNo}+{NowUtc}+{PrivateSecurityKey}+{Amount}+{ExternalUserId}+{IsTestMode}
  * ExtraParams- Дополнительные параметры (не обяз.)
  */
 public override void ProcessForm(Order order)
 {
     new PaymentFormHandler
     {
         Url = "http://www.qppi.ru/Pay/Listener",
         InputValues = new Dictionary<string, string>
                               {
                                   {"MerchantXid", MerchantXid},
                                   {"PrivateSecurityKey", PrivateSecurityKey},
                                   {"ExternalProjectID", order.OrderID.ToString()},
                                   {"ExternalProjectName", ExternalProjectName},
                                   {"ExternalUserID", order.OrderCustomer.Email},
                                   {"CurrencySid", "RUR"},
                                   {"MerchantOrderNo", order.OrderID.ToString()},
                                   {"Amount", order.Sum.ToString()},
                                   {"IsTestMode", Sandbox.ToString()},
                                   {"SecurityKey", string.Format("{0}{1}{2}{3}{4}{5}", order.OrderID, DateTime.Now.ToString("yyyyMMddHHmmss"), PrivateSecurityKey, order.Sum, order.OrderCustomer.Email, Sandbox).Md5(false, Encoding.ASCII)},
                                   {"NowUtc", DateTime.Now.ToString("yyyyMMddHHmmss")}
                               }
     }.Post();
 }
Example #30
0
        public override string ProcessFormString(Order order, PaymentService.PageWithPaymentButton page)
        {
            string sum = System.Math.Round((order.Sum * CurrencyValue), 1).ToString().Replace(",", ".");
            if (CheckMd5)
            {
                return new PaymentFormHandler
                 {
                     FormName = "_xclick",
                     Method = FormMethod.GET,
                     Page = page,
                     Url = "http://secure.onpay.ru/pay/" + FormPay,
                     InputValues = new Dictionary<string, string>
                                      {
                                          {"url_success", SuccessUrl},
                                          {"pay_mode", "fix"},
                                          {"price", sum},
                                          {"currency", CurrencyLabel},
                                          {"pay_for", order.OrderID.ToString()},
                                          {
                                             "md5",
                                             ("fix" + sum + ";" + CurrencyLabel + ";" + order.Number + ";yes;" + SecretKey).Md5()
                                             }
                                      }
                 }.ProcessRequest();
            }

            else
            {
                return new PaymentFormHandler
                 {
                     FormName = "_xclick",
                     Method = FormMethod.GET,
                     Page = page,
                     Url = "http://secure.onpay.ru/pay/" + FormPay,
                     InputValues = new Dictionary<string, string>
                                      {
                                          {"url_success", SuccessUrl},
                                          {"pay_mode", "fix"},
                                          {"price", sum},
                                          {"currency", CurrencyLabel},
                                          {"pay_for", order.OrderID.ToString()}
                                      }
                 }.ProcessRequest();
            }
        }