An object representing Shopify's ApplicationCredit object, which can be used to offer credits for payments made via the Application Charge, Recurring Application Charge, and Usage Charge APIs.
Inheritance: ShopifySharp.ShopifyObject
        /// <summary>
        /// Creates a new <see cref="ShopifyApplicationCredit"/>.
        /// </summary>
        /// <param name="credit">A new <see cref="ShopifyApplicationCredit"/>. Id should be set to null.</param>
        public async Task<ShopifyApplicationCredit> CreateAsync(ShopifyApplicationCredit credit)
        {
            var req = RequestEngine.CreateRequest($"application_credits.json", Method.POST, "application_credit");

            req.AddJsonBody(new { application_credit = credit });

            return await RequestEngine.ExecuteRequestAsync<ShopifyApplicationCredit>(_RestClient, req);
        }        
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new <see cref="ShopifyApplicationCredit"/>.
        /// </summary>
        /// <param name="credit">A new <see cref="ShopifyApplicationCredit"/>. Id should be set to null.</param>
        public virtual async Task <ShopifyApplicationCredit> CreateAsync(ShopifyApplicationCredit credit)
        {
            var req = RequestEngine.CreateRequest($"application_credits.json", Method.POST, "application_credit");

            req.AddJsonBody(new { application_credit = credit });

            return(await RequestEngine.ExecuteRequestAsync <ShopifyApplicationCredit>(_RestClient, req));
        }