简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM