コード例 #1
0
        /// <summary>
        /// Updates a charge.
        /// </summary>
        public HttpResponse <OkResponse> UpdateCharge(string chargeId, ChargeUpdate requestModel)
        {
            if (!chargeId.StartsWith("charge_"))
            {
                chargeId = "charge_" + chargeId;
            }

            var request = new RestRequest(Endpoints.Charge, Method.PUT);

            request.AddUrlSegment("chargeId", chargeId);
            request.RequestFormat = DataFormat.Json;
            request.AddBody(requestModel);
            return(Execute <OkResponse>(request));
        }
コード例 #2
0
        /// <summary>
        /// Updates a charge.
        /// </summary>
        public HttpResponse <OkResponse> UpdateCharge(string chargeId, ChargeUpdate requestModel)
        {
            var updateChargesApiUri = string.Format(ApiUrls.Charge, chargeId);

            return(new ApiHttpClient().PutRequest <OkResponse>(updateChargesApiUri, AppSettings.SecretKey, requestModel));
        }
コード例 #3
0
 /// <summary>
 /// Updates a charge.
 /// </summary>
 public HttpResponse<OkResponse> UpdateCharge(string chargeId, ChargeUpdate requestModel)
 {
     var updateChargesApiUri = string.Format(ApiUrls.Charge, chargeId);
     return new ApiHttpClient().PutRequest<OkResponse>(updateChargesApiUri, AppSettings.SecretKey, requestModel);
 }
コード例 #4
0
        public Task <HttpResponse <OkResponse> > UpdateChargeAsync(string chargeId, ChargeUpdate requestModel)
        {
            var updateChargesApiUri = string.Format(_configuration.ApiUrls.Charge, chargeId);

            return(_apiHttpClient.PutRequest <OkResponse>(updateChargesApiUri, _configuration.SecretKey, requestModel));
        }
コード例 #5
0
 public HttpResponse <OkResponse> UpdateCharge(string chargeId, ChargeUpdate requestModel)
 {
     return(_chargeServiceAsync.UpdateChargeAsync(chargeId, requestModel).Result);
 }