简体   繁体   中英

paypal Subscription button : payment notification

I have two payment methods one is through subscription and another one is single payment.

for single payment: I receive the message payment_status 'completed' to return url then I do the database update.

for subscription : I receive the message txn_type subscr_signup.to return url not subscr_payment. But I need to immediately tell give the product to the user.

How to know in the success page itself the payment is collected by paypal... for subscription

In short I want to know the payment status.

please help me

for single payment: I receive the message payment_status 'completed' to return url then I do the database update.

That's where I feel you are doing it wrong. You are relying on the buyer to go back to your webpage (in order to do the database update) by clicking on the link at the end of the checkout or by Paypal automatically redirecting to your webpage. What's the problem with that? If the buyer doesn't click the link or wait for the redirect, then they do not go back to the webpage and therefore no database update gets made.

So how can I get the payment information? There is a better (but not 100% reliable) way to do this and that is by using IPN . With both payment methods, you can add a notify_url variable. This is the URL of a listener script to which Paypal will post information about the transaction that is made. So when a buyer makes a payment, your script will be called to make the necessary database update. Just be aware the script has to do certain things in order for Paypal to send you the information. I have used this implementation in the past and it has worked for the most part.

How to know in the success page itself the payment is collected by paypal... for subscription

Above might not answer your original question. From looking at their documentation , you might be able to use return and cancel_return variables in both methods to determine whether the payment was complete or not, respectively.

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