PayPal, php

Hi,

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 :- https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_AddressVerify

any help would be very much appreciated.

Thanks in advance.
MK15Asked:
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.
0
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.
0
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.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

liveaspankajCommented:
0
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.
0
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.

0
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'.

 
<?php


// clearing the session before starting new API Call
session_unset();

require_once 'CallerService.php';

session_start();

$transactionID=urlencode('20P46879S1049380U');

/* 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 */
$nvpStr="&TRANSACTIONID=$transactionID";



/* 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 */

$reqArray=$_SESSION['nvpReqArray'];

/* 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"]);

var_dump($ack);


?>

Open in new window


the constants.php file looks like:-

 
<?php
/****************************************************
constants.php

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 	sdk-three_api1.sdk.com
API Password 	QFZCWN5HZM8VBG7Q
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', 'platfo_1255077030_biz_api1.gmail.com');
//

/**
# 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
# IMPORTANT - HAVING YOUR API PASSWORD INCLUDED IN THE MANNER IS NOT
# SECURE, AND ITS ONLY BEING SHOWN THIS WAY FOR TESTING PURPOSES
*/

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', 'https://api-3t.sandbox.paypal.com/nvp');

/*
 # Third party Email address that you granted permission to make api call.
 */
define('SUBJECT','');
/*for permission APIs ->token, signature, timestamp  are needed
define('AUTH_TOKEN',"4oSymRbHLgXZVIvtZuQziRVVxcxaiRpOeOEmQw");
define('AUTH_SIGNATURE',"+q1PggENX0u+6vj+49tLiw9CLpA=");
define('AUTH_TIMESTAMP',"1284959128");
*/
/**
USE_PROXY: Set this variable to TRUE to route all the API requests through proxy.
like define('USE_PROXY',TRUE);
*/
define('USE_PROXY',FALSE);
/**
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', '127.0.0.1');
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
   https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
   For the live site, the URL is
   https://www.paypal.com/webscr&cmd=_express-checkout&token=
   */
define('PAYPAL_URL', 'https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=');


/**
# 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
define('ACK_SUCCESS', 'SUCCESS');
define('ACK_SUCCESS_WITH_WARNING', 'SUCCESSWITHWARNING');

?>

Open in new window

.

i would appreciate any help just to get me started.

btw thank you for all your support,
0
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.
0
AlexSoftware EngineerCommented:
Hello MK15,

Please take a look at this link: http://www.9lessons.info/2011/03/payment-system-with-paypal.html

I think that will help you definitely!
0

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:
thanks
0
AlexSoftware EngineerCommented:
Glad to help you.
0
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
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.