简体   繁体   中英

How to get Paypal 'Add to Cart' button response?

I m trying to add a Paypal Add to cart button in my application. For that i create code from paypal sanbox. This is my form,

<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="business" value="EGZD52TPWUERY">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="item_name" value="Fees">
    <input type="hidden" name="item_number" value="255">
    <input type="hidden" name="amount" value="85.00">
    <input type="hidden" name="currency_code" value="GBP">
    <input type="hidden" name="button_subtype" value="products">
    <input type="hidden" name="no_note" value="0">
    <input type="hidden" name="cn" value="Add special instructions to the seller:" />
    <input type="hidden" name="no_shipping" value="2">
    <input type="hidden" name="rm" value="1">
    <input type="hidden" name="return" value="my-application/paypal/success">
    <input type="hidden" name="tax_rate" value="0.000">
    <input type="hidden" name="shipping" value="0.00">
    <input type="hidden" name="item_id_<?php echo $res_1->id; ?>" value="<?php echo $res_1->id; ?>" />
    <input type="hidden" name="add" value="1">
    <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

The payment transaction is completed successfully and the redirect is done perfectly to my application. But the problem is i didn't get any response in that page. I tried var_dump($_POST) . It retruns null . Don't know why i didn't get any response. Any help is appreciated.

Check the following link and update your paypal account.The response is in $_GET

https://developer.paypal.com/webapps/developer/docs/classic/products/payment-data-transfer/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM