Skip to content

Enable trial period billing using trialDays parameter in EnsureBilling class #240

@visionlabit

Description

@visionlabit

Overview

The Shopify PHP app template already supports, using the EnsureBilling class, the management of some Billing APIs mutations.
Since the underlying billing mutations already support the usage of "trialDays" parameter to enable a trial period of the app (https://shopify.dev/apps/billing/purchase-adjustments/free-trials), I would like to be able to define its value in the shopify.php config file and use it through the EnsureBilling functions as we can do for all the other billing parameters.

Type

  • New feature
  • Changes to existing features

Motivation

The EnsureBilling class enables setting up easily the Shopify app billing using middleware.
Since the billing API mutations used by EnsureBilling's functions already support for the trial period using the "trialDays" parameter, it would be convenient to be able to use all the mutations' native options also through EnsureBilling's functions which wrap them.

...

Area

  • Billing

Checklist

  • Add "trialDays" parameter to shopify.php config file example
  • Edit requestRecurringPayment and requestOneTimePayment functions to use and support the new trialDays parameter
  • Edit RECURRING_PURCHASE_MUTATION and ONE_TIME_PURCHASE_MUTATION to support the new trialDays parameter

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions