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

XF 1.2 Classifying User Upgrades as Donations

Discussion in 'XenForo Questions and Support' started by Kazyyk, Jan 26, 2014.

  1. Kazyyk

    Kazyyk Member

    Hello, XenForo Community!

    I've used search, I've used Google, I've looked into the HTML, I've looked at the php files, and I just can't seem to figure out how to change the type of transaction XenForo makes with PayPal for purchasing a user upgrade.

    I'd like it so that when a user purchases an upgrade that it be flagged as a donation to PayPal, to avoid merchant fees that shouldn't exist as it isn't actually a 'purchase'. As far as I can tell, I can generate the proper links by creating donation flagged donor buttons through PayPal, but I can't figured out how to hook them into the User Upgrade system.

    Any help regarding this would be greatly appreciated.
    wmnitin and shelton like this.
  2. Mike

    Mike XenForo Developer Staff Member

    All of the data sent to PayPal is in the account_upgrades template.
  3. Kazyyk

    Kazyyk Member

    Aye - I've looked at the code inside that template but I still have been unable to figure out how it's getting the unique PayPal address that it uses for purchases.
    I can only assume it's some sort of internal component that I've been unable to find.

    This line in particular stands out to me:
    <input type="hidden" name="custom" value="{$visitor.user_id},{$upgrade.user_upgrade_id},token,{$visitor.csrf_token_page}" />

    But I can't find where $visitor.csrf_token_page is set.
  4. Mike

    Mike XenForo Developer Staff Member

    Don't change that line... :)

    I'm not totally sure what you're trying to change. It will be in the PayPal docs somewhere, but it may interfere with the other components of the system, depending on how PayPal works.

    Trying to change the type may involve the "cmd" param, though this may then change callback details in an invalid way.
  5. Kazyyk

    Kazyyk Member

    The best way I can think to explain it is thusly:

    For simplicity, let's say PayPal offers two modes of transaction (despite them offering more) and let's ignore subscription based transactions for the moment.
    The two transactions we have are:
    • Merchant
    • Donation
    When a user makes a merchant transaction, the way XenForo is currently configured to use, the 'seller' recieves payment and is then asked to print a shipping label if applicable.
    A Merchant transaction is classified by PayPal as an exchange of tender for goods - and as thus, is covered under PayPal's buyer protection.
    This type of transaction also incurs a transaction fee from PayPal, and for larger transactions, this can be in upwards of $5 off the purchase for the seller.

    When a user makes a donation transaction, PayPal recognizes this as a donation and asks for no additional action by the 'seller' or reciever.
    It permits the reciever to easily issue a refund if they so desire, and also waives any transaction fees, resulting in a full monetary exchange.

    My goal here is to switch XenForo's User Upgrades from processing transactions as a Merchant, and instead process them as Donations.
    The experience for the enduser is almost the same, and from what I know, the transaction process is almost identical as well. I can imagine that there may be some callback issues, but I also believe that these can be fixed.
    I'm not a technical guru, but I usually can figure things out - it's just stumped me this time around.
  6. Kazyyk

    Kazyyk Member

    Still haven't figured this out yet. Will keep it updated.
  7. shelton

    shelton Member

    I am interested on this too.
  8. Kazyyk

    Kazyyk Member

    I still haven't figured this out. The PayPal code has to be somewhere in here.
  9. Madhuse

    Madhuse Member

    Have you had any success with this @Kazyyk ?
  10. Alfa1

    Alfa1 Well-Known Member

    This is an important issue, because defining donations as goods can cause a slurry of charge-backs and if you run a non-profit / charitable organization like me then it can also cause issues with the tax agency.
  11. Kazyyk

    Kazyyk Member

    I never could get it figured out, and ended up going with an addon for it instead and moving away from User Upgrades.
    I'm deeply disappointed that the XenForo team doesn't offer support for these types of features, however.

Share This Page