Solved

Pay pal return URL  problem

Posted on 2006-07-17
3
254 Views
Last Modified: 2006-11-18
Hai,
I integerate shopping cart to paypal i give return url after payment both sucess and Cancel url with some GET variables but the variables are not reply in paypal how to i fix this?

I set Return URL with querystring like
<input type=\"hidden\" name=\"return\" value=\"$site_url/bala/thanks.php?total=$totp&cart_id=$cart_id&uid=$uid\" />

But i got return URL from paypal $site_url/bala/thanks.php?  only Query string's are missing How to retrive this ?

My code here
echo "<form id=\"form1\" name=\"upfrm\" method=\"post\" action=\"https://www.paypal.com/cgi-bin/webscr\">
                      <div align=\"center\">
                      <input type=\"hidden\" name=\"cmd\" value=\"_xclick\" />                        
            <input type=\"hidden\" name=\"business\" value=\"$pemail\" />                      
             <input type='hidden' name='item_name' value=\"Images in DNB PHOTOGRAPHY\" />
                        <input type=\"hidden\" name=\"cart_id\" value=\"$cart_id\" />
                        <input type=\"hidden\" name=\"amount\" value=\"$totp\" />
                        <input type=\"hidden\" name=\"first_name\" value=\"$name\" />
                        <input type=\"hidden\" name=\"currency_code\" value=\"USD\" />
                        <input type=\"hidden\" name=\"uid\" value=\"$uid \" />
                        <input type='hidden' name='cn' value='DNB PHOTOGRAPHY  payment gateway!' />
<input type=\"hidden\" name=\"return\" value=\"$site_url/bala/thanks.php?total=$totp&cart_id=$cart_id&uid=$uid\" />
                <input type=\"hidden\" name=\"cancel_return\" value=\"$site_url/bala/thanks.php?total=$totp&cart_id=$cart_id&uid=$uid&fail=fail\" />                        
                          <input name=\"Submit\" type=\"submit\" class=\"colorbuttonsh\" value=\"Online Pay\" />
                          </a>
                        </div>
                              </form>";

Thanks
Bala
0
Comment
Question by:gstalin
3 Comments
 
LVL 1

Accepted Solution

by:
HardJeans earned 500 total points
Comment Utility
View the source of the HTML file that PHP outputs to create the form.  Does the return URL show up correctly?  Can you copy/paste it into the address bar, and it shows correctly with the GET variables?  Here's a better way to clarify to PHP what you want to treat as a string, and what you want to treat as a var etc...:

echo '<form id="form1" name="upfrm" method="post" action="https://www.paypal.com/cgi-bin/webscr">'."\n";
echo '                      <div align="center">'."\n";
echo '                      <input type="hidden" name="cmd" value="_xclick" />'."\n";
echo '           <input type="hidden" name="business" value="'.$pemail.'" />'."\n";
echo '            <input type="hidden" name="item_name" value="Images in DNB PHOTOGRAPHY" />'."\n";
echo '                        <input type="hidden" name="cart_id" value="'.$cart_id.'" />'."\n";
echo '                        <input type="hidden" name="amount" value="'.$totp.'" />'."\n";
echo '                        <input type="hidden" name="first_name" value="'.$name.'" />'."\n";
echo '                        <input type="hidden" name="currency_code" value="USD" />'."\n";
echo '                        <input type="hidden" name="uid" value="'.$uid.'" />'."\n";
echo '                        <input type="hidden" name="cn" value="DNB PHOTOGRAPHY  payment gateway!" />'."\n";
echo '<input type="hidden" name="return" value="'.$site_url.'/bala/thanks.php?total='.$totp.'&cart_id='.$cart_id.'&uid='.$uid.'" />'."\n";
echo '                <input type="hidden" name="cancel_return" value="'.$site_url.'/bala/thanks.php?total='.$totp.'&cart_id='.$cart_id.'&uid='.$uid.'&fail=fail" />'."\n";
echo '                          <input name="Submit" type="submit" class="colorbuttonsh" value="Online Pay" />."\n";
echo '                          </a>'."\n";
echo '                        </div>'."\n";
echo '                         </form>'."\n";

^^ This way you don't have to remember if you escaped this character, or that character etc...Use single quotes around text, then concatenate it with a variable (.$var.), and continue on with a single quote string.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now