Link to home
Start Free TrialLog in
Avatar of royalcyber
royalcyber

asked on

Paypal parameter passing problem through hidden fields

I am trying to integrated paypal in my commerce website using the following code. But the problem is that when I completed the payment in Paypal website, it does not return to the "retun_url" that I have provided in the hidden field of the form. Is there any other way to pass the return_url and cancel_url as parameter to the paypal website. Any help in this regard will be highly appriciated

<script type="text/javascript">
      function putValues(form){
       form.quantity_1.value = 1;                   
       form.amount_1.value = 100;
       form.submit();
      }
</script>
<form method="post" action="https://www.sandbox.paypal.com/us/cgi-bin/webscr">
               <input type="hidden" name="cmd" value="_cart"/>
               <input type="hidden" name="upload" value="1"/>
      <input type="hidden" name="business" value="sales@royalcyber.com"/>
      <input type="hidden" name="item_name_1" value="Aggregated items"/>
      <input type="hidden" name="amount_1" value="3.00"/>
      <input type="hidden" name="return_url" value="<%retrunurl%>"/>
      <input type="hidden" name="cancel_url" value="="<%cancelurl%>"/>

<input type="submit" value="Make Payment" onclick="putValues(this.form)">
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of royalcyber
royalcyber

ASKER

Yes of course you are right. I have given the "return_url" and "cancel_url" in the same way as in the following. But still when I complete the payment on paypal test website, I am unable to return to my own website.....

<input type="hidden" name="return_url" value="<%=retrunurl%>"></input>
<input type="hidden" name="cancel_url" value="<%=cancelurl%>"></input>

Any help in this regard will be highly appriciated..
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Now I passed the parameters as in the following, but still I am unable to return to the given "return_url" after when I complete my payment on paypal test website.

<input type="hidden" name="return_url" value="http://www.royalcyber.com"/>
<input type="hidden" name="cancel_url" value="http://www.royalcyber.com"/>

Actully when I complete my payment on payal test website, then payal shows me a a message that payment has successfully been made, and there is a button "Continue", when I hover my mouse pointer over the "Continue" button, a message containing the next page url like "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_yahoo-toolbar&return_url=&caller=" is shown on the status bar. where return_url is empty in the url.

 Any help will be greatly appriciated
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am now going to put my problem at paypal forum
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ya of course dear I will post the solution as soon as I get
I have found the answer. the parameters must be 'cancel_return', and 'return'
Thanks to all who helped me