paypal subscription, payment information update

I am trying to design a web application(using php and mysql) in which I will ask my clients to pay via paypal subscription, which detects money from the clients paypal account automatically and transfers it to my paypal account.

Now when a client logs into my web application after 3 months of time, is there a way my web application to know if a payment has been made from the clients account to my merchant account in the last 30 days.

Any suggestions please


I think you must set up a table like this:

id | user_id | order_id | payment_method | payment_received
-----------------------------------------------------------
1  | 8       | 7        | paypal         | 2009-12-12 16:03
2  | 6       | 9        | paypal         | 2010-02-01 12:03

If the customer has payed his order, you will insert a record in this table. You can check the last payments for your customer with this query:

SELECT COUNT(*) FROM payments 
WHERE (payment_received + INTERVAL 30 DAY) >= NOW()
AND user_id = xx

If the result is bigger than 0, you know that there was a transaction in the last 30 days between you and your customer

链接地址: http://www.djcxy.com/p/33666.html

上一篇: 使用贝宝自适应付款API(如Kickstarter)使用Amazon Payments?

下一篇: PayPal订阅,付款信息更新