Exemplo n.º 1
0
        /// <summary>
        /// Perform a new Refund.
        ///
        /// <param name="refundData">
        /// Refund Object
        /// </param>
        /// <returns>
        /// RefundInformation object.
        /// </returns>
        /// <seealso cref="PayHubWS.com.payhub.ws.api.RefundInformation"/>
        /// </summary>
        public RefundInformation doRefund(Refund refundData)
        {
            refundData.Merchant = _merchant;
            refundData._url     = _url;
            var    request = setHeadersPost(refundData._url, this._oauthToken);
            string json    = JsonConvert.SerializeObject(refundData, Formatting.None, new JsonSerializerSettings {
                DefaultValueHandling = DefaultValueHandling.Ignore
            });
            RefundInformation response = refundData.PerformRefund(json, request);

            response.transactionManager = this;
            return(response);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Perform a new query that retrieves you the Refund Information for a particular Refund Operation.
        ///
        /// <param name="refundId">
        /// the ID of a particular Refund Transaction.
        /// </param>
        /// <returns>
        /// RefundInformation object.
        /// </returns>
        /// <seealso cref="PayHubWS.com.payhub.ws.api.RecurringBillingInformation"/>
        /// </summary>
        public RefundInformation getRefundInformation(string refundId)
        {
            if (refundId == null || refundId.Equals(""))
            {
                return(null);
            }
            RefundInformation response = new RefundInformation();
            var    url     = _url + Refund.REFUND_ID_LINK + refundId;
            var    request = setHeadersGet(url, this._oauthToken);
            string result  = doGet(request);

            if (result == null || result.Equals(""))
            {
                return(null);
            }
            response                    = JsonConvert.DeserializeObject <RefundInformation>(result);
            response.rowData            = result;
            response.transactionManager = this;
            return(response);
        }
Exemplo n.º 3
0
 public RefundInformation PerformRefund(string json, HttpWebRequest request)
 {
     RefundInformation responseObject = new RefundInformation();
     using (var streamWriter = new StreamWriter(request.GetRequestStream()))
     {
         streamWriter.Write(json);
         streamWriter.Flush();
         streamWriter.Close();
     }
     var result = doPost(request, _url);
     responseObject = JsonConvert.DeserializeObject<RefundInformation>(result);
     responseObject.rowData = result;
     return responseObject;
 }
Exemplo n.º 4
0
 /// <summary> 
 /// Perform a new query that retrieves you the Refund Information for a particular Refund Operation.
 ///
 /// <param name="refundId"> 
 /// the ID of a particular Refund Transaction.
 /// </param>
 /// <returns>
 /// RefundInformation object.
 /// </returns>   
 /// <seealso cref="PayHubWS.com.payhub.ws.api.RecurringBillingInformation"/>
 /// </summary> 
 public RefundInformation getRefundInformation(string refundId)
 {
     if (refundId == null || refundId.Equals(""))
         return null;
     RefundInformation response = new RefundInformation();
     var url = _url + Refund.REFUND_ID_LINK + refundId;
     var request = setHeadersGet(url, this._oauthToken);
     string result = doGet(request);
     if (result == null || result.Equals(""))
         return null;
     response = JsonConvert.DeserializeObject<RefundInformation>(result);
     response.rowData = result;
     response.transactionManager = this;
     return response;
 }