I’m trying to redirect users to Paypal to make a payment but instead the usual html form I wrote this code (I need the form to submit data to my site, then I redirect to Paypal)
($sandbox) ? $url = "https://www.sandbox.paypal.com/cgi-bin/webscr" : $url = "https://www.paypal.com/cgi-bin/webscr";
($sandbox) ? $button = "XXXXX" : $button = "YYYYY";
$notify_url = urlencode($site_url . "index.php?act=member-pn&mid=" . $ld['member_id']);
$return_url = urlencode($site_url . "index.php?act=member-ps");
$cancel_url = urlencode($site_url . "index.php?act=member-pc&mid=" . $ld['member_id']);
$url .= "/?notify_url=$notify_url&return=$return_url&cancel_return=$cancel_url&cmd=_s-xclick&hosted_button_id=$button";
header("Location: $url");
Why is it that only the cancel URL is working? Return and notify doesn’t seems to work.
So …the answer to my question is simple: always remember if you have htaccess authentication for the site you are working on. Paypal’s IPN never got a chance to access my scripts 🙂
And, yes, you can do a GET requests for a simple button instead of POST.