Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal WPP Direct Payments & Express Checkout Support


dynamoeffects

Recommended Posts

It could be a permissions problem; either on the directory, or the file itself. The module should be able to find the Pear files if you set the Pear Modules parameter (on the module configuration page) to /home/.../public_html/store/pear/, without having to fiddle with the PHP include path.

--Glen

 

Turns out it was strictly user error. In case anyone makes the same mistake, I missed some of the PEAR files to be uploaded. Once all of the files were in place it worked like a charm.

 

Thanks much for the reply.

 

Michael

Link to comment
Share on other sites

Sounds like a concensus. :) I'll make it an option in the next version.

 

Hi,

just one question...what about the spanish lang? i have a customer who wants the website in englis & spanish, but i having some problems with the spanish, checkout,

wich files i must modify or i don't know if somebody did the spanish files, for the leng, folder......

thx

Link to comment
Share on other sites

Vincent,

The certificate directory in the distribution has a .htaccess file that denies web access to it, as long as your web server honors .htaccess files. One could do the same for the Pear files, though it may be sufficient to make them read-only, as there is no user data in them.

 

--Glen

 

If you are not careful with these types of files Search Engines can see it unless it's in the robots.txt file marked as exclude and if they know your file name and location that may well be enough.

 

You are not dealing with joe average who can just get around with his browser.

You are dealing with hackers who will find any hole you make because you assume .htaccess will do the trick or pear files are safe.

 

I have had several hacker download pear files along with other files into the server tmp directories

And how is it that this took place - because programmers of open and non-open source applications assume their code is ok.

 

You know the old story about assume - When you assume you make - ah you know the rest.

 

If you don't want problems you follow simple security rules

And the best rule to follow is if you are not 100% sure then hide it.

How do you hide files - simple - place it above your public root!!!

 

Unless you want to pay guys like me to fix the mess you get into

If that's the case put it anywhere you want.

 

Vincent G

Link to comment
Share on other sites

I'm having the exact same problem. I've installed this contribution (paypal_wpp_0.7.3) on a brand new osCommerce version MS2.2. I'm new to PHP and I have no experience with using PEAR, so any guidance here would be appreciated.

 

Hi all,

 

I'm having trouble with the WPP module, but I'm new to PHP and OSCommerce, so it's probably an error on my end. I checked the first dozen or so pages of this thread, but didn't see anything along the lines of my problem. Any help navigating the trouble would be appreciated.

 

WPP is installed. I've created a catalog/pear/ directory and recreated the directory structure and files there. I get through to the OSC "Order confirmation" screen fine. When I click "Confirm Order," I get the following error:

 

Warning: main(HTTP/Request.php) [function.main]: failed to open stream: No such file or directory in /home/.../public_html/store/pear/Services/PayPal/SOAP/WSDL.php on line 24

Fatal error: main() [function.require]: Failed opening required 'HTTP/Request.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/olddomin/public_html:/home/olddomin/public_html/store/pear:/home/.../public_html/store/pear/') in /home/olddomin/public_html/store/pear/Services/PayPal/SOAP/WSDL.php on line 24

 

My PHP include path was:, but I lengthened it to

("..." replacing my site's user name in all instances above)

 

Any thoughts on where I've gone wrong? If I go directly to the WSDL.php file above via my browser, I similarly get:...both which seem to me to point to include path problems of some sort.

 

Thanks much for any help.

 

Michael

Link to comment
Share on other sites

well appears that your Pear module has not been totaly uploaded.Please recheck that all files are uploaded.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

I have a dreaded setopt() question. Sorry about this....

 

My host does not have curl compiled into PHP, but does have curl installed on the system. Is there a way to have the module use the installed binary or library?

 

Many thanks, Brian

Link to comment
Share on other sites

I have a dreaded setopt() question. Sorry about this....

 

My host does not have curl compiled into PHP, but does have curl installed on the system. Is there a way to have the module use the installed binary or library?

 

Many thanks, Brian

 

My web hosting company was kind enough to compile the support into PHP. The problem is solved. Now I have other ones.

Link to comment
Share on other sites

Holy crap, 68 pages of replies!?? :lol:

 

I have 2 suggestions and 1 question for anyone who wants to reply:

 

Suggestions:

 

1) When updating from version .5 to version .73, do follow the install instructions and uninstall the module first, and then reinstall after updating the two changed files catalog\checkout_payment.php and includes\modules\payment\paypal_wpp.php! It makes things work. :)

 

2) CCard numbers with spaces don't work. Update code to add some text to notify the user, like this:

 

Add:

define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER_INFO', '(<b>No spaces</b>)');

 

To:

catalog/includes/languages/english/modules/payment/paypal_wpp.php

 

Then add:

'field' => tep_draw_input_field('paypalwpp_cc_number', '') . '?<small>' . MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER_INFO . '</small>'),

 

To:

catalog/includes/modules/payment/paypal_wpp.php, just below:

array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER,

 

 

Question:

 

Why doesn't Paypal complain when the user enters a bogus ccard expiration date or "check number"? It seems that the service isn't checking the credit card information fully. Is this a problem???

 

Thanks for any feedback... -Chris.

Link to comment
Share on other sites

Holy crap, 68 pages of replies!?? :lol:

It's a complex module that has been out for almost a year. A large number of replies is not unusual for a payment module.

 

I have 2 suggestions and 1 question for anyone who wants to reply:

 

Suggestions:

 

1) When updating from version .5 to version .73, do follow the install instructions and uninstall the module first, and then reinstall after updating the two changed files catalog\checkout_payment.php and includes\modules\payment\paypal_wpp.php! It makes things work. :)

 

2) CCard numbers with spaces don't work. Update code to add some text to notify the user, like this:

 

A better solution is to fix the module so that the spaces are deleted before sending the card number to PayPal. This already happens in cc_validation.php, but the module doesn't update the card number with the value that is returned. The last time this issue was mentioned, back in April 2006, I posted a solution, which borrows the line of code from cc_validation.php which cleans the number. You can find it in post #942 in this thread. A better solution would be to take the result from the validate function and use it to update the number with the cleaned version.

 

Here is the revised fix. Add to paypal_wpp.php at about line 157, in the function pre_confirmation_check(), below the line that begins with "$HTTP_POST_VARS['paypalwpp_cc_checkcode'] = ".

	   $HTTP_POST_VARS['paypalwpp_cc_number'] = $cc_validation->cc_number;

 

Why doesn't Paypal complain when the user enters a bogus ccard expiration date or "check number"? It seems that the service isn't checking the credit card information fully. Is this a problem???

Are you using the sandbox? It doesn't do any checking, which makes it useless for testing error handling code.

 

The WPP module does some sanity checks on the expiration date and card number before you can leave checkout_payment.php. On the live server, PayPal will not authorize a transaction where the expiration date or security code are bogus. Note, however, that some card issuers will process an authorization and put an authorization hold on the customer's account, even with a bad expiration date or security code number. PayPal will reject the transaction with a "Gateway Decline" error message. This can be a problem for customers using debit cards, as their available balance will drop until the authorization expires, typically from three to five days after the transaction.

 

--Glen

Edited by SteveDallas
Link to comment
Share on other sites

Here is the revised fix. Add to paypal_wpp.php at about line 157, in the function pre_confirmation_check(), below the line that begins with "$HTTP_POST_VARS['paypalwpp_cc_checkcode'] = ".

	   $HTTP_POST_VARS['paypalwpp_cc_number'] = $cc_validation->cc_number;

Are you using the sandbox? It doesn't do any checking, which makes it useless for testing error handling code.

 

The WPP module does some sanity checks on the expiration date and card number before you can leave checkout_payment.php. On the live server, PayPal will not authorize a transaction where the expiration date or security code are bogus. Note, however, that some card issuers will process an authorization and put an authorization hold on the customer's account, even with a bad expiration date or security code number. PayPal will reject the transaction with a "Gateway Decline" error message. This can be a problem for customers using debit cards, as their available balance will drop until the authorization expires, typically from three to five days after the transaction.

 

--Glen

 

Thanks Glen, the ccard fix works great! Yes I'm using the sandbox. I'm going to apply for a real Key probably today. Thanks for the great work on this contribution.

Link to comment
Share on other sites

Hey Glen,

 

Have you ever heard this: When testing "Express Checkout With PayPal" (sandbox setting) and logged into my paypal dev account, I'm able to apparently "pay" for a test purchase with my dev account but when I returned to my website, I see this message in osC: "There was a problem validating your account. Please try again."

 

Huhhhh?

 

My question is, does "Express Checkout With Paypal" work reliably most of the time and if so, do you think it's a pain for customers use? It seems like a real hassle for customers to have to go there first and hope they don't get "lost" somehow. Seems very "klunky" to me. Any thoughts on this?

Link to comment
Share on other sites

I've got the Express Checkout installed as well as the Direct Payment - which I don't want - and I'm having the problem that I can't disable Direct Payment without also disabling the Express Checkout.

I modified mine to allow it to be configured with either Direct Payment or Express Checkout or both. The changes aren't too difficult. A new configuration element was added to control the presence of Direct Payment.

 

The modified selection() function is:

	function selection() {
  global $order;

  $selection = '';

  if ((MODULE_PAYMENT_PAYPAL_SHOW_DP_ON_PAYMENT_PAGE == 'Yes') || (MODULE_PAYMENT_PAYPAL_DP_BUTTON_PAYMENT_PAGE == 'Yes')) {
	// create the selection array
	$selection = array('id' => $this->code,
					 'module' => MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE,
					 'fields' => array());
  }
  if (MODULE_PAYMENT_PAYPAL_SHOW_DP_ON_PAYMENT_PAGE == 'Yes') {
	for ($i=1; $i < 13; $i++) {
	  $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
	}

	$today = getdate(); 
	for ($i=$today['year']; $i < $today['year']+10; $i++) {
	  $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
	}

	$selection['fields'][] = array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_FIRSTNAME,
								   'field' => tep_draw_input_field('paypalwpp_cc_firstname', $order->billing['firstname']));
	$selection['fields'][] = array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_LASTNAME,
								   'field' => tep_draw_input_field('paypalwpp_cc_lastname', $order->billing['lastname']));
	$selection['fields'][] = array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_TYPE,
								   'field' => tep_draw_pull_down_menu('paypalwpp_cc_type', array(array('id' => 'Visa', 'text' => 'Visa'),
																								 array('id' => 'MasterCard', 'text' => 'MasterCard'),
																								 array('id' => 'Discover', 'text' => 'Discover'),
																								 array('id' => 'Amex', 'text' => 'American Express'))));
	$selection['fields'][] = array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER,
								   'field' => tep_draw_input_field('paypalwpp_cc_number', ''));
	$selection['fields'][] = array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_EXPIRES,
								   'field' => tep_draw_pull_down_menu('paypalwpp_cc_expires_month', $expires_month) . '?' . tep_draw_pull_down_menu('paypalwpp_cc_expires_year', $expires_year));
	$selection['fields'][] = array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_CHECKNUMBER,
								   'field' => tep_draw_input_field('paypalwpp_cc_checkcode', '', 'size="4" maxlength="4"') . '?<small>' . MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION . '</small>');
  }
  if (MODULE_PAYMENT_PAYPAL_DP_BUTTON_PAYMENT_PAGE == 'Yes') {
	$selection['fields'][] = array('title' => '<b>' . MODULE_PAYMENT_PAYPAL_DP_TEXT_EC_HEADER . '</b>',
								   'field' => '<a href="' . tep_href_link('ec_process.php', '', 'SSL') . '"><img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" border=0 style="padding-right:10px;padding-bottom:10px"></a><br><span style="font-size:11px; font-family: Arial, Verdana;">' . MODULE_PAYMENT_PAYPAL_DP_TEXT_BUTTON_TEXT . '</span></td>');
  }

  return $selection;
}

Next, add this line somewhere in the install() function:

	  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Direct Payment: On Payment Page', 'MODULE_PAYMENT_PAYPAL_SHOW_DP_ON_PAYMENT_PAGE', 'No', 'Do you want to display the PayPal Direct Payment Option on the payment page?', '6', '5',  'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now())");

 

Lastly, add this key to elements returned by the keys() function:

			'MODULE_PAYMENT_PAYPAL_SHOW_DP_ON_PAYMENT_PAGE',

 

You'll need to uninstall the module before you make these changes or add the new configuration key to the configuration table manually.

Don

Portland, OR USA

Link to comment
Share on other sites

I am looking for a decline or error PAGE solution. When a customer types in the wrong billing address or messes up a credit card number, the PP_WPP takes them back to the credit card page and simply places an error message on top with a pink background. I would like to see an error or decline PAGE, just like the success page only it details the problem with the credit card. Has anyone does this, or do we need to build it? I think it would go a long way towards making the credit card transactions more user friendly.

 

Thank you!

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

Hey Glen,

 

Have you ever heard this: When testing "Express Checkout With PayPal" (sandbox setting) and logged into my paypal dev account, I'm able to apparently "pay" for a test purchase with my dev account but when I returned to my website, I see this message in osC: "There was a problem validating your account. Please try again."

 

Huhhhh?

 

My question is, does "Express Checkout With Paypal" work reliably most of the time and if so, do you think it's a pain for customers use? It seems like a real hassle for customers to have to go there first and hope they don't get "lost" somehow. Seems very "klunky" to me. Any thoughts on this?

 

I haven't seen that. I don't keep statistics for my site based on payment method, but I do know that some use Express Checkout, while others prefer to select PayPal on the payment page (I use PayPal IPN to offer PayPal on the payment page). Both methods work quite well.

 

In the sandbox, did you create two accounts? You need one for the merchant, and one for the customer, as you can't send money to yourself. PayPal would catch this before you return to the store, though.

 

--Glen

Link to comment
Share on other sites

I don't think I set it up right... I probably only have a merchant test account. But it did go through like the transaction was sucessfull. Not sure, I'll have to look at my test accounts closer, turn on debug emails, and try it again.

Link to comment
Share on other sites

I figured it out... A few months ago someone posted this:

 

There was a problem validating your account. Please try again.Several people have posted about this error recently (jlong07, MechBun), but the fix (which seems to have done the trick for me) was posted on March 23 by giz286sim:Around line 516 in the file /catalog/includes/modules/payment/paypal_wpp.php change:

 

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

 

TO:

 

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

 

That fixed the "There was a problem validating your account. Please try again." error message using Express Checkout. Looks like all is well. All that's left is to install my new live WPP key and test again.

Link to comment
Share on other sites

I figured it out... A few months ago someone posted this:

 

There was a problem validating your account. Please try again.Several people have posted about this error recently (jlong07, MechBun), but the fix (which seems to have done the trick for me) was posted on March 23 by giz286sim:Around line 516 in the file /catalog/includes/modules/payment/paypal_wpp.php change:

 

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

 

TO:

 

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

 

That fixed the "There was a problem validating your account. Please try again." error message using Express Checkout. Looks like all is well. All that's left is to install my new live WPP key and test again.

You're right, there is a problem at the login screen with the Express Checkout. After the login screen, there's no trouble at all. I can't figure it out. I tried your fix above, but that did not work. Where it states:

 

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

 

Did you erase the 2 // marks at the start of the line? If not, then maybe I'm looking at the wrong line. No wonder I'm not getting any PayPal orders.

 

Let me know what you did here. I am running live and I need a fix for this ASAP.

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

Hi Glen, I just tried your Express Checkout PayPal button and it worked fine from the login page. Would send me a copy of your ec_process file so I can see if that's the cause of my problem? I would like to compare.

 

Many thanks,

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

Hi Glen, I just tried your Express Checkout PayPal button and it worked fine from the login page. Would send me a copy of your ec_process file so I can see if that's the cause of my problem? I would like to compare.

 

Many thanks,

Never mind Glen. I found the answer to my questions in another post. giz286sim had the answer and it seems to work just fine. I did a complete transaction with no troubles.

 

Just to clear it up, in the catalog/includes/modules/payment/paypal_wpp.php file, you need to change.

 

FROM

//$_SESSION['paypal_ec_payer_info'] = $paypal_ec_payer_info;

tep_session_register('paypal_ec_payer_info');

 

TO

tep_session_register('paypal_ec_payer_info');

$_SESSION['paypal_ec_payer_info'] = $paypal_ec_payer_info;

 

Be sure to remove the slashes. The slashes are commenting out the line and not allowing it to function.

 

Thanks everyone for all the hard work.

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

One more update to the fix by giz286sim. I simply removed the slashes // mentioned in my post above without changing the order of the lines and it works correctly on a live production server.

 

That line was mistakenly commented out when it's a function command and not a comment about what it does.

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

One more update to the fix by giz286sim. I simply removed the slashes // mentioned in my post above without changing the order of the lines and it works correctly on a live production server.

 

That line was mistakenly commented out when it's a function command and not a comment about what it does.

 

It wasn't a mistake. That line is needed only when register_globals is turned off in PHP. If you check your Server Info (Admin->Tools->Server Info), you will find that register_globals is listed as "off".

 

--Glen

Edited by SteveDallas
Link to comment
Share on other sites

It wasn't a mistake. That line is needed only when register_globals is turned off in PHP. If you check your Server Info (Admin->Tools->Server Info), you will find that register_globals is listed as "off".

 

--Glen

 

Stickypod, correct my first line was also remmed out (with // in front). Sorry, I didn't mention that. :D

 

 

Glen, I'm lost now. My register_globals = ON currently. But above you say the line is only needed if it's OFF, but my Express Checkout was not working with it remmed out and with My register_globals = ON. However with it un-remmed, it works. So are you sure about this?

 

Even tho I'm no expert, it seems that the new order (I found from a previous post in this thread) seems correct:

 

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

 

It seems that you would need to Set paypal_ec_payer_info first and then use it. Do you agree? Can you (or anyone) confirm if the above order is correct or not? Stickypod seems to say it works. But the other post said reversing them worked.

 

So I'm not sure what is right.

Link to comment
Share on other sites

It wasn't a mistake. That line is needed only when register_globals is turned off in PHP. If you check your Server Info (Admin->Tools->Server Info), you will find that register_globals is listed as "off".

 

--Glen

I hate to be the bearer of bad news, but listed under my PHP Core the register_globals for both the local and master value are set to "on". It all seems to work just fine the way it is. All I did was remove the slashes.

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

After transferring from sandbox to live, payment by paypal stopped working. If the customer stays on the site, it processes fine, but if the customer clicks on the "pay using paypal" link, this comes up:

 

Your credit card was declined. Please try another card or contact your bank for more info.

 

No response from the payment processor

No response was received from the payment processor. Please contact the store owner for assistance.

 

Even though it refers to credit cards, this occurs even when using a stored balance, or a transfer from a bank./

 

I am certain the user/pass/cert is correct.

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...