Solved

Pay pal return URL  problem

Posted on 2006-07-17
3
257 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
ID: 17157635
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

895 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

18 Experts available now in Live!

Get 1:1 Help Now