/// <summary> /// Creates a <see cref="RecurringCharge"/>. /// </summary> /// <param name="charge">The <see cref="RecurringCharge"/> to create.</param> /// <returns>The new <see cref="RecurringCharge"/>.</returns> public virtual async Task <RecurringCharge> CreateAsync(RecurringCharge charge) { var req = PrepareRequest("recurring_application_charges.json"); var content = new JsonContent(new { recurring_application_charge = charge }); return(await ExecuteRequestAsync <RecurringCharge>(req, HttpMethod.Post, content, "recurring_application_charge")); }
/// <summary> /// Creates a <see cref="RecurringCharge"/>. /// </summary> /// <param name="charge">The <see cref="RecurringCharge"/> to create.</param> /// <returns>The new <see cref="RecurringCharge"/>.</returns> public virtual async Task <RecurringCharge> CreateAsync(RecurringCharge charge) { return(await ExecutePostAsync <RecurringCharge>("recurring_application_charges.json", "recurring_application_charge", new { recurring_application_charge = charge })); }
/// <summary> /// Creates a <see cref="RecurringCharge"/>. /// </summary> /// <param name="charge">The <see cref="RecurringCharge"/> to create.</param> /// <param name="cancellationToken">Cancellation Token</param> /// <returns>The new <see cref="RecurringCharge"/>.</returns> public virtual async Task <RecurringCharge> CreateAsync(RecurringCharge charge, CancellationToken cancellationToken = default) { return(await ExecutePostAsync <RecurringCharge>("recurring_application_charges.json", "recurring_application_charge", cancellationToken, new { recurring_application_charge = charge })); }