Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal WPP Direct Payments & Express Checkout Support


dynamoeffects

Recommended Posts

Can someone please help, I'm really stuck. I keep getting the same error message, I have tried everything.

 

Warning: main(PEAR.php): failed to open stream: No such file or directory in /usr/local/psa/home/vhosts/sublimegolf.com/httpsdocs/catalog/pear/Services/PayPal.php on line 11

 

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.:/usr/local/psa/apache/lib/php:/usr/local/psa/home/vhosts/sublimegolf.com/httpsdocs/catalog/pear/') in /usr/local/psa/home/vhosts/sublimegolf.com/httpsdocs/catalog/pear/Services/PayPal.php on line 11

Please help. Thanks.

 

PEAR hasn't been installed on your copy of PHP. Recent versions of PHP include a base installation of PEAR, though it can be disabled. If this is on your own server, check the PEAR documentation at <http://pear.php.net> for installation instructions. If not, contact your host's administrator and request that PEAR be enabled on their copy of PHP.

Link to comment
Share on other sites

That's a new one. *If* everything's installed correctly, sounds like you're having a problem with sessions. Recheck your installation and make sure everything got installed.

 

Definitely a problem with sessions! You are right on the money. I have been troubleshooting this for a while now and cannot figure out why the paypal_ec_token session is not sticking... I know it is getting set because the Express Checkout is sending a token to PayPal in the redirect URL in ec_step1. So this pulls the paypal_ec_token session variable...

 

But when ec_process.php is getting ran again after PayPal sends the customer back to the store it does not think paypal_ec_token session variable is registered and trys to run ec_step1 again instead of ec_step2.

 

Now I coded around that problem, but the rest of the checkout process is flaky, so I think I need to get that problem fixed before the rest will work...

 

I am running Windows Server 2003 w/IIS 6, PHP 4.4.1 and I have a couple of other stores setup that work fine and I assume they are using session variables in the store without WPP mod...

 

OK, I did some more poking around while I was thinking about my post. I have the register_globals mod and do not have register globals turned on in PHP. I think that may be the problem because some minor testing I have done with $_SESSION["paypal_ec_token"] instead of $paypal_ec_token has worked...

 

OK, I did another search on the register globals theory and there was a post about it:

 

http://www.oscommerce.com/forums/index.php?sho...98entry754098

 

That is my exact problem. I am not sure why my searches for the symptoms did not bring that up, but oh well. So do I need to get rid of the register globals mod and turn it on?

 

Thanks!

 

Chad

Link to comment
Share on other sites

OK. I had my ec_process.php so gummed up with test code that I replaced it with the orginial from the mod and it is working correctly now... Go figure since I copied that file directly from the mod and did no changes... Must have been some hidden or gummed up characters or something...

 

Now it is sending me back to the correct place, but is declining my card, so off to correct that error which may be PayPal from my quick searches...

 

Thanks again for this great mod!

 

Chad

Link to comment
Share on other sites

Hello Chad,

 

I'm having the same problem. It keeps on looping up, asking the user to login and again and again. It doesn't take it back to the site.

 

I looked into the possibility of a gummed up characters or something, but the file is okay, exactly the same one as from the mod.

 

Any ideas on fixing this up?

 

I look forward to hear from you guys soon.

 

Thanks,

Mohsin.

Link to comment
Share on other sites

Hello Chad,

 

I'm having the same problem. It keeps on looping up, asking the user to login and again and again. It doesn't take it back to the site.

 

I looked into the possibility of a gummed up characters or something, but the file is okay, exactly the same one as from the mod.

 

Any ideas on fixing this up?

 

I look forward to hear from you guys soon.

 

Thanks,

Mohsin.

 

Hey Mohsin,

 

Depending on what operating system you are using, I am on Windows and use FrontPage to edit my website files... I originally copied the ec_process.php file directly from the mod. What I did that fixed the problem was opened the original mod file in Wordpad (since there are carriage returns that Notepad does not recognize) and copied and pasted it into my existing ec_process.php file opened in FrontPage (replaced the contents with a copy and paste)...

 

Why that made a difference since the files looked to the naked eye exactly the same, I do not know...

 

Hope this helps!

 

Chad

Link to comment
Share on other sites

Can someone please help, I'm really stuck. I keep getting the same error message, I have tried everything.

 

Warning: main(PEAR.php): failed to open stream: No such file or directory in /usr/local/psa/home/vhosts/sublimegolf.com/httpsdocs/catalog/pear/Services/PayPal.php on line 11

 

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.:/usr/local/psa/apache/lib/php:/usr/local/psa/home/vhosts/sublimegolf.com/httpsdocs/catalog/pear/') in /usr/local/psa/home/vhosts/sublimegolf.com/httpsdocs/catalog/pear/Services/PayPal.php on line 11

Please help. Thanks.

 

Hey rxkrall,

 

I had that problem because I did not have the path to my PEAR.php file in the PHP folder in my path operating system environment variables... What I did to correct it was to edit all the files with referece to just PEAR.php and put in the full path to the file... Or you can add the location of the PEAR.php file to your path statements I assume.

 

Hope this makes sense and helps.

 

Chad

Link to comment
Share on other sites

Dear Chad,

 

I use Dreamweaver on Windows. The file online is exactly the same as from the mod, no changes at all.

 

I get the same problem, express checkout keeps on looping while direct payments works perfectly. I'm doing this on Sandbox, also tried on Live server.

 

Same problem.

 

Any ideas to get this to work?

Link to comment
Share on other sites

Dear Chad,

 

I use Dreamweaver on Windows. The file online is exactly the same as from the mod, no changes at all.

 

I get the same problem, express checkout keeps on looping while direct payments works perfectly. I'm doing this on Sandbox, also tried on Live server.

 

Same problem.

 

Any ideas to get this to work?

 

Hey Mohsin,

 

Try opening the original ec_process.php file from the mod zip file in Wordpad and copy and paste the contents from it into the file you have on your web server replacing the contents of the file on your web server. I know it sounds trivial and they both look exactly the same, but that fixed it for me...

 

If not, I can e-mail you a my file if you PM me.

 

I know I am a Windows user, but I am not crazy, right? LOL

 

Chad

Link to comment
Share on other sites

OK, new problem for me. Go figure, right? I have a store that uses a low order fee and when that is included in an Express Checkout payment I get a 10413 error where the order total does not match the PayPal total...

 

I saw some replies for using the CGV (coupon, gift, voucher) mod and this error, but what about low order fee which is built into the base osCommerce.

 

Any ideas before I start wading through code? Have mercy on this ASP VBScript programmer!

 

Chad

Link to comment
Share on other sites

Hi,

 

It definitely is a session problem. I have been running a few tests on ec_process.php file.

 

It does receive the ec_token from paypal (get parameters), but instead of going to step 2, it still loops in step one.

 

My guess is the token isn't registered in the session and this makes it loop into circles.

 

if(!tep_session_is_registered('paypal_ec_token')) {

$payment_modules->ec_step1();

} else {

$payment_modules->ec_step2();

}

 

Is there any fix for this??

Link to comment
Share on other sites

So... I edited catalog/includes/modules/payment/paypal_wpp.php as follows:

 

		$order_total =& Services_PayPal::getType('BasicAmountType');
	$order_total->setval(number_format($order->info['total'], 2));
	$order_total->setattr('currencyID', $order->info['currency']);
	$pdt->setOrderTotal($order_total);
/*Start comment out portion to not send ItemTotal,ShippingTotal & TaxTotal to PayPal via EC - CCGV Coupon Redeem

	$item_total =& Services_PayPal::getType('BasicAmountType');
	$item_total->setval(number_format($order->info['subtotal'], 2));
	$item_total->setattr('currencyID', $order->info['currency']);
	$pdt->setItemTotal($item_total);


	$ship_total =& Services_PayPal::getType('BasicAmountType');
	$ship_total->setval(number_format($order->info['shipping_cost'], 2));
	$ship_total->setattr('currencyID', $order->info['currency']);
	$pdt->setShippingTotal($ship_total);

	$tax_total =& Services_PayPal::getType('BasicAmountType');
	$tax_total->setval(number_format($order->info['tax'], 2));
	$tax_total->setattr('currencyID', $order->info['currency']);
	$pdt->setTaxTotal($tax_total);

End comment out portion to not send ItemTotal,ShippingTotal & TaxTotal to PayPal via EC - CCGV Coupon Redeem*/

	$details =& Services_PayPal::getType('DoExpressCheckoutPaymentRequestDetailsType');
	$details->setPaymentAction('Sale');
	$details->setToken($paypal_ec_token);
	$details->setPayerID($paypal_ec_payer_id);
	$details->setPaymentDetails($pdt);

And now PayPal EC works fine - customer presses the button, gos to PayPal to log in and set shipping address, returns to my site, enters the coupon code, confirms the order and the proper coupon amount is charged via PayPal then the customer is greeted with the success page.

 

My question is - Is this a good way to do this?

 

I use flat rate shipping - orders over $25.00 get it free, orders under $25.00 pay $4.95.

 

I don't implement taxes anywhere.

 

BFC

 

This seems to also work for the low order fee for me. Thanks!!! Chad

Link to comment
Share on other sites

Hi,

 

I got through after tracking what the problem was.

 

For some wierd reason, around line 426/427 read like this:

 

tep_session_register('paypal_ec_token');
$paypal_ec_token = $response->getToken();

 

I modified this to:

 

$paypal_ec_token = $response->getToken();
tep_session_register('paypal_ec_token');
$_SESSION['paypal_ec_token'] = $paypal_ec_token;

 

Now it successfully goes through to step two, but I receive this error:

 

To maintain a high level of security, customers using Express Checkout must be verified PayPal customers. Please either verify your account at PayPal or choose another means of payment.

 

I'm on SandBox and the account IS verified.

 

Please advice.

Link to comment
Share on other sites

This seems to also work for the low order fee for me. Thanks!!! Chad

 

I had a different problem which seemed to be solved by commenting out the code you suggested. Non logged in users who chose Express Checkout were routed to Paypal, then back to checkout_shipping where they'd select a shipping method, but when they clicked Continue on checkout_shipping.php, they were routed to checkout_payment with the error messave "Please select a payment method for your order." For some reason, commenting out that code prevents this error, and also results in the correct amounts being sent to Paypal, so thanks for the tip. If anyone can think of any downsides to commenting out this code, please let me know. Thanks again. -Rich

Link to comment
Share on other sites

I had a different problem which seemed to be solved by commenting out the code you suggested. Non logged in users who chose Express Checkout were routed to Paypal, then back to checkout_shipping where they'd select a shipping method, but when they clicked Continue on checkout_shipping.php, they were routed to checkout_payment with the error message "Please select a payment method for your order." For some reason, commenting out that code prevents this error, and also results in the correct amounts being sent to Paypal, so thanks for the tip. If anyone can think of any downsides to commenting out this code, please let me know. Thanks again. -Rich

I was a little premature annoucing the demise of my problem. I am still getting the error (this is not the standard pink background error message, but rather white text on a red background), "Please select a payment method for your order," after selecting a shipping method during EC. If anyone knows what might be causing this, I'd appreciate a little help, as debug mode isn't generating any emails for this one. The odd thing is that if I click Continue on checkout_payment.php--which is the page showing the error--I go to the confirmation and then success pages without a hitch, and the order registers with Paypal.

Link to comment
Share on other sites

My problem solved, I tried closing everything up and retrying and it works like a charm.

 

However... I noticed another problem, my orders are messed up. They are in the database, but they aren't listed in Administration Area > Orders (0 of 0 orders). They aren't even displayed in my previous orders under my account. It says 0 of 0 orders, and the pagination goes like: -4, -3, -2, -1, 0.

 

Any ideas about this?

Link to comment
Share on other sites

My problem solved, I tried closing everything up and retrying and it works like a charm.

 

However... I noticed another problem, my orders are messed up. They are in the database, but they aren't listed in Administration Area > Orders (0 of 0 orders). They aren't even displayed in my previous orders under my account. It says 0 of 0 orders, and the pagination goes like: -4, -3, -2, -1, 0.

 

Any ideas about this?

 

Same problem here after an "upgrade". posted earlier about it.

Link to comment
Share on other sites

I have setup the website payment pro, and I got the contribution to work correctly. But I have a slight problem, in my paypal account when I click on the "details" of the transaction then it forwards me to the details of the transaction and at the bottom there is an alterniative auction feature such as: Packaging slip / Tracking number / Remove link and etc. When I look in the packaging slip of the transaction, the slip shows only the dollar amount and qty number but it shows "n/a" for my web url, model number, and item description. I talk to paypal about this, and the tech guy say that the contribution isn't sending these kind of information to paypal to be process on the packaging slip.

 

So my question is: is there any solution to this problem? Anyway I can change the code in the contribution to make it so that the necessary information is process to paypal. Thankx in advance.

Link to comment
Share on other sites

Some international customers are getting the ol' MODULE_PAYMENT_PAYPAL_DP_TEXT_STATE_ERROR ( I read here that in 0.6 this has been addressed and fixed so maybe my question is moot)

 

Nonetheless, what should international customers type in for State/Province? Do all countries have Provinces? I don't think international customers know what to type in the State field.

One customer types in Madrid for the State and their transaction goes through. Another customer types in Italy for the State and it gives this Text State Error.

 

I've just updated to 0.7.

Edited by MJP
Link to comment
Share on other sites

GunGraveAce, it doesn't send that information purely for simplicity. Don't your customers get order emails from your store when they checkout with all of that information?

 

MJP: SteveDallas is really the expert on the whole international payment situation. You might try installing the world zones contribution and see if that fixes your problem (although, it will break all of your current customers' zones). Another option is to set your Italian customer's state to IT or their abbreviated province name and see if that makes a difference.

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.

Link to comment
Share on other sites

GunGraveAce, it doesn't send that information purely for simplicity. Don't your customers get order emails from your store when they checkout with all of that information?

 

Dynamoeffects, it's not so much for customers as like u said they will get the order from the mail. But I believe it's for me to keep track who pays for what in my paypal account, and I can communicate with paypal support much easier if a dispute should ever occurs on a particular transaction.

 

Another question about the contribution: when I do the paypal express checkout I try changing the address so that it uses the one on the paypal account, but everytime when I am at the final confirmation page it always ship to another address that the customer created their account on my store's website. Is this how it suppose to work? or is this a bug that's still being fixed? Thank You

Link to comment
Share on other sites

Being new to OSC, but not to IPB, I have spent litterally hours using the search but found nothing that answers the same question asked litterally hundreds of times:

 

What causes the "There has been an error processing your credit card. Please try again." and "Authorization Failed This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow." errors?

 

I have a US account and set everything up with the sandbox, copied the certificate to the right folder, set the right path, etc.

 

Are these errors due to something I have missed, or is this just a sandbox only error?

Link to comment
Share on other sites

For you people with Register Globals turned off, try doing this:

 

1. Open up /catalog/includes/modules/payment/paypal_wpp.php

 

2. Change these lines:

 

tep_session_register('paypal_ec_token');

$paypal_ec_token = $response->getToken();

 

to this:

 

$paypal_ec_token = $response->getToken();

tep_session_register('paypal_ec_token');

 

 

There are a few other lines that need to be fixed, but if this gets you past the looping problem, I'll release a version with all of the lines fixed.

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.

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