Buy Now Button return not working

DoctorB
Contributor
Contributor

I'm an issue with my Buy Now button return address. It seems that Paypal isn't seeing it and it is redirecting to the Auto Return url entered into the account instead.

 

This is currently just set up with sandbox accounts for testing purposes.

 

Here's my form:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST" target="_blank">
<input type="hidden" name="hosted_button_id" value="DXSG8TKUPB4RQ">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="notify_url" value="mysite.com/IPN">
<input type="hidden" name="custom" value="THIS IS A TEST">
<input type="hidden" name="return" value="mysite.com/thanks.html">
<input type="hidden" name="rm" value="2">
</form>

Just a note, and I'm not sure if it makes a difference but, I am dynamically building and sending this form with javascript. Here's the code for that:

 

var _getHiddenInput = function(name, value){
var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("name", name);
input.setAttribute("value", value);
return input;
};

var form = document.createElement("form"); form.setAttribute("action", PAYPAL_LINK); form.setAttribute("method", "POST"); form.setAttribute("target", "_blank"); form.appendChild(_getHiddenInput("hosted_button_id", SANDBOX ? "DXSG8TKUPB4RQ" : hostedButtonId)); form.appendChild(_getHiddenInput("cmd", "_s-xclick")); form.appendChild(_getHiddenInput("notify_url", notifyUrl)); form.appendChild(_getHiddenInput("custom", custom)); //This is a pass-through attribute from Paypal. form.appendChild(_getHiddenInput("return", nextPage)); form.appendChild(_getHiddenInput("rm", "2")); document.body.appendChild(form); form.submit();

 

I appreciate your responses and help.

Login to Me Too
2 REPLIES 2

JCarpenter
New Community Member

Any resolution to this issue? I'm having the same problem. It seems to me that it used to work.

Login to Me Too

ZoneF
Member
Member

Any resolution This is annoying as hell.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.