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

Xenforo PayPal IPN

Discussion in 'XenForo Pre-Sales Questions' started by mongs, Apr 15, 2013.

  1. mongs

    mongs New Member

    Hello! I'm thinking about buying XenForo but there's one thing I haven't been able to find on the forum or on google. I need the ability to create user upgrades, which XenForo supports natively, and from what I can see after hours of googling is that it uses it's own IPN to work out the PayPal transactions.

    I need the above feature to stay intact but I also need to use an extra IPN for a Minecraft plugin that operates on another database. Since XenForo uses it's own PayPal form with the:
    <input type="hidden" name="custom" value="{$visitor.user_id},{$upgrade.user_upgrade_id},token,{$visitor.csrf_token_page}" />
    I cannot use the value from that input form. My other IPN needs to fetch the input above with the value="mc_account" from a custom field that the user has to type in at registration.

    To the point:
    a) Is it possible to somehow include the other IPN but "cut away" the default value XenForo uses in its name="custom" input tag and replace it with the value from a custom field? Then send this information to the other IPN.

    b) Or could you just edit the code to instead say:
    <input type="text" name="custom" value="Enter Minecraft IGN" />
    (i.e use another value than XenForo uses by default.)

    Right now I'm using a phpBB forum that uses option b).

    I certainly hope either a) or b) can be done because I really want to buy XenForo, and my server is completely funded by donations so it is crucial that a feature like this could be used.

    Very sorry for the overcomplicated and long explanation!
  2. mongs

    mongs New Member

    Bump. Anyone knows?:)
  3. shadrxninga

    shadrxninga Well-Known Member

  4. mongs

    mongs New Member

    That definately looks like something I could use!

    Now since I've never worked with XenForo before, how would you use this plugin/add-on(?) to insert values from a custom field? Since I want my members to be able to have a different forum name than ingame name I would have to somehow read that value from another table, right? Or is everything user-related, even custom fields, stored inside the "xf_user" table?

    Thank you for responding! :)
  5. shadrxninga

    shadrxninga Well-Known Member

    To get the details on the user, you could use this:
    $servers = XenForo_Model::create('Xenforo_Model_User')->getUserById(id);
    And yes, you would have to read that from another table, the custom fields are not stored in the same table, instead the field types are stored in 'xf_user_field' and they're assigned to users in 'xf_user_field_value'. You could use a model for this too, or you could just query the database to get their minecraft username.

    So... go ahead and by Xenforo! You'll be able to do what you want to do with it. If you need anymore help after you've bought it - then send me a PM.
  6. mongs

    mongs New Member

    This sounds awesome. Could it be tweaked to handle PayPal refunds or user downgrades and perform SQL queries if needed there too? I suppose this isn't something XenForo and this plugin supports natively? If not I might have to look into something else.

    I do want to buy it! But I really need to reassure I'm not spending all my users money on something that couldn't be implemented to our regular gameplay without adding a ton of game addons and such.

    Thanks for responding! :)
  7. shadrxninga

    shadrxninga Well-Known Member

    Yes, you can. You just need to put this method in the same file as the other upgrade one.
    public function downgradeUserUpgrades(array $upgrades){
    //downgrade user code here
    I'm not too sure about refunds (but when you're refunding someone - you could easily just manually downgrade them in the AdminCP - which will then run your custom downgrade code.)

    You'll have to look into how to make an add-on too, here's a few links which will help you out:

Share This Page