Parsing Paypal Recurring Subscriptions

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Parsing Paypal Recurring Subscriptions

Post by volomike »

I posted the following on StackOverflow and got no response. Anyone have an idea what statuses to check for in PayPal? I'm using a PHP script for a membership site I wrote. I need to parse txn_type value from the PayPal IPN so that if someone stops payment, has an end of term, or otherwise cancels their subscription, I can have my PHP script email a membership admin so that he can stop their account.

http://stackoverflow.com/questions/1385 ... on-ran-out
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Parsing Paypal Recurring Subscriptions

Post by califdon »

I've never dealt with subscriptions, so I can't help you, but have you tried the PayPal forums? Back when I was working on a PayPal enabled site, I found them to be fairly responsive.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Parsing Paypal Recurring Subscriptions

Post by Eric! »

You'll get txn_type='subscr_cancel'

Here's the docs:
[text]txn_type:
'subscr_signup" This Instant Payment Notification is for a subscription sign-up.
"subscr_cancel" This Instant Payment Notification is for a subscription cancellation.
"subscr_modify" This Instant Payment Notification is for a subscription modification.
"subscr_failed" This Instant Payment Notification is for a subscription payment failure.
"subscr_payment" This Instant Payment Notification is for a subscription payment.
"subscr_eot" This Instant Payment Notification is for a subscription's end of term.

subscr_date:
Transaction-specific Start date or cancellation date depending on whether transaction is "subscr_signup" or "subscr_cancel"

subscr_effective:
Transaction-specific Date when the subscription modification will be effective (only for txn_type = subscr_modify)[/text]
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: Parsing Paypal Recurring Subscriptions

Post by volomike »

I found that all I really need to look for are:

subscr_cancel
subscr_eot

As far as "membership ran out" type reactions in my code, I should ignore all the others as just "noise". I mean subscr_failed, for instance, is not something to be concerned about because after 3 attempts after receiving a subscr_failed, PayPal automatically sends subscr_cancel. To react on subscr_failed, disabling a subscription for instance, would not be the right way to handle things.
Post Reply