subscr_payment & subscr_failed - paypal-ipn

Sorry new to all this so hopefully not stupid questions
If you use the "subscr_payment" & "subscr_failed" IPN variables what values do you get sent?
If a user starts a transaction but then cancels does an IPN get sent?
Thanks
John

https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/
This tells you what data you receive with Instant Payment Notifications. Search for subscr_payment and subscr_failed to find what you get with them. There is also a description of what each data holds.

Related

Buy with pay now vs pay with subscription on IPN paypal

I'm having problem with payment on subscription IPN paypal.
If I set cmd is '_xclick-subscriptions', after payment, I saw IPN response to update my db is very slow.
But if I set cmd is '_xclick', after paypmen, I saw IPN response to update my db is very quickly, seems immediate...
Does anyone know about this problem. Could you help me??
Thanks you so much!
If you rely on time then you need to use Express Checkout for subscriptions.
This is because you won't need to wait for an IPN notification to update your database, instead you will get the answer from paypal right away in an API call.
In your case you will need the credentials of the person who will receive the money, not the person who is going to subscribe. You need the follow the process described here: developer.paypal.com/docs/classic/express-checkout/
Here you can see some diagrams: here

How to explicitly reject an IPN request

In the documentation for IPN, it says things like "Check email address to make sure that this is not a spoof". But I cannot see what to do when that is the case, and how I tell PayPal I want to reject a transaction. E.g. do I sent back a 400 instead of a 200? Or alter the POST data in some other way?
Or do I just ignore the message? (The problem with that is that PayPal will keep re-trying, which is wasted bandwidth for us, but also means it takes longer for the user to hear about the payment failure.)
Background: I realize sending it back to PayPal and getting the VERIFIED message back handles most security issues. But in my case, there is some unique ID information in the custom field. If that is missing, or does not validate against the DB, I want to reject the payment. I want my customer to see it failed, so they know to go and use a fresh form. The alternative is to accept the payment, and then have to involve a manual process trying to work out who the payment came from, and then possibly do a manual refund. (Other reasons to do this might be that the inventory has sold out in the split second between them seeing a product on the site and clicking BUY.)
The payment didn't fail. PayPal is notifying you that the payment succeeded: not asking you whether you want to accept it. You can't reject it at this stage.
Simple send back a 200 code to let Paypal know you received the IPN, otherwise Paypal will try to send the IPN response repeatedly.
IPN is Instant Payment Notification. After the payment paypal notify you the result of the payment. Check if connection VERIFIED, and next if if the payment is Completed and mark the result in the database.
If you say to PayPal the ipn address in the cart, Paypal send you the notification. You can't say to paypal: "yes please, send me a notification" and when receive say "why you send this?" If you put ipn in cart form you can provide a ipn url with code 200, not 404. Or remove ipn value in the cart form

how to identify a transaction with IPN

First of all sorry about my english,
I have a small problem with the IPN PayPal notification system. After a payment is done on my website, Paypal send to me a IPN message in order to confirm the transaction. In my website I need to do some stuff, including setting a variable which indicates the order can be send. But in the case two payments with the same amount are done at the same moment, how can I distinguish them? The user's mail is not enough because the mail I have can be diferent of the paypal user's mail...
Any Idea?
Ok, I think using the custom filed I can achieve that.
The transaction is identified by the txn_id field. In the case of a Reversal or Cancel_reversal, the original transaction it refers to is given by the parent_txn_id field.
I don't see what 'with the same amount' has to do with it.

When PayPal sends a REFUND message to your IPN listener, does it still carry the data for the custom fields?

I've recently wrote my IPN listener script to manage purchases for my website. Whenever a user submits a payment, there is a custom hidden field with their USER ID as the value. I know that to identify if the message is a REFUND, it'll have the post parameters:
reason_code = refund
Now my question is, when PayPal notifies my IPN listener of the refunded item, will it still send the exact same post data (including my custom field so I can manage the user accordingly due to thei) that was sent when they purchased the item?
I hope I made my message clear and that it's not too confusing.
Thank you.
Yes, when you issue a refund you will receive the same custom variable back in the refund that you passed over when you charged the buyer. It will have the same value that you set. I also just tested this to make sure there were no issues with this feature, and it is working as it should.

Update Paypal IPN message details

Is there a way to update the variable data that was sent to paypal?
Given this scenario, a customer purchases an item with code A, then code B is introduced that now logs users id and other information. But all customers who purchased using code A will not be correctly identified by code B.
I can see the IPN message detail in the IPN history, but I just wished I could type into that box and manually update/correct a few of the variables.
Is there a way to do this, or a way around this?
You can update the customer's recurring payment profile using another API. I don't know what the point of amending, at PayPal, an IPN message that has already been sent to you is, but you can't do it, and you don't want to do it. You would be lying to yoursef about what they have sent you, and perpetrating a fraud against PayPal as well. All you have to do is adjust what happened at your end.