简体   繁体   中英

How to Integrate Paypal IPN for Custom Shopping Cart without using Buy Now Buttons

I'm having some trouble understanding how I can send my shopping cart items to PayPal using the IPN service without using the 'Buy Now' buttons which many tutorials seem to demonstrate.

So my shopping cart details are stored within $_SESSION['cart'] as a multidimensional array.

e.g: 
$_SESSION['cart'][0]['item_price'] 
$_SESSION['cart'][0]['item_name']
$_SESSION['cart'][0]['item_description']
$_SESSION['cart'][1]['item_price'] ...

I know that a listener is involved for the rest of the process however I cannot see how I can send the item details such as name and cost to paypal for payment processing.

Is cURL involved in anyway. Any information would be very helpful!

IPN stands for Instant Payment Notification. IPN itself is a POST from PayPal's servers to a page on your site to let you know that a transaction has completed (or failed).

To send a shopping cart to PayPal without using the simple button method you need to use the PayPal API. Check out the SetExpressCheckout method, which initialises a cart/checkout on the PayPal site. This will give you an ID/URL you can use to redirect your customer to at a later time.

See:

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout

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