I want to integrate Paypal in my site using Express Checkout and notify_url parameter which would notify my site and accordinly I can take actions.
I generated buynowbuttons. Sample buy now button is:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input name="notify_url" value='http://localhost:9000/Home/ProcessPayment' type="hidden"/>
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="something@something.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Basic">
<input type="hidden" name="amount" value="24.99">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="tax_rate" value="0.000">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif"
border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif"
width="1" height="1">
</form>
I added <input name="notify_url" value='http://localhost:9000/Home/ProcessPayment' type="hidden"/> so it can notify my action method in my controller for debugging purpose. However, it is not working.
I get redirected to Paypal account :
https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=somesession&dispatch=somedispatch
But once the payment is completed it never hits my breakpoint in ProcessPayment action in Home controller. Is there something that I am missing?
Thanks in advance 🙂
UPDATE:- I had hidemyass pro account and all I had then was to setup my website in IIS and then my notify_url worked like a charm ;).
In usual cases your breakpoint will never be hit in this case, and that’s normal, because:
If you don’t have a “direct” external IP-address ( and you will AT LEAST have a router ) or you have configured everything to perform correct NAT port forwarding, the PayPal IPN will go either to:
1) Nirvana, because you have not configured the IP address correctly
OR
2) To your Testserver/Productionserver which IP-Adress for IPNs you actually configured.
UPDATE:
There are 2 Solutions:
OR
I personally would tend to solution 1., because i never got the remote debugger to work like i expected..