public static async Task AddGetUpdateTradeOffer(Dinero dinero) { var tradeoffer = await AddAndGetNewTradeOffer(dinero); var productLines = new List<TradeOfferLineCreate>(); foreach (var line in tradeoffer.ProductLines) { productLines.Add(new TradeOfferLineCreate() { Description = line.Description, BaseAmountValue = line.BaseAmountValue, AccountNumber = line.AccountNumber, Unit = line.Unit, Quantity = line.Quantity, Comments = line.Comments }); } var updateObj = new TradeOfferUpdate() { Timestamp = tradeoffer.TimeStamp, ContactGuid = tradeoffer.ContactGuid, ExternalReference = "I've updated this invoice!", ProductLines = productLines }; await dinero.TradeOffers.UpdateAsync(tradeoffer.Guid, updateObj); Console.WriteLine("Trade offer updated."); }
/// <summary> /// Update the organization's trade offer. /// </summary> /// <param name="guid">The guid of the trade offer to update</param> /// <param name="updatedModel">The updated trade offer</param> public Task<UpdatedResponse> UpdateAsync(Guid guid, TradeOfferUpdate updatedModel) { if (updatedModel == null) throw new ArgumentNullException("updatedModel"); return PutAsyncWithGuid<UpdatedResponse>(guid, updatedModel); }
/// <summary> /// Update the organization's trade offer. /// </summary> /// <param name="guid">The guid of the trade offer to update</param> /// <param name="updatedModel">The updated trade offer</param> public UpdatedResponse Update(Guid guid, TradeOfferUpdate updatedModel) { return TaskHelper.ExecuteSync(() => UpdateAsync(guid, updatedModel)); }