UPDATES PayPlans 4.2.10 Released

Helpdesk

Identified bug in renewal

Hi

A customer at our site is faced with a fatal error in Payplans each time they try to renew their subscription:


Call to undefined method stdClass::refresh()


I did the debugging again to find out the cause of the problem, and it's a bug in Payplans, in include/renewal/renewal.php

I was about to report all the details here but then I looked at my past tickets and I realized I HAD ALREADY DEBUGGED AND REPORTED THIS ISSUE in this ticket, a year ago.

I am really p...ed that you had a paying customer provide a full report on a serious bug and you did not fix it. That's really not up to Stackideas reputation.

Granted, the bug is slightly different now because you changed some other parts of the code, but I think you simply re-introduced it. Or it was just not tested again.

So the bug now is as follow:

- the description of the problem is the same as in this older ticket: last invoice for that customer has been refunded
- in administrator/components/com_payplans/includes/renewal/renewal.php at line 71, you call


$order->createInvoice()


- in administrator/components/com_payplans/includes/order/order.php at line 394 you have:


$invoices = $this->getInvoices(array(PP_INVOICE_PAID, PP_INVOICE_REFUNDED));


At line 413 you do:


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


In createChildInvoices() you do:


$masterInvoice = $this->getInvoice($invoiceCount);


In getInvoice() you do:


$invoices = $this->getInvoices(PP_INVOICE_PAID);


and there is the problem, because in getInvoice(), you only include the paid invoices and not the refunded ones, so the invoice counter is incorrect and this causes a fatal error later on.

You do not need any access to our system, just re-create the problem your self by creating 3 subscriptions for a user, with the last one being refunded. Here is the description from my report a year ago:

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



IMPORTANT: we are waiting for a fix. This customer cannot renew their subscription. The same sort of of issue happened last year. I cannot change the code or change data in the database because I don't know of the side effects. Can I just delete in the database the last refunded invoice? is there any side effect now or in the future (with the value of the counter for instance).

I am waiting for an urgent fix to this, considering I already reported this bug in details last year and no action was taken.


Yannick Gaultier

This section can only be seen by users with a valid subscription.
If you have a valid subscription, please login now

Your time
Stack Ideas HQ
Support is
Offline

It is currently off working hours and most of us aren't around.

Rest assured that we will get back to your issues as soon as the day starts tomorrow!

Buy Us Coffee

Are you happy with our support and would like to buy us a cup of coffee?

$
Enjoy the Coffee!
Service via PayPal
Subscribe for product updates & promotions