SMF bug (untracked?) re invalid transaction types/not handling cancellation


  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

First up, I dispute the assertion that it is txn_type = subscr_cancel that causes it to fail, because it isn't. Following the logic as best I can (bearing in mind I glanced rather than studied in depth, vs what the IPN variables list says), the reason it fails where it does with the error it does is because of the check made in Subscriptions-PayPal.php's paypal_payment::isValid() routine.

Specifically, it's failing there because the email address given in the admin panel no longer matches the one PayPal was using (you know, like the reporter said), and fails at that hurdle. So we need to update isValid() to be able to return bool true for successful, or any other value as a text string to identify exactly what failed.[1]

There IS a fault also that txn_type = subscr_cancel isn't handled. The correct solution is to have an isCancelled() method, which checks the txn_type, and returns that to the subs handler. As I understand it, subscr_cancel is to cancel further subscription payments and as such all it has to do is flag the subscription as 'do not auto-renew'.
 1. Because that's half the battle: understanding what's actually wrong.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial