Jump to content

IPN & Shopping Cart


Recommended Posts

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.

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.