Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Request body in new Object in CreateAsync and UpdateAsync #800

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Send Request body in new Object in CreateAsync and UpdateAsync
  • Loading branch information
zeeshan-plaza committed Oct 17, 2022
commit b075c64c88a8ad5f3dd933414d4586d8f5ba1aa1
4 changes: 2 additions & 2 deletions ShopifySharp/Services/Checkout/CheckoutService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public virtual async Task<Checkout> CreateAsync(Checkout checkout, CancellationT
var req = PrepareRequest("checkouts.json");
var body = checkout.ToDictionary();

var response = await ExecuteRequestAsync<Checkout>(req, HttpMethod.Post, cancellationToken, new JsonContent(checkout), "checkout");
var response = await ExecuteRequestAsync<Checkout>(req, HttpMethod.Post, cancellationToken, new JsonContent(new { checkout }), "checkout");
return response.Result;
}

Expand Down Expand Up @@ -90,7 +90,7 @@ public virtual async Task<Checkout> UpdateAsync(string token, Checkout updatedCh
{
var req = PrepareRequest($"checkouts/{token}.json");

var response = await ExecuteRequestAsync<Checkout>(req, HttpMethod.Put, cancellationToken, new JsonContent(updatedCheckout), "checkout");
var response = await ExecuteRequestAsync<Checkout>(req, HttpMethod.Put, cancellationToken, new JsonContent(new { updatedCheckout }), "checkout");
return response.Result;
}

Expand Down