Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twocheckout_Sale::stop Recurring item problem #20

Closed
ahmetemir opened this issue Jan 29, 2016 · 2 comments
Closed

Twocheckout_Sale::stop Recurring item problem #20

ahmetemir opened this issue Jan 29, 2016 · 2 comments

Comments

@ahmetemir
Copy link

In Twocheckoutsale.php

$lineitemData = Twocheckout_Util::getRecurringLineitems($result);
if (isset($lineitemData[0])) {
...
}

If recurring item is not the first line item,it throws "No recurring lineitems to stop".And in my situation array returned from getRecurringLineitems function has index starting from 1.Please replace this line with:

if (count($lineitemData)>0) {

}
@craigchristenson
Copy link
Member

Thanks for reporting this issue. The issue has been fixed so that we properly push the lineitems to the array, resulting in the expected index.

@umutm
Copy link

umutm commented May 1, 2019

This issue still existed for me.

I believe that the getRecurringLineitems function in Twocheckoututil.php was not getting the latest invoice in a sale properly and changing:

$invoice = max($invoiceData);
to
$invoice = end($invoiceData);
in Twocheckoututil.php worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants