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

<p>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:</p>

<p>I've got three payments taken for this subscriber:</p>

<pre><code>2018-07-26
2018-07-25
2018-07-24
</code></pre>

<p>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.</p>

<p>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.</p>

<pre><code>{% if charge.subscription.status == "active" %}

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

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

{% endif %}
</code></pre>

CC BY-SA 4.0
2018-07-26T11:16:51.480Z
2018-07-26T11:27:51.317Z
2018-07-26T11:27:51.317Z
Clive Portman
<p>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.</p>

<p>A problem I'm seeing is that the dates displayed using Charge's <code>subscription.currentPeriodEnd</code> 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.</p>

<p>Anyone else experiencing this and can suggest a fix?</p>

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

<p><a href="https://i.sstatic.net/igm9F.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/igm9F.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2018-05-01T18:18:59.787Z
I am also seeing these same two issues. Did you ever get it sorted?
Jacob Graf
CC BY-SA 3.0
2018-05-01T22:22:47.567Z
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.
Adam Snetman
CC BY-SA 4.0
2018-05-02T13:06:45.770Z
Well, that's frustrating. I've had a nightmare of a time using Charge. Disgusting support for the product.
Jacob Graf
CC BY-SA 4.0
2018-05-02T17:33:26.057Z
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.
Adam Snetman
CC BY-SA 4.0
2018-07-23T11:00:58.573Z
Anyone heard anything from Top Shelf Craft recently?
Clive Portman
CC BY-SA 4.0
2018-07-27T19:30:32.033Z
Hey @ClivePortman (and Jacob and Adam), I work for Top Shelf Craft. Just want to apologize for the slow support. When we took over development of Charge we inherited a ton of old support and issues that we've been slowly weeding our way through. We'll be releasing Charge for Craft 3 soonish and hopefully it will solve a lot of these old issues with the Craft 2 version. We've been busy but we're definitely trying to get to all the tickets we've received (and are still receiving). Please bear with us during this time :) Thanks!
Jalen Davenport
CC BY-SA 4.0
2018-07-30T08:13:53.397Z
But we'll have these fixed on the Craft 2.x version as well, right?
Clive Portman
<plugins><plugin-charge>
Charge plugin: subscription start and end dates not updating for recurring subscription payments
# Charge plugin: subscription start and end dates not updating for recurring subscription payments

(Asked by: username_0 on 2017-11-20)

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](https://i.sstatic.net/igm9F.png)](https://i.sstatic.net/igm9F.png)

**Tags:** plugins, plugin-charge

> **Comments:**
> **username_1**: I am also seeing these same two issues. Did you ever get it sorted?  
> **username_0**: 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.  
> **username_1**: Well, that's frustrating. I've had a nightmare of a time using Charge. Disgusting support for the product.  
> **username_0**: 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.  
> **username_2**: Anyone heard anything from Top Shelf Craft recently?  
> **username_3**: Hey @ClivePortman (and Jacob and Adam), I work for Top Shelf Craft. Just want to apologize for the slow support. When we took over development of Charge we inherited a ton of old support and issues that we've been slowly weeding our way through. We'll be releasing Charge for Craft 3 soonish and hopefully it will solve a lot of these old issues with the Craft 2 version. We've been busy but we're definitely trying to get to all the tickets we've received (and are still receiving). Please bear with us during this time :) Thanks!  
> **username_2**: But we'll have these fixed on the Craft 2.x version as well, right?  

---

## 1 answers

### Answer by username_2 on 2018-07-26. Score: 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') }}
    {% set daysToRenewal = date(paymentEnd).diff(now).days %}
    {{ daysToRenewal }} days to renewal
    {# Send email to subscriber if exactly 28 days to go #}

{% endif %}


---

