コード例 #1
0
        public string BuildQueryString()
        {
            Dictionary <string, string> queryParams = new Dictionary <string, string>();

            queryParams["id"]          = this._smsId.ToString();
            queryParams["msg"]         = this._message;
            queryParams["transaction"] = CryptoUtility.CalculateMD5(this._signPassword + "|" + this._smsId);
            string queryString = HttpQueryUtility.BuildQueryString(queryParams);

            return(queryString);
        }
コード例 #2
0
        public string BuildRequestUrl(MacroRequest request)
        {
            string data = request.ToBase64String();
            string sign = CryptoUtility.CalculateMD5(data + this._signPassword);

            Dictionary <string, string> requestQueryParams = new Dictionary <string, string>();

            requestQueryParams["data"] = data;
            requestQueryParams["sign"] = sign;

            string requestQuery = HttpQueryUtility.BuildQueryString(requestQueryParams);

            return(Client.PAY_URL + "?" + requestQuery);
        }
コード例 #3
0
        public string ToBase64String()
        {
            Dictionary <string, string> dataQueryParams = new Dictionary <string, string>();

            dataQueryParams["projectid"]        = this._projectId.ToString();
            dataQueryParams["orderid"]          = this._orderId;
            dataQueryParams["accepturl"]        = this._acceptUrl;
            dataQueryParams["cancelurl"]        = this._cancelUrl;
            dataQueryParams["callbackurl"]      = this._callbackUrl;
            dataQueryParams["version"]          = this._version;
            dataQueryParams["lang"]             = this._language;
            dataQueryParams["amount"]           = HttpQueryUtility.ToQueryParameter(this._amount);
            dataQueryParams["currency"]         = this._currency;
            dataQueryParams["payment"]          = this._payment;
            dataQueryParams["country"]          = this._country;
            dataQueryParams["paytext"]          = this._payText;
            dataQueryParams["p_firstname"]      = this._paypalFirstName;
            dataQueryParams["p_lastname"]       = this._paypalLastName;
            dataQueryParams["p_email"]          = this._email;
            dataQueryParams["p_street"]         = this._paypalStreet;
            dataQueryParams["p_city"]           = this._paypalCity;
            dataQueryParams["p_state"]          = this._paypalState;
            dataQueryParams["p_zip"]            = this._paypalZip;
            dataQueryParams["p_countrycode"]    = this._paypalCountryCode;
            dataQueryParams["time_limit"]       = this._timeLimit;
            dataQueryParams["personcode"]       = this._personCode;
            dataQueryParams["test"]             = HttpQueryUtility.ToQueryParameter(this._test);
            dataQueryParams["repeat_request"]   = HttpQueryUtility.ToQueryParameter(this._repeatRequest);
            dataQueryParams["only_payments"]    = HttpQueryUtility.ToQueryParameter(this._allowPayments);
            dataQueryParams["disalow_payments"] = HttpQueryUtility.ToQueryParameter(this._disallowPayments);

            foreach (KeyValuePair <string, string> param in this._additionalParameters)
            {
                if (!dataQueryParams.ContainsKey(param.Key))
                {
                    dataQueryParams[param.Key] = param.Value;
                }
            }

            string dataQuery         = HttpQueryUtility.BuildQueryString(dataQueryParams);
            string dataQueryAsBase64 = CryptoUtility.EncodeBase64UrlSafe(dataQuery);

            return(dataQueryAsBase64);
        }