Support » Plugin: PayPal IPN for WordPress » PayPal money receipt lifecycle and how relates to IPN hooks

  • I am curious as to the PayPal lifecycle for money received (regardless if by donation, subscription, transfer etc) and how this relates to the hooks you provide.

    It is nice that you provide so many options for hooking, but for me I want a single point of entry and I want to do it when the money (again, regardless of source or payment type) is confirmed and complete (no holds or holds released etc), what hook would I use in that situation?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor angelleye

    (@angelleye)

    For that you would just use the paypal_ipn_for_wordpress_payment_status_completed hook.

    This will be triggered any time a payment of any kind comes through with the Completed status.

    Perfect, does this also apply for reoccurring payment after the initial payment?

    Plugin Contributor angelleye

    (@angelleye)

    Yes, those will trigger payment IPNs, so those will come through the same way.

    Double perfect. One last question I think, and this is more a technical PayPal question and not necessarily related to you guys but perhaps you would know. I set my IPN via a post variable when transactions are sent to PayPal as I have several sites using one PayPal, my question is if you know if reoccurring payments keep the IPN sent via the post data and reuse that for further notifications on payments on that subscription, or does it revert back to the IPN set up in PayPal settings?

    Plugin Contributor angelleye

    (@angelleye)

    First, if you set the IPN URL the way you mentioned here it’s going to override your PayPal profile setting, so our plugin’s URL would never get hit, and any hooks you have configured would not be triggered.

    Second, no, the recurring payment IPNs would not go to the original URL you set from the button variable. Those would go to whatever you have configured in the PayPal account profile.

    As such, I always recommend that you use our plugin as a catch-all for your IPN solution as a whole. This way you can set the PayPal account to point to the URL our plugin provides, and you’ll have the freedom and flexibility to do anything you need based on payment status, transaction type, etc.

    If you need the data to also be sent to the URL listener you’re using now from the button, that’s where our IPN Forwarder plugin comes into play. This allows you to forward the IPN data out from our base plugin to as many additional URLs as you need, so that they all work together.

    Well i use your plugins URL in the post data, so it has been getting hit, was just hoping to not have to change the setting in PayPal, though it may be moot since it does not maintain the custom IPN after the initial transaction, odds are it does not keep the “custom” field either which is where I store the user info, so my IPN hook wouldn’t be able to link the payments back to user accounts anyway.

    Is there any functionality to link subsequent subscription payments to the initial one which would have the info about the user that I store in the custom field?

    Plugin Contributor angelleye

    (@angelleye)

    Well, yes, but we need to clarify exactly what product you’re using. Are you creating Subscription buttons with PayPal Standard (HTML forms), or are you building recurring profiles using API calls?

    Just a subscription with HTML forms

    Plugin Contributor angelleye

    (@angelleye)

    You should have a subscr_id that gets returned when you create the initial profile, and that same ID should be available in the subsequent subscription payments so that you can match them up.

    So I typically like to add the subscr_id to my user profile record (or a related subscriptions table) with the actual payments in a related payments table.

    This would give you a tight relationship between all the data so you can pull any queries you need.

    Hmm, may be a little outside your plugins scope, but since you are recording IPN responses into a table anyway, a lookup function to lookup subscr_id and return original IPN message from subscription creation would be nice. I have 90k users so I am doing everything I can to keep user meta down.

    Plugin Contributor angelleye

    (@angelleye)

    That sort of thing could be done pretty easily if you’re a WordPress coder, and that’s really what this plugin is for.

    The whole idea is that it will quickly get you setup with an IPN data holder, basically, and let you do whatever you want to do with that data.

    Are you familiar with writing hook functions for WordPress and interacting with the DB in general?

    Yea, I just figured it would be a helper function that would be commonly used enough to incorporate it into this plugin, but I will likely code it into mine.

    Oliver

    (@angelleyesupport)

    Great! Lets us know if you have any other questions or concerns.
    Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘PayPal money receipt lifecycle and how relates to IPN hooks’ is closed to new replies.