我想将 Paypal 集成到我的网站,并要求用户输入 Paypal 帐户以支付佣金。
如何检查他们的帐户是否存在于Paypal上?
我宁愿不给他们寄0.01美元,还是这是支票帐户的唯一方法?
当用户注册网站时,它应该自动验证它。
最佳答案
GetVerifiedStatus应该可以解决问题。您必须传递电子邮件地址和该人的姓名,然后它将返回其帐户是否已通过验证。
如果他们没有PayPal帐户,则会收到错误消息,提示“无法确定PayPal帐户状态”。
这是我刚刚在沙盒中针对经过验证的PayPal帐户运行的请求和响应的示例...
<?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="">sandbo_1204199080_biz@angelleye.com</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>sandbo_1204199080_biz@angelleye.com</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>
这是不存在PayPal帐户的请求和响应的示例...
<?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="">nodice@fail.com</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>
关于api - 如何验证 Paypal 账户?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3228963/