Exemple #1
0
 private void DebugRawResponse(RequestBase request)
 {
     AddDebug("RAW Result from PAYNL");
     AddDebug(request.RawResponse);
 }
Exemple #2
0
 /// <summary>
 /// Performs an actual request
 /// </summary>
 /// <param name="request">Specific request implementation to perform</param>
 /// <returns>raw response string</returns>
 public string PerformRequest(RequestBase request)
 {
     HttpWebRequest httprequest = PrepareRequest(request.Url, "POST");
     string rawResponse = PerformRoundTrip2(httprequest, HttpStatusCode.OK, () =>
     {
         using (var requestWriter = new StreamWriter(httprequest.GetRequestStream()))
         {
             //string serializedResource = resource.Serialize();
             string serializedResource = request.ToQueryString();
             requestWriter.Write(serializedResource);
         }
     }
     );
     request.RawResponse = rawResponse;
     return rawResponse;
 }
Exemple #3
0
 private void InitRequestDebug(RequestBase request)
 {
     APISettings.InitAPI();
     AddDebug(string.Format("Calling API {0} / {1}", request.Controller, request.Method));
     AddDebug(string.Format("Requires TOKEN? {0}", request.RequiresApiToken));
     AddDebug(string.Format("Requires SERVICEID? {0}", request.RequiresServiceId));
     AddDebug("-----");
     AddDebug("Initializing...");
     AddDebug(string.Format("URL    : {0}", request.Url));
     AddDebug(string.Format("PARAMS : {0}", request.ToQueryString()));
     AddDebug("-----");
 }