UPDATES EasyBlog 6.0.11 Released! Update to the latest version now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is offline
Our team is away during the weekend. Some answers may already be available on our documentation

Rest assured that we will get back to your posts as soon as the week starts!
  Support is offline
None
Hi

I have debugged an issue in Payplans 4.2.2 that causes me some trouble with users renewal of their subscription. I have reproduced this independantly on my live site, so you can too.

It goes as like this:

- User purchased a sub in November 2018
- They renew in November 2019 (Paypal) but there's a problem somewhere and they pay twice
- We refund one of the invoice. User now has one Active sub and 3 invoices: 2018, 2019 paid and 2019 refunded
- Now they want to renew in 2020: go to dashboard, hit the Renew button and they get a Fatal error:



Error: 0 call to undefined method stdClass::refresh()


I have tracked that down to /administrator/components/com_payplans/includes/renewal/renewal.php at line 71: the $invoice object is a stdClass instead of being an invoice object.
I have tracked that down then to: /administrator/components/com_payplans/includes/order/order.php at line 413.
Payplans gets the 2 invoices for that user: the oldes is active and the more recent has been redunded. Therefore at line 413


$invoice = $this->createChildInvoice($invoiceCount);


fails to create a child invoice and eventually a fatal error is triggered later on.

So there are 3 problems:

1 - This situation is not taken into account: createChildInvoice should not try to create a childInvoice from the last subscription but from the last active subscription.
2. If not possible, this should not trigger a fatal error but simply some kind of error message.

Please have a look and try fix that.

The 3rd problem is how I fix that manually until the problem is really fixed. I have tried re-creating a separate subscription expiring in a month, but when I go to the user dashboard, the "Renew" button is not displayed.

Right now, I have:

- deleted all the invoices, orders and subscriptions of that user in the database as there's no UI to delete those items
- Created a new subscription
- Set the expiration date of that subscription to November 8, 2020 (the original expiration date)

BUT: when going to the dashboard, the Renew button is not displayed. What's going on?

Please provide me for a temporary solution to allow user to renew. Why is the renew button not showing on an active subscription?

Best regards
Yannick Gaultier
weeblr.com / @weeblr
The replies under this section are restricted to logged in users or users with an active subscription with us