My problem
I set up an IPN listener in CodeIgniter framework, but it always returns INVALID Response.
What I tried Till now:
- Ensured that my server is sending the request to www.sandbox.paypal.com and not www.paypal.com.
- Ensured that my response is equal to PayPal's request, prefixed with cmd=_notify-validate&
- I used PayPal IPN code sample
My Code:
Paypal Buy 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="My sandbox facilitator email id">
<input type="hidden" name="item_name" value="My Business">
<input type="hidden" name="item_number" value="10101">
<input type="hidden" name="amount" value="10">
<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="" 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="<?php echo base_url(); ?>homepage/success">
<input type="hidden" name="cancel_return" value="<?php echo base_url();homepage/cancel">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="notify_url" value="<?php echo base_url(); ?>/homepage/ipn" />
</form>
Paypal IPN codes sample from this link https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php#L125