AlexA
AlexA

Reputation: 4118

PayPal Express returns 4011 error message in Sandbox mode

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 successful response from paypal with Ack=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.

Upvotes: 2

Views: 3479

Answers (1)

AlexA
AlexA

Reputation: 4118

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");

Upvotes: 8

Related Questions