payment_callback.php intercepter

Is there any way to intercept payment_callback.php, get info from it and not harm the upgrade process w/o modifying payment_callback.php?

I am making an addon where when a user upgrades he/she is instantly upgraded on lets say a game server. I am pretty sure the only way to know if someone upgraded right away is if you are able to intercept it like that or have a db check for new info every second. And of coarse I do not want that. I do not want a db check every hour either I want it instant. I have analyzed it and could not find anything. I just need to intercept the user_id and (I think) user_upgrade_id (hopefully that tells you what package they ordered). I will then take this info, match it up to their steam id and send a command to the server to upgrade them. So any ideas on the intercept?

Thanks guys! This is my first addon for xenforo btw :D
 
You should hook into the XenForo_Model_UserUpgrade class.

The upgradeUser() method is run when they are upgraded and downgradeUserUpgrades() is run when they are downgraded.
 
So I when I try to test my plugin and I want to print a value out to see if it is correct, how do I do that? Where would I look for the print? Or should I be using errors to look up in the error log?
 
No idea... not really sure what you are trying to do... you could test your stuff being triggered by manually upgrading/downgrading a user via the User Upgrade system in the admin area.
 
No idea... not really sure what you are trying to do... you could test your stuff being triggered by manually upgrading/downgrading a user via the User Upgrade system in the admin area.
No, I want to see if my code works for something like this

Code:
$_UserSendId = $userId;
$_UserUpgradeSend = $userUpgradeId;

And then print $_UserSendId and $_UserUpgradeSend to see if the intercept worked. I just need to know a way to print so I can see the print somewhere.
 
Forget the running manually. If I have an echo and everything runs regularly and it echo'd, where would I see the echo? I want to make sure the intercept worked
 
Top Bottom