?
Solved

Pay pal return URL  problem

Posted on 2006-07-17
3
Medium Priority
?
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
HardJeans earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
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 dynamically set the form action using jQuery.
Suggested Courses

764 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