Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to figure out how cancelled PayPal WPS subscriptions are supposed to be expired.
The fees associated with the PayPal subscriptions are set to own_handler = 1 in the database, but uc_recurring_get_fees_for_expiration() only looks for fees that have own_handler = 0. This looks like uc_recurring is expecting PayPal to handle the expiration, but, as far as I can tell, there aren't any further IPNs coming from PayPal once a subscription is cancelled.
Comments
Comment #1
univate CreditAttribution: univate commentedWhen I used paypal a few years ago they sent a IPN message on expiration - i think its a message with txn_type = "subscr_eot"
Not sure the paypal code here is handling that message to actually "expire" the subscription - shouldn't be a massive amount of effort to add that.
Take a look in modules/uc_recurring_hosted/uc_recurring_hosted.paypal_ipn.inc
Comment #2
KirkF CreditAttribution: KirkF commentedSince I'm not seeing any PayPal IPNs for expiration, I figure I can modify the query in uc_recurring_get_fees_for_expiration() to ignore the own_handler setting.
Before I do that, though, I wanted to make sure that this won't cause any other problems - I don't think it will, since the site is only using PayPal for purchasing subscriptions.
Thanks!
Comment #3
dunx CreditAttribution: dunx at Webgreen Systems Limited commentedSo a WPS recurring fee doesn't actually expire? Not ideal and a fairly major issue!
No idea why a WPS recurring order is set to have its own handler as the subscr_eot IPN is treated exactly the same way as a subscr_cancel.
As the poster above said, just modify the sql in uc_recurring_get_fees_for_expiration.
From:
$result = db_query("SELECT * FROM {uc_recurring_users} WHERE remaining_intervals = 0 AND next_charge <= %d AND own_handler = 0 AND status <> %d ORDER BY order_id DESC", time(), UC_RECURRING_FEE_STATUS_EXPIRED);
To:
$result = db_query("SELECT * FROM {uc_recurring_users} WHERE remaining_intervals = 0 AND next_charge <= %d AND (own_handler = 0 OR (own_handler = 1 AND fee_handler = 'paypal_wps')) AND status <> %d ORDER BY order_id DESC", time(), UC_RECURRING_FEE_STATUS_EXPIRED);
And yes, I know... I should be moving to D7 before anybody else says it ;)
Comment #4
apadernoI am closing this issue, since it's for a Drupal version no longer supported.