1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

payment_callback.php intercepter

Discussion in 'XenForo Development Discussions' started by Vince Taglia, Feb 26, 2013.

  1. Vince Taglia

    Vince Taglia Member

    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
     
    Russ likes this.
  2. digitalpoint

    digitalpoint Well-Known Member

    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.
     
  3. digitalpoint

    digitalpoint Well-Known Member

    No, you would just use the normal Code Event Listener system and extend the user upgrade model that way.
     
  4. Vince Taglia

    Vince Taglia Member

    Ya idk why I asked that it was a stupid question I knew the answer to. >.<
     
  5. Vince Taglia

    Vince Taglia Member

    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?
     
  6. digitalpoint

    digitalpoint Well-Known Member

    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.
     
  7. Vince Taglia

    Vince Taglia Member

    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.
     
  8. digitalpoint

    digitalpoint Well-Known Member

    I guess you could just echo stuff out or something. {shrug}
     
  9. Vince Taglia

    Vince Taglia Member

    Ya but where can I see the echo?
     
  10. digitalpoint

    digitalpoint Well-Known Member

    When you run it manually from the admin?
     
  11. Vince Taglia

    Vince Taglia Member

    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
     
  12. digitalpoint

    digitalpoint Well-Known Member

    You would see it when you ran it manually (assuming you are extending the methods mentioned above).
     
  13. Vince Taglia

    Vince Taglia Member

    I am fairly new to php. How would I create a Listener for that?
     
  14. digitalpoint

    digitalpoint Well-Known Member

    Lawrence likes this.

Share This Page