Jump to content

Archived

This topic is now archived and is closed to further replies.

cmgmyr

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.

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

Share this post


Link to post
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.

Share this post


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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


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

Share this post


Link to post
Share on other sites

×

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.