I am trying to build a online shipping system with use of ubercart. I have integrated Credit card Payment getway option I am geting these following issue.

•Notice: Undefined offset: 1 in _uc_paypal_nvp_to_array() (line 1049 of D:\projects\mycart\sites\all\modules\ubercart\payment\uc_paypal\uc_paypal.module).
•Notice: Undefined index: ACK in uc_paypal_wpp_charge() (line 296 of D:\projects\mycart\sites\all\modules\ubercart\payment\uc_paypal\uc_paypal.module).
•Notice: Undefined index: ACK in uc_paypal_wpp_charge() (line 357 of D:\projects\mycart\sites\all\modules\ubercart\payment\uc_paypal\uc_paypal.module).
•We were unable to process your credit card payment. Please verify your details and try again. If the problem persists, contact us to complete your order.

But I have ensured my all details, Its seems to be correct only. where else paypal payment getway is working fine for me.. But credit card only I got this issue.

Please do the needful.

Balaji K


DanZ’s picture

Category: support » bug
Priority: Critical » Normal

You shouldn't ever get undefined index errors unless you have a corrupt installation of some sort. Problems like this should produce more graceful (and useful!) error messages, so this is a bug report.

However, both support requests and bugs that only affect one installation can't be critical priority.

That said, it looks like you're not getting valid data back from Paypal. This is usually a result of setting up the sandbox incorrectly. Your sandbox account is completely separate from your regular account.

It's also possible that your Paypal account can't handle credit cards. Paypal has some strange rules that sometimes depend on geography, and they might have a rule for India.

Check your Drupal watchdog log for more detailed errors and report them here.

longwave’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

The errors mean that the PayPal server returned a response in an unexpected format that could not be parsed at all.

Are you using the sandbox or a live account? Have you entered all your PayPal credentials correctly in the payment method settings page?

longwave’s picture

Assigned: balajiii » Unassigned
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No further info provided.

ybkishore’s picture

I am getting the same error. I have a fresh install of the latest drupal and ubercart. I setup paypal express correctly for testing via sandbox. I error I see on my local server is

Notice: Undefined offset: 1 in _uc_paypal_nvp_to_array() (line 1049 of C:\Users\KISHORE\Documents\My Web Sites\GCSite3\sites\all\modules\ubercart\payment\uc_paypal\uc_paypal.module).
Notice: Undefined index: ACK in uc_paypal_ec_form_submit() (line 730 of C:\Users\KISHORE\Documents\My Web Sites\GCSite3\sites\all\modules\ubercart\payment\uc_paypal\uc_paypal.module).
Notice: Undefined index: L_ERRORCODE0 in uc_paypal_ec_form_submit() (line 731 of C:\Users\KISHORE\Documents\My Web Sites\GCSite3\sites\all\modules\ubercart\payment\uc_paypal\uc_paypal.module).
Notice: Undefined index: L_LONGMESSAGE0 in uc_paypal_ec_form_submit() (line 731 of C:\Users\KISHORE\Documents\My Web Sites\GCSite3\sites\all\modules\ubercart\payment\uc_paypal\uc_paypal.module).
PayPal reported an error: :

I uploaded mysite to azure using webmatrix. I have the same error.

I tried two different installs of drupal. One from drupal site another from acquia drupal. Both result in the same error. What could I be doing wrong? Can someone help.

ybkishore’s picture

I finally found the cause of the error. It is in some way related to the IIS server on windows and/or webmatrx.

I re installed drupal and ubercart on a linux host. Everything works fine now.

Sswater Shi’s picture

Category: support » bug
Status: Closed (cannot reproduce) » Active

PalPal Express fail.
I get the same problem, after I upgrade ubercart from 3.1 to 3.3

PayPal standard ok.

longwave’s picture

Oh, if it worked before an upgrade, that's very useful information. The only relevant change between 7.x-3.1 and 7.x-3.3 was #1479190: Certificates on https requests to payment processors are not getting verified. This suggests that the CURLOPT_SSL_VERIFYPEER option is not working on some servers.

Is anything logged with type "uc_paypal" in watchdog (Reports > Recent log entries) when this happens? Also, what hosting company are you using?

longwave’s picture

Status: Active » Postponed (maintainer needs more info)
longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

For anyone seeing these errors, please answer the questions in #7.

specture’s picture

I have tested with two instances and got the errors in both cases.
First - Drupal 7.19 clean install - Personal Server - Windows 7, IIS 7.5, PHP 5.3.8, MySQL 5.5.17
Second - Drupal 7.16 theme profile install - Hosting.com Enterprise server - Windows Server 2008 R2 - Apache 2.2 - PHP 5.3.8, MySQL 5.5.25
I have a third option that is a Linux server, however I do not see how the OS would make a difference.

In both instances the log filed the following error for uc_paypal:
Message: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

This must be referring to the API URLs SSL Cert as my personal server does not have an SSL cert and my Enterprise Server does.

specture’s picture

Perhaps I was wrong about the OS. I just did an install on Linux, Apache 2.2, PHP 5.3.21, MySQL 5.5.28 and it worked fine. The Apache & PHP configuration is setup to match that of the Windows 2008 server. This linux machine does not currently have an SSL cert installed.

longwave’s picture

Title: unable to process your credit card payment in paypal payment gatway » Unable to process PayPal credit card payments on Windows
Category: bug » task
Status: Closed (cannot reproduce) » Active

Looking at the file paths reported in #0, #4 and #5 the common link seems to be everyone is using Windows. I guess maybe the Windows install of cURL does not include CA certificates, or at least the certificates required by PayPal. This is not strictly a bug in Ubercart, more a problem with the cURL setup, but perhaps we can work around it - maybe by disabling CURLOPT_SSL_VERIFYPEER on Windows, or adding an option to do so.

longwave’s picture

longwave’s picture

Category: task » support

http://curl.haxx.se/docs/sslcerts.html explains this issue in full. I am not convinced that disabling peer verification is the right thing to do.

longwave’s picture

Status: Active » Fixed

If you are experiencing this issue, please read the above two links and ensure that a valid CA cert bundle is installed on your server for use with cURL.

bryan1221’s picture

Status: Fixed » Active

I recently had the same problem. Our environment is Windows Server 2008 R2 and Drupal 7.20. As of this morning orders were being processed through PayPal with no problem or issue. I updated the Ubercart Module from 7.x-3.1 to 7.x-3.4 and began to receive the following error uc_paypal “error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed”. I reverted snapshot on my virtual machine and it is working fine again. Our certificates are valid and work fine prior to the update.

TR’s picture

Status: Active » Fixed

@bryan1221: It's not *your* SSL certificate that's the problem, it's the Certification Authority root certificates that are installed as part of your PHP/cURL software. What you report in #16 doesn't contradict anything that has been said previously in this issue. Please read the documentation linked above to find out how to download and install the CA certificates you will need.

The change in Ubercart was to start verifying the PayPal certificate; this requires valid CA certificates on your server because using a CA certificate is the only way to validate the authenticity of any other certificate. This is an improvement in transaction security, and I would not recommend that you keep using the old version of Ubercart.

ontological’s picture

It seems that testing using the PayPal sandbox on your local machine will be more difficult. I'm using Acquia Dev Desktop on Windows and received the error. Is there a developer mode setting or something that could be used?


bryan1221’s picture

Not sure if this is the best solution but what fixed this issue for me was the following.
I browsed to uc_paypal.module file located in modules\ubercart\payment then changed the code below and everything works as it used to.
FROM: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
TO: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

This was the default setting in Ubercart 7.x-3.1 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

longwave’s picture

No, that is definitely not a recommended solution. Changing that code disables "peer verification", which means that someone could perform a man-in-the-middle attack between your server and PayPal, which would let them intercept credit card details or otherwise tamper with payment data. The correct solution is to fix your cURL installation so the correct CA certificates are available.

See e.g. http://stackoverflow.com/questions/14914330/security-consequences-of-dis... for confirmation of this.

Aigeec’s picture

Anyone know where to put the cacert.pem file once you have it?

Is the suggestion that we install curl as opposed to using the standard that comes with php?

If not is there an alternative to setting the location of the cacert.pem file using

curl_setopt($ch, CURLOPT_CAINFO, 'your file location here');

and if not where should this code be entered?

Would prefer not to hack anything, especially payment related features.

There is some mention of adding a curl.cainfo property to your php.ini but this doesn't seem to be working.

Thanks, A

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.