/// <summary> /// Apply an adjustment to an existing gift card <see cref="GiftCardAdjustment"/> /// </summary> /// <param name="giftCardId">The gift card that the adjustment was applied to.</param> /// <param name="adjustment">A new <see cref="GiftCardAdjustment"/>. Signed amount and note should be the only properties set.</param> /// <returns></returns> public virtual async Task <GiftCardAdjustment> CreateAsync(long giftCardId, GiftCardAdjustment adjustment) { var req = PrepareRequest($"gift_cards/{giftCardId}/adjustments.json"); var content = new JsonContent(new { adjustment = adjustment }); return(await ExecuteRequestAsync <GiftCardAdjustment>(req, HttpMethod.Post, content, "adjustment")); }
/// <summary> /// Apply an adjustment to an existing gift card <see cref="GiftCardAdjustment"/> /// </summary> /// <param name="giftCardId">The gift card that the adjustment was applied to.</param> /// <param name="adjustment">A new <see cref="GiftCardAdjustment"/>. Signed amount and note should be the only properties set.</param> /// <param name="cancellationToken">Cancellation Token</param> /// <returns></returns> public virtual async Task <GiftCardAdjustment> CreateAsync(long giftCardId, GiftCardAdjustment adjustment, CancellationToken cancellationToken = default) { var req = PrepareRequest($"gift_cards/{giftCardId}/adjustments.json"); var content = new JsonContent(new { adjustment = adjustment }); var response = await ExecuteRequestAsync <GiftCardAdjustment>(req, HttpMethod.Post, cancellationToken, content, "adjustment"); return(response.Result); }