Update Paypal IPN message details - paypal-ipn

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.

Related

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.

PayPal Payments Pro - Skip IPN

Is it possible to tell PayPal through the NVP to not send a response to the IPN handler? For instance I use the IPN for payments I receive through a store I have running FoxyCart. However the store Im setting up now doesnt use a 3rd party cart, Im just using the API response to handle handle everything. Because of this I dont want PayPal to send a response to the IPN.
Ive scoped out the notify_url param, but that appears to only change where the IPN response is sent to.
I would prefer for this store that no IPN response gets sent at all, while allowing the other store to continue using the IPN it has always been.
Thanks in advance.
It depends on your account settings.
There are two types of IPN's, one is set at account level, and it's triggered whenever money comes into your account, regardless of the source. If you disable this, you will not get ny IPN's from either store.
The other type of IPN, is based on the API call being made.
You need to check your magento payment module config to see if it's generating the second type, and disable it there. If it's already disabled, it means that you are only getting the first type of IPN. If this is the case, you would actually need to modify your OTHER shopping cart.
(A simpler option might be to open a child paypal account, rather than mess with all the carts)

PayPal IPN and updating database

I understand how IPN works, and the basic idea of the sending of information, verifying etc. But for the life of me I cannot get it to work!!
This is what I'm trying to do...
A user selects a certain part of a product to purchase, once they click it, they are linked to a paypal button which I've added 2 text fields to. First is there User ID and the second the name of their selected part - both of which the value is added in automatically. That all works fine.
They then press Buy Now and fill out their card details and it is purchased and redirected to a success page.
However, I want it so it updates their profile in my database to show they have purchased that product.
I understand that using PayPal's IPN I can send information to a page on my site to check it, and if the payment is complete then take whatever action needed.
I have tried the scripts from the PayPal site itself and I get no response at all. Can someone give me a really, REALLY simple method of achieving what I'm after? Because every tutorial out there is overly complicated or doesn't work, and the examples don't help me in the slightest and they talk to you as if you should know how it's done already.
I've even read the whole PDF and still I'm clueless about how to get this working. Any help?
This really depends on how you have your users stored in a database.
How are they identified, do they have a username?
Are you saving transactions to a database before you submit the information to PayPal?
Basically, you would want to look at the IPN Variables and see what you could use to associate the data with your databases when the IPN message is received by your script.
Lets say you have the following Databases:
Users: ID, email, etc.. etc..
Transactions: ID, emailofUser, invoiceID, Success/Fail(bool)
You want to store information to the database before you send the data to PayPal - "Hey, this guy was sent to PayPal to purchase this".
Then, IPN comes in when you want to ensure that the item was actually purchased. You don't want to offer someone the benefits of purchasing an item just for being sent to PayPal, you want to make sure they actually completed payment. Going off of the IPN variables, you could easily use the 'invoice' variable (as long as you define it appropriately when you send the data to PayPal).
So lets say you send a buyer to PayPal, he completes checkout, and your script gets an IPN message. You'll want to do something like the following:
Verify the IPN
Check what invoice this is for
mysql_query("SELECT * FROM Transactions WHERE invoiceID=$_POST['invoice']");
See if the transaction is successful or not.
if ($_POST['payment_status'] == 'completed')
{
//update whatever information you need to
}
else
{
//something else happened with this transaction, put a flag on it for review by
//an admin
}
You should check out the links below which describe a little more about managing your orders
Order Management Automation
Order Management Guide

How do I deal with PayPal customers who can't direct return

PayPal states:
Note: If you have turned on Auto
Return and have chosen to turn on
PayPal Account Optional for new users,
a new user will not be automatically
directed back to your website, but
will be given the option to return.
But if some of the customers don't get "Auto Returned", how do I handle them programmatically?
Paypal does not guarantee autoreturn especially when Paypal Account - optional setting is on.
The right way to handle the integration is with Instant Payment Notification (IPN) option. Using IPN Paypal will make POSTS to your page notifying you of payment events. The following link explains the IPN process pretty well.
To summarize, you will write code that will trap posts from Paypal and then make sure to update your billing data accordingly.
Also, IPN messages might be slightly delayed.
Create a script (cron or what) that does check for such payments at paypal perodically (e.g. every hour).
Is this what you mean?
https://www.paypal.com/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside
If not, you may need to be a little more specific with your question. Like - are you using paypal pro? How are your customers checking out? etc. And now that I read the answer below mine, I wonder if you are even talking about the payment process and not something else.