/// <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)); }
/// <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)); }
/// <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); }
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)); }
public HttpResponse <OkResponse> UpdateCharge(string chargeId, ChargeUpdate requestModel) { return(_chargeServiceAsync.UpdateChargeAsync(chargeId, requestModel).Result); }