0

I've built a buy/sell/trade site, Its not launched yet but before I do launch I need to add in a PayPal IPN feature so users have to pay a small fee before their advert goes live!

But I've never used paypal IPN before and all the tutorials I can find are for things like premium memberships... So quite how I implement this is a bit 'messy' if you see what I mean.

You can view the site at http://www.airgunvillage.com/ if you wish. Like I said its still pre launch but I'm planning to put the first 500 users who advertise into a draw for a prize, at the half way point I want to turn on this paypal IPN so that it covers the cost... (hence I need it done now, not after launch)

My thoughts are I have 2 ways to do this:

Method 1 i use paypal IPN to update a 'paid' column in the adverts after advert has been uploaded by user.

PROBLEM: I'm going to have my advert table cluttered with adverts people have not paid for - I'm going to have my image folder with images that do not belong to live adverts.

GOOD: I can upload and go to a preview page then pay for the advert which would let people see what they are getting I suppose.

I suppose I could write a function to clear out unpaid adverts after 1 week or something...

Method 2 Advertise form sends all data through to paypal IPN listener, upon a successful payment data is uploaded.

PROBLEM: How to validate form, then send data to paypal. almost need two submits?

GOOD: No junk images, no junk advert DB files.

What would you do? and why?

many thanks :)

4

1 回答 1

0

我会选择方法 1。编写一个脚本来保持你的表格/图像干净应该很容易。

对于方法 2,我会质疑 PayPal 是否会为您传递所有这些数据。方法1更清洁。

另一种选择是将未付费广告存储在反映付费广告的临时表中。您可以使用临时表进行预览等。当 IPN POST 进来时,只需将数据从临时保存表复制到活动表。然后,与方法 1 一样,每隔几天运行一次 cron 作业以清理旧的/未付的项目。

于 2013-08-16T02:39:31.177 回答