0 Replies - 5909 Views - Last Post: 13 January 2013 - 06:10 AM Rate Topic: -----

#1 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

connecting my website cart with paypal.com

Posted 13 January 2013 - 06:10 AM

i just started reading how to connect ur cart to paypal. i get the main idea but when i hit paypal buy button. data doesnt tranfer. so on paypal site it alway say to have 0 items in ur cart.

<?php
...
$x=1;
$pp_checkout_btn = '';
$pp_checkout_btn .= '
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_cart">
        <input type="hidden" name="upload" value="1">
        <input type="hidden" name="business" value="abcdef@hotmail.com">
';

.....
while($row = mysql_fetch_assoc($item_cart_query))  
{
    $cart_id_db = $row['cart_id'];           //get item id,name,price,quantity etc from database
    .....

    //Dynamic CheckOut Btn Assembly
    $pp_checkout_btn .= '
        <input type="hidden" name="item_name_'.$x.'" value="$image_user_name_db">
        <input type="hidden" name="amount_'.$x.'" value="$price_db">
        <input type="hidden" name="quantity_'.$x.'" value="$qty_db">
        ';
    $x++;
}

$pp_checkout_btn .= '
    <input type="hidden" name="notify_url" value="https://www.yoursite.com/storescripts/my_ipn.php">
    <input type="hidden" name="return" value="https://www.yoursite.com/checkout_complete.php">
    <input type="hidden" name="rm" value="2">
    <input type="hidden" name="cbt" value="Return to The Store">
    <input type="hidden" name="cancel_return" value="https://yoursite.com/paypal_cancel.php">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="currency_code" value="USD">
    <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal">
    </form>';

....
    echo"$pp_checkout_btn;"
?>



Is This A Good Question/Topic? 0
  • +

Page 1 of 1