When uc_recurring_renew() executes it creates a new renewal order (if one does not already exist) but the link between the original order and the renewal order, stored in 'uc_recurring_orders', is only created if the payment is successful. This means that a renewal order that failed payment is not visible on the admin order recurring fees tab (admin/store/orders/{order_id}/recurring).

The reference should be saved when the renewal order is created and does not depend on the payment being successful.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tinker created an issue. See original summary.

tinker’s picture

Title: New order reference not save in uc_recurring_orders when payment fails » New order reference not saved in uc_recurring_orders when payment fails
Status: Active » Needs review
FileSize
1.13 KB

This patch moves the renewal order reference creation into uc_recurring_create_renewal_order() so that it is only executed once when the renewal order is created.

tinker’s picture

Note: This patch is not retro active and could lead to existing renewal orders that failed payment to NOT be linked to the original order. Patch operation is still better that current operation. Ideally this patch should include a hook_update_N() to find all renewal orders that do not have a reference in 'uc_recurring_orders' and add one.

glynster’s picture

@tinker, I just tried to apply this patch but I think there is an order issue, as the patch failed. Do I need to apply this patch first and then your patch list from Fee operation links access control faulty, wrong arguments on admin fees overview page. Excited to get this tested!

tinker’s picture

@glynster, This is why maintaining a patched version is so difficult. All patches are made to apply to clean 7.x-2.x-dev and assume that no other patches have been applied. If your working version has many patches then you have to merge or manually apply the patch. If you want help you can provide the error message that you got when you tried to apply the patch. BTW I will be gone for a few days so be patient for my response.

glynster’s picture

@tinker, perfect thanks for the feedback that is what I thought, so I will manually apply this patch and see what the result is. The good thing here is I only have 1 patch at the moment. Will keep you posted.

glynster’s picture

@tinker, and as always your patch works a treat. Just had a couple of subscriptions fail and are in pending mode and they all remain connected as they should. You rock. As you say it would be awesome to run a small script to update all the past orders but otherwise the issue completely. +1 to have this committed.

glynster’s picture

@tinker, have tested this on production for 3 days now and it works a treat. +1 to have this committed to dev.

glynster’s picture

I think it is time to RTBC.