Hello there i've made a PHP shopping cart (ecommerce) i used SESSION to record cart item. ppl can add items more than once. so for example the cart might looks like this: item1 - quentity: 5 - $20 item2 - quentity: 2 - $10 item3 - quentity: 1 - $25 -------------------------------- total: $55 now i want when ppl click on "check out" button...it take them to paypal site, where they can proceed their payment (paypal or credit card...both must be available). And if the payment successful, it send my site "YES" so my site send me an email to me about the orders (product/payment details/order trace number etc) how can i do it anyone plz help...i need it urgent
Read the documentation on buy now buttons, you can create them dynamically, and also read up on IPN. The buy now button will take the shopper to PayPal to bill them for the cart total, assuming payment completes then PayPal will issue an IPN to your site so that you know that the cart was paid for or not.
https://cms.paypal.com/us/cgi-bin/?...content_ID=developer/e_howto_html_cart_upload https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro
Heres the PayPal IPN <?php echo <<< END <form action="$sys_paypal_URL" method="post" id="paymentform"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="shipping" value="0.00"> <input type="hidden" name="lc" value="$sys_locale"> <input type="hidden" name="bn" value="PP-BuyNowBF"> <input type="hidden" name="rm" value="2"> <input type="hidden" name="business" value="$email"> <input type="hidden" name="item_name" value="$item_name"> <input type="hidden" name="item_number" value="$item_number"> <input type="hidden" name="amount" value="$item_price"> <input type="hidden" name="currency_code" value="$sys_currency"> <input type="hidden" name="notify_url" value="$item_ipn_url"> <input type="hidden" name="return" value="$item_download_url"> <input type="hidden" name="cbt" value="Click Here to Download"> <input type="hidden" name="cancel_return" value="$item_cancel_url"> <input type="hidden" name="custom" value="|$ip|$discount|$country|$state|$zipcode|$sys_domain|$_COOKIE[ref]"> </form> END; ?> PHP: I hope you can assume the Variables from their name
That's not really the right form for a proper checkout from a webstore. That will only provide a total cost for one item (and a quantity). The OP will need to have multiple values for each different item, and a total cost will be generated automatically by paypal
I'd say that depends, if he's already got a cart storing the shopping list which it sounds like he has then there's nothing that stops the total for the whole care being fed to PayPal, you have a PayPal transaction number and the cart information therefore you can tie it all back up in the shop.
I guess, but I always find it nicer to have a full breakdown available for the consumer on the paypal screen as the user is asked to login, they can review all the costs
thank you everyone i think i got it but still i need to be cleared abt one more thing i want to send a variable to paypal & want paypal will send me back with IPN like: a variable orderid=77 i want to send it to paypal...so when paypal send it back to my site...it will update mysql database table of that orderID with success, failed or other status