/// <summary> /// Creates a new Checkout. /// </summary> public virtual async Task <Checkout> CreateAsync(Checkout checkout) { var req = PrepareRequest("checkout.json"); var body = checkout.ToDictionary(); return(await ExecuteRequestAsync <Checkout>(req, HttpMethod.Post, new JsonContent(checkout), rootElement : "checkout")); }
public virtual async Task <Checkout> CreateAsync(Checkout checkout, CancellationToken cancellationToken = default) { var req = PrepareRequest("checkout.json"); var body = checkout.ToDictionary(); var response = await ExecuteRequestAsync <Checkout>(req, HttpMethod.Post, cancellationToken, new JsonContent(checkout), "checkout"); return(response.Result); }