Jump to content
Sign in to follow this  
dynamoeffects

PayPal WPP Direct Payments & Express Checkout Support

Recommended Posts

I also am having the PayPal WPP installation incomplete! There should be XML files located in /includes/wpp_xml/ ! (setExpressCheckout.xml) Error. I have tried a couple of things that people have suggested in this thread but nothing has worked yet. Please, any help would be greatly appreciated.

 

Basic Tests

Using at least PHP 4.3.0? Yes

Does your store have an SSL certificate installed and working? Yes

Is cURL installed? Yes

Does cURL work? (Simple HTTP test) Yes

API Certificate installed? Yes

API Certificate directory protected? Yes

API Username in place? Yes

API Password in place? Yes

XML Document "doDirectPayment.xml" exists? Yes

XML Document "doExpressCheckout.xml" exists? Yes

XML Document "getExpressCheckoutDetails.xml" exists? Yes

XML Document "setExpressCheckout.xml" exists? Yes

XML Document "transactionSearch.xml" exists? Yes

Advanced Diagnostics

Able to connect to PayPal through cURL? No

Error received: 58: unable to use client certificate (no key found or wrong pass phrase?)

Received a valid response? Yes

Did PayPal respond without errors? (If not, errors are below) Yes

 

Config File

 

*/

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', ''); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', true); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', '');

define('HTTPS_COOKIE_DOMAIN', '');

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', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

Share this post


Link to post
Share on other sites

Well this makes me feel better, I thought I was going crazy. I have dropped in all the files provided with the module to see if there was a problem with my code integration and still get this issue.

 

I use Linux, and tried deleting the extra characters in the xml file, still same issue. My link with paypal fails each time. I am going to see if the values get returned but are getting unset from $SESSION by one of the subroutines.

 

Register globals is on, and my SSL is fine, it makes the request from paypal from an SSL page. Do I need to set some specific option on the paypal side I might be missing ?

 

Funny thing is while paypal_ec fields (except token) are blank, it somehow logs me in correctly as my customer_id and customer_default_address_id are correct....

 

Should I go back to 8.1 maybe ?

 

I am having the same problm as dogriley. I did notice that the express checkout works if I DO NOT login as a user first. But If I login, then payment fails for the same reasons quoted below. Very frustrating. I am thinking of just removing the express checkout button from the shipping/payment page so that it only appears on the login page...

 

Of note, I was also having a problem getting the direct payment option to work - after poking around a while, I found that the doDirectPayment.xml file contains 2 hidden characters at the beginning of the very first line. After removing them, it worked perfectly. I downloaded the file again today to double check, and yes, they are there in the 0.8.2 version. So something to look at for everyone...

 

I am just wondering now if there are some hidden characters in any other files that may be causing the session variables register to fail or something... Dynamo, I checked the registerglobals settings as you suggested to dogriley (it is on locally) and I have full SSL. I'm stumped. The address, and payer id do not get returned apparently. Anybody have some help or suggestions for me?

Edited by dogriley

Share this post


Link to post
Share on other sites
The service is only available to US and UK merchants at the moment.

 

Im looking to integrate WPP into my website based in the UK. Does contribution v0.8.2 allow me to take credit card payments and fast checkout in sterling? I've been watching the developments of the latest version thinking that was the only one that will support UK payments?

Share this post


Link to post
Share on other sites

OK I can confirm that the paypal_wpp.php script is getting the proper values from PayPal. So it looks like a bug and not a configuration problem

 

In function ec_step2() {} if I set a session variable of my own and store the results of:

 

$response = $this->wpp_execute_transaction('getExpressCheckoutDetails', $token_info);

 

or

 

$payer_info = $response['GetExpressCheckoutDetailsResponse'][0]['GetExpressCheckoutDetailsResponseDetails'][0]['PayerInfo'][0];

 

I can loop through the array and see I get my PayerID etc from PayPal.

 

There must be somewhere where the logic is unsetting these later on..........

 

I have to take a break on troubleshooting, maybe someone who knows the modules better can pick up from here?

 

TIA

 

Well this makes me feel better, I thought I was going crazy. I have dropped in all the files provided with the module to see if there was a problem with my code integration and still get this issue.

 

I use Linux, and tried deleting the extra characters in the xml file, still same issue. My link with paypal fails each time. I am going to see if the values get returned but are getting unset from $SESSION by one of the subroutines.

 

Register globals is on, and my SSL is fine, it makes the request from paypal from an SSL page. Do I need to set some specific option on the paypal side I might be missing ?

 

Funny thing is while paypal_ec fields (except token) are blank, it somehow logs me in correctly as my customer_id and customer_default_address_id are correct....

 

Should I go back to 8.1 maybe ?

Share this post


Link to post
Share on other sites

Dogriley,

 

I know how you feel.. I spent more than a few hours trying to comb through it looking for a spot where the session may get unset... no luck finding it yet. I too need a break and will probably try again this weekend.

Share this post


Link to post
Share on other sites

@dogriley: Since you know how to do that, try setting checks through the whole checkout, at the beginning and end of each of the checkout pages. When one fails, you'll know where the problem is.


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

I mapped out the ec_payment process, and tracked the Session variables throughout.

It runs like this:

 

ec_process -> ec_step1 -> ec_stept2 -> away_with_you -> checkout_shipping

 

if not logged in it is:

 

ec_process -> ec_step1 -> ec_stept2 -> user_login -> away_with_you -> checkout_shipping

 

This is fine all the way until away_with_you() does it's redirect:

 

tep_redirect(tep_href_link($redirect_path, '', 'SSL', true, false));

 

the values fed to it are:

redirect_path: checkout_shipping.php, with a resulting URL:

 

https://www.site.com///catalog/checkout_shi...xxxxxxxxxxxxxxx

 

The session variables are fine until after this redirect. If I capture them to an alt array prior to the away_with_you redirect they still exist, but if I try and capture to an alt array at top of checkout_shipping.php the important ones (ec_PayerID etc) are blank.

 

I am confused as to how $_SESSION['paypal_ec_payer_id'] can get wiped with this redirect.....

 

Any thoughts ?

 

 

@dogriley: Since you know how to do that, try setting checks through the whole checkout, at the beginning and end of each of the checkout pages. When one fails, you'll know where the problem is.

Share this post


Link to post
Share on other sites

I'm leaning towards something to do with the session_start stuff, which I haven't had a chance to read yet....

 

Anyway, I have a work around that seems to work. 4leaf may want something like this. any warnings or comments from anyone would be appriciated.

 

So.. since the $_SESSION['ec_xxxx'] variables are getting zero'ed I create antoher $_SESSION variable called mysession and assign all of $_SESSION to it. Then at the top of checkout_shipping I repopulate the important ec_xxxxx variables.

 

paypal_wpp.php

		  tep_session_register('mysession');
	  $_SESSION['mysession'] = $_SESSION;

 

right after $cart->restore_contents(); in the function user_login

 

then in checkout_shipping.php

  if ((is_array($_SESSION['mysession'])) && $_SESSION['paypal_ec_payer_id'] == '') {
	$_SESSION['paypal_ec_payer_id'] = $_SESSION['mysession']['paypal_ec_payer_id'];
	  $_SESSION['paypal_ec_payer_info'] = $_SESSION['mysession']['paypal_ec_payer_info'];
 }

 

right after the file includes at the very top.

 

This fixes the issue, and works for credit cards, and paypal payments now. I have NOT TESTED all possible variations to see if anything failes.

 

Again comments welcomed.

 

I mapped out the ec_payment process, and tracked the Session variables throughout.

It runs like this:

 

ec_process -> ec_step1 -> ec_stept2 -> away_with_you -> checkout_shipping

 

if not logged in it is:

 

ec_process -> ec_step1 -> ec_stept2 -> user_login -> away_with_you -> checkout_shipping

 

This is fine all the way until away_with_you() does it's redirect:

 

tep_redirect(tep_href_link($redirect_path, '', 'SSL', true, false));

 

the values fed to it are:

redirect_path: checkout_shipping.php, with a resulting URL:

 

https://www.site.com///catalog/checkout_shi...xxxxxxxxxxxxxxx

 

The session variables are fine until after this redirect. If I capture them to an alt array prior to the away_with_you redirect they still exist, but if I try and capture to an alt array at top of checkout_shipping.php the important ones (ec_PayerID etc) are blank.

 

I am confused as to how $_SESSION['paypal_ec_payer_id'] can get wiped with this redirect.....

 

Any thoughts ?

Share this post


Link to post
Share on other sites

Ah, I bet the problem is with your configure.php file. On your site, is the session ID always/sometimes visible in the URL? If so, your configure.php file is to blame.

 

Post the first part of your configure.php file, everything above the database configuration, and please don't change the paths/URLs as that will make debugging this even more difficult. Or if you want to try changing it yourself, make sure that the COOKIE variables are like this:

 

Your site:

www.dogrileysite.com

 

COOKIE defines:

dogrileysite.com

 

Be sure to set both of them. If it's redirecting your site to:

htt ps://www.site.com///catalog/checkout_shipping.php?osCsid=xxxxxxxxxxxxxxxxx

 

Then the other defines are incorrect as well.


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

@serge:

  • Make sure that you have cURL with ssl support
  • This error message is usually generated when you set the environment to live and then use the sandbox API credentials (username, password, certificate) or vise versa.

Edited by dynamoeffects

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

I'll try that, my solution above is not working ... :(

 

Will report back. Thanks

 

Ah, I bet the problem is with your configure.php file. On your site, is the session ID always/sometimes visible in the URL? If so, your configure.php file is to blame.

 

Post the first part of your configure.php file, everything above the database configuration, and please don't change the paths/URLs as that will make debugging this even more difficult. Or if you want to try changing it yourself, make sure that the COOKIE variables are like this:

 

Your site:

www.dogrileysite.com

 

COOKIE defines:

dogrileysite.com

 

Be sure to set both of them. If it's redirecting your site to:

htt ps://www.site.com///catalog/checkout_shipping.php?osCsid=xxxxxxxxxxxxxxxxx

 

Then the other defines are incorrect as well.

Share this post


Link to post
Share on other sites

OK here it is not I haven't changed anything :)

 

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
define('HTTP_SERVER', 'http://www.meandmysisterjewelry.com//');
define('HTTPS_SERVER', 'https://www.meandmysisterjewelry.com//');
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', 'www.meandmysisterjewelry.com'); 
define('HTTPS_COOKIE_DOMAIN', 'www.meandmysisterjewelry.com'); 
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/');

Ah, I bet the problem is with your configure.php file. On your site, is the session ID always/sometimes visible in the URL? If so, your configure.php file is to blame.

 

Post the first part of your configure.php file, everything above the database configuration, and please don't change the paths/URLs as that will make debugging this even more difficult. Or if you want to try changing it yourself, make sure that the COOKIE variables are like this:

 

Your site:

www.dogrileysite.com

 

COOKIE defines:

dogrileysite.com

 

Be sure to set both of them. If it's redirecting your site to:

htt ps://www.site.com///catalog/checkout_shipping.php?osCsid=xxxxxxxxxxxxxxxxx

 

Then the other defines are incorrect as well.




			
		

Share this post


Link to post
Share on other sites

Make the following changes:

 

define('HTTP_SERVER', 'http://www.meandmysisterjewelry.com');

define('HTTPS_SERVER', 'https://www.meandmysisterjewelry.com');

define('ENABLE_SSL', true);

define('HTTP_COOKIE_DOMAIN', 'meandmysisterjewelry.com');

define('HTTPS_COOKIE_DOMAIN', 'meandmysisterjewelry.com');

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/');

Edited by dynamoeffects

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

Did it, but still having the problem :(

 

I also have the SEO URL's package integrated, could there be a conflict? I don't see one in the code pieces.

 

I have set up redirection to a test page and that page also is missing the data. It's like there is a tep_session_refresh or something that is restoring session to pre ec_step2() state.....

 

Any other ideas ?

 

Make the following changes:

Share this post


Link to post
Share on other sites
On the beta release for CCGV, when the coupon is over the total with tax included it gives an error.

 

 

Nvm I found the fix.

Share this post


Link to post
Share on other sites
It sometimes does not show it itemized in paypal though.

Seems like this happens when the order exceeds $999.99

Share this post


Link to post
Share on other sites
On the beta release for CCGV, when the coupon is over the total with tax included it gives an error.
Nvm I found the fix.

Did it have something to do with the module, or a misconfiguration in another part of your store?

 

It sometimes does not show it itemized in paypal though.

I've received a report that orders through Express Checkout aren't itemized, but haven't looked into it yet.


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites

Still scratching my head as to why the session varibles get zeroed. I have added code that works around this mysterious event, and it is working (with a caviat).

 

The changes are very similar to above's but a little more targetted, and I believe better placed.

 

in paypal_wpp.php in ec_step2() right after order-> is populated and paypal_ec_temp is instantiated

 

		if (!tep_session_is_registered('mysession')) tep_session_register('mysession'); 
	  $_SESSION['mysession']['paypal_ec_payer_id'] = $_SESSION['paypal_ec_payer_id'];
	  $_SESSION['mysession']['paypal_ec_payer_info'] = $_SESSION['paypal_ec_payer_info'];

 

and then in checkout_shipping.php I added two bits:

1) In the ec_cancel routine

2) Altered that entire if (isset($_GET['ec_cancel']) || .....)))) { to have an else that populates the values on the page

 

	if (isset($_GET['ec_cancel']) || (tep_session_is_registered('paypal_ec_token') && !tep_session_is_registered('paypal_ec_payer_id') && !tep_session_is_registered('paypal_ec_payer_info'))) {
  if (tep_session_is_registered('paypal_ec_temp')) tep_session_unregister('paypal_ec_temp');
  if (tep_session_is_registered('paypal_ec_token')) tep_session_unregister('paypal_ec_token');
  if (tep_session_is_registered('paypal_ec_payer_id')) tep_session_unregister('paypal_ec_payer_id');
  if (tep_session_is_registered('paypal_ec_payer_info')) tep_session_unregister('paypal_ec_payer_info');
  //Added by DogRiley
  if (tep_session_is_registered('mysession')) tep_session_unregister('mysession');
	$ec_enabled = false;
} else {

   // Added by DogRiley works around problem with missing PP details
		  if ((is_array($_SESSION['mysession'])) && ($_SESSION['paypal_ec_payer_id'] == '') ) {
		  $_SESSION['paypal_ec_payer_id'] = $_SESSION['mysession']['paypal_ec_payer_id'];	   
 		$_SESSION['paypal_ec_payer_info'] = $_SESSION['mysession']['paypal_ec_payer_info'];
	  }
	}

 

If a user chooses paypal, logins into paypal, comes back to the site and then decides to pay with a credit card, the ec_cancel changes the page appropriately, but there is some lingering value it seems. If I try to go on from shipping to payment page errors and indicates I am using paypal. If I click 'use other method' I'm back at shipping with the corrrect screen but same issue if I move on to checkout. If I log out and log in it still thinks I want to pay with paypal. If I complete the transaction it resets, and if I delete the cookie same.

 

Any direction for completing the ec_cacel process better ? Does this work normally ? (I feel so abnormal :) )

 

Dispite these difficulties I think you for all your hard work, this is a great contribution.

 

Did it, but still having the problem :(

 

I also have the SEO URL's package integrated, could there be a conflict? I don't see one in the code pieces.

 

I have set up redirection to a test page and that page also is missing the data. It's like there is a tep_session_refresh or something that is restoring session to pre ec_step2() state.....

 

Any other ideas ?

Share this post


Link to post
Share on other sites

Hello all.

 

Now that PayPal are rolling out UK support for Website Payments Pro, is this contribution ready to be used in the UK or does it need some more work?

 

If not ready, is there a quick fix until an official release is ready?

 

Thanks.

Share this post


Link to post
Share on other sites

Another user has commissioned the UK portion, but testing has been difficult as PayPal's sandbox errors everytime I try to setup a UK account. If the small changes work, it should be ready this week.


Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Share this post


Link to post
Share on other sites
Did it have something to do with the module, or a misconfiguration in another part of your store?

I've received a report that orders through Express Checkout aren't itemized, but haven't looked into it yet.

I used the fixed posted back a couple of pages with the formatcurrency().

Well sometimes it shows them itemized in express and sometimes not, same with regular card processing...

Share this post


Link to post
Share on other sites
Make the following changes in paypal_wpp.php (version 0.8.2):

 

Line 419
From: $order_info['PAYPAL_ORDER_TOTAL'] = number_format($order->info['total'], 2);
To:   $order_info['PAYPAL_ORDER_TOTAL'] = number_format($order->info['total'], 2,'.','');

Line 981
From: $order_info['PAYPAL_ORDER_TOTAL'] = number_format($order->info['total'], 2);
To:   $order_info['PAYPAL_ORDER_TOTAL'] = number_format($order->info['total'], 2,'.','');

Line 1122
From:  $transaction_info['PAYPAL_AMOUNT'] = number_format($order->info['total'], 2);
To:	$transaction_info['PAYPAL_AMOUNT'] = number_format($order->info['total'], 2,'.','');

These changes force the decimal separator to be a period (dot) and the thousands separator to be NULL for data sent to PayPal, overriding the store settings. This is what PayPal expects, and will be even more important when implementing this module in locales where the decimal separator presented to the customer is a comma.

 

This issue has come up in another contribution that I use.

 

--Glen

 

Hi,,, I receive this error when I click on "Checkout with Paypal" before logging into my account (sign in Page)

 

bool(false)

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/..../...../catalog/includes/modules/payment/paypal_wpp.php:514) in /var/www/vhosts/..../.../catalog/includes/functions/general.php on line 33

 

Can anyone help???

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×