Express Checkout 错误消息:“安全标头无效”

发布于 2024-08-10 18:42:31 字数 547 浏览 5 评论 0原文

我正在 PayPal 中实施快速结帐

我对前两个步骤 SetExpressCheckoutGetExpressCheckout 没有任何问题。但是当我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

属性 2024-08-17 18:42:31

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

何必那么矫情 2024-08-17 18:42:31

我在现场环境中遇到了同样的错误。对我来说,事实证明我的 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.

转角预定愛 2024-08-17 18:42:31

他可能不会授予结账许可。显然,请参阅这篇文章目前已关闭,但仍然可用 此处

He may not grant permission for checkout. Refer to this article, apparently down for now but still available here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文