PayPal Express returns 4011 error message in Sandbox mode

自作多情 提交于 2020-01-02 16:17:09

问题


I am using PayPal express in Sandbox mode in my PHP script (curl + SOAP). I have a simple purchase form with 1 "buy" button. When it's clicked I send initial SetExpressCheckout request and get successfull response from paypal with Acc=success and a fresh token

<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
<Token xsi:type="ebl:ExpressCheckoutTokenType">EC-4GV76670YM092205U</Token></SetExpressCheckoutResponse>

Next I am trying to redirect script to PayPal with this new token:

  header("Location: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=".$result[Token]."&address_override=1");

but as a result PayPal displays a page with error message:

We are sorry, we are experiencing temporary difficulties. Please try again later. If this error occurred while making a payment, avoid duplicate payments by checking your Account Overview before resending a payment. Message 4011

What can have caused this error? I am using a plain US/USD Sandbox account, the only thing that might look suspicious is that in paypal response xml username and password fields are empty.


回答1:


This error was cause by using SandBox credentials, while redirecting to non-sandbox URL. It should've been header("Location: https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=".$result[Token]."&address_override=1");



来源:https://stackoverflow.com/questions/2415640/paypal-express-returns-4011-error-message-in-sandbox-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!