PayPal, php


I am a academic student, wondering if i could get some help verifying a users Paypal e-mail address which has been inputted in a form.

I have found an api but was having a difficult time putting it into practice therefore would really appreciate, if someone could help me.

Paypal api :-

any help would be very much appreciated.

Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
What have you tried so far?  Where did you get stuck?  

The API link requires more than the user's email address.  It requires the postal address as well.  It is not really about verifying an email address; it's more targeted toward finding out if the user's postal address has been verified by PayPal.  Postal address verification is a part of the sign-up process for PayPal.

Maybe if you can describe the problem in more general terms we can offer better help.  PayPal has already done the email, banking and address verification, but the verification is part of their business IP so they would not expose this information to you about another PayPal client unless you were selling something and expecting to receive payment via PayPal and ship products to PayPal verified addresses, etc.
MK15Author Commented:
Thanks for the reply.

I am creating an consumer to consumer store where users can buy and sell goods to each other. I was wanting to ensure that the users PayPal email is correct for fluid transactions to be processed en both parties.
Ray PaseurCommented:
PayPal has already done the work for you.  Anyone who has a PayPal account, who can send and receive money, has been through the verification process.  PayPal is owned by eBay, which is a site where users can buy and sell goods to each other.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

MK15Author Commented:
thanks for the replies.  i have looked at sample codes but was having a difficult time getting it working.  

i understand Paypal have already done the work but i need to be able be sure the user is entering a valid Paypal e-mail address, if this check is not done then any e-mail can be used.

when the seller is receiving payment from the buyer there may be complications as the e-mail provided is not verified.
Scott MadeiraCommented:
What is your difficulty?  Can you post your code here for us to look at?  Using the address verify API you should be able to determine if the email address supplied is a valid PayPal email address.  

If you give us something to start with we may be able to get it to work for you.

MK15Author Commented:
okay. I for examples sakes lets say i have the users email and postal address, how do i use the address verify class to get a response.

what i have done so far is user the constants.php class provided by paypal which has the account credentials stored.

i am confused how to use the class to my benefit - i have been playing around with the transaction detail.php file and removed to see if i get back a response with my details but instead receive a message saying 'failure'.


// clearing the session before starting new API Call

require_once 'CallerService.php';



/* Construct the request string that will be sent to PayPal.
   The variable $nvpstr contains all the variables and is a
   name value pair string with & as a delimiter */

/* Make the API call to PayPal, using API signature.
   The API response is stored in an associative array called $resArray */
$resArray=hash_call("gettransactionDetails",$nvpStr); <--- do i provide the first parameter from the address verify and the second as the credentials? confused!

/* Next, collect the API request in the associative array $reqArray
   as well to display back to the browser.
   Normally you wouldnt not need to do this, but its shown for testing */


/* Display the API response back to the browser.
   If the response from PayPal was a success, display the response parameters'
   If the response was an error, display the errors received using APIError.php.
$ack = strtoupper($resArray["ACK"]);



Open in new window

the constants.php file looks like:-


This is the configuration file for the samples.This file
defines the parameters needed to make an API call.

PayPal includes the following API Signature for making API
calls to the PayPal sandbox:

API Username
API Signature 	A.d9eRKfd1yVkRrtmMfCFLTqa6M9AyodL0SJkhYztxUi8W9pCXF6.4NI

Called by CallerService.php.
# API user: The user that is identified as making the call. you can
# also use your own API username that you created on PayPalís sandbox
# or the PayPal live site
//for 3-token -> API_USERNAME,API_PASSWORD,API_SIGNATURE  are needed

define('API_USERNAME', '');

# API_password: The password associated with the API user
# If you are using your own API username, enter the API password that
# was generated by PayPal below

define('API_PASSWORD', '1255077037');

# API_Signature:The Signature associated with the API user. which is generated by paypal.

define('API_SIGNATURE', 'Abg0gYcQyxQvnf2HDJkKtA-p6pqhA1k-KTYE0Gcy1diujFio4io5Vqjf');

# Endpoint: this is the server URL which you have to connect for submitting your API request.

define('API_ENDPOINT', '');

 # Third party Email address that you granted permission to make api call.
/*for permission APIs ->token, signature, timestamp  are needed
USE_PROXY: Set this variable to TRUE to route all the API requests through proxy.
like define('USE_PROXY',TRUE);
PROXY_HOST: Set the host name or the IP address of proxy server.
PROXY_PORT: Set proxy port.

PROXY_HOST and PROXY_PORT will be read only if USE_PROXY is set to TRUE
define('PROXY_HOST', '');
define('PROXY_PORT', '808');

/* Define the PayPal URL. This is the URL that the buyer is
   first sent to to authorize payment with their paypal account
   change the URL depending if you are testing on the sandbox
   or going to the live PayPal site
   For the sandbox, the URL is
   For the live site, the URL is
define('PAYPAL_URL', '');

# Version: this is the API version in the request.
# It is a mandatory parameter for each API request.
# The only supported value at this time is 2.3

define('VERSION', '65.1');

// Ack related constants


Open in new window


i would appreciate any help just to get me started.

btw thank you for all your support,
MK15Author Commented:
the proposed logic is

1,get authenticated
2,send requests containing the e-mail and postal address of the user
3, determine the responses.

i am finding it difficult to get past the first hurdle.
AlexSoftware EngineerCommented:
Hello MK15,

Please take a look at this link:

I think that will help you definitely!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MK15Author Commented:
AlexSoftware EngineerCommented:
Glad to help you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.