Hi All,

I am having a problem which there doesn't seem to be any mention of round here at all. I am using Paypal WPS for getting my recurring payments.
The issue is logged nicely. The below log sample shows my problem: (newest entry at the top!)

	uc_order	12/26/2009 - 14:47	Order 9 deleted by user 0.	 Anonymous 	
error 	uc_recurring	12/26/2009 - 14:47	Failed to capture recurring fee of 1.000 for product ...	Anonymous 	order 4
	uc_recurring_hos	12/26/2009 - 14:47	IPN transaction verified.	Anonymous 	
	uc_recurring_hos	12/26/2009 - 14:47	Receiving IPN at URL for order . <pre>Array ( ...	Anonymous 	
error 	php	12/26/2009 - 14:47	Missing argument 1 for ...	Anonymous 	

Note: I have included all the log entries relating to this issue and I can see that the oldest one is caused by the menu entry for the paypal section not parsing the order number URL argument to the function, however this doesn't actually prevent the system from working. The IPN data is real data from a real paypal transaction:

Array (
[transaction_subject] => 
[payment_date] => 06:47:31 Dec 26, 2009 PST 
[txn_type] => subscr_payment 
[subscr_id] => obscured before posting
[last_name] => Howes 
[residence_country] => GB 
[item_name] => Order 4 at http://beta.obscured before posting.com/ 
[payment_gross] => 
[mc_currency] => GBP 
[business] => obscured before posting 
[payment_type] => instant 
[protection_eligibility] => Ineligible 
[verify_sign] => obscured before posting
[payer_status] => verified 
[payer_email] => obscured before posting
[txn_id] => 4LP156955F394562U 
[receiver_email] => obscured before posting
[first_name] => Ben 
[invoice] => 4-1261592439 
[payer_id] => obscured before posting
[receiver_id] => obscured before posting
[payment_status] => Completed 
[payment_fee] => 
[mc_fee] => 0.23 
[mc_gross] => 1.00 
[charset] => windows-1252 
[notify_version] => 2.8 )

Order 4 has a recurring fee of 1.00 GBP attached. The IPN for the payment is captured from paypal exactly how one would expect, with all the correct info logged. The issue seems to arrise from uc_reccuring.module 591, where the 'renew callback' is called. I can see that the paypal payment methods don't seem to implement this call back, causing the invoke function to not return true.

I would be very grateful for a pointer as to what I am doing wrong!? I am using php 5.2.6 and I have tried all recent versions of the code including December 24th. As far as I can tell a very simple implementation of the 'rewal callback' which just logs the payment and returns TRUE would do the job, but seen as it is working fine for other people I am assuming I must be doing something wrong?

Thanks,
Ben

Comments

Ben Howes’s picture

I have made a slight change to the line I mentioned which I thought may be where the problem was arising.

I changed line 591 from:

 if (uc_recurring_invoke($fee->fee_handler, 'renew callback', array($new_order, &$fee))) {

To:

 if (uc_recurring_invoke($fee->fee_handler, 'renew callback', array($new_order, &$fee)) !== FALSE) {

I have not done much testing of this, but I have found it to make processing recurring paypal payments to work for me. My change just makes the recurring fee handler assume that the payment was successful unless it returns FALSE, which means that modules which return nothing (or are not implemented, as is the case for me) are assumed to have successfully completed payment.

My site now successfully makes a new order when a recurring payment is encountered and adds all the information to the orders as you would hope, so I am very happy in that respect :)

I would, however, still very much like to know if this is something I am doing wrong?

Thanks,
Ben

sheazo’s picture

I'm seeing the same issue. Subscribing...

Ben Howes’s picture

Did you try making the changes I listed? I have left it for a few more days and found it to work flawlessly.

Thanks,
Ben

univate’s picture

Status: Active » Fixed

I thought there was a dummy function in there to handle the renewals.

But I do like this solution. I have committed the fix to only fail if the renew callback explicitly returns FALSE.

Ben Howes’s picture

Status: Fixed » Active

Glad to have been able to give something back, this module is exactly what I needed! :)

Thanks,
Ben

univate’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.