コード例 #1
0
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            RandomStringGenerator RSG = new RandomStringGenerator();

            RSG.MinLowerCaseCharacters = 25;
            RSG.RepeatCharacters       = false;

            Debug.WriteLine(RSG.Generate(25));
            Debug.WriteLine("PostProcessPayment");

            var nfi        = new CultureInfo("en-US", false).NumberFormat;
            var url        = GetPaymentUrl();
            var gatewayUrl = new Uri(url);
            var post       = new RemotePost {
                Url = gatewayUrl.ToString(), Method = "POST"
            };
            var order       = postProcessPaymentRequest.Order;
            var merchTxnRef = RSG.Generate(25);
            var orderInfo   = RSG.Generate(25);

            post.Add("mid", "20130114001");
            post.Add("ref", merchTxnRef);
            post.Add("cur", "SGD");
            post.Add("amt", "20");
            post.Add("ccnum", "4111111111111111");

            post.Add("ccdate", "1511");
            post.Add("cccvv", "989");
            post.Add("paytype", "3");
            post.Add("transtype", "sale");

            post.Add("returnurl", "http://localhost:15536/onepagecheckout");

            post.Post();
        }
コード例 #2
0
ファイル: Program_backup.cs プロジェクト: terry2012/DSV
        public ActionResult CoinTosser(string token, int id)
        {
            var client = new WebClient();

            //protocol agnostic code
            CanonicalRequestResponse req = new CanonicalRequestResponse();

            req.token = token;
            req.id    = id;

            CanonicalRequestResponse req1 = agnosticVerifyTokenRequest(req);

            string OAuthResponse = FetchVerifyTokenResult(req1.token, req1.result);

            CanonicalRequestResponse resp1 = new CanonicalRequestResponse();

            resp1.result = OAuthResponse;

            agnosticFinalGamblingRequest(resp1);

            if (resp1.result != "")
            {
                ViewBag.result = req.result;
                //make a remote post back to gaming site
                RemotePost post = new RemotePost();
                post.FormName = "Cointoss";
                post.Url      = site_root + "/Home/Index";
                post.Method   = "POST";
                post.Add("result", OAuthResponse);
                post.Add("id", Convert.ToString(id));
                post.Post();
            }

            return(View());
        }
コード例 #3
0
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            string returnURL = CommonHelper.GetStoreLocation(false) + "WorldpayReturn.aspx";

            RemotePost remotePostHelper = new RemotePost();

            remotePostHelper.FormName = "WorldpayForm";
            remotePostHelper.Url      = GetWorldpayUrl();

            remotePostHelper.Add("instId", instanceID);
            remotePostHelper.Add("cartId", order.OrderID.ToString());
            remotePostHelper.Add("currency", "USD");
            remotePostHelper.Add("amount", order.OrderTotal.ToString(new CultureInfo("en-US", false).NumberFormat));
            remotePostHelper.Add("desc", SettingManager.StoreName);
            remotePostHelper.Add("M_UserID", order.CustomerID.ToString());
            remotePostHelper.Add("M_FirstName", order.BillingFirstName);
            remotePostHelper.Add("M_LastName", order.BillingLastName);
            remotePostHelper.Add("M_Addr1", order.BillingAddress1);
            remotePostHelper.Add("tel", order.BillingPhoneNumber);
            remotePostHelper.Add("M_Addr2", order.BillingAddress2);
            remotePostHelper.Add("M_Business", order.BillingCompany);

            StateProvince billingStateProvince = StateProvinceManager.GetStateProvinceByID(order.BillingStateProvinceID);

            if (billingStateProvince != null)
            {
                remotePostHelper.Add("M_StateCounty", billingStateProvince.Abbreviation);
            }
            else
            {
                remotePostHelper.Add("M_StateCounty", order.BillingStateProvince);
            }
            if (!useSandBox)
            {
                remotePostHelper.Add("testMode", "0");
            }
            else
            {
                remotePostHelper.Add("testMode", "100");
            }
            //TODO remotePostHelper.Add("testMode", "101");
            remotePostHelper.Add("postcode", order.BillingZipPostalCode);
            Country billingCountry = CountryManager.GetCountryByID(order.BillingCountryID);

            if (billingCountry != null)
            {
                remotePostHelper.Add("country", billingCountry.TwoLetterISOCode);
            }
            else
            {
                remotePostHelper.Add("country", order.BillingCountry);
            }
            remotePostHelper.Add("email", order.BillingEmail);
            remotePostHelper.Add("address", order.BillingAddress1 + "," + order.BillingCountry);
            remotePostHelper.Add("MC_callback", returnURL);
            remotePostHelper.Add("name", order.BillingFirstName + " " + order.BillingLastName);

            remotePostHelper.Post();
            return(string.Empty);
        }
コード例 #4
0
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            //create common query parameters for the request
            var queryParameters = CreateOxipayRequestPost(postProcessPaymentRequest);

            AddOrderTotalParameters(queryParameters, postProcessPaymentRequest);
            var hmacSignature = GenerateHMAC(queryParameters);

            var order      = postProcessPaymentRequest.Order;
            var gatewayUrl = new Uri(GetOxipayUrl());

            var remotePostHelper = new RemotePost
            {
                Url      = gatewayUrl.ToString(),
                Method   = "POST",
                FormName = "OxipayForm"
            };

            //queryParameters
            foreach (KeyValuePair <string, string> record in queryParameters)
            {
                remotePostHelper.Add(record.Key, record.Value);
            }
            ;
            // Add HMAC Signature to the request
            remotePostHelper.Add("x_signature", hmacSignature);
            _logger.InsertLog(LogLevel.Warning, remotePostHelper.Url, remotePostHelper.Method);
            remotePostHelper.Post();
        }
コード例 #5
0
        public void Demo(FormCollection form)
        {
            var firstName   = form["txtfirstname"];
            var amount      = form["txtamount"];
            var productInfo = form["txtprodinfo"];
            var email       = form["txtemail"];
            var phone       = form["txtphone"];
            var key         = ConfigurationManager.AppSettings["MERCHANT_KEY"];
            var salt        = ConfigurationManager.AppSettings["SALT"];

            var myremotepost = new RemotePost {
                Url = ConfigurationManager.AppSettings["PAYU_BASE_URL"] + "/_payment"
            };

            myremotepost.Add("key", key);
            myremotepost.Add("txnid", Generatetxnid());
            myremotepost.Add("amount", amount);
            myremotepost.Add("productinfo", productInfo);
            myremotepost.Add("firstname", firstName);
            myremotepost.Add("phone", phone);
            myremotepost.Add("email", email);
            myremotepost.Add("surl", "http://*****:*****@gmail.com|||||||||||mE2RxRwx";
            string hash = Generatehash512(hashString);

            //var hashString = key + "|" + Generatetxnid() + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|||||||||||" + salt;
            //var hash = Generatehash512(hashString);
            myremotepost.Add("hash", hash);
            myremotepost.Post();
        }
コード例 #6
0
        protected override void BuildPostForm(Order order, IndividualOrderCollection indOrders, decimal price, decimal shipping, Customer customer)
        {
            var remotePostHelper = new RemotePost {
                FormName = "AssistForm", Url = GetPaymentServiceUrl()
            };

            remotePostHelper.Add("Merchant_ID", "706403");
            remotePostHelper.Add("OrderNumber", order.OrderID.ToString());
            remotePostHelper.Add("OrderAmount", Math.Round(price + shipping).ToString());
            remotePostHelper.Add("OrderCurrency", ConvertToUsd ? "USD" : CurrencyId);
            remotePostHelper.Add("TestMode", IsTestMode? "1": "0");
            if (!String.IsNullOrEmpty(customer.BillingAddress.LastName))
            {
                remotePostHelper.Add("Lastname", customer.BillingAddress.LastName);
            }
            if (!String.IsNullOrEmpty(customer.BillingAddress.FirstName))
            {
                remotePostHelper.Add("Firstname", customer.BillingAddress.FirstName);
            }
            if (!String.IsNullOrEmpty(customer.BillingAddress.Email))
            {
                remotePostHelper.Add("Email", customer.BillingAddress.Email);
            }

            remotePostHelper.Add("URL_RETURN_OK", SettingManager.GetSettingValue("PaymentMethod.Assist.OkUrl"));
            remotePostHelper.Add("URL_RETURN_NO", SettingManager.GetSettingValue("PaymentMethod.Assist.NoUrl"));

            remotePostHelper.Post();
        }
コード例 #7
0
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="betting">betting</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(TransactionPayment transactionPayment)
        {
            RemotePost remotePostHelper = new RemotePost();

            remotePostHelper.FormName = "MoneybookersForm";
            remotePostHelper.Url      = GetMoneybookersUrl();

            remotePostHelper.Add("pay_to_email", payToEmail);
            remotePostHelper.Add("recipient_description", Constant.Payment.STORENAME);
            remotePostHelper.Add("transaction_id", transactionPayment.TransactionPaymentId.ToString());
            remotePostHelper.Add("cancel_url", CommonHelper.GetStoreLocation(false));
            remotePostHelper.Add("status_url", CommonHelper.GetStoreLocation(false) + "MoneybookersReturn.aspx");
            //supported moneybookers languages (EN, DE, ES, FR, IT, PL, GR, RO, RU, TR, CN, CZ or NL)
            remotePostHelper.Add("language", "EN");
            remotePostHelper.Add("amount", transactionPayment.TransactionPaymentTotal.ToString(new CultureInfo("en-US", false).NumberFormat));
            remotePostHelper.Add("currency", Constant.Payment.CURRENCYCODE);
            remotePostHelper.Add("detail1_description", "TransactionPayment ID:");
            remotePostHelper.Add("detail1_text", transactionPayment.TransactionPaymentId.ToString());

            remotePostHelper.Add("firstname", transactionPayment.Customer.FirstName);
            remotePostHelper.Add("lastname", transactionPayment.Customer.Language);
            remotePostHelper.Add("address", transactionPayment.Customer.Address);
            remotePostHelper.Add("phone_number", transactionPayment.Customer.Telephone);
            remotePostHelper.Add("postal_code", transactionPayment.Customer.PostalCode);
            remotePostHelper.Add("city", transactionPayment.Customer.City);
            //review later
            //Country billingCountry = IoC.Resolve<ICountryService>().GetCountryById(order.BillingCountryId);
            //if (billingCountry != null)
            //    remotePostHelper.Add("country", billingCountry.ThreeLetterIsoCode);
            //else
            remotePostHelper.Add("country", transactionPayment.Customer.Country.ToString());
            remotePostHelper.Post();
            return(string.Empty);
        }
コード例 #8
0
        //public ActionResult Update(int id)
        //{
        //    if (HttpContext.Request.RequestType == "POST")
        //    {
        //        // Request is Post type; must be a submit
        //        var name = Request.Form["name"];
        //        var address = Request.Form["address"];
        //        var trusted = Request.Form["trusted"];

        //        // Get all of the clients
        //        var clints = ClientsRecord.GetClients();

        //        foreach (ClientsRecord client in clints)
        //        {
        //            // Find the client
        //            if (client.ID == id)
        //            {
        //                // Client found, now update his properties and save it.
        //                client.Name = name;
        //                client.Address = address;
        //                client.Trusted = Convert.ToBoolean(trusted);
        //                // Break through the loop
        //                break;
        //            }
        //        }

        //        // Update the clients in the disk
        //        System.IO.File.WriteAllText(ClientsRecord.ClientFile, JsonConvert.SerializeObject(clints));

        //        // Add the details to the View
        //        Response.Redirect("~/Client/Index?Message=Client_Updated");
        //    }


        //    // Create a model object.
        //    var clnt = new ClientsRecord();
        //    // Get the list of clients
        //    var clients = ClientsRecord.GetClients();
        //    // Search within the clients
        //    foreach (ClientsRecord client in clients)
        //    {
        //        // If the client's ID matches
        //        if (client.ID == id)
        //        {
        //            clnt = client;
        //        }
        //        // No need to further run the loop
        //        break;
        //    }
        //    if (clnt == null)
        //    {
        //        // No client was found
        //        ViewBag.Message = "No client was found.";
        //    }
        //    return View(clnt);
        //}



        //public void Payment(int id, string amt)
        //{
        //    //string firstName = Session["UserName"].ToString();
        //    string firstName = SessionClass.Username;
        //    string amount = amt;
        //    string productInfo = Convert.ToString(id);
        //    string email = "";
        //    string phone = "";
        //    RemotePost myremotepost = new RemotePost();
        //    string key = "HKi5X9";
        //    string salt = "hUtCMrYk";
        //    myremotepost.Url = "https://secure.payu.in/_payment";
        //    myremotepost.Add("key", "HKi5X9");
        //    string txnid = Generatetxnid();
        //    myremotepost.Add("txnid", txnid);
        //    myremotepost.Add("amount", amount);
        //    myremotepost.Add("productinfo", productInfo);
        //    myremotepost.Add("firstname", firstName);
        //    myremotepost.Add("phone", phone);
        //    myremotepost.Add("email", email);
        //    myremotepost.Add("surl", "http://localhost:32607/UploadDownload/UploadFile");//Change the success url here depending upon the port number of your local system.
        //    //myremotepost.Add("furl", "http://www.vibration-service.com/Services/ServiceDetail");//Change the failure url here depending upon the port number of your local system.
        //    myremotepost.Add("furl", "http://www.vibration-service.com/Clients/ClientList");//Change the failure url here depending upon the port number of your local system.
        //    myremotepost.Url = "https://test.payumoney.com/payment/payment/chkMerchantTxnStatus?";
        //    myremotepost.Add("service_provider", "payu_paisa");
        //    string hashString = key + "|" + txnid + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|||||||||||" + salt;
        //    string hash = Generatehash512(hashString);
        //    myremotepost.Add("hash", hash);
        //    myremotepost.Post();
        //}
        /// <summary>
        /// this is for upload the data
        /// </summary>
        /// <param name="Amount"></param>
        public void Payment1(string Amount)
        {
            //bool sts = false;
            //string firstName = Session["UserName"].ToString();
            string     firstName    = SessionClass.Username;
            string     amount       = Amount;
            string     productInfo  = Convert.ToString(1);
            string     email        = "";
            string     phone        = "";
            RemotePost myremotepost = new RemotePost();
            string     key          = "HKi5X9";
            string     salt         = "hUtCMrYk";

            myremotepost.Url = "https://secure.payu.in/_payment";
            myremotepost.Add("key", "HKi5X9");
            string txnid = Generatetxnid();

            myremotepost.Add("txnid", txnid);
            myremotepost.Add("amount", amount);
            myremotepost.Add("productinfo", productInfo);
            myremotepost.Add("firstname", firstName);
            myremotepost.Add("phone", phone);
            myremotepost.Add("email", email);
            myremotepost.Add("surl", "http://www.vibration-service.com/UploadDownload/UploadFile"); //Change the success url here depending upon the port number of your local system.
            myremotepost.Add("furl", "http://www.vibration-service.com/UploadDownload/View1");      //Change the failure url here depending upon the port number of your local system.
            myremotepost.Add("service_provider", "payu_paisa");
            string hashString = key + "|" + txnid + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|||||||||||" + salt;
            string hash       = Generatehash512(hashString);

            myremotepost.Add("hash", hash);
            myremotepost.Post();
        }
コード例 #9
0
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            Uri gatewayUrl = new Uri(HostedPaymentSettings.GatewayUrl);

            RemotePost post = new RemotePost();

            post.FormName = "BeanstreamHostedPayment";
            post.Url      = gatewayUrl.ToString();
            post.Method   = "POST";

            post.Add("requestType", "BACKEND");
            post.Add("merchant_id", HostedPaymentSettings.MerchantId);
            post.Add("trnOrderNumber", order.OrderId.ToString());
            post.Add("trnAmount", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.OrderTotal));
            post.Add("errorPage", String.Format("{0}BeanstreamHostedPaymentReturn.aspx", CommonHelper.GetStoreLocation()));
            post.Add("approvedPage", String.Format("{0}BeanstreamHostedPaymentReturn.aspx", CommonHelper.GetStoreLocation()));

            post.Add("ordName", order.BillingFullName);
            post.Add("ordEmailAddress", order.BillingEmail);
            post.Add("ordPhoneNumber", order.BillingPhoneNumber);
            post.Add("ordAddress1", order.BillingAddress1);
            post.Add("ordPostalCode", order.BillingZipPostalCode);
            post.Add("ordCity", order.BillingCity);
            Country billCountry = IoC.Resolve <ICountryService>().GetCountryById(order.BillingCountryId);

            if (billCountry != null)
            {
                post.Add("ordCountry", billCountry.TwoLetterIsoCode);
            }
            StateProvince billState = IoC.Resolve <IStateProvinceService>().GetStateProvinceById(order.BillingStateProvinceId);

            if (billState != null)
            {
                post.Add("ordProvince", billState.Abbreviation);
            }

            if (order.ShippingStatus != ShippingStatusEnum.ShippingNotRequired)
            {
                post.Add("shipName", order.ShippingFullName);
                post.Add("shipEmailAddress", order.ShippingEmail);
                post.Add("shipPhoneNumber", order.ShippingPhoneNumber);
                post.Add("shipAddress1", order.ShippingAddress1);
                post.Add("shipPostalCode", order.ShippingZipPostalCode);
                post.Add("shipCity", order.ShippingCity);
                Country shipCountry = IoC.Resolve <ICountryService>().GetCountryById(order.ShippingCountryId);
                if (shipCountry != null)
                {
                    post.Add("shipCountry", shipCountry.TwoLetterIsoCode);
                }
                StateProvince shipState = IoC.Resolve <IStateProvinceService>().GetStateProvinceById(order.ShippingStateProvinceId);
                if (shipState != null)
                {
                    post.Add("shipProvince", shipState.Abbreviation);
                }
            }

            post.Post();

            return(String.Empty);
        }
コード例 #10
0
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            Uri gatewayUrl = new Uri(SimplePaySettings.GatewayUrl);

            RemotePost post = new RemotePost();

            post.FormName = "SimplePay";
            post.Url      = gatewayUrl.ToString();
            post.Method   = "POST";

            post.Add("immediateReturn", "1");
            post.Add(AmazonHelper.SIGNATURE_VERSION_KEYNAME, AmazonHelper.SIGNATURE_VERSION_2);
            post.Add(AmazonHelper.SIGNATURE_METHOD_KEYNAME, AmazonHelper.HMAC_SHA256_ALGORITHM);
            post.Add("accessKey", SimplePaySettings.AccessKey);
            post.Add("amount", String.Format(CultureInfo.InvariantCulture, "USD {0:0.00}", order.OrderTotal));
            post.Add("description", string.Format("{0}, {1}", SettingManager.StoreName, order.OrderId));
            post.Add("amazonPaymentsAccountId", SimplePaySettings.AccountId);
            post.Add("returnUrl", String.Format("{0}AmazonSimplePayReturn.aspx", CommonHelper.GetStoreLocation(false)));
            post.Add("processImmediate", (SimplePaySettings.SettleImmediately ? "1" : "0"));
            post.Add("referenceId", order.OrderId.ToString());
            post.Add(AmazonHelper.SIGNATURE_KEYNAME, AmazonHelper.SignParameters(post.Params, SimplePaySettings.SecretKey, post.Method, gatewayUrl.Host, gatewayUrl.AbsolutePath));


            post.Post();

            return(String.Empty);
        }
コード例 #11
0
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            var storeLocation = _webHelper.GetStoreLocation();

            var post = new RemotePost
            {
                FormName = "PayFast",
                Method   = "POST",
                Url      = string.Format("{0}/eng/process?", _payFastPaymentSettings.UseSandbox ? "https://sandbox.payfast.co.za" : "https://www.payfast.co.za")
            };

            post.Add("merchant_id", _payFastPaymentSettings.MerchantId);
            post.Add("merchant_key", _payFastPaymentSettings.MerchantKey);
            post.Add("return_url", string.Format("{0}checkout/completed/{1}", storeLocation, postProcessPaymentRequest.Order.Id));
            post.Add("cancel_url", string.Format("{0}orderdetails/{1}", storeLocation, postProcessPaymentRequest.Order.Id));
            post.Add("notify_url", string.Format("{0}Plugins/PaymentPayFast/PaymentResult", storeLocation));
            post.Add("m_payment_id", postProcessPaymentRequest.Order.OrderGuid.ToString());
            post.Add("amount", postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture));
            post.Add("item_name", string.Format("Order #{0}", postProcessPaymentRequest.Order.Id));
            if (postProcessPaymentRequest.Order.BillingAddress != null)
            {
                post.Add("name_first", postProcessPaymentRequest.Order.BillingAddress.FirstName);
                post.Add("name_last", postProcessPaymentRequest.Order.BillingAddress.LastName);
                post.Add("email_address", postProcessPaymentRequest.Order.BillingAddress.Email);
            }

            post.Post();
        }
コード例 #12
0
ファイル: WxPayPaymentProcessor.cs プロジェクト: wiksin/SuGa
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            //获取供运商ID
            ICollection <OrderItem> list         = postProcessPaymentRequest.Order.OrderItems;
            ConfigurationModel      wenxinConfig = new ConfigurationModel();
            var modelList = postProcessPaymentRequest.Order.OrderItems as List <OrderItem>;
            // var totalFee = postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture);
            var vendorId = modelList[0].Product.VendorId;
            var wenxin   = _vendorService.GetVendorById(vendorId);

            wenxinConfig.APPID     = wenxin.APPID.Trim();
            wenxinConfig.APPSECRET = wenxin.APPSECRET.Trim();
            wenxinConfig.KEY       = wenxin.KEY.Trim();
            wenxinConfig.MCHID     = wenxin.MCHID.Trim();
            wenxinConfig.IP        = postProcessPaymentRequest.Order.CustomerIp;
            OrderDetails orderdetails = new OrderDetails
            {
                Attach    = wenxin.Name,
                OrderId   = postProcessPaymentRequest.Order.Id,
                Body      = modelList[0].Product.Name,
                Detail    = modelList[0].Product.ShortDescription,
                ProductId = modelList[0].Product.Id.ToString(),
                Total_fee = (Convert.ToDouble(postProcessPaymentRequest.Order.OrderTotal) * 100).ToString()
            };

            wenxinConfig.orderDetails = orderdetails;
            NativePayHtml htmlPay = new NativePayHtml(wenxinConfig);
            string        htmPay  = htmlPay.GetHtmlPay();
            string        jsPay   = htmlPay.GetPayJs();
            var           post    = new RemotePost();

            post.Post(htmPay, jsPay);
        }
コード例 #13
0
        public ActionResult Payment(string Amount, string EnquiryId)
        {
            //bool sts = false;
            //string firstName = Session["UserName"].ToString();
            string     firstName    = SessionClass.Username;
            string     amount       = Amount;
            string     productInfo  = Convert.ToString(1);
            string     email        = "";
            string     phone        = "";
            RemotePost myremotepost = new RemotePost();
            string     key          = "HKi5X9";
            string     salt         = "hUtCMrYk";

            myremotepost.Url = "https://secure.payu.in/_payment";
            myremotepost.Add("key", "HKi5X9");
            string txnid = Generatetxnid();

            myremotepost.Add("txnid", txnid);
            myremotepost.Add("amount", amount);
            myremotepost.Add("productinfo", productInfo);
            myremotepost.Add("firstname", firstName);
            myremotepost.Add("phone", phone);
            myremotepost.Add("email", email);
            myremotepost.Add("surl", "http://www.vibration-service.com/Order/SendEnquiryDetailToClient?EnquiryId=" + EnquiryId); //Change the success url here depending upon the port number of your local system.
            myremotepost.Add("furl", "http://www.vibration-service.com/Order/fail");                                             //Change the failure url here depending upon the port number of your local system.
            myremotepost.Add("service_provider", "payu_paisa");
            string hashString = key + "|" + txnid + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|||||||||||" + salt;
            string hash       = Generatehash512(hashString);

            myremotepost.Add("hash", hash);
            myremotepost.Post();
            return(Json(new { status = "Success", message = "Success" }, JsonRequestBehavior.AllowGet));
        }
コード例 #14
0
ファイル: AliPayPaymentProcessor.cs プロジェクト: wiksin/SuGa
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            var sellerEmail = _aliPayPaymentSettings.SellerEmail;
            var key         = _aliPayPaymentSettings.Key;
            var partner     = _aliPayPaymentSettings.Partner;
            var outTradeNo  = postProcessPaymentRequest.Order.Id.ToString();
            var subject     = _storeContext.CurrentStore.Name;
            var body        = "Order from " + _storeContext.CurrentStore.Name;
            var totalFee    = postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture);
            var notifyUrl   = _webHelper.GetStoreLocation(false) + "Plugins/PaymentAliPay/Notify";
            var returnUrl   = _webHelper.GetStoreLocation(false) + "Plugins/PaymentAliPay/Return";
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("service", Service);
            sParaTemp.Add("partner", partner);
            sParaTemp.Add("seller_id", partner);
            sParaTemp.Add("_input_charset", Config.input_charset.ToLower());
            sParaTemp.Add("payment_type", Config.payment_type);
            sParaTemp.Add("notify_url", notifyUrl);
            sParaTemp.Add("return_url", returnUrl);
            sParaTemp.Add("anti_phishing_key", Config.anti_phishing_key);
            sParaTemp.Add("exter_invoke_ip", Config.exter_invoke_ip);
            sParaTemp.Add("out_trade_no", outTradeNo);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("total_fee", totalFee);
            sParaTemp.Add("body", body);
            string sHtmlText = Submit.BuildRequest(sParaTemp, "post", "确认");
            var    post      = new RemotePost();

            post.Post(sHtmlText);
        }
コード例 #15
0
ファイル: Program_backup.cs プロジェクト: terry2012/DSV
        public CanonicalRequestResponse agnosticSimplePayReq(CanonicalRequestResponse req)
        {
            CanonicalRequestResponse resp = new CanonicalRequestResponse();

            var bets = betDb.Bets;

            foreach (var b in bets)
            {
                betDb.Bets.Remove(b);
            }

            Bet bet = new Bet();

            bet.guess  = req.flip;
            bet.amount = req.price;
            betDb.Bets.Add(bet);
            betDb.SaveChanges();

            //protocol agnostic code
            GamblingSite.AccountID      = "*****@*****.**";
            GamblingSite.bets[0].guess  = req.flip;
            GamblingSite.bets[0].amount = req.price;

            resp.id    = 0;
            resp.price = req.price;
            resp.payee = "*****@*****.**";


            //Contract.Assert(GamblingSite.bets[0].amount == resp.price);

            //1. redirect to simplepay
            RemotePost post = new RemotePost();

            post.FormName = "SimplePay";
            post.Url      = "https://authorize.payments-sandbox.amazon.com/pba/paypipeline";
            post.Method   = "POST";

            post.Add("immediateReturn", "1");
            post.Add("signatureVersion", "2");
            post.Add("signatureMethod", "HmacSHA256");
            post.Add("accessKey", "AKIAJB4XJRGX6XRRVIDA");
            post.Add("amount", String.Format(CultureInfo.InvariantCulture, "USD {0:0.00}", req.price));
            post.Add("description", req.flip);
            post.Add("amazonPaymentsAccountId", "IGFCUTPWGXVM311K1E6QTXIQ1RPEIUG5PTIMUZ");
            post.Add("returnUrl", site_root + "/Home/SimplePayResp?path_digest=A[[HASH1()]]");
            post.Add("processImmediate", "1");
            post.Add("referenceId", Convert.ToString(bet.ID));
            //the entire msg is signed using the pre-decided simplepay secret key
            post.Add("signature", AmazonHelper.SignParameters(post.Params,
                                                              "WfZ3JnrY8mpJ8DZ7VlL07+RYtWznX3PWHNV8Zj5M", //simplePay secret key
                                                              post.Method,
                                                              "authorize.payments-sandbox.amazon.com",
                                                              "/pba/paypipeline"));
            post.Post();



            return(resp);
        }
コード例 #16
0
        /// <summary>
        /// Creates a payment transaction and returns the PayUMoney generated payment URL.
        /// </summary>
        /// <param name="returnUrl">The redirect url for PayUMoney callback to web store portal.</param>
        /// <param name="order">The order details for which payment needs to be made.</param>
        /// <returns>Payment URL from PayUMoney.</returns>
        public async Task <string> GeneratePaymentUriAsync(string returnUrl, OrderViewModel order)
        {
            returnUrl.AssertNotEmpty(nameof(returnUrl));
            order.AssertNotNull(nameof(order));
            RemotePost myremotepost = await PrepareRemotePost(order, returnUrl).ConfigureAwait(false);

            return(myremotepost.Post());
        }
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            try
            {
                ZarinPalService.PaymentGatewayImplementationService zps = new ZarinPalService.PaymentGatewayImplementationService();

                string ItemsDescription = "";
                foreach (OrderItem item in postProcessPaymentRequest.Order.OrderItems)
                {
                    ItemsDescription += item.Product.ShortDescription + "; ";
                }
                int result = zps.PaymentRequest(_zarinPalPaymentSettings.MerchantCode, Convert.ToInt32(postProcessPaymentRequest.Order.OrderTotal / 10), ItemsDescription, "", "", _zarinPalPaymentSettings.CallbackUrl, out string Authority);


                if (result == 100) // sussessful
                {
                    if (Authority.Length.Equals(36))
                    {
                        // ok to proceed
                        // after getting the number check for duplicate in db in case of fraud

                        var query = from or in _orderRepository.Table
                                    where or.AuthorizationTransactionCode == Authority
                                    select or;

                        if (query.Count() > 0)
                        {
                            // THIS CODE EXISTS,   H A L T   O P E R A T I O N
                            postProcessPaymentRequest.Order.PaymentStatus = PaymentStatus.Pending;
                            return;
                        }
                        else
                        {
                            // NO PREVIOUS RECORD OF REFNUM, CLEAR TO PROCEED
                            postProcessPaymentRequest.Order.AuthorizationTransactionCode = Authority;
                            _orderRepository.Update(postProcessPaymentRequest.Order);

                            var remotePostHelper = new RemotePost();
                            remotePostHelper.FormName = "form1";
                            remotePostHelper.Url      = "https://www.zarinpal.com/pg/StartPay/" + Authority;
                            //remotePostHelper.Add("RefId", strRefNum);
                            remotePostHelper.Post();
                        }
                    }
                }
                else
                {
                    _logger.Error("int returned from initial request is: " + result.ToString());
                    postProcessPaymentRequest.Order.PaymentStatus = PaymentStatus.Pending;
                    return;
                }
                //nothing
            }
            catch (Exception ex)
            {
                return;
            }
        }
コード例 #18
0
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            var orderTotal = postProcessPaymentRequest.Order.OrderTotal;
            var amount     = string.Format(CultureInfo.InvariantCulture, "{0:0.00}", orderTotal);
            var orderId    = postProcessPaymentRequest.Order.Id;
            var currency   = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId);
            var enumerator = 1;
            var storeUrl   = _webHelper.GetStoreLocation();

            var form = new RemotePost
            {
                FormName = "PayPoint",
                Url      = Constants.OK_PAYMENT_URL
            };

            //var ipnUrl = "https://www.nopcommerce.com/RecordQueryTest.aspx";
            var ipnUrl = string.Concat(storeUrl, "plugins/okpay/ipnhandler");

            var successUrl = string.Concat(storeUrl, "plugins/okpay/success");
            var failUrl    = string.Concat(storeUrl, "plugins/okpay/fail");

            form.Add(Constants.OK_IPN_URL_KEY, ipnUrl);
            form.Add(Constants.OK_RETURN_SUCCESS_URL_KEY, successUrl);
            form.Add(Constants.OK_RETURN_FAIL_URL_KEY, failUrl);

            form.Add(Constants.OK_RECEIVER_KEY, _okPayPaymentSettings.WalletId);

            form.Add(string.Format(Constants.OK_ITEM_NAME_FORMATED_KEY, enumerator), string.Format(_okPayPaymentSettings.OrderDescription, orderId));
            form.Add(string.Format(Constants.OK_ITEM_QTY_FORMATED_KEY, enumerator), "1");
            form.Add(string.Format(Constants.OK_ITEM_PRICE_FORMATED_KEY, enumerator), amount);

            form.Add(Constants.OK_KIND_KEY, "payment");
            form.Add(Constants.OK_INVOICE_KEY, orderId.ToString());
            form.Add(Constants.OK_CURRENCY_KEY, currency.CurrencyCode);
            form.Add(Constants.OK_FEES_KEY, _okPayPaymentSettings.Fees.ToString());

            if (_okPayPaymentSettings.PassBillingInfo)
            {
                var billingInfo = postProcessPaymentRequest.Order.BillingAddress;
                form.Add(Constants.OK_PAYER_FIRST_NAME_KEY, billingInfo.FirstName.ToTransliterate());
                form.Add(Constants.OK_PAYER_LAST_NAME_KEY, billingInfo.LastName.ToTransliterate());
                if (!string.IsNullOrEmpty(billingInfo.Company))
                {
                    form.Add(Constants.OK_PAYER_COMPANY_NAME_KEY, billingInfo.Company.ToTransliterate());
                }
                form.Add(Constants.OK_PAYER_EMAIL_KEY, billingInfo.Email.ToTransliterate());
                form.Add(Constants.OK_PAYER_PHONE_KEY, billingInfo.PhoneNumber.ToTransliterate());
                form.Add(Constants.OK_PAYER_COUNTRY_CODE_KEY, billingInfo.Country.TwoLetterIsoCode.ToTransliterate());
                form.Add(Constants.OK_PAYER_COUNTRY_KEY, billingInfo.Country.Name.ToTransliterate());
                form.Add(Constants.OK_PAYER_CITY_KEY, billingInfo.City.ToTransliterate());
                form.Add(Constants.OK_PAYER_STATE_KEY, billingInfo.StateProvince.Name);
                form.Add(Constants.OK_PAYER_STREET_KEY, billingInfo.Address1);
                form.Add(Constants.OK_PAYER_ZIP_KEY, billingInfo.ZipPostalCode);
            }

            form.Post();
        }
コード例 #19
0
ファイル: Default.aspx.cs プロジェクト: terry2012/DSV
        protected void Page_Load(object sender, EventArgs e)
        {
            // Code that runs when a new session is started

            //get the incoming request
            var         context = HttpContext.Current;
            HttpRequest req     = context.Request;

            RemotePost post = new RemotePost();

            post.FormName = "SimplePay";
            post.Url      = "https://www.sandbox.paypal.com/us/cgi-bin/webscr";
            post.Method   = "POST";

            //get info from nopcommerce submission form
            NameValueCollection queryString = Request.QueryString;
            var items = queryString.AllKeys.SelectMany(queryString.GetValues, (k, v) => new { key = k, value = v });

            foreach (var item in items)
            {
                if (item.key == "return" && queryString["tx"] == null) //Rui: request from store to PayPal
                {
                    if (queryString["path_digest"] != null)
                    {
                        post.Add(item.key, "http://protoagnostic.cloudapp.net:8002/pay.aspx?path_digest=" + queryString["path_digest"]);
                    }
                    else
                    {
                        post.Add(item.key, "http://protoagnostic.cloudapp.net:8002/pay.aspx");
                    }
                }
                else if (item.key == "path_digest")
                {
                    continue;
                }
                else
                {
                    post.Add(item.key, item.value);
                }
            }

            /*
             * post.Add("immediateReturn", "1");
             * post.Add("signatureVersion", "2");
             * post.Add("signatureMethod", "HmacSHA256");
             * post.Add("accessKey", "AKIAJB4XJRGX6XRRVIDA");
             * post.Add("amount", "USD 35.12");
             * post.Add("description", "Your store name, 9");
             * post.Add("amazonPaymentsAccountId", "IGFCUTPWGXVM311K1E6QTXIQ1RPEIUG5PTIMUZ");
             * post.Add("returnUrl", "http://localhost:8242/AmazonSimplePayReturn.aspx");
             * post.Add("processImmediate", "0");
             * post.Add("referenceId", "9");
             * post.Add("signature", "e6nHOQqZCC3BMXZ1veEVIzWfu5SQxUIJ7O6v2wjdpQw=");
             */

            post.Post();
        }
コード例 #20
0
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            //string gateway = "https://www.alipay.com/cooperate/gateway.do?";
            string service      = "create_forex_trade";
            string partner      = _aliPayPaymentSettings.Partner;
            string out_trade_no = postProcessPaymentRequest.Order.Id.ToString();
            string subject      = "Payment with AliPay";
            string body         = "Order from " + _storeContext.CurrentStore.Name;
            string total_fee    = postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture);

            string notify_url = _webHelper.GetStoreLocation(false) + "Plugins/PaymentAliPay/Notify";
            string return_url = _webHelper.GetStoreLocation(false) + "Plugins/PaymentAliPay/Return";

            var sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("partner", _aliPayPaymentSettings.Partner);
            sParaTemp.Add("_input_charset", Config.Input_charset.ToLower());
            sParaTemp.Add("service", "create_forex_trade");
            sParaTemp.Add("return_url", return_url);
            sParaTemp.Add("notify_url", notify_url);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("body", body);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("currency", postProcessPaymentRequest.Order.CustomerCurrencyCode);
            sParaTemp.Add("total_fee", total_fee);

            //BuildRequest(sParaTemp);

            //待签名请求参数数组
            var sPara = new Dictionary <string, string>();

            //过滤签名参数数组
            sPara = Core.FilterPara(sParaTemp);
            string sign = BuildRequestMysign(sPara);

            var post = new RemotePost();

            post.FormName = "alipaysubmit";
            post.Url      = "https://mapi.alipay.com/gateway.do?" + "_input_charset=" + _input_charset;
            post.Method   = "POST";

            post.Add("partner", partner);
            post.Add("_input_charset", Config.Input_charset.ToLower());
            post.Add("service", service);
            post.Add("return_url", return_url);
            post.Add("notify_url", notify_url);
            post.Add("subject", subject);
            post.Add("body", body);
            post.Add("out_trade_no", out_trade_no);
            post.Add("currency", postProcessPaymentRequest.Order.CustomerCurrencyCode);
            post.Add("total_fee", total_fee);

            post.Add("sign", sign);
            post.Add("sign_type", Config.Sign_type.Trim().ToUpper());

            post.Post();
        }
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            //string gateway = "https://www.alipay.com/cooperate/gateway.do?";

            var sellerEmail = _aliPayPaymentSettings.SellerEmail;
            var key         = _aliPayPaymentSettings.Key;
            var partner     = _aliPayPaymentSettings.Partner;
            var outTradeNo  = postProcessPaymentRequest.Order.Id.ToString();
            var subject     = _storeContext.CurrentStore.Name;
            var body        = "Order from " + _storeContext.CurrentStore.Name;
            var totalFee    = postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture);
            var notifyUrl   = _webHelper.GetStoreLocation(false) + "Plugins/PaymentAliPay/Notify";
            var returnUrl   = _webHelper.GetStoreLocation(false) + "Plugins/PaymentAliPay/Return";

            string[] para =
            {
                "service=" + Service,
                "partner=" + partner,
                "seller_email=" + sellerEmail,
                "out_trade_no=" + outTradeNo,
                "subject=" + subject,
                "body=" + body,
                "total_fee=" + totalFee,
                "show_url=" + ShowUrl,
                "payment_type=1",
                "notify_url=" + notifyUrl,
                "return_url=" + returnUrl,
                "_input_charset=" + InputCharset
            };

            var aliayUrl = CreatUrl(para, InputCharset, key);

            var post = new RemotePost
            {
                FormName = "alipaysubmit",
                Url      = "https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8",
                Method   = "POST"
            };

            post.Add("service", Service);
            post.Add("partner", partner);
            post.Add("seller_email", sellerEmail);
            post.Add("out_trade_no", outTradeNo);
            post.Add("subject", subject);
            post.Add("body", body);
            post.Add("total_fee", totalFee);
            post.Add("show_url", ShowUrl);
            post.Add("return_url", returnUrl);
            post.Add("notify_url", notifyUrl);
            post.Add("payment_type", "1");
            post.Add("sign", aliayUrl);
            post.Add("sign_type", SignType);

            post.Post();
        }
コード例 #22
0
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            var orderId     = postProcessPaymentRequest.Order.Id;
            var requestData = new Dictionary <string, string>();

            var requestUrl = _instamojoSettings.EndPoint;// "https://www.instamojo.com/api/1.1/payment-requests/";

            requestData.Add("buyer_name", postProcessPaymentRequest.Order.BillingAddress.FirstName);
            requestData.Add("email", postProcessPaymentRequest.Order.BillingAddress.Email);
            requestData.Add("phone", postProcessPaymentRequest.Order.BillingAddress.PhoneNumber);
            var nfi = new CultureInfo("en-US", false).NumberFormat;

            nfi.NumberDecimalDigits = 2;
            requestData.Add("amount", postProcessPaymentRequest.Order.OrderTotal.ToString("N", nfi));
            requestData.Add("purpose", postProcessPaymentRequest.Order.Id.ToString());
            requestData.Add("send_email", "false");
            requestData.Add("send_sms", "false");
            requestData.Add("redirect_url", _webHelper.GetStoreLocation(false) + "Plugins/PaymentInstamojo/Return");
            if (_webHelper.GetStoreLocation(false).Contains("localhost"))
            {
                requestData.Add("webhook", "https://www.meedo.in/Plugins/PaymentInstamojo/Return");
            }
            else
            {
                requestData.Add("webhook", _webHelper.GetStoreLocation(false) + "Plugins/PaymentInstamojo/Return");
            }


            try
            {
                string paymentUrl;
                using (var client = new HttpClient())
                {
                    client.DefaultRequestHeaders.Add("X-Api-Key", _instamojoSettings.ApiKey);       // "abd485fcdfe77d7fb1925ce4899e13fb");
                    client.DefaultRequestHeaders.Add("X-Auth-Token", _instamojoSettings.AuthToken); // "0057118ff55d97b222d7977a1a5f7ce0");
                    var task = client.PostAsync(requestUrl, new FormUrlEncodedContent(requestData));
                    task.Wait();
                    var     responseString = task.Result.Content.ReadAsStringAsync().Result;
                    JObject rss            = JObject.Parse(responseString);
                    paymentUrl = (string)rss["payment_request"]["longurl"];
                }
                var remotePostHelper = new RemotePost();
                remotePostHelper.FormName = "InstamojoForm";
                remotePostHelper.Url      = paymentUrl;
                remotePostHelper.Method   = "GET";
                remotePostHelper.Post();
            }
            catch (Exception ex)
            {
                //Send email SendPaymentFailedStoreOwnerNotification
                SendEmail(ex.ToString(), postProcessPaymentRequest);
                throw new Exception(ex.Message);
            }
        }
コード例 #23
0
ファイル: paypal.aspx.cs プロジェクト: Syssigm/Swamytrust
        protected void Pay()
        {
            RemotePost myremotepost = new RemotePost();

            myremotepost.Url = "https://www.paypal.com/cgi-bin/webscr";
            myremotepost.Add("business", "*****@*****.**");
            myremotepost.Add("cmd", "_xclick");
            myremotepost.Add("item_name", "Hot Sauce-12oz Bottle");
            myremotepost.Add("amount", Lblamt.Text);
            myremotepost.Add("currency_code", "USD");
            myremotepost.Post();
        }
コード例 #24
0
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            //string amount = postProcessPaymentRequest.Order.OrderTotal.ToString ("#.##");
            //amount.ToString ();
            var remotePostHelper     = new RemotePost();
            var remotePostHelperData = new Dictionary <string, string>();

            remotePostHelper.FormName = "PaytmForm";
            remotePostHelper.Url      = _PaytmPaymentSettings.PaymentUrl;
            remotePostHelperData.Add("MID", _PaytmPaymentSettings.MerchantId.ToString());
            remotePostHelperData.Add("WEBSITE", _PaytmPaymentSettings.Website.ToString());
            remotePostHelperData.Add("CHANNEL_ID", "WEB");
            remotePostHelperData.Add("INDUSTRY_TYPE_ID", _PaytmPaymentSettings.IndustryTypeId.ToString());
            remotePostHelperData.Add("TXN_AMOUNT", postProcessPaymentRequest.Order.OrderTotal.ToString("0.00"));
            remotePostHelperData.Add("ORDER_ID", postProcessPaymentRequest.Order.Id.ToString());
            remotePostHelperData.Add("EMAIL", postProcessPaymentRequest.Order.BillingAddress.Email);
            remotePostHelperData.Add("MOBILE_NO", postProcessPaymentRequest.Order.BillingAddress.PhoneNumber);
            remotePostHelperData.Add("CUST_ID", postProcessPaymentRequest.Order.BillingAddress.Email);
            remotePostHelperData.Add("CALLBACK_URL", _webHelper.GetStoreLocation(false) + "Plugins/PaymentPaytm/Return");

            //remotePostHelperData.Add("CALLBACK_URL", _PaytmPaymentSettings.CallBackUrl.ToString());
            // changes done by mayank --
            Dictionary <string, string> parameters = new Dictionary <string, string> ();

            foreach (var item in remotePostHelperData.Keys)
            {
                // below code snippet is mandatory, so that no one can use your checksumgeneration url for other purpose .
                if (remotePostHelperData[item].Trim().ToUpper().Contains("REFUND") || remotePostHelperData[item].Trim().Contains("|"))
                {
                    continue;
                }
                else
                {
                    parameters.Add(item, remotePostHelperData[item]);
                    remotePostHelper.Add(item, remotePostHelperData[item]);
                }
            }


            // changes end --
            try
            {
                string checksumHash = "";

                checksumHash = CheckSum.generateCheckSum(_PaytmPaymentSettings.MerchantKey, parameters);
                remotePostHelper.Add("CHECKSUMHASH", checksumHash);
                remotePostHelper.Post();
            }
            catch (Exception ep)
            {
                throw new Exception(ep.Message);
            }
        }
コード例 #25
0
        public List <ListEvents> getEvents()
        {
            RemotePost req = new RemotePost("http://tickets4you.dk/api/getEvents");

            req.Timeout = 3;

            req.Add("userSession", this.userSession);

            ListEvents[] le = JsonConvert.DeserializeObject <ListEvents[]>(req.Post());

            return(le.ToList <ListEvents>());
        }
コード例 #26
0
        private string PayUsingGateway(int userid, string userFirstName, string userEmail, string userPhoneNumber, int orderid)
        {
            var order = _shoppingCartRepository.GetOrder(userid, orderid);

            //  order.TransactionId = Guid.NewGuid().ToString("N");

            _shoppingCartRepository.UpdateAndSaveTransactionId(orderid, order);



            string firstName   = userFirstName;
            string amount      = order.OrderTotal.ToString();
            string productInfo = orderid.ToString();
            string email       = userEmail;
            string phone       = userPhoneNumber;
            string surl        = "http://www.vbuy.in/PayUResponseHandling.aspx";
            string furl        = "http://www.vbuy.in/PayUResponseHandling.aspx";



            string txnid = Generatetxnid();

            order.TransactionId = txnid;
            _shoppingCartRepository.UpdateAndSaveTransactionId(orderid, order);


            RemotePost myremotepost = new RemotePost();
            string     key          = "PAYUKEY";  //PAYUKEY
            string     salt         = "PAYUSALT"; //PAYUSALT

            //posting all the parameters required for integration.

            myremotepost.Url = "https://secure.payu.in/_payment";
            myremotepost.Add("key", "PAYUKEY");

            //  myremotepost.Add("txnid", orderid.ToString());
            myremotepost.Add("txnid", txnid);
            myremotepost.Add("amount", amount);
            myremotepost.Add("productinfo", productInfo);
            myremotepost.Add("firstname", firstName);
            myremotepost.Add("phone", phone);
            myremotepost.Add("email", email);
            myremotepost.Add("surl", surl); //Change the success url here depending upon the port number of your local system.
            myremotepost.Add("furl", furl); //Change the failure url here depending upon the port number of your local system.
            myremotepost.Add("service_provider", "payu_paisa");
            string hashString = key + "|" + txnid + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|||||||||||" + salt;
            //string hashString = "3Q5c3q|2590640|3053.00|OnlineBooking|vimallad|[email protected]|||||||||||mE2RxRwx";
            string hash = Generatehash512(hashString);

            myremotepost.Add("hash", hash);

            return(myremotepost.Post());
        }
コード例 #27
0
ファイル: PITPController.cs プロジェクト: FinnMacCumail/pitp
        public ActionResult Donate(FormView fw)
        {
            if (ModelState.IsValid)
            {
                string sentName;
                if (String.IsNullOrEmpty(fw.Name) || fw.Name == "Anonymous")
                {
                    sentName = "Anonymous";
                }
                else
                {
                    sentName = fw.Name;
                }

                formuser fu = new formuser
                {
                    Message    = fw.Message,
                    SubmitTime = DateTime.Now,
                    ppal       = new ppal
                    {
                        paid          = false,
                        sAmountPaid   = fw.amount,
                        transactionId = null
                    },
                    Name = sentName
                };

                pc.formusers.Add(fu);
                pc.SaveChanges();

                RemotePost myremotepost = new RemotePost();
                myremotepost.Url = "https://www.paypal.com/cgi-bin/webscr";
                //myremotepost.Url = "https://www.sandbox.paypal.com/cgi-bin/webscr";
                myremotepost.Add("cmd", "_donations");
                myremotepost.Add("item_name", "Party in the Park 2018 - Donation");
                // live paypal id
                myremotepost.Add("business", "AQF49WHBFF5XN");
                // sandbox id
                //myremotepost.Add("business", "56LULGKTVTCNL");
                myremotepost.Add("amount", fu.ppal.sAmountPaid.ToString());
                myremotepost.Add("no_note", "1");
                myremotepost.Add("currency_code", "GBP");
                myremotepost.Add("notify_url", "http://pitpnxd.co.uk/ipn/receive");
                myremotepost.Add("custom", fu.ID.ToString());
                myremotepost.Add("return", "http://pitpnxd.co.uk/paypal/thankyou");
                myremotepost.Post();
                return(View());
            }
            else
            {
                return(View(fw));
            }
        }
コード例 #28
0
        protected void Pay()
        {
            RemotePost myremotepost = new RemotePost();

            myremotepost.Url = "https://www.paypal.com/cgi-bin/webscr";
            myremotepost.Add("business", "*****@*****.**");
            myremotepost.Add("cmd", "_xclick");
            myremotepost.Add("item_name", "ShaktiPrabha Magazine");
            myremotepost.Add("amount", Lblamt.Text);
            myremotepost.Add("currency_code", "USD");
            myremotepost.Post();
        }
コード例 #29
0
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            CultureInfo cultureInfo = new CultureInfo(NopContext.Current.WorkingLanguage.LanguageCulture);

            string language = cultureInfo.TwoLetterISOLanguageName;
            string amount   = (order.OrderTotal * 100).ToString("0", CultureInfo.InvariantCulture);   //NOTE: Primary store should be changed to DKK, if you do not have internatinal agreement with pbs and quickpay. Otherwise you need to do currency conversion here.

            string currencyCode = IoC.Resolve <ICurrencyService>().PrimaryStoreCurrency.CurrencyCode; //NOTE: Primary store should be changed to DKK, if you do not have internatinal agreement with pbs and quickpay. Otherwise you need to do currency conversion here.
            string protocol     = "3";
            string autocapture  = "0";
            string cardtypelock = IoC.Resolve <ISettingManager>().GetSettingValue(QuickPayConstants.SETTING_CREDITCARD_CODE_PROPERTY, "dankort");
            bool   useSandBox   = IoC.Resolve <ISettingManager>().GetSettingValueBoolean(QuickPayConstants.SETTING_USE_SANDBOX);
            string testmode     = (useSandBox) ? "1" : "0";
            string continueurl  = CommonHelper.GetStoreLocation(false) + "CheckoutCompleted.aspx";
            string cancelurl    = CommonHelper.GetStoreLocation(false) + "QuickpayCancel.aspx";
            string callbackurl  = CommonHelper.GetStoreLocation(false) + "QuickpayReturn.aspx";
            string merchant     = IoC.Resolve <ISettingManager>().GetSettingValue(QuickPayConstants.SETTING_MERCHANTID);
            string ipaddress    = NopContext.Current.UserHostAddress;
            string msgtype      = "authorize";
            string md5secret    = IoC.Resolve <ISettingManager>().GetSettingValue(QuickPayConstants.SETTING_MD5SECRET);
            string ordernumber  = FormatOrderNumber(order.OrderId.ToString());

            string stringToMd5 = string.Concat(protocol, msgtype, merchant,
                                               language, ordernumber, amount, currencyCode, continueurl,
                                               cancelurl, callbackurl, autocapture, cardtypelock,
                                               ipaddress, testmode, md5secret);
            string md5check = GetMD5(stringToMd5);

            RemotePost remotePostHelper = new RemotePost();

            remotePostHelper.FormName = "QuickPay";
            remotePostHelper.Url      = "https://secure.quickpay.dk/form/";
            remotePostHelper.Add("protocol", protocol);
            remotePostHelper.Add("msgtype", msgtype);
            remotePostHelper.Add("merchant", merchant);
            remotePostHelper.Add("language", language);
            remotePostHelper.Add("ordernumber", ordernumber);
            remotePostHelper.Add("amount", amount);
            remotePostHelper.Add("currency", currencyCode);
            remotePostHelper.Add("continueurl", continueurl);
            remotePostHelper.Add("cancelurl", cancelurl);
            remotePostHelper.Add("callbackurl", callbackurl);
            remotePostHelper.Add("autocapture", autocapture);
            remotePostHelper.Add("cardtypelock", cardtypelock);
            remotePostHelper.Add("testmode", testmode);
            remotePostHelper.Add("ipaddress", ipaddress);
            remotePostHelper.Add("md5check", md5check);


            remotePostHelper.Post();
            return(string.Empty);
        }
コード例 #30
0
        /// <summary>
        /// Post process payment (used by payment gateways that require redirecting to a third-party URL)
        /// </summary>
        /// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
        public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
        {
            var baseUrl = _MinburPaymentPaymentSettings.UseSandbox ?
                          "https://1.requestcatcher.com/us/cgi-bin/webscr/sandbox/" :
                          "https://1.requestcatcher.com/us/cgi-bin/webscr";

            //create common query parameters for the request
            var queryParameters = CreateQueryParameters(postProcessPaymentRequest);

            //whether to include order items in a transaction
            if (_MinburPaymentPaymentSettings.PassProductNamesAndTotals)
            {
                //add order items query parameters to the request
                var parameters = new Dictionary <string, string>(queryParameters);
                AddItemsParameters(parameters, postProcessPaymentRequest);

                //remove null values from parameters
                parameters = parameters.Where(parameter => !string.IsNullOrEmpty(parameter.Value))
                             .ToDictionary(parameter => parameter.Key, parameter => parameter.Value);

                //ensure redirect URL doesn't exceed 2K chars to avoid "too long URL" exception
                var redirectUrl = QueryHelpers.AddQueryString(baseUrl, parameters);
                if (redirectUrl.Length <= 2048)
                {
                    _httpContextAccessor.HttpContext.Response.Redirect(redirectUrl);
                    return;
                }
            }

            //or add only an order total query parameters to the request
            AddOrderTotalParameters(queryParameters, postProcessPaymentRequest);

            //remove null values from parameters
            queryParameters = queryParameters.Where(parameter => !string.IsNullOrEmpty(parameter.Value))
                              .ToDictionary(parameter => parameter.Key, parameter => parameter.Value);

            var url = QueryHelpers.AddQueryString(baseUrl, queryParameters);

            _httpContextAccessor.HttpContext.Response.Redirect(url);


            var post = new RemotePost
            {
                FormName = "alipaysubmit",
                Url      = "https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8",
                Method   = "POST"
            };

            post.Add("sign_type", "imza");

            post.Post();
        }
コード例 #31
0
ファイル: PaymentController.cs プロジェクト: Burima/LYSApp
        public void RedirectToPayumoney(BookingDetailsViewModel bookingDetailsViewModel)
        {
            var user = SessionManager.GetSessionUser();
            var searchCriteria = (SearchViewModel)Session["SearchCriteria"];
            if (user == null && user.Id == 0)
            {
                //user session time out
            }
            else if (searchCriteria == null && searchCriteria.BookingFromDate == null)
            {
                //search criteria is removed...redirect user for search again
            }
            else
            {
                string txnid = Generatetxnid();
                //transaction management
                if (transactionManagement.AddTransaction(bookingDetailsViewModel, txnid, user.Id, searchCriteria.BookingFromDate) > 1)
                {
                    string firstName = user.FirstName;
                    string amount = bookingDetailsViewModel.Price.ToString();
                    string productInfo = bookingDetailsViewModel.RoomID.ToString();
                    string email = user.Email;
                    string phone = user.PhoneNumber;
                    string surl = Url.Action("Payment", "Success");
                    string furl = Url.Action("Payment", "Success");

                    RemotePost myremotepost = new RemotePost();

                    string key = LYSConfig.PayUmoneyKey;
                    string salt = LYSConfig.PayUmoneySalt;

                    //posting all the parameters required for integration.
                    myremotepost.Url = LYSConfig.PayUmoneyRedirectURL;
                    myremotepost.Add("key", key);
                    myremotepost.Add("txnid", txnid);
                    myremotepost.Add("amount", bookingDetailsViewModel.Price.ToString());
                    myremotepost.Add("productinfo", productInfo);
                    myremotepost.Add("firstname", firstName);
                    myremotepost.Add("phone", phone);
                    myremotepost.Add("email", email);
                    myremotepost.Add("surl", surl);//Change the success url here depending upon the port number of your local system.
                    myremotepost.Add("furl", furl);//Change the failure url here depending upon the port number of your local system.
                    myremotepost.Add("service_provider", "payu_paisa");
                    string hashString = key + "|" + txnid + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|||||||||||" + salt;
                    //string hashString = "3Q5c3q|2590640|3053.00|OnlineBooking|vimallad|[email protected]|||||||||||mE2RxRwx";
                    string hash = Generatehash512(hashString);
                    myremotepost.Add("hash", hash);

                    myremotepost.Post();
                }
                else
                {
                    //bed not available
                }
            }
        }
コード例 #32
0
        public void Post()
        {
             var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
             {
            string firstName = Name;
            string amount = Totalamount;
            string productInfo = "Test";
            string email = Email;
            string phone = mobile;
            string surl = "";
            string furl = "";

            RemotePost myremotepost = new RemotePost();
            string key = "JBZaLc";
            string salt = "GQs7yium";
            myremotepost.Url = "https://test.payu.in/_payment";
            myremotepost.Add("key", "JBZaLc");
            string txnid = await Generatetxnid();
            myremotepost.Add("txnid", txnid);
            myremotepost.Add("amount", amount);
            myremotepost.Add("productinfo", productInfo);
            myremotepost.Add("firstname", firstName);
            myremotepost.Add("phone", phone);
            myremotepost.Add("email", email);
            myremotepost.Add("surl", "http://sdsdsdsd");//Change the success url here depending upon the port number of your local system.
            myremotepost.Add("furl", "http://www.google.com");//Change the failure url here depending upon the port number of your local system.
            myremotepost.Add("service_provider", "payu_paisa");
            string hashString = key + "|" + txnid + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|||||||||||" + salt;
            await Generatehash512(hashString);
            //string hashString = "3Q5c3q|2590640|3053.00|OnlineBooking|vimallad|[email protected]|||||||||||mE2RxRwx";
            string hash = await Generatehash512(hashString);
            myremotepost.Add("hash", hash);
            myremotepost.PostURL();
             }).AsTask();
        }
コード例 #33
0
    private void SepeteUrunEkleSayfayaGit()
    {
        RemotePost urlPost = new RemotePost();
        urlPost.Url = ResolveUrl( string.Format("{0}/Market/Sepet.aspx?user=ok", ConfigurationManager.AppSettings["sslSitePath"]));
        urlPost.Add("urunId", ViewState["urunId"]);
        urlPost.Add("sagAdet", ViewState["sagAdet"]);
        urlPost.Add("solAdet", ViewState["solAdet"]);
        urlPost.Add("sagBilgi", ViewState["sagBilgi"]);
        urlPost.Add("solBilgi", ViewState["solBilgi"]);
        urlPost.Add("hediyeId", ViewState["hediyeId"]);
        urlPost.Add("hediyeBilgi", ViewState["hediyeBilgi"]);

        urlPost.Post();
    }