/// <summary>
        /// Perform a new Capture.
        ///
        /// <param name="capture">
        /// Capture Object
        /// </param>
        /// <returns>
        /// LastCaptureResponseInfromation object.
        /// </returns>
        /// <seealso cref="PayHubWS.com.payhub.ws.api.LastCaptureResponseInfromation"/>
        /// </summary>
        public CaptureResponseInfromation doCapture(Capture capture)
        {
            capture.Merchant = _merchant;
            capture._url     = _url;
            var    request = setHeadersPost(capture._url, this._oauthToken);
            string json    = JsonConvert.SerializeObject(capture, Formatting.None, new JsonSerializerSettings {
                DefaultValueHandling = DefaultValueHandling.Ignore
            });
            CaptureResponseInfromation response = capture.captureData(json, request);

            response.transactionManager = this;
            return(response);
        }
        /// <summary>
        /// Perform a new query that retrieves you the Capture Information for a particular Capture Transaction.
        ///
        /// <param name="captureId">
        /// the ID of a particular Capture Transaction.
        /// </param>
        /// <returns>
        /// LastCaptureResponseInfromation object.
        /// </returns>
        /// <seealso cref="PayHubWS.com.payhub.ws.api.LastCaptureResponseInfromation"/>
        /// </summary>
        public CaptureResponseInfromation getCaptureInformation(string captureId)
        {
            if (captureId == null || captureId.Equals(""))
            {
                return(null);
            }
            CaptureResponseInfromation response = new CaptureResponseInfromation();
            var    url     = _url + Capture.CAPTURE_ID_LINK + captureId;
            var    request = setHeadersGet(url, this._oauthToken);
            string result  = doGet(request);

            if (result == null || result.Equals(""))
            {
                return(null);
            }
            response                    = JsonConvert.DeserializeObject <CaptureResponseInfromation>(result);
            response.rowData            = result;
            response.transactionManager = this;
            return(response);
        }
Exemple #3
0
 public CaptureResponseInfromation captureData(string json, HttpWebRequest request)
 {
     CaptureResponseInfromation responseObject = new CaptureResponseInfromation();
     using (var streamWriter = new StreamWriter(request.GetRequestStream()))
     {
         streamWriter.Write(json);
         streamWriter.Flush();
         streamWriter.Close();
     }
     var result = doPost(request, _url);
     responseObject = JsonConvert.DeserializeObject<CaptureResponseInfromation>(result);
     responseObject.rowData = result;
     return responseObject;
 }
 /// <summary> 
 /// Perform a new query that retrieves you the Capture Information for a particular Capture Transaction.
 ///
 /// <param name="captureId"> 
 /// the ID of a particular Capture Transaction.
 /// </param>
 /// <returns>
 /// LastCaptureResponseInfromation object.
 /// </returns>   
 /// <seealso cref="PayHubWS.com.payhub.ws.api.LastCaptureResponseInfromation"/>
 /// </summary> 
 public CaptureResponseInfromation getCaptureInformation(string captureId)
 {
     if (captureId == null || captureId .Equals(""))
         return null;
     CaptureResponseInfromation response = new CaptureResponseInfromation();
     var url = _url + Capture.CAPTURE_ID_LINK + captureId;
     var request = setHeadersGet(url, this._oauthToken);
     string result = doGet(request);
     if (result == null || result.Equals(""))
         return null;
     response = JsonConvert.DeserializeObject<CaptureResponseInfromation>(result);
     response.rowData = result;
     response.transactionManager = this;
     return response;
 }