Invoice value not defined in IPN - paypal

I'm starting to IPN posts that do not have the invoice number. This is happening randomly. I have doubled checked the code and the URL and have verified that I am passing a value for invoice.
&invoice=123456
This started happening more often this year and I'm not able to track down the error. I'm not able to reproduce this.

Related

How can i fix or handle the Generic error "PAYMENT_ALREADY_DONE" with paypal sandbox?

You guys are my last hope... I created a website with WordPress and I'm using woocommerce. I have been doing test transactions in the PayPal sandbox. And it was working, but suddenly started to give this error in PayPal
/genericError?code=PAYMENT_ALREADY_DONE
And each time cancels my orders. I tried to solve the issue by adding a prefix to the order number but still is giving me that error. I am only using one shop.
and I've checked everywhere for hours, for most people it was a problem of forgetting to change the sandbox PayPal account to their real business account, for others it was because they weren't using a prefix and had more than one shop. All the others never got any answer or help.
how can i fix this?
By the way, after the process paypal redirects de user to cancel order page of woocomerce but in the woocomercer order panel appears te order was made.
in the image below you can see the order were created and the random prefix and subfix i added to order numbers.
picture

Does paypal changes the order of POST fields in every IPN notification?

I read that I need to send a confirmation to paypal with the fields in the same order plus the cmd=_notify-validate field. I know that for certains event the fields will be different, but for example for a notification of paid using paypal buttons, will the params will always be in the same order?
Due some limitations I can't get the whole POST fields array (I can only get them by explicitely calling the key) so an option is to set each field in the confirmation request to paypal.
Whether it's always the same order is irrelevant. You're supposed to send them back in the same order they arrived in, whatever that was.
BUT I don't believe that observing the same order in the validation request is necessary, and in some languages, e.g. Java, it isn't even possible, as the order isn't preserved. I've been running IPN for several years without observing this constraint, and I've only ever had one validation failure, from Turkey, which remains unexplained but could have been say a character set issue.
Note that PayPal provide sample code for Java somewhere which therefore doesn't observe the constraint either. One assumes it was tested and passed a review ...

Not receiving payment_status = Completed

I have setup a php script to work with the paypal IPN. Overall things work, but I'm not getting some of the variables the documentation says I will be receiving:
https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/#protocol_and_arch
Most notably I'm not getting anything returned for Payment_status which it says should be returned as Completed.
I'm doing a monthly or yearly recurring payment option with a free one month trial. I'm wondering if this could be the culprit? If it is, what else can I do to verify the user has in fact completed the process of supplying payment information properly to paypal to start the trial period? I can't find any variable in the set that identifies this (as opposed to a declined transaction, or a subscription cancellation, or a totally faked entry).
Also, it's not anywhere near as important; but i'm not getting back a transaction id (txn_id), and the referenced variable mc_gross is also missing. Although it is giving me the monthly renewal rate in a variable called mc_amount3.
Lastly, is there a listing of what the possible results are for each possible variable somewhere? For instance, I randomly get back subscription period as "period3 = 1 M", which I assume means 1 Month. But how am I supposed to know what the other options are? Would a year renewal be 1 Y? Or something else entirely?
A little frustrated right now so I'd appreciate it if anyone who had similar issues can provide some insight.
Well, after a couple days I finally ponied up for a tech support call to paypal. The lady literally knew less than I did which was disappointing. I still, can't get a direct answer on why I'm not seeing the same variables their basic setup page states I should be looking for.
However, after another couple days of looking i at least found the IPN variable reference guide buried DEEP in the paypal help pages.
Thought I'd post the link in case anyone comes across this page looking for similar answers:
https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNandPDTVariables/

Paypal recuring get no response from test account number

I am using these credit card test number for test. but got null response form some of these number
test paypal credit number.
for example visa : 4012888888881881 i got null response form this number. not even i got any error. is all the number are valid or all are changed .
I found it is randomly . so if i will got no response with no error it will create recurring profile or not.
I checked your account, and I do show that requests are reaching PayPal and PayPal is sending back an API response for every request. Most were successful, some returned an API error but none the less everyone did generate a successful response back to your system. Make sure that the code that you are using is correct, and that it is set up to read the response that is being sent back. You can find some sample code that may help you here.

paypal ipn notification twice

My notification script is launched twice first is VERIFIED and second INVALID.
I've tried different ipn validation scripts and always get it twice.
I'm using sandbox maybe seller account settings are not right? I've set IPN on with notify url and auto return. Also in form there is return and notify_url set
I remember in the documentation it states that duplicates are possible -- that's just the nature of the internet. That's why it gives you a unique transaction ID. You're supposed to use that to prevent bad things from happening if you get notified twice.
A better question might be: why does it say Verified and then Invalid? Or is that ok?
EDIT
The docs say "PayPal sends a single word back, which is either VERIFIED if the message originated with PayPal or INVALID if there is any discrepancy with what was originally sent". I'm going to guess that YOUR code accidentally sends the "echo" back to PayPak twice and one of them is malformed. Maybe they're both identical but PayPal responds with INVALID if it gets it twice. But no matter, for a particular transaction Id, once you get VERIFIED, you're good. Simply ignore all subsequent responses.
EDIT 2
The return url is simply used by PayPal to redirect the user back to your site. Use this page to thank them for their purchase and inform them they will be notified once processing is complete. You can even set this to an empty string if you don't want this feature. When Payment is actually complete (or some problem was identified), PayPal will invoke the script referenced by the notify url. This is where you make sure everything looks right, handle duplicate notifications, update your database, send an email to the user saying their payment was processed, etc.
before inserting or updating your mysql query Check if the returned Transaction id '$_POST['txn_id']' already exists in your db table, if it doesnt exists so insert it with other $_POST data, because paypal calls the notify url many times.