php - PayPal IPN theory and method -


i've built buy/sell/trade site, not launched yet before launch need add in paypal ipn feature users have pay small fee before advert goes live!

but i've never used paypal ipn before , tutorials can find things premium memberships... quite how implement bit 'messy' if see mean.

you can view site @ http://www.airgunvillage.com/ if wish. said still pre launch i'm planning put first 500 users advertise draw prize, @ half way point want turn on paypal ipn covers cost... (hence need done now, not after launch)

my thoughts have 2 ways this:

method 1 use paypal ipn update 'paid' column in adverts after advert has been uploaded user.

problem: i'm going have advert table cluttered adverts people have not paid - i'm going have image folder images not belong live adverts.

good: can upload , go preview page pay advert let people see getting suppose.

i suppose write function clear out unpaid adverts after 1 week or something...

method 2 advertise form sends data through paypal ipn listener, upon successful payment data uploaded.

problem: how validate form, send data paypal. need 2 submits?

good: no junk images, no junk advert db files.

what do? , why?

many :)

i'd go method 1. writing script keep tables/images clean should trivially easy.

with method 2, i'd question whether paypal pass data around you. method 1 cleaner.

another option store unpaid ads in temporary table mirrors paid one. use temporary table previews , such. when ipn post comes in, copy data temporary holding table live table. then, method 1, run cron job every few days clear old/unpaid items.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -