- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试将 Paypal API 集成到我的 PHP 应用程序中。我使用 cURL 调用远程方法 GetVerifiedStatus,但收到错误 580023 - 无效请求。
我的要求:
'requestEnvelope.errorLanguage=en_US&requestEnvelope.detailLevel=ReturnAll&emailAddress=email%40address.com&firstName=John&lastName=Doe&matchCriteria=NAME'
转成JSON后的响应:
{
"responseEnvelope.timestamp":"2013-07-25T05:36:26.695-07:00",
"responseEnvelope.ack":"Failure",
"responseEnvelope.correlationId":"e540c8c04a5b4",
"responseEnvelope.build":"6679946",
"error(0).errorId":"580023",
"error(0).domain":"PLATFORM",
"error(0).subdomain":"Application",
"error(0).severity":"Error",
"error(0).category":"Application",
"error(0).message":"Cannot determine PayPal Account status"
}
curl 代码
function hash_call_account($methodName, $nvpStr)
{
//declaring of global variables
$this->API_Endpoint_Adaptive_Account .= "/" . $methodName;
//setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$this->API_Endpoint_Adaptive_Account);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
//turning off the server and peer verification(TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
// Set the HTTP Headers
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-PAYPAL-REQUEST-DATA-FORMAT: NV',
'X-PAYPAL-RESPONSE-DATA-FORMAT: NV',
'X-PAYPAL-SECURITY-USERID: ' . $this->API_UserName,
'X-PAYPAL-SECURITY-PASSWORD: ' .$this->API_Password,
'X-PAYPAL-SECURITY-SIGNATURE: ' . $this->API_Signature,
'X-PAYPAL-APPLICATION-ID: ' . $this->API_AppID
));
//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.
//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php
if($this->USE_PROXY)
curl_setopt ($ch, CURLOPT_PROXY, $this->PROXY_HOST. ":" . $this->PROXY_PORT);
// RequestEnvelope fields
$detailLevel = urlencode("ReturnAll"); // See DetailLevelCode in the WSDL for valid enumerations
$errorLanguage = urlencode("en_US"); // This should be the standard RFC 3066 language identification tag, e.g., en_US
// NVPRequest for submitting to server
$nvpreq = "requestEnvelope.errorLanguage=$errorLanguage&requestEnvelope.detailLevel=$detailLevel";
$nvpreq .= "&$nvpStr";
//echo $nvpreq; die;
//setting the nvpreq as POST FIELD to curl
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
//getting response from server
$response = curl_exec($ch);
//converting NVPResponse to an Associative Array
$nvpResArray=$this->deformatNVP($response);
$nvpReqArray=$this->deformatNVP($nvpreq);
$_SESSION['nvpReqArray']=$nvpReqArray;
if (curl_errno($ch))
{
// moving to display page to display curl errors
$_SESSION['curl_error_no']=curl_errno($ch) ;
$_SESSION['curl_error_msg']=curl_error($ch);
//Execute the Error handling module to display errors.
}
else
{
//closing the curl
curl_close($ch);
}
return $nvpResArray;
}
配置:
Configure::write('ParallelPayPalAPI.URL', 'https://svcs.sandbox.paypal.com/AdaptivePayments');
Configure::write('ParallelPayPalAPI.AdaptiveAccountURL', 'https://svcs.sandbox.paypal.com/AdaptiveAccounts');
Configure::write('ParallelPayPalAPI.api_username', user);
Configure::write('ParallelPayPalAPI.api_password', password);
Configure::write('ParallelPayPalAPI.api_signature', signature);
Configure::write('ParallelPayPalAPI.business', business);
Configure::write('ParallelPayPalAPI.PaymentDetailUrl', 'https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails');
Configure::write('ParallelPayPalAPI.AppID', AppId);
可能是 API 版本的问题? NVP请求有问题吗?
最佳答案
我遇到了同样的问题并联系了 paypal 技术支持,解决方案很简单,当名称与 paypal 帐户的电子邮件不匹配时,错误 580023 是正常行为。这是令人困惑的,因为请求没有任何问题,与响应消息暗示的相反。因此,对于您的示例,如果您遇到相同的问题,那么您只需将 John Doe 更改为与您尝试匹配的 Paypal 电子邮件关联的用户的名字和姓氏。
我与 paypal MTS 的 session 记录:
“您收到的错误是预料之中的。为了获得已验证或未验证的响应,您提供的姓名必须与您提供的电子邮件地址相匹配。”
关于php - Paypal API - GetVerifiedStatus - 无效请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17858746/
你好, 我想使用 Paypal API 的 GetVerifiedStatus。 所以我已经创建了我的应用程序并且我有一个应用程序 ID。 在沙箱中,一切正常,服务返回我的客户的状态。 但是当我进行实
我这里有一个简单的问题。我有一个代码调用 API 来检查给定的 Paypal 电子邮件是否有效。 api是PayPal的AdapativeAccounts/GetVerifiedStatus,url:
我正在尝试将 Paypal API 集成到我的 PHP 应用程序中。我使用 cURL 调用远程方法 GetVerifiedStatus,但收到错误 580023 - 无效请求。 我的要求: 'req
是否有将 GetVerifiedStatus 与经典 ASP 一起使用的示例?我从 Paypal 下载了示例,但没有任何关于 GetVerifiedStatus 的信息。 谢谢帮助 最佳答案 我们拥有
我成功地使用了 Paypal 的自适应帐户 API GetVerifiedStatus端点通过名字、姓氏和电子邮件地址验证我们用户的 Paypal 帐户。然而,他们中的很大一部分人使用没有关联名字和姓
我正在使用 this库通过电子邮件 ID 验证 PayPal 用户。我使用的 API 是 GetVerifiedStatus。该库的开发人员在代码中提供了一个电子邮件地址,它工作正常。该代码为其电子邮
我一直在尝试让这个 GetVerifiedStatus API 工作,但它就是行不通。 我已尝试使用有效的电子邮件地址 http://www.dev-tool.com/pptester/NVP/Cal
我使用来自 http://www.angelleye.com/download-angell-eye-php-class-library-for-paypal/ 的 PHP 库获取 Paypal 帐户
根据 Paypal Doc's matchCriteria 可以是NONE 只针对某些金融机构,这是什么意思? 在沙盒环境中发送 firstName & lastName 空值和 matchCrite
我想验证我拥有的服务的帐户。似乎所有来自美国的帐户都可以使用,但是一旦来自海外的人尝试验证他们的帐户,api 就不起作用。 我收到错误 580022:无法确定 PayPal 帐户状态。每个区域是否相互
我是一名优秀的程序员,十分优秀!