troubleshooting Question

Paypal parameter passing problem through hidden fields

Avatar of royalcyber
royalcyber asked on
E-CommerceJavaScriptWeb Development
12 Comments6 Solutions1626 ViewsLast Modified:
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
Join our community to see this answer!
Unlock 6 Answers and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 6 Answers and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros