cmgmyr Posted October 24, 2006 Share Posted October 24, 2006 I have an IPN set up on a website right now and it works great for single purchases. What I'm setting up is an mp3 store where bands can log on and upload music that they want to sell. Other users log on and purchase the music. Then at the end of the month I will download the list of purchases and then pay the bands.Questions:1. How do I get the items that were purchased out of the script?2. What is the best way to go about doing this?Please let me know if you need any more information or if you would like to see my script.Thanks,-Chris Quote Link to comment https://forums.phpfreaks.com/topic/24965-ipn-shopping-cart/ Share on other sites More sharing options...
gmwebs Posted October 24, 2006 Share Posted October 24, 2006 You basically need to code your own invoicing system. As the user checks out, and is redirected to PayPal for payment, add in all the relevant details to your invoicing table/s (items downloaded, customer, etc.) and generate an invoice. One of the variables you can send to PayPal is a custom one, so I use my invoice number I have just generated. That variable will come back in with the IPN transaction, so you would know which invoice it belongs to. Once the IPN transaction comes in to your IPN script, update the invoice as paid (if paid obviously!), and then update the artist table to reflect that a customer has bought their music track. Then write a report script that would pull all the artist records that have paid downloads associated with their account, pay them, and mark them as paid in the artist table. Quote Link to comment https://forums.phpfreaks.com/topic/24965-ipn-shopping-cart/#findComment-113802 Share on other sites More sharing options...
cmgmyr Posted October 24, 2006 Author Share Posted October 24, 2006 Thank you for the response, but how do the items in the cart come through the IPN? Does each item come through seperately or is it in a batch?Thanks,-Chris Quote Link to comment https://forums.phpfreaks.com/topic/24965-ipn-shopping-cart/#findComment-113809 Share on other sites More sharing options...
gmwebs Posted October 24, 2006 Share Posted October 24, 2006 Well you can choose to send your cart items to PayPal, but I can't remember if they send them back with the IPN transaction. I don't think they do.So if you write your invoice script to include the line items, then when the IPN transaction comes through it will contain that invoice number, so you would be able to cross reference them that way.Have you looked at the PayPal developer sandbox? [url=https://developer.paypal.com/]https://developer.paypal.com/[/url] It proved invaluable to me when I was setting IPN up for a client. It contains all the docs you could need as well. Quote Link to comment https://forums.phpfreaks.com/topic/24965-ipn-shopping-cart/#findComment-113831 Share on other sites More sharing options...
doni49 Posted October 24, 2006 Share Posted October 24, 2006 With each purchase, you send the purchase info to paypal. The IPN sends back the info that you passed to paypal.This should include song number, title, artist etc. Your IPN handling script can then add the transaction info to your database and/or send you an email message.Once you have the transaction data, you can handle it as you please. Quote Link to comment https://forums.phpfreaks.com/topic/24965-ipn-shopping-cart/#findComment-113952 Share on other sites More sharing options...
doni49 Posted October 24, 2006 Share Posted October 24, 2006 BTW Here's a link to the PP integration center. Forums where all they do is discuss integrating PP into your site.https://www.paypal.com/IntegrationCenter/ic_pdnHome.html Quote Link to comment https://forums.phpfreaks.com/topic/24965-ipn-shopping-cart/#findComment-113954 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.