Rashid Rupani
Rashid Rupani

Reputation: 41

Paypal IPN Help... Getting Invalid response from Sandbox

Can anybody help me in solving this error. I am getting Invalid response from paypal sandbox.

My sandbox account is verified, IPN is on at my account, I have also set notify url in my sandbox account.

Here is my button code

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr"  method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="item_name" value="My Business">
<input type="hidden" name="item_number" value="10101">
<input type="hidden" name="amount" value="101.35">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="http://www.mydomain.com/wp-content/themes/MiniMeCity/images/paypalbutton.jpg" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="return" value="http://www.mydomain.com/payment-confirmation/"> 
<input type="hidden" name="cancel_return" value="http://www.mydomain.com/">
<input type="hidden" name="rm" value="2"> 
<input type="hidden" name="notify_url" value="http://www.mydomain.com/paypalipn.php" /> 
</form>

and here is my IPN code : http://codepad.org/Xu0rhDBY

Upvotes: 1

Views: 2592

Answers (4)

user2982337
user2982337

Reputation: 81

i have same problem, but i use paypal new more secure button and the ipn API from https://developer.paypal.com/docs/classic/ipn/gs_IPN/. Tom as you say i used var_dump and the response is string(7) "INVALID"

Upvotes: 0

periklis
periklis

Reputation: 10188

Inside your IPN, you are opening a socket to www.paypal.com instead of www.sandbox.paypal.com

Upvotes: 2

subroutines
subroutines

Reputation: 1458

You need to have OpenSSL enabled in your php config

Upvotes: 0

Tom
Tom

Reputation: 591

https://www.paypal-community.com/t5/Selling-on-your-website/IPN-response-problem/m-p/521312#M2445

I recently experienced this problem, going from a code base that hadn't changed and was working correctly on the Paypal sandbox.

If you can provide more information was to what is occuring, i can point you more in the right direction. I'd suggest doing what's been talked about in that post first. Which is simply adding the new header.

$header .= "Host: www.sandbox.paypal.com\r\n";

Just be aware not to have this header on a production system.

Hope this helps. If it doesn't resolve your issue, use var_dump line 39 to see what the responses are.

I've posted a more detail response in a different topic which outlines debugging in an easier manner : Paypal IPN Integration into PHP

Upvotes: 0

Related Questions