Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
661 views
in Technique[技术] by (71.8m points)

api - How to validate PayPal account?

I want to integrate paypal to my website and ask users to enter paypal account for commission pay out. How can I check if their account exists on paypal? I prefer NOT to send them $0.01 or it's the only way to check account?

It should validate it automatically while user sign ups to the website.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

GetVerifiedStatus should do the trick. You'll have to pass the email address and the name of the person and it will then return whether or not their account has been verified.

If they don't have a PayPal account you'll get an error back that says "Cannot determine PayPal Account status."

Here's a sample of the request and response I just ran on the sandbox for a verified PayPal account...

<?xml version="1.0" encoding="utf-8"?>
<GetVerifiedStatusRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <emailAddress xmlns="">[email protected]</emailAddress>
  <matchCriteria xmlns="">NAME</matchCriteria>
  <firstName xmlns="">Drew</firstName>
  <lastName xmlns="">Angell</lastName>
</GetVerifiedStatusRequest>

<?xml version='1.0' encoding='UTF-8'?>
<ns2:GetVerifiedStatusResponse xmlns:ns2="http://svcs.paypal.com/types/aa">
  <responseEnvelope>
    <timestamp>2013-01-05T00:07:01.729-08:00</timestamp>
    <ack>Success</ack>
    <correlationId>3fecb3e1f2011</correlationId>
    <build>4055066</build>
  </responseEnvelope>
  <accountStatus>VERIFIED</accountStatus>
  <userInfo>
    <emailAddress>[email protected]</emailAddress>
    <accountType>BUSINESS</accountType>
    <accountId>E7BTGVXBFSUAU</accountId>
    <name>
      <salutation></salutation>
      <firstName>Drew</firstName>
      <middleName></middleName>
      <lastName>Angell</lastName>
      <suffix></suffix>
    </name>
    <businessName>Drew Angell's Test Store</businessName>
  </userInfo>
</ns2:GetVerifiedStatusResponse>

And here's a sample of a request and response where the PayPal account doesn't exist...

<?xml version="1.0" encoding="utf-8"?>
<GetVerifiedStatusRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <emailAddress xmlns="">[email protected]</emailAddress>
  <matchCriteria xmlns="">NAME</matchCriteria>
  <firstName xmlns="">Drew</firstName>
  <lastName xmlns="">Angell</lastName>
</GetVerifiedStatusRequest>

<?xml version='1.0' encoding='UTF-8'?>
<ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/aa">
  <responseEnvelope>
    <timestamp>2013-01-05T00:08:28.581-08:00</timestamp>
    <ack>Failure</ack>
    <correlationId>43364ce704211</correlationId>
    <build>4055066</build>
  </responseEnvelope>
  <error>
    <errorId>580023</errorId>
    <domain>PLATFORM</domain>
    <subdomain>Application</subdomain>
    <severity>Error</severity>
    <category>Application</category>
    <message>Cannot determine PayPal Account status</message>
  </error>
</ns3:FaultMessage>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...