Jump to content


Photo

IPN & Shopping Cart


  • Please log in to reply
5 replies to this topic

#1 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 24 October 2006 - 07:29 PM

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

#2 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 24 October 2006 - 07:54 PM

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.

#3 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 24 October 2006 - 08:05 PM

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

#4 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 24 October 2006 - 08:37 PM

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? https://developer.paypal.com/ It proved invaluable to me when I was setting IPN up for a client. It contains all the docs you could need as well.

#5 doni49

doni49
  • Members
  • PipPipPip
  • Advanced Member
  • 515 posts
  • LocationCentral MO

Posted 24 October 2006 - 11:22 PM

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.
Don

#6 doni49

doni49
  • Members
  • PipPipPip
  • Advanced Member
  • 515 posts
  • LocationCentral MO

Posted 24 October 2006 - 11:31 PM

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.c...ic_pdnHome.html
Don




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users