Exemplo n.º 1
0
        /// <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"));
        }
Exemplo n.º 2
0
        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);
        }