Express Checkout 错误消息:“安全标头无效”
我正在 PayPal 中实施快速结帐。
我对前两个步骤 SetExpressCheckout
和 GetExpressCheckout
没有任何问题。但是当我使用 DoExpressCheckout
时,我遇到错误“安全标头无效”。
API 凭证是相同的!
我已通过将 DoExpressCheckout
中的 $environment
更改为 live
来修复此问题。 ($environment
的区别在于它将使用 https://api.sandbox.paypal.com/nvp/
而不是 https://api -3t.$environment.paypal.com/nvp
)
但是为什么呢?
https://api-3t.$environment.paypal.com/nvp
有问题吗?
I'm implementing Express Checkout in PayPal.
I have no problem with the first two steps, SetExpressCheckout
and GetExpressCheckout
. But when I use DoExpressCheckout
, I encounter the error "Security header is not valid".
The API credentials are the same!
I've fixed it by changing the $environment
to live
in DoExpressCheckout
. (The difference $environment
makes is that it'll use https://api.sandbox.paypal.com/nvp/
instead of https://api-3t.$environment.paypal.com/nvp
)
But why?
Is there something wrong with https://api-3t.$environment.paypal.com/nvp
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
https://api-3t.sandbox.paypal.com/nvp 需要不同的用户-帐户数量超过 https://api-3t.paypal.com/nvp 要求的帐户。
沙盒帐户可以在 developer.paypal.com 激活
https://api-3t.sandbox.paypal.com/nvp requires different user-accounts than what https://api-3t.paypal.com/nvp requires.
The sandbox accounts can be activated at developer.paypal.com
我在现场环境中遇到了同样的错误。对我来说,事实证明我的 API 用户名末尾有一个尾随空格...我删除了该空格并且工作正常...我已将它们直接从 PayPal 粘贴到配置文件中并且必须已经在那里也复制了一个空白...所以如果您遇到这种情况,请检查尾随空格!如果用户名被硬编码在字符串中,这将是显而易见的,但事实并非如此,因为它位于 java 属性文件中。
请注意,如果您的凭据错误(即错误的用户名、密码或签名),您也会收到此错误。当我将信息粘贴到配置文件中时,我遇到了同样的问题,并且错误地在签名末尾添加了额外的字符。
I had the same error being thrown for the live environment. For me, it turned out there was a trailing space at the end of my API username.... I removed the space and it worked fine.... I'd pasted them into a config file straight from PayPal and must've copied a blank there as well... so if this happens to you, check for trailing spaces! This would've been obvious if the username was hardcoded in a string, but wasn't because it was in a java properties file.
note that you'll also get this error if your credentials are wrong (ie bad username, password or signature). I just had the same issue happen when I pasted in my info to a config file, and had extra characters at the end of my signature by mistake.
他可能不会授予结账许可。显然,请参阅这篇文章目前已关闭,但仍然可用 此处。
He may not grant permission for checkout. Refer to this article, apparently down for now but still available here.