And*_*rey 21 api validation paypal
我想将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>
Run Code Online (Sandbox Code Playgroud)
以下是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>
Run Code Online (Sandbox Code Playgroud)
您可以要求他们输入他们在 PayPal 中使用的电子邮件地址。如果他们没有 PayPal 帐户,您仍然可以将资金发送到他们输入的任何电子邮件中。Paypal 将负责让他们使用该电子邮件 ID 创建一个 Paypal 帐户并向他们展示资金。
您可能需要确保他们输入正确的电子邮件 ID。也许电子邮件地址验证步骤可以解决问题。
| 归档时间: |
|
| 查看次数: |
17563 次 |
| 最近记录: |