Skip to content

Commit

Permalink
Merge pull request #767 from nozzlegear/fulfillment-orders/get
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear authored Aug 6, 2022
2 parents 90f1e2f + b4e6d30 commit 4b36dc5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions ShopifySharp/Services/FulfillmentOrders/FulfillmentOrderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,22 @@ public class FulfillmentOrderService : ShopifyService
public FulfillmentOrderService(string myShopifyUrl, string shopAccessToken) : base(myShopifyUrl, shopAccessToken) { }

/// <summary>
/// Gets a list of up to 250 of the order's fulfillments.
/// Gets a fulfillment order with the given id.
/// </summary>
/// <param name="orderId">The order id to which the fulfillments belong.</param>
/// <param name="fulfillmentOrderId">The fulfillment order to which the fulfillment orders belong.</param>
/// <param name="cancellationToken">Cancellation Token</param>
public virtual async Task<IEnumerable<FulfillmentOrder>> GetAsync(long fulfillmentOrderId, CancellationToken cancellationToken = default)
{
var req = PrepareRequest($"fulfillment_orders/{fulfillmentOrderId}.json");
var response = await ExecuteRequestAsync<IEnumerable<FulfillmentOrder>>(req, HttpMethod.Get, cancellationToken, rootElement: "fulfillment_order");

return response.Result;
}

/// <summary>
/// Gets a list of up to 250 of the order's fulfillment orders.
/// </summary>
/// <param name="orderId">The order id to which the fulfillment orders belong.</param>
/// <param name="cancellationToken">Cancellation Token</param>
public virtual async Task<IEnumerable<FulfillmentOrder>> ListAsync(long orderId, CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public virtual async Task<FulfillmentOrder> CreateAsync(long fulfillmentOrderId,

public virtual async Task<FulfillmentOrder> AcceptAsync(long fulfillmentOrderId, string message, CancellationToken cancellationToken = default)
{
var req = PrepareRequest($@"fulfillment_orders/{fulfillmentOrderId}/fulfillment_request/accept.json");
var req = PrepareRequest($"fulfillment_orders/{fulfillmentOrderId}/fulfillment_request/accept.json");
var fulfillmentRequest = new FulfillmentRequest { Message = message };
var body = fulfillmentRequest.ToDictionary();

Expand Down

0 comments on commit 4b36dc5

Please sign in to comment.