PayPal WPP Direct Payments & Express Checkout Support
#4121
Posted 24 February 2010, 21:52
I'm having trouble figuring this one out, as I keep getting an error after I've installed everything.
The error reads:
Fatal error: Call to a member function add_current_page() on a non-object in /home/2/a/agderaudio/www/includes/application_top.php on line 312
Everything works in the admin area, I've tripple checked that all files are where they'r supposed to be, and made multiple checks on the
inserted code in the various files.
I'm about to tear what's left of my hair off in frustration, as I can't seem to figure out where I made a boo-boo...
osc v2.2 RC2 with non-standard(own) template
paypal_wpp v 1.1.1
PHP v 5.2.10
MySQL 5.1.44
Anny suggestions?
#4122
Posted 01 March 2010, 13:56
#4123
Posted 04 March 2010, 23:08
I am getting a PHP Warning when I perform any of the operations on the orders page (capture, refund, charge). The transactions work even though I get this warning in my error_log.
[04-Mar-2010 17:53:34] PHP Warning: include(): Failed opening '/path_to_html_files/includes/configure.php' for inclusion (include_path='.:/usr/local/lib/php-pear') in /path_to_html_files/admin/includes/paypal_wpp/paypal_wpp_capture.php on line 11My admin directory is directly in the html folder and not in the catalog folder.
This is from paypal_wpp_capture.php. The third line is generating this warning.
chdir('../../');
include('includes/application_top.php');
include(DIR_FS_DOCUMENT_ROOT . DIR_WS_INCLUDES . 'configure.php');
include(DIR_WS_CLASSES . 'order.php');
include(DIR_WS_INCLUDES . 'paypal_wpp/paypal_wpp_include.php');
$paypal_wpp = new paypal_wpp_admin;
My question is, does this matter and if so, which directory do I need to point to?admin/includes/configure.php or catalog/includes/configure.php
Thank you for your help.
Michael
Edited by mvigil514, 04 March 2010, 23:10.
#4124
Posted 04 March 2010, 23:41
mvigil514, on 04 March 2010, 23:08, said:
I am getting a PHP Warning when I perform any of the operations on the orders page (capture, refund, charge). The transactions work even though I get this warning in my error_log.
[04-Mar-2010 17:53:34] PHP Warning: include(): Failed opening '/path_to_html_files/includes/configure.php' for inclusion (include_path='.:/usr/local/lib/php-pear') in /path_to_html_files/admin/includes/paypal_wpp/paypal_wpp_capture.php on line 11My admin directory is directly in the html folder and not in the catalog folder.
This is from paypal_wpp_capture.php. The third line is generating this warning.
chdir('../../');
include('includes/application_top.php');
include(DIR_FS_DOCUMENT_ROOT . DIR_WS_INCLUDES . 'configure.php');
include(DIR_WS_CLASSES . 'order.php');
include(DIR_WS_INCLUDES . 'paypal_wpp/paypal_wpp_include.php');
$paypal_wpp = new paypal_wpp_admin;
My question is, does this matter and if so, which directory do I need to point to?admin/includes/configure.php or catalog/includes/configure.php
Thank you for your help.
Michael
It should point to catalog/includes/configure.php. On the admin side, application_top.php will include admin/includes/configure.php. The reason for pulling the shop's configure.php is that there are some items defined only there and not on the admin side.
--Glen
#4125
Posted 05 March 2010, 01:40
SteveDallas, on 04 March 2010, 23:41, said:
--Glen
Thanks for the quick response Glen.
#4126
Posted 10 March 2010, 22:54
Just installed this module but getting the following warnings at the top of Admin Modules Payment Page
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in XXXXXXXX/catalog/includes/modules/payment/paypal_wpp.php on line 1589
Same on line 2166
and same on line 2168
These same warnings come up on the Payment page as well when I try to go through payment
Any ideas what is causing this?
Also when I click on the Paypal Express button in the store it says that it cannot find the cert file when it is there in the includes/paypal_wpp/cert/ folder.
Any help much appreciated and thank you in advance!
#4127
Posted 11 March 2010, 00:18
matthell, on 10 March 2010, 22:54, said:
Just installed this module but getting the following warnings at the top of Admin Modules Payment Page
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in XXXXXXXX/catalog/includes/modules/payment/paypal_wpp.php on line 1589
Same on line 2166
and same on line 2168
These same warnings come up on the Payment page as well when I try to go through payment
Any ideas what is causing this?
Also when I click on the Paypal Express button in the store it says that it cannot find the cert file when it is there in the includes/paypal_wpp/cert/ folder.
Any help much appreciated and thank you in advance!
Untested fix for the call-time pass-by-reference issue:
On lines 1580, 2166, and 2168, remove the ampersand ('&') preceding $order_info.
On lines 2132, 2174, and 2248, add an ampersand in front of $order_info.
For the missing cert file, ensure that the location is set correctly in Admin->Modules->Payment->PayPal WPP. I think the installation process sometimes generates the wrong path. Note that it should be an absolute file system path, not a URL.
--Glen
Edited by SteveDallas, 11 March 2010, 00:25.
#4128
Posted 11 March 2010, 19:22
SteveDallas, on 11 March 2010, 00:18, said:
Untested fix for the call-time pass-by-reference issue:
On lines 1580, 2166, and 2168, remove the ampersand ('&') preceding $order_info.
On lines 2132, 2174, and 2248, add an ampersand in front of $order_info.
For the missing cert file, ensure that the location is set correctly in Admin->Modules->Payment->PayPal WPP. I think the installation process sometimes generates the wrong path. Note that it should be an absolute file system path, not a URL.
--Glen
Thanks Very Much!
That sorted it out.
I was getting the following error at the top of checkout_confirmation.php
Warning: Missing argument 4 for cc_validation::validate(), called in XXXXXX/catalog/includes/modules/payment/paypal_wpp.php on line 199 and defined in XXXXXX/catalog/includes/classes/cc_validation.php on line 16
If anyone else has been getting this its a simple fix change line 199 in paypal_wpp.php from
$result = $cc_validation->validate($_POST['paypalwpp_cc_number'], $_POST['paypalwpp_cc_expires_month'], $_POST['paypalwpp_cc_expires_year']);
to the following:
$result = $cc_validation->validate($_POST['paypalwpp_cc_number'], $_POST['paypalwpp_cc_expires_month'], $_POST['paypalwpp_cc_expires_year'], $_POST['paypalwpp_cc_checkcode']);
It seems that it wanted to be passed the CCV2 code in this section but since it wasnt it threw up the error as it was only getting 3 of the 4 variables it wanted.
Or I might be talking garbage ..... lol
Hope this helps someone out!
#4129
Posted 11 March 2010, 20:23
So it all works in my development folder but when I implement it onto the website which uses totally different webspace for the SSL it all comes undone!
First I was getting the 'cannot find cert file' - fixed this in the admin by pointing the module to the secure webspace instead of the normal webspace (it didnt like me pointing it at the absolute path in the standard webspace)
Now when I click on the Paypal Express button from the secure webspace I get the following:
PayPal WPP installation incomplete! There should be XML files located in /XXXXXX/catalog/includes/wpp_xml/ !
(setExpressCheckout.xml)
Its looking for files in the standard webspace instead of the secure webspace.
Is there a way to force the module to look for the files on my secure webspace instead of on the standard one?
Thanks in advance!
#4130
Posted 11 March 2010, 20:43
matthell, on 11 March 2010, 20:23, said:
So it all works in my development folder but when I implement it onto the website which uses totally different webspace for the SSL it all comes undone!
First I was getting the 'cannot find cert file' - fixed this in the admin by pointing the module to the secure webspace instead of the normal webspace (it didnt like me pointing it at the absolute path in the standard webspace)
Now when I click on the Paypal Express button from the secure webspace I get the following:
PayPal WPP installation incomplete! There should be XML files located in /XXXXXX/catalog/includes/wpp_xml/ !
(setExpressCheckout.xml)
Its looking for files in the standard webspace instead of the secure webspace.
Is there a way to force the module to look for the files on my secure webspace instead of on the standard one?
Thanks in advance!
The problem I am getting now is:
'unable to use client certificate (no key found or wrong pass phrase?) (Error No. 58)'
I am able to go all the way through with the transaction including putting in 3d secure information then when i have entered the 3d secure info this error comes up.
Also clicking on the Pay by Paypal button produces this same error message.
Thanks
#4131
Posted 11 March 2010, 21:54
matthell, on 11 March 2010, 19:22, said:
Warning: Missing argument 4 for cc_validation::validate(), called in XXXXXX/catalog/includes/modules/payment/paypal_wpp.php on line 199 and defined in XXXXXX/catalog/includes/classes/cc_validation.php on line 16
If anyone else has been getting this its a simple fix change line 199 in paypal_wpp.php from
$result = $cc_validation->validate($_POST['paypalwpp_cc_number'], $_POST['paypalwpp_cc_expires_month'], $_POST['paypalwpp_cc_expires_year']);
to the following:
$result = $cc_validation->validate($_POST['paypalwpp_cc_number'], $_POST['paypalwpp_cc_expires_month'], $_POST['paypalwpp_cc_expires_year'], $_POST['paypalwpp_cc_checkcode']);
It seems that it wanted to be passed the CCV2 code in this section but since it wasnt it threw up the error as it was only getting 3 of the 4 variables it wanted.
Or I might be talking garbage ..... lol
Hope this helps someone out!
The validate() function in includes/classes/cc_validation.php from osC 2.2RC2a takes only three parameters. Either you are using some other cart derived from osC or you installed a contribution somewhere along the line that modifies cc_validation.php. In either case, it's not a WPP bug, but we're glad that you got it sorted out for your setup. I would be curious as to why it wants the card security code, other than to check that it is either three or four digits.
--Glen
#4132
Posted 11 March 2010, 22:06
matthell, on 11 March 2010, 20:43, said:
The problem I am getting now is:
'unable to use client certificate (no key found or wrong pass phrase?) (Error No. 58)'
I am able to go all the way through with the transaction including putting in 3d secure information then when i have entered the 3d secure info this error comes up.
Also clicking on the Pay by Paypal button produces this same error message.
Thanks
--Glen
#4133
Posted 12 March 2010, 09:33
SteveDallas, on 11 March 2010, 22:06, said:
--Glen
Just got off the phone to Fasthosts they claim that my proxy address is my secure webspace address .... is this correct or are they making it up?
What should my proxy address look like?
Thanks
#4134
Posted 12 March 2010, 12:47
matthell, on 12 March 2010, 09:33, said:
Just got off the phone to Fasthosts they claim that my proxy address is my secure webspace address .... is this correct or are they making it up?
What should my proxy address look like?
Thanks
--Glen
#4135
Posted 12 March 2010, 13:25
SteveDallas, on 12 March 2010, 12:47, said:
--Glen
when the proxy is blank i get the old error coming up.
Could this be something to do with configure.php in includes in the secure section of the website?
Code below:
define('HTTP_SERVER', 'http://www.XXX.com');
define('HTTPS_SERVER', 'https://vault1.secured-url.com/XXX'); // secure server
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', 'www.XXX.com');
define('HTTPS_COOKIE_DOMAIN', 'https://vault1.secured-url.com/XXX'); // secure server
define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '/catalog/');
define('DIR_WS_HTTP_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
define('DIR_FS_CATALOG', '/sslroot/XXX/catalog/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
I have tried changing the
define('DIR_FS_CATALOG', '/sslroot/XXX/catalog/'); code to the standard website but I get an error
#4136
Posted 12 March 2010, 15:58
matthell, on 12 March 2010, 13:25, said:
when the proxy is blank i get the old error coming up.
Which error was that? Cannot find cert file? That would make sense, because the invalid proxy would come before it looks for the certificate.
DIR_FS_CATALOG is almost certainly incorrect. It should be the full path to the catalog as seen by the file system. Since you can access the preferences panel for WPP, it is set correctly in admin/includes/configure.php, so take that value and put it into the shop's includes/configure.php. You should be able to see the correct value at the bottom of the payment module page, under the heading "Module Directory:" Just take everything up to and including '/catalog/'. (Don't add the 'includes/modules/payment/'.)
The value for 'API Certificate' should look somewhat like the value you set for DIR_FS_CATALOG, with 'includes/modules/payment/wpp_cert/{name_of_your_certificate_file}' appended to the end.
--Glen
#4137
Posted 12 March 2010, 16:43
SteveDallas, on 12 March 2010, 15:58, said:
DIR_FS_CATALOG is almost certainly incorrect. It should be the full path to the catalog as seen by the file system. Since you can access the preferences panel for WPP, it is set correctly in admin/includes/configure.php, so take that value and put it into the shop's includes/configure.php. You should be able to see the correct value at the bottom of the payment module page, under the heading "Module Directory:" Just take everything up to and including '/catalog/'. (Don't add the 'includes/modules/payment/'.)
The value for 'API Certificate' should look somewhat like the value you set for DIR_FS_CATALOG, with 'includes/modules/payment/wpp_cert/{name_of_your_certificate_file}' appended to the end.
--Glen
Have done this and I am now back to the following errors:
When I put the API Certificate address in on the config as
/home/fhlinux134/x/XXX.com/user/htdocs/catalog/etc/etc
I get the cant find API Certificate error
I change it to /sslroot/XXX/catalog/etc/etc (my secure server address) and it manages to find it but then I get this:
PayPal WPP installation incomplete! There should be XML files located in /XXXXXX/catalog/includes/wpp_xml/ !
(setExpressCheckout.xml)
I have noticed that this is pointing to the wrong folder and isnt the same as the file structure in the download. - setExpressCheckout.xml is in the folder catalog/includes/paypal_wpp/xml/
I have tried copying the xml folder into the includes folder (on both secure and standard) and renaming it wpp_xml but it still comes up with the same error.
Thanks for your help with this so far much appreciated!
#4138
Posted 12 March 2010, 18:16
I think that we need to define some things first, to help you understand what is going on. DIR_FS_CATALOG is used when we need to find a file on the server. DIR_WS_CATALOG is used when we build a URL. FS references don't change between HTTP and HTTPS requests, as they are always located in the same place on the server.
You receive the "can't find certificate" error because the API Certificate path is not correct.
Set API Certificate to '/home/fhlinux134/x/XXX.com/user/htdocs/catalog/includes/paypal_wpp/cert/cert_key_pem.txt'. If you saved the key under a different name, adjust accordingly.
You receive the "PayPal WPP installation incomplete!" because the WPP module can't find the XML files. This search depends on the value of DIR_FS_CATALOG.
Set DIR_FS_CATALOG in catalog/includes/configure.php to '/home/fhlinux134/x/XXX.com/user/htdocs/catalog/'.
Note that the "PayPal WPP installation incomplete!" test occurs before the code attempts to locate the certificate, so changing DIR_FS_CATALOG doesn't fix the first error; it just masks it because we never get to the other test.
There is a fault in the error message that displays the proper location of the XML files. Thanks for pointing this out; we'll fix it in the next release. In the mean time, here is the fix:
In catalog/includes/languages/english/modules/payment/paypal_wpp.php at line 39:
Change:
define('MODULE_PAYMENT_PAYPAL_DP_MISSING_XML', 'PayPal WPP installation incomplete! There should be XML files located in ' . DIR_FS_CATALOG . DIR_WS_INCLUDES . 'wpp_xml/ !');
to
define('MODULE_PAYMENT_PAYPAL_DP_MISSING_XML', 'PayPal WPP installation incomplete! There should be XML files located in ' . DIR_FS_CATALOG . DIR_WS_INCLUDES . 'paypal_wpp/xml/ !');
Have you uploaded wpp_diagnostics.php to your catalog directory? This is a useful tool for determining whether the WPP module is installed correctly.
To use it, open your web browser with http://www.xxx.com/catalog/wpp_diagnostics.php
--Glen
#4139
Posted 14 March 2010, 11:19
SteveDallas, on 12 March 2010, 18:16, said:
I think that we need to define some things first, to help you understand what is going on. DIR_FS_CATALOG is used when we need to find a file on the server. DIR_WS_CATALOG is used when we build a URL. FS references don't change between HTTP and HTTPS requests, as they are always located in the same place on the server.
You receive the "can't find certificate" error because the API Certificate path is not correct.
Set API Certificate to '/home/fhlinux134/x/XXX.com/user/htdocs/catalog/includes/paypal_wpp/cert/cert_key_pem.txt'. If you saved the key under a different name, adjust accordingly.
You receive the "PayPal WPP installation incomplete!" because the WPP module can't find the XML files. This search depends on the value of DIR_FS_CATALOG.
Set DIR_FS_CATALOG in catalog/includes/configure.php to '/home/fhlinux134/x/XXX.com/user/htdocs/catalog/'.
Note that the "PayPal WPP installation incomplete!" test occurs before the code attempts to locate the certificate, so changing DIR_FS_CATALOG doesn't fix the first error; it just masks it because we never get to the other test.
There is a fault in the error message that displays the proper location of the XML files. Thanks for pointing this out; we'll fix it in the next release. In the mean time, here is the fix:
In catalog/includes/languages/english/modules/payment/paypal_wpp.php at line 39:
Change:
define('MODULE_PAYMENT_PAYPAL_DP_MISSING_XML', 'PayPal WPP installation incomplete! There should be XML files located in ' . DIR_FS_CATALOG . DIR_WS_INCLUDES . 'wpp_xml/ !');
to
define('MODULE_PAYMENT_PAYPAL_DP_MISSING_XML', 'PayPal WPP installation incomplete! There should be XML files located in ' . DIR_FS_CATALOG . DIR_WS_INCLUDES . 'paypal_wpp/xml/ !');
Have you uploaded wpp_diagnostics.php to your catalog directory? This is a useful tool for determining whether the WPP module is installed correctly.
To use it, open your web browser with http://www.xxx.com/catalog/wpp_diagnostics.php
--Glen
I have done the following and I'm getting 'Cannot find API cert' error. The path is correct but if im running the command to look for the api cert from the secure folder (which is on a different server) I'm thinking that I would need to put the full web server address into the api cert location box?
And which server should it be looking for the api cert on the secure server or the standard server?
I ran wpp_diagnostics and the following erros came up:
Does cURL work? (Simple HTTPS test) No
SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (Error No. 60)
API Certificate installed? No
API Certificate directory protected? No
This is a shared SSL server so I do not have access to the SSL certificate nor did I install it.
Is there a way to configure cURL to accept any server certificate as this what the problem seems to be.
Thanks
Edited by matthell, 14 March 2010, 11:22.
#4140
Posted 14 March 2010, 19:14
matthell, on 14 March 2010, 11:19, said:
I have done the following and I'm getting 'Cannot find API cert' error. The path is correct but if im running the command to look for the api cert from the secure folder (which is on a different server) I'm thinking that I would need to put the full web server address into the api cert location box?
And which server should it be looking for the api cert on the secure server or the standard server?
Quote
Does cURL work? (Simple HTTPS test) No
SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (Error No. 60)
Quote
API Certificate directory protected? No
I'm pretty much at the end of what I can do without actually looking at your server configuration. If you would like me to have a look at it, please contact me via private message here.
--Glen














