Search code examples
phppaypalpaypal-ipnpaymentpaypal-subscriptions

PayPal Subscription and IPN


I have few questions regarding PayPal subscriptions and IPN.

According to this answer, when using PayPal recurring payments (subscriptions), PayPal sends two types of notifications when a subscription is made:

a) An IPN with txn_type of subscr_signup is sent once

b) An IPN with txt_type of subscr_payment is a recurring IPN that is sent every time a subscription payment is made.

So I have the following questions

  1. Is the custom field sent for every subscr_payment made? And does it have the same value always?

  2. What is subscr_id? Is it subscriber ID or subscription ID? I am assuming it is the subscriber ID, and therefore, I am also assuming that it will be the same per subscriber if he/she has more than one subscription in the site (assuming the site offers more than one item available for subscription). Is my assumption correct?

  3. Is txt_id different for every new transaction? In other words, when two consecutive payments are made for the same subscription, are they going to have different txt_id's?

  4. What is the id field in subscr_payment?

  5. Is there a field that is sent with the subscr_payment message which allows us to identify which subscription is being renewed? I am thinking this is a subscription ID that will have the same value for all payments made to that subscription. Again, the reason I ask is my site is offering more than one subscription per user. And I need a way to identify which subscription is being renewed when an IPN message is sent.


Solution

  • 1) No, it will not be included in the payment IPNs.

    2) It's basically the same thing. Their documentation calls it a "subscriber ID" but it's treated as a subscription profile ID.

    3) You must mean txn_id..?? Yes, each individual payment for a profile would have its own txn_id. I'm a little confused how you would two consecutive payments, though..?? It would be per week, per month, or whatever the profile is setup as.

    4) Need a sample of what you're referring to here.

    5) Again, this would be the subscr_id.