Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal App missing invoice parameter


AngusD

Recommended Posts

Hi,

 

in the last couple of days, we had the issue that the PayPal App (IPN) couldn't finalize an order, because it was missing in the database. This shouldn't happen, or this should only happen when a customer returns to the checkout payment-page.

 

I checked the PayPal log and found that the invoice parameter was missing from those orders. I don't know how this could have happened. I assume, the PayPal App couldn't insert the order into the database and continued without it. When the customer came back from PayPal, he was transfered to the checkout payment-page; maybe with an error-message he couldn't understand correctly, and the order was removed from the database.

 

Why the App couldn't set up the order, I don't know and I'm not sure how to find out if this was the case.

 

After the first time this happened, I put the App in Sandbox mode and tested the checkout. Everything worked as it should. Afterwards we had orders that were finalized correctly, until it happened again.

 

I'm not sure how to deal with it. I've added a check to the PayPal payment module, if there's an order_id present for the current order, but I'm not sure if this is the right thing to do:

$insert_id = NULL;
$insert_id = tep_db_insert_id();

if(empty($insert_id)){ // The insert_id (=order_id) is missing. Why is the order_id missing? Get back to the payment page and try again.
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_ORDER_MISMATCH), 'SSL'));
  exit;
}

Any advice?

 

AD

Link to comment
Share on other sites

In the paypal app there is the option to save log files. Have you looked in there to see if there is anything that is serious. If you dont have logging turned on, turn it on, at least to save errors.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

I have "Log Transactions" set to "All". There are no errors in the log.

 

Everything looks good. Nothing that screams "Error".

 

If I check the details of a "successful" transaction in the log, the second (_notify-validate [iPN]) or third (_notify-synch) "Request" is "invoice". This request is missing in the "failed" transactions.

 

I guess the order_id wasn't transfered to PayPal and so PayPal didn't send it back.

 

AD

Link to comment
Share on other sites

I tested it again, but this time in live-mode. After they're finished in PayPal, the customers are being directed to the shopping cart, without any error-message on their part.

 

The order is correctly entered in our database, but the invoice parameter ist missing in the PayPal transaction log.

 

Pretty strange...

 

AD

Link to comment
Share on other sites

So, I'm convinced it's a PayPal issue and it has nothing to do with our store or the PayPal App itself.

 

I thought long and hard about it, but in the end, I had no choice: I altered the PayPal App.

 

If the invoice-parameter is missing, the script grabs the order_id from the database and works with this value.

 

AD

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...