Get Commerce 2's Stripe subscription planData as object How do I access a subscription plan's planData? Maybe as an object? I'm using Commerce 2 with the Stripe gateway.

For example:

{% set plans = craft.commerce.getPlans().getAllPlans() %}
{% for plan in plans %}
    {{ dump(plan.planData) }}
{% endfor %}


planData looks like JSON stored as a string. How do I access its data (amount, trial_period_days etc.) on the front end?

Does this need to be handled by a custom plugin? Seems like something that should be available out of the box. Hopefully I just over looked it.
A subscription's planData is currently only stored as JSON. You can use that JSON in your template but you'll need to decode it first. Marion Newlevant’s Twig Perversion plugin adds a json_decode filter among other helpful capabilities to Twig.

With that plugin installed, set planData to a variable with the json_decode filter applied to it then you can access attributes of planData as you normally would in Twig.

{% set plans = craft.commerce.getPlans().getAllPlans() %}
{% for plan in plans %}
    {% set planData = plan.planData|json_decode %}
    {{ planData.plan.amount }}
    {# Stripe stores the amount as cents, so formatting for dollars or euros might look like this #}
    {{ (planData.plan.amount / 100)|currency }}
    {# Trial period  #}
    {{ planData.plan.trial_period_days }}
{% endfor %}