YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Payment_status is Undefined Options
KimMazz
#1 Posted : Monday, January 10, 2005 5:48:13 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2005
Posts: 7
Location: ,
I have an IPN set up for a recurring subscription to my site. The IPN code I am using is straight from PayPal. If I eliminate the check for payment status the IPN works. But if I check for the status is throws an error. The payments still go through and the emails are sent, but the IPN throws an error. I thought the field "payment_status" was a dynamic field sent from PayPal. I can't see where to add it or where to get it from. Code below: <!-- read post from PayPal system and add 'cmd' --> <cfset str="cmd=_notify-validate"> <cfloop index="TheField" list="#Form.FieldNames#"> <cfset str = str & "#LCase(TheField)#=#URLEncodedFormat(Form[TheField])#"> </cfloop> <cfif IsDefined("FORM.payment_date")> <cfset str = str & "&payment_date=#URLEncodedFormat(Form.payment_date)#"> </cfif> <cfif IsDefined("FORM.subscr_date")> <cfset str = str & "&subscr_date=#URLEncodedFormat(Form.subscr_date)#"> </cfif> <!-- post back to PayPal system to validate --> <cfhttp url="https://www.paypal.com/cgi-bin/webscr?#str#" method="GET" resolveurl="false"> </cfhttp> <!-- assign posted variables to local variables --> <cfset receiver_email = FORM.receiver_email> <cfset item_name = FORM.item_name> <cfset item_number =FORM.item_number> <cfset payer_email =FORM.payer_email> <cfset first_name=FORM.first_name> <cfset last_name=FORM.last_name> <!-- check notification validation --> <cfif #CFHTTP.FileContent# is "VERIFIED"> <!-- check that payment_status=Completed --> <cfif FORM.payment_status eq "Completed"> <!-- check that receiver_email is your email address --> <cfif #FORM.RECEIVER_EMAIL# eq "myemailaccount@aol.com"> <!-- process payment --> <!--- send user an email ---> here an email is sent to the user for login directions Kim
Sponsor  
 
PayPalStephen
#2 Posted : Monday, January 10, 2005 5:57:53 PM
Rank: Starting Member

Groups: Registered

Joined: 10/17/2002
Posts: 2,139
Location: ,
Hello,

With a subscription you will get two IPN post with a sign-up, one will have the payment_status (txn_type = subscr_payment) the other will not (txn_type = subscr_signup).

Is your script producing the error for the one that does not?

If you are offering a free trial, you will not see the payment_status until the trial is over and the first payment is made.

Stephen Ivaskevicius
PayPal/eBay, Inc.
www.paypal.com/pdn
KimMazz
#3 Posted : Monday, January 10, 2005 6:37:59 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2005
Posts: 7
Location: ,
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by PayPalStephen
[br]Hello,

With a subscription you will get two IPN post with a sign-up, one will have the payment_status (txn_type = subscr_payment) the other will not (txn_type = subscr_signup).

Is your script producing the error for the one that does not?

If you are offering a free trial, you will not see the payment_status until the trial is over and the first payment is made.

Stephen Ivaskevicius
PayPal/eBay, Inc.
www.paypal.com/pdn
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Kim
KimMazz
#4 Posted : Monday, January 10, 2005 6:40:34 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2005
Posts: 7
Location: ,
Sorry Stephen,

There was problem with my login (to paypal board) so it bounced and I didn't think to check the message when correcting my login.

Anyway, I am not checking for the txn_type. Should I be testing for that rather than payment_status?

txn_type is being posted as "subscr_signup" with a new subscripton, but I don't know how it gets posted with a payment as I can't seem to test for that.

Kim

Kim
KimMazz
#5 Posted : Monday, January 10, 2005 6:55:44 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2005
Posts: 7
Location: ,
Stephen,

Is your script producing the error for the one that does not?

No it doesn't produce an error if I don't check for payment_status

Kim


Kim
PayPalStephen
#6 Posted : Monday, January 10, 2005 7:41:09 PM
Rank: Starting Member

Groups: Registered

Joined: 10/17/2002
Posts: 2,139
Location: ,
Hello,

You can match up a sign up with a payment by looking for the subscr_id = S-12G243244N352460K

Stephen Ivaskevicius
PayPal/eBay, Inc.
www.paypal.com/pdn
KimMazz
#7 Posted : Monday, January 10, 2005 8:04:49 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2005
Posts: 7
Location: ,
Stephen,

I am not sure If I understand, If the subscr_id is being passed and it is do I need to save it in my database so that it can be checked? Right now I am not saving any of that info. I set up my ipn as follows:
&lt;!--- send user an email If it's an NEW subscription---&gt;

&lt;cfif IsDefined("variables.payment_type") AND variables.payment_type eq "subscr_signup"&gt;

all the rest of the code here for emails about loging and such.

&lt;!--- send user an email If it's an NEW subscription---&gt;

&lt;cfif IsDefined("variables.payment_type") AND variables.payment_type eq "subscr_payment"&gt;

don't send a new email with login info just send one saying thank you for your continued support.

Should this work?

If I set my subscr_id as a varialbe isn't that different every time?


Kim
PayPalStephen
#8 Posted : Monday, January 10, 2005 8:17:05 PM
Rank: Starting Member

Groups: Registered

Joined: 10/17/2002
Posts: 2,139
Location: ,
Hello,

I see what you are doing now, what are you going to do if a subscriber terminates their subscription? How are you going to restrict their access?

Are you using the Perl Password Management Script, then your CF script after? Are you having the Perl script write the user ID and password PP give them to the .htpassword file?

If you are using the Perl Password Management script as is, and using your CF script to send out an email based on sign up v payment, then that should be fine.

Stephen Ivaskevicius
PayPal/eBay, Inc.
www.paypal.com/pdn
KimMazz
#9 Posted : Monday, January 10, 2005 9:01:30 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2005
Posts: 7
Location: ,
[quote]Originally posted by PayPalStephen
[br]Hello,

I see what you are doing now, what are you going to do if a subscriber terminates their subscription? How are you going to restrict their access?

Once this is working - and coded correclty I will add additional code that checks the IPN for subscription cancellation and then set the access that way. THe Member Expiration date will be updated in the db to reflect the cancellation date.

Are you using the Perl Password Management Script, then your CF script after? Are you having the Perl script write the user ID and password PP give them to the .htpassword file?

NO, the enail that they receive directs them to a sign up page and then they create their own account. So I have to code the IPN to search for them and update their record accordingly.

If you are using the Perl Password Management script as is, and using your CF script to send out an email based on sign up v payment, then that should be fine.

If I am not using the Perl Password Management script will what I have outlined work anyway?


Kim
PayPalStephen
#10 Posted : Monday, January 10, 2005 9:50:43 PM
Rank: Starting Member

Groups: Registered

Joined: 10/17/2002
Posts: 2,139
Location: ,
Hello,

How are you setting the cancellation date? do you have the subsriptions set for a specific time, or are you going to extend the subscription to the next payment due date once you have received a payment?

Stephen Ivaskevicius
PayPal/eBay, Inc.
www.paypal.com/pdn
KimMazz
#11 Posted : Monday, January 10, 2005 10:40:30 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2005
Posts: 7
Location: ,
I am going to extend it once I receive payment.


Kim
PayPalStephen
#12 Posted : Tuesday, January 11, 2005 1:25:25 PM
Rank: Starting Member

Groups: Registered

Joined: 10/17/2002
Posts: 2,139
Location: ,
Hello,

Sounds good so far. Keep us posted on how it goes.

Stephen Ivaskevicius
PayPal/eBay, Inc.
www.paypal.com/pdn
listingware
#13 Posted : Saturday, September 17, 2005 1:26:36 PM
Rank: Starting Member

Groups: Registered

Joined: 9/17/2005
Posts: 2
Location: ,
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by PayPalStephen
[br]Hello,

With a subscription you will get two IPN post with a sign-up, one will have the payment_status (txn_type = subscr_payment) the other will not (txn_type = subscr_signup).

Is your script producing the error for the one that does not?

If you are offering a free trial, you will not see the payment_status until the trial is over and the first payment is made.

Stephen Ivaskevicius
PayPal/eBay, Inc.
www.paypal.com/pdn
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

So, are you saying that IPN sends TWO separate POSTS to my IPN script? I was seeing this exact situation but couldn't understand why the signups were occurring correctly (so it seemed).

Bob Hendren
ListingWare, Inc.
squire40
#14 Posted : Wednesday, September 26, 2007 3:59:12 PM
Rank: Starting Member

Groups: Registered

Joined: 9/26/2007
Posts: 2
Location: ,
I'm having a similar problem as the one described above. The problem is, the script I'm maintaining requires the payment_status parameter be returned from the PayPal IPN in order to successfully store the transaction. What I'm missing is how to indicate that the transaction is a subscription renewal rather than a new signup. Any ideas? Also, I'm testing using two sandbox accounts. Does that make a difference? Thanks.


Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.468 seconds.