示例#1
0
        public TransparentRedirectRequest(String queryString, BraintreeService service)
        {
            queryString = queryString.TrimStart('?');

            Dictionary <String, String> paramMap = new Dictionary <String, String>();

            String[] queryParams = queryString.Split('&');

            foreach (String queryParam in queryParams)
            {
                String[] items = queryParam.Split('=');
                paramMap[items[0]] = items[1];
            }

            String message = null;

            if (paramMap.ContainsKey("bt_message"))
            {
                message = HttpUtility.UrlDecode(paramMap["bt_message"]);
            }

            BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)Int32.Parse(paramMap["http_status"]), message);

            if (!TrUtil.IsValidTrQueryString(queryString, service))
            {
                throw new ForgedQueryStringException();
            }

            Id = paramMap["id"];
        }
示例#2
0
        public virtual string CreditTrData(TransactionRequest trData, string redirectURL)
        {
            trData.Type = TransactionType.CREDIT;

            return(TrUtil.BuildTrData(trData, redirectURL, service));
        }
 public String BuildTrData(Request request, String redirectURL)
 {
     return(TrUtil.BuildTrData(request, redirectURL, Service));
 }
 public virtual string TrData(Request trData, string redirectURL)
 {
     return(TrUtil.BuildTrData(trData, redirectURL, new BraintreeService(Configuration)));
 }
        public virtual String SaleTrData(TransactionRequest trData, String redirectURL)
        {
            trData.Type = TransactionType.SALE;

            return TrUtil.BuildTrData(trData, redirectURL, Service);
        }