Jump to content


Photo

receiver_email?


  • This topic is locked This topic is locked
5 replies to this topic

#1 scoutt

scoutt

    Junior Member

  • Members
  • 139 posts

Posted 05 November 2002 - 09:59 PM

"check that receiver_email is an email address in your PayPal account"

I am a little confused here. am I suppose to check the email against the users email in my DB or somewhere else?

http://www.snippetlibrary.com
  • Mymnrumourf, xxkalliy and Infevavof like this

#2 Bruce

Bruce

    Member

  • Members
  • PipPip
  • 14 posts

Posted 06 November 2002 - 02:03 AM

Hi Scoutt,

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 = 'myemailaddress@mydomain.co.uk';

if($reciever_email eq $myPaypalEmail)
{
#continue with processing transaction
}
else
{
#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);
$sth ->execute();
if ($row = $sth->fetchrow_array())
{
$count = $row;
}
$sth ->finish();
if ($count == 0)
{
#unique txn_id
#store txn_id in database
#process transaction
}
else
{
#duplicate txn_id
#ignore
}


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!
Bruce

#3 scoutt

scoutt

    Junior Member

  • Members
  • 139 posts

Posted 06 November 2002 - 06:06 PM

thanks Bruce, I have cleared up the txn_id but the receiver_email was just throwing me.

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.

any thoughts?

http://www.snippetlibrary.com

#4 Bruce

Bruce

    Member

  • Members
  • PipPip
  • 14 posts

Posted 07 November 2002 - 08:58 AM

Hi scoutt,

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
Bruce



#5 scoutt

scoutt

    Junior Member

  • Members
  • 139 posts

Posted 07 November 2002 - 12:45 PM

Yes Bruce that was it, I hd notify_url instead of return. now it returns whit an error all the time.

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.

http://www.snippetlibrary.com

#6 Bruce

Bruce

    Member

  • Members
  • PipPip
  • 14 posts

Posted 08 November 2002 - 07:08 AM

Scoutt,

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.

Cheers
Bruce
http://www.serendipity-interactive.com






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users