2

I've been using Charge to handle a subscription service on a client site, and for the most part, it's been working well for the past year. Now that a year has gone by, the first set of recurring membership subscriptions are starting to be automatically renewed.

A problem I'm seeing is that the dates displayed using Charge's subscription.currentPeriodEnd template variables are not showing updated dates. They still show the end date for the initial year of the subscription, not the new end date which should be one year past the date of the renewal.

Anyone else experiencing this and can suggest a fix?

In a potentially related issue, the recurring payment is being displayed as "TEST" mode in the UI in Charge. See screenshot:

enter image description here

7
  • I am also seeing these same two issues. Did you ever get it sorted?
    – Jacob Graf
    Commented May 1, 2018 at 18:18
  • Nope. I submitted this back in February as a bug/support request to Top Shelf Craft who took over development of Charge, but have not heard anything back. Commented May 1, 2018 at 22:22
  • Well, that's frustrating. I've had a nightmare of a time using Charge. Disgusting support for the product.
    – Jacob Graf
    Commented May 2, 2018 at 13:06
  • Yes, it has not been ideal. I am looking forward to the release of Commerce Lite which will include subscription functionality. That should be much better supported. Commented May 2, 2018 at 17:33
  • Anyone heard anything from Top Shelf Craft recently? Commented Jul 23, 2018 at 11:00

1 Answer 1

1

Not really a solution, I know, but in the absence of any support from the developer on this there may be a workaround.

In my case I've been developing using planIntervals of only 1 day so I can see what's going on. As noted in your question, it never updates to the correct currentPeriodEnd, but it does seem to be updating. It looks like it updates to the end of the next but last payment taken. Here's an example:

I've got three payments taken for this subscriber:

2018-07-26
2018-07-25
2018-07-24

With the last payment being on 26 July, currentPeriodEnd should be 27 July. It isn't. It's outputting 26 Jul, the period end of the next to last payment. Or maybe the actual date the last payment was taken. I'm not sure.

Rather than fix this, I'm probably just going to test for the subscription being active and adding the planInterval to the currentPeriodEnd. But only if more than the initial payment has been made.

{% if charge.subscription.status == "active" %}

    {% if charge.payments | length > 1 %}
        {% set paymentEnd = charge.subscription.currentPeriodEnd | date_modify("+1 day") %}
    {% else %}
        {% set paymentEnd = charge.subscription.currentPeriodEnd %}
    {% endif %}

    {{ paymentEnd | date('j M Y') }}<br>
    {% set daysToRenewal = date(paymentEnd).diff(now).days %}
    {{ daysToRenewal }} days to renewal<br><br>
    {# Send email to subscriber if exactly 28 days to go #}

{% endif %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.