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

I can't get Paypal to contact my IPN script Options
waytech
#1 Posted : Thursday, November 14, 2002 9:07:07 PM
Rank: Starting Member

Groups: Registered

Joined: 11/14/2002
Posts: 3
Location: ,
I can't get Paypal to contact my IPN script no matter what I did. My paypal account is a business account, and it's verifiled. I also activated the IPN support and put in the url of my IPN script. I did tests, each time, i could receive emails from paypal to notify that i had a subscription,but i received no post to my IPN scripts. I changed the ipn url in paypal to my other IPN scripts. But it seems that all scripts didn't conmmunicate with paypal at all. I wondered whether paypal has diabled this function of my account or not? Does paypal update the IPN URL immediately if i change it ? Can some provide a really simple but accurate IPN script that i can use on my server(supports php and perl) to do a test to make sure whether paypal post the notification or not ? So i can know whether it's paypal's problem or not. Please help !!!! Thanks a lot !!! vwaytech@yahoo.com braveheart
Sponsor  
 
paypal_pb
#2 Posted : Thursday, November 14, 2002 9:46:32 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
#!/usr/bin/perl

$mailprog = '/usr/sbin/sendmail';

# read the post from PayPal system and add 'cmd'
if ($ENV{'REQUEST_METHOD'} eq "GET") {
$query = $ENV{'QUERY_STRING'};
}
else {
read (STDIN, $query, $ENV{'CONTENT_LENGTH'});
}

# post back to PayPal system to validate
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$req = new HTTP::Request 'POST','http://www.paypal.com/cgi-bin/webscr';
$req->content_type('application/x-www-form-urlencoded');
$req->content($query . '&cmd=_notify-validate');
$res = $ua->request($req);

# split posted variables into pairs
@pairs = split(/&/, $query);
$count = 0;
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$variable{$name} = $value;
$count++;
}

# assign posted variables to local variables
$receiver_email = $variable{'receiver_email'};
$item_name = $variable{'item_name'};

open(MAIL,"|$mailprog -t");

print MAIL "To: vwaytech\@yahoo.com\n";
print MAIL "Cc: $variable{'receiver_email'}\n";
print MAIL "From: vwaytech\@yahoo.com\n";
print MAIL "Subject: Test: $item_name\n\n";
print MAIL localtime() . "\n\n";
print MAIL "$query\n\n";

print "Content-Type: text/html\n\n";
print "<html><body>" . localtime() . "<p>";
print "$query\n\n<p>";

if ($res->is_error) {
print MAIL "HTTP ERROR\n\n";
print "HTTP ERROR<p></body></html>";
}
elsif ($res->content eq 'VERIFIED') {
print MAIL "VERIFIED\n\n";
print "VERIFIED<p></body></html>";
}
elsif ($res->content eq 'INVALID') {
print MAIL "INVALID\n\n";
print "INVALID<p></body></html>";
}
else {
print MAIL "ERROR\n\n";
print "ERROR<p></body></html>";
}

close(MAIL);

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
paypal_pb
#3 Posted : Thursday, November 14, 2002 9:47:44 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
First, you should try setting your success "return" URL to point to your IPN script. The "Continue" button on the final PayPal page that links back to your site will include all of the IPN variables.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
waytech
#4 Posted : Thursday, November 14, 2002 11:27:40 PM
Rank: Starting Member

Groups: Registered

Joined: 11/14/2002
Posts: 3
Location: ,
hi Patrick,

I used the script u gave me and did the test, below is the
result of the test.:

my Instant Payment Notification Preferences in paypal are:
Instant Payment Notification (IPN): On
Instant Payment Notification (IPN) URL: http://www.mydomain.com/cgi-bin/ipn-test.cgi

======================================================


And my signup file(paypal.html) is:

<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="waytech@nofraud.org">
<input type="hidden" name="item_name" value="Monthly membership">
<input type="hidden" name="item_number" value="21009">
<input type="hidden" name="return" value="http://www.mydomain.com/cgi-bin/ipn-test.cgi">
<input type="image" src="https://www.paypal.com/images/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a1" value="0.00">
<input type="hidden" name="p1" value="30">
<input type="hidden" name="t1" value="D">
<input type="hidden" name="a3" value="19.95">
<input type="hidden" name="p3" value="30">
<input type="hidden" name="t3" value="D">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
</form>
</body>
</html>

==============================================

This is the error i received from browser
after i pressed the "Access subscription":

Thu Nov 14 17:09:31 2002

ERROR

================================================

What does the error mean ?

does it mean my testing script did

not communicate with paypal at all ?

Do u think the error is in my server side or

in paypal side ?

did paypal really activate my IPN function ?

What else i can do ......



braveheart
paypal_pb
#5 Posted : Friday, November 15, 2002 3:17:12 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
For subscriptions, the "Access" button does *not* include all the IPN fields.

Can you POST this FORM to your script:

<form method="post" action="http://www.mysite.com/ipn.cfm">
<input type="submit" name="" value="Test IPN">
<input type="hidden" name="payment_date" value="17:53:45 Nov 5, 2002 PST">
<input type="hidden" name="txn_type" value="web_accept">
<input type="hidden" name="last_name" value="Breitenbach">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="payment_gross" value="0.01">
<input type="hidden" name="mc_currency" value="USD">
<input type="hidden" name="payment_type" value="instant">
<input type="hidden" name="verify_sign" value="AlWncXKLadIepzMosHhM.VWxC0Z6AZYI0ynXRnEUma0d3RMC.TXWaJro">
<input type="hidden" name="payer_status" value="unverified">
<input type="hidden" name="payer_email" value="pb-test@paypal.com">
<input type="hidden" name="txn_id" value="01G32341KC3727119">
<input type="hidden" name="first_name" value="Patrick">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="receiver_email" value="pb-sell@paypal.com">
<input type="hidden" name="payer_id" value="QGVDAFGZ9XHLJ">
<input type="hidden" name="payment_method" value="non_cc">
<input type="hidden" name="item_number" value="">
<input type="hidden" name="payment_status" value="Completed">
<input type="hidden" name="mc_gross" value="0.01">
<input type="hidden" name="custom" value="">
<input type="hidden" name="notify_version" value="1.4">
</form>

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
paypal_pb
#6 Posted : Friday, November 15, 2002 3:18:14 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
If you're using .htaccess password protection, you should consider using Password Management for which we provide a PERL script that automatically updates your .htpasswd file. Log in to PayPal and go to "Sell > Subscriptions" to download the script.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
waytech
#7 Posted : Friday, November 15, 2002 4:04:53 PM
Rank: Starting Member

Groups: Registered

Joined: 11/14/2002
Posts: 3
Location: ,
hi, this is the messege i got from browser
if i post your form to
my scripts
=====================================

Fri Nov 15 09:55:38 2002
payment_date=17%3A53%3A45+Nov+5%2C+2002+PST&txn_type=web_accept&last_name=Breitenbach&item_name=&payment_gross=0.01&mc_currency=USD&payment_type=instant&verify_sign=AlWncXKLadIepzMosHhM.VWxC0Z6AZYI0ynXRnEUma0d3RMC.TXWaJro&payer_status=unverified&payer_email=pb-test@paypal.com&txn_id=01G32341KC3727119&first_name=Patrick&quantity=1&receiver_email=pb-sell@paypal.com&payer_id=QGVDAFGZ9XHLJ&payment_method=non_cc&item_number=&payment_status=Completed&mc_gross=0.01&custom=¬ify_version=1.4

VERIFIED
=========================================
In the email i received:
i got the following errors:
The following error message was generated while trying to acknowledge
IPN:
Notification could not be acknowledged due to a network or PayPal
issue. PayPal will retry until it succeeds.


User Information
Subscriber's Username:
Subscriber's Email:
Subscription Number:
Transaction Type:
===============================================


what does it mean ?

anything i should change in my end ?

i download the perl script from paypal and installed it

it can generated password and username through paypal.

but did not update my .htpasswd file at all.

that's why i want to know, whether

paypal communicate with my script or not

please tell me what i should do next ?




braveheart
Users browsing this topic
Guest (2)
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.295 seconds.