Esempio n. 1
0
        /// <summary>
        /// Send an invite by email to activate a customers account.
        /// </summary>
        /// <param name="customerId">The customer object's Id.</param>
        /// <param name="invite">Options for the invite email request</param>
        /// <returns></returns>
        public virtual async Task <CustomerInvite> SendInviteAsync(long customerId, CustomerInvite invite = null)
        {
            var req = PrepareRequest($"customers/{customerId}/send_invite.json");

            var content = new JsonContent(new
            {
                customer_invite = invite
            });

            return(await ExecuteRequestAsync <CustomerInvite>(req, HttpMethod.Post, content, "customer_invite"));
        }
Esempio n. 2
0
        /// <summary>
        /// Send an invite by email to activate a customers account.
        /// </summary>
        /// <param name="customerId">The customer object's Id.</param>
        /// <param name="invite">Options for the invite email request</param>
        /// <param name="cancellationToken">Cancellation Token</param>
        /// <returns></returns>
        public virtual async Task <CustomerInvite> SendInviteAsync(long customerId, CustomerInvite invite = null, CancellationToken cancellationToken = default)
        {
            var req = PrepareRequest($"customers/{customerId}/send_invite.json");

            var content = new JsonContent(new
            {
                customer_invite = invite
            });

            var response = await ExecuteRequestAsync <CustomerInvite>(req, HttpMethod.Post, cancellationToken, content, "customer_invite");

            return(response.Result);
        }