Posted 05 November 2002 - 09:59 PM
I am a little confused here. am I suppose to check the email against the users email in my DB or somewhere else?
- Mymnrumourf, xxkalliy and Infevavof like this
Posted 06 November 2002 - 02:03 AM
reciever_email is the Merchant, the person who is doing the 'selling' so to speak. You need to check that the reciever_email variable that is posted to your script from the paypal server is the same as the one YOU (or YOUR seller)use to log in to paypal.
A simple check in perl is:
$myPaypalEmail = 'firstname.lastname@example.org';
if($reciever_email eq $myPaypalEmail)
#continue with processing transaction
#do not process transaction
You do not really need to check the reciever_email but Paypal recommends it, I guess you want to ensure that the 'money' is going into your account and not someones elses.
You should also check that the transaction is not a duplicate to prevent processing the order more than once. You should check the variable txn_id against previous txn_id's, you can store these in a file or database table.
#check that txn_id is not a duplicate
$dbh = DBI->connect("DBI:$datasource:$login:$password");
$select = "SELECT COUNT(*) FROM tnx WHERE txn_id = \'$txn_id\'";
$sth = $dbh->prepare($select);
if ($row = $sth->fetchrow_array())
$count = $row;
if ($count == 0)
#store txn_id in database
Also,the payer_email variable refers to the email of the individual who is making the purchase.
Hope this clears it up, apologies if my perl is a bit messy!
Posted 06 November 2002 - 06:06 PM
I got it checking but when I ran some test it passed and worked ok, but when I ran a test from the paypal server it just logged in to the paypal rather than go to my script.
they sure don't make this easy do they
the script (which was perl) was using the subsciption method and now we went to php and IPN and used the script that paypal said to use for php. nothing seems to work as it didn't log anything and just logged teh user in to payapl.
Posted 07 November 2002 - 08:58 AM
It sounds like from what you are saying that after you have completed payment on the paypal site and then it logs you in too your (the buyer) paypal account rather than appearing to run your (the merchant) script, and then return to your site.
This is a easy problem to fix, ensure that IPN is enabled and that you have specified a URL (your script). Make sure that when you make your button that you specifiy a return url (such as thankyou.pl, this page must be able to accept POST, so it will be a php in your case) for the paypal to goto after payment. If you do not specify a return URL then paypal 'chooses' where you go, this is usually into the buyers account. This goes the same for the cancel_return url, unless you specify one it will take you into your paypal account.
It should run your script ok if you don't specifiy one,but you might not see the outcome, since you are in the buyer paypal account.
hope this helps
Posted 07 November 2002 - 12:45 PM
I have had it tested at one of teh test scipt sites and it worked really good. fournd out i had some syntaz errors that I over looked, but now my script says invalid. not sue why yet but am looking into it.
also if I use some subscription variables it doesn't send a subscription notice but just a single buy instead.
Posted 08 November 2002 - 07:08 AM
again it sounds as if your problem with not getting the subscription variables lies with the paypal button. You need to make sure that you use the subscription factory to make your button. Otheriwse the variables will not passed in the first place.
If thats not the source of the problem, them I would post a note on the
subscriptions forum, developers on there maybe better suited to help you. My experience of paypal is so far linmited to IPN and single puchase.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users