Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal WPP Direct Payments & Express Checkout Support


dynamoeffects

Recommended Posts

Alright so I am kinda new at this so i may be doing something stupid. I just installed this contrib. and it seems to be working fine but i cant view my orders from my admin page. When i try to veiw orders i get this error ( Fatal error: Cannot redeclare class currencies in /home/rpstdntg/public_html/admin/includes/classes/currencies.php on line 16) My currencies.php file at that location looks like this

<?php
/*
 $Id: currencies.php,v 1.3 2003/06/20 16:23:08 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

////
// Class to handle currencies
// TABLES: currencies
 class currencies {
   var $currencies;

// class constructor
   function currencies() {
     $this->currencies = array();
     $currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);
     while ($currencies = tep_db_fetch_array($currencies_query)) {
    $this->currencies[$currencies['code']] = array('title' => $currencies['title'],
                                                      'symbol_left' => $currencies['symbol_left'],
                                                      'symbol_right' => $currencies['symbol_right'],
                                                      'decimal_point' => $currencies['decimal_point'],
                                                      'thousands_point' => $currencies['thousands_point'],
                                                      'decimal_places' => $currencies['decimal_places'],
                                                      'value' => $currencies['value']);
     }
   }

// class methods
   function format($number, $calculate_currency_value = true, $currency_type = DEFAULT_CURRENCY, $currency_value = '') {
     if ($calculate_currency_value) {
       $rate = ($currency_value) ? $currency_value : $this->currencies[$currency_type]['value'];
       $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format($number * $rate, 

Any help? thanks in advance.

Link to comment
Share on other sites

Hi Brian,

 

I'm a developer working with Jack, so maybe I can explain the situation in a more simplified way.

 

Default Paypal

 

checkout_shipping.php -> Select Paypal ->

POST -> checkout_shipping.php ->

REDIRECT -> checkout_confirmation.php Success!

 

WPP Direct Payment Module

 

checkout_shipping.php -> Select WPP and Enter CC ->

POST -> checkout_shipping.php ->

REDIRECT -> checkout_payment.php -> Select WPP Again and Enter CC again ->

POST -> checkout_confirmation.php Success!

 

WPP Direct Payment Module (I added forced redirect in checkout_payment.php)

 

checkout_shipping.php -> Select WPP and Enter CC ->

POST -> checkout_shipping.php ->

REDIRECT -> checkout_payment.php ->

FORCED TEPREDIRECT -> checkout_confirmation.php ->

ERROR REDIRECT -> checkout_shipping.php Please Select Payment

 

Therefore:

 

1) Default paypal installation saves info in session somewhere on checkout_shipping.php and redirects to checkout_confirmation to complete.

2) WPP Direct Payment module only works on the second submit where it posts directly to checkout_confirmation.php.

3) A solution would be to patch either checkout_shipping.php to save WPP Direct Payment form info into the session and force redirect to checkout_confirmation.php OR to patch WPP Direct Payment to post to checkout_confirmation.php

 

Can you provide me with some direction as to how I might begin either of these solutions?

 

Ok, first of all upload the /catalog/includes/paypal_wpp/cert/.htaccess file found in the zip file that you downloaded from here to the same place on your site. Right now your key is completely unprotected and that's not good. If you don't see a .htaccess file, you need to set the options in your FTP software to show hidden files.

 

What is the path you have set for the certificate in the module's settings? The default one should be correct.

Link to comment
Share on other sites

@sheridch: Find this line in /admin/orders.php:

require(DIR_WS_CLASSES . 'currencies.php');

 

and change it to this:

require_once(DIR_WS_CLASSES . 'currencies.php');

 

 

@jackcorbis' developer: Sounds like you're having the same problems that I am with FEC. The $payment session variable isn't getting set correctly and is only available when you reload the page. The same problem happens with CCGV. It's like it's being set before the session is initialized, which isn't possible, but that's the behavior.

 

The module itself doesn't save the payment choice to the $payment session variable (osCommerce uses global/session craziness), the checkout_shipping.php page is supposed to do that after verifying the input. Take a look at the standard checkout_confirmation.php and you'll see where $payment gets set. In FEC, that code has been moved to the checkout_shipping.php page. Look where there's a if ($n == 1) { line and that will get you going.

 

I'm 99.9% sure that this is a problem with FEC because I'm experiencing the same thing, without having this module installed.

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

Hey Brian,

 

I understand that FEC is causing some problems that probably aren't the fault of your module, but I just installed the manual CC module and it also works.

 

Is it possible that the other modules are reading a portion of the FEC code that your module is ignoring? If so where do you think this is occurring?

 

-Jacks' Developer

Link to comment
Share on other sites

That is very strange. Just step through the post and figure out why the $payment variable isn't getting set correctly.

 

Looking back at the module, you'll probably need to change the case statement near the end of /includes/paypal_wpp/paypal_wpp_include.php where it's watching for FILENAME_CHECKOUT_PAYMENT. However, I don't think that's going to fix your problem all by itself.

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

Can anyone HELP???

 

I have tried to get an answer to:

 

Can you help me find the image for the PayPal Direct Payment Button on the checkout_payment.php page? I can't seem to find it and it isn't showing on the site?

 

Also the error I received when I click on the "WHAT'S THIS?" on the checkout_payment.php page - is still reading:

You are not authorized to view this page

You might not have permission to view this directory or page using the credentials you supplied.

How do I fix this??

 

I would appreciate any direction.

Link to comment
Share on other sites

I don't understand what you mean by "PayPal Direct Payment Button." Do you mean the Express Checkout button? I know that you're seeing the credit card fields since you're seeing the What's This? link, so could you be more specific?

 

If you have a .htaccess file in your /includes/ directory, try renaming that temporarily and try the What's This link again.

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

I don't understand what you mean by "PayPal Direct Payment Button." Do you mean the Express Checkout button? I know that you're seeing the credit card fields since you're seeing the What's This? link, so could you be more specific?

 

If you have a .htaccess file in your /includes/ directory, try renaming that temporarily and try the What's This link again.

 

I'm also having the same issue with the What's This link opening. Everything else works perfect. I renamed and even deleted the .thaaccess file. I keep getting the error:

 

"Forbidden You don't have permission to access /catalog/includes/paypal_wpp/cvv2info.php on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

 

Joe

Link to comment
Share on other sites

Oh no, looks like I have an errant .htaccess file in the /includes/paypal_wpp/ directory. Delete that one as well and it should start working.

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

Oh no, looks like I have an errant .htaccess file in the /includes/paypal_wpp/ directory. Delete that one as well and it should start working.

 

I deleted both .htaccess files in the includes and the paypal_wpp directories.

 

New error message in the pop up window.

 

Warning: Unknown(/home/valleye1/public_html/catalog/includes/paypal_wpp/cvv2info.php): failed to open stream: Permission denied in Unknown on line 0

 

Warning: Unknown(/home/valleye1/public_html/catalog/includes/paypal_wpp/cvv2info.php): failed to open stream: Permission denied in Unknown on line 0

 

Warning: (null)(): Failed opening '/home/valleye1/public_html/catalog/includes/paypal_wpp/cvv2info.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0

 

Joe

Link to comment
Share on other sites

Thanks for the directions - I removed both .htaccess files but there seems to be more happening - so I upgraded to the new release paypal_wpp v1.01 version - uninstalled and reinstalled. I originally did not want the shipping page to show up since these are no items that get shipped - maybe you can tell me how to remove the shipping info and shipping charges once I fix the problem below:

 

I am on the checkout_payment.php page here is a screen shot of the button that is missing (since I want the customer to be able to use direct payment in addition to having the option of Express checkout) also when you hit the What's this - now it shows up but images in it are missing also) The path to the missing button is showing that it originates from my images/icons/credit_cards.gif - there is also a screen shot of the What's This below:

 

checkout_payment.jpg

 

WhatsThis-PAGE.jpg

 

CAN YOU HELP - Greatly appreciated.

Link to comment
Share on other sites

Thanks dynamoeffects but I am not sure if you want me to edit the first (require(DIR_WS_CLASSES . 'currencies.php');) or the second? I am wondering if it needs to be there twice? Thanks again

 

 

 

 

<?php
/*
 $Id: orders.php,v 1.112 2003/06/29 22:50:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
//---PayPal WPP Modification START ---//
 //Since the admin's configure.php file is STILL missing defines
 include(DIR_FS_DOCUMENT_ROOT . DIR_WS_INCLUDES . 'configure.php');

 include(DIR_WS_CLASSES . 'order.php');

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 include(DIR_WS_INCLUDES . 'paypal_wpp/paypal_wpp_include.php');
 $paypal_wpp = new paypal_wpp_admin;
//---PayPal WPP Modification END ---//

 require_once(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $orders_statuses = array();
 $orders_status_array = array();
 $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
 while ($orders_status = tep_db_fetch_array($orders_status_query)) {
   $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
                              'text' => $orders_status['orders_status_name']);
   $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
 }

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

Link to comment
Share on other sites

@valleyent: That's very strange, it sounds like the contribution is not fully uploaded. Can you check and make sure that there's a cvv2info.php file in /includes/paypal_wpp ?

 

@mdtdesign: Ack! Looks like those images didn't get included in the contribution. I'll add those and release another update.

 

@sheridch: Ah, I see the problem. You were supposed to overwrite those two additional lines with that block of code. Just delete the second instances of those lines and it should work fine. The installation instructions are wrong, but they'll be fixed in the next release.

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

Brian:

 

Thanks for all your help - I really appreciate it.

 

I located the two images for the What's This and I have attached them - if you need them for your updates.

 

amexcsc.gifvisacsc.gif

 

 

I can't seem to locate the image for the PAYPAL DIRECT PAYMENT Button - is there any way you could upload to the forum???

 

Greatly Appreciated...

Link to comment
Share on other sites

Brian:

 

By any chance would that PAYPAL DIRECT PAYMENT Button be this image I am attaching????

 

cclogos.gif

 

If so - can you let me know???

 

Thanks,

 

Marie,

The missing image isn't a button; just a graphic with the acceptance marks for the cards. The one you posted is a bit outdated, but could be used. (VISA has a new acceptance mark.)

 

This is the one that I sent to Brian for inclusion in the module: cards.gif

 

Where possible, I got the marks directly from the card association sites, and the background is transparent, so it doesn't put a big white blob in your checkout page.

 

--Glen

Link to comment
Share on other sites

Marie,

The missing image isn't a button; just a graphic with the acceptance marks for the cards. The one you posted is a bit outdated, but could be used. (VISA has a new acceptance mark.)

 

This is the one that I sent to Brian for inclusion in the module: cards.gif

 

Where possible, I got the marks directly from the card association sites, and the background is transparent, so it doesn't put a big white blob in your checkout page.

 

--Glen

 

Glen:

 

Thanks so much - I will use the one you sent

 

Marie

Link to comment
Share on other sites

Glen:

 

Thanks so much - I will use the one you sent

 

Marie

 

Marie,

You're most welcome. Something else you might want to do is to change the text for the radio button from "PayPal Direct Payment" to something like "Credit/Debit Card". Customers don't need to know that PayPal is handling your back-end functionality. The string is in includes/languages/english/modules/payment/paypal_wpp.php

 

Not a requirement, but something you might want to think about.

 

--Glen

Link to comment
Share on other sites

Brian and all,

 

Thanks in advance for any suggestions you can provide. After 154 pages of questions, I bet you are wondering what you got yourself into! Seems like an awesome contrib though so I am hoping you can help.

 

I have a very basic store with no other payment contributions. As such, instead of making all of the manual changes, I just uploaded all of the php files in your distribution package. If that's a bad idea, let me know and I'll revert to my backup and then make all of the changes manually. Everything so far displays correctly though.

 

I'm using firefox. I can go through the checkout process almost all of the way, but when I get to the point that I click "confirm order" the page hangs for a while, then gives me the option of opening or saving "checkout_process.php" as if it can not read the page.

 

I searched this thread but didn't find anyone with a similar problem. I may be missing something silly, but I've worked on it for quite a while and am out of ideas.

 

Any tips?

 

Again, thanks in advance for any help!

 

Best,

Peter

Link to comment
Share on other sites

I found the problem. Just had to step away and come back. I reread some of your config notes in the readme and saw the section about using a proxy if GoDaddy is hosting the site, which is the case for me! I used the proxy http://proxy.shr.secureserver.net:3128 and it's getting closer to working! Now I'm getting a 10501 but that looks like a paypal thing.

 

 

Sorry to bother ya! Thanks for the contribution!!!!

 

Peter

Link to comment
Share on other sites

Hello,

 

Thanks to this wonderful contribution I've managed to install paypal pro but there's a slight hitch - each and every time I run an order test (live on authorisation so I can void it since my sandbox login never turned up) paypal takes the payment TWICE and I can see two copies of the order in my paypal login. At first I thought it was connected with quantities but that doesn't seem to be the case, I've tested multiple numbers of products and within that quantities and it's still just doubling it.

 

The site (unfinished) is - http://www.copybits.co.uk/catalog - first one so please forgive it!

 

My php skills aren't good enough to figure this out myself

 

If anyone can point me in the right direction it would be a great help.

 

Theres also an error on my orders/admin page that I can't track down - it goes like this...

 

"Fatal error: Call to undefined function tep_hide_session_id() in /usr/home/u1146/domains/copybits.co.uk/public_html/catalog/iadmin/orders.php on line 364"

 

Dynamo Effects - once I've got some orders coming in I'd be happy to make a donation for all your good works and efforts

 

Thanks

 

Jo

Link to comment
Share on other sites

Hey Yall,

 

Im 99% working. I keep receiving this error when trying to view the orders in admin

 

Fatal error: Call to undefined function tep_hide_session_id() in /home/graysonh/public_html/catalog/admin/orders.php on line 509

 

ALSO

 

Before I break anything else..

 

I get this error, not sure where to update/change this option

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

Edited by graysonhobby
Link to comment
Share on other sites

@fruitbat: Typically the problem with getting charged twice is an error caused by one of the customizations that causes the checkout_process.php script to execute twice. The only way to figure out the cause is to slowly work your way through it by adding die(); statements down the script until you find where it's reloading the script.

 

 

@ both fruitbat and graysonhobby: The error you're receiving in the admin has to do with missing a function in the admin/includes/functions/html_output.php file. Make sure that the function tep_hide_session_id() exists there. It's strange that you both experienced it simultaneously, but this contribution doesn't change that function nor the file that it's contained in, so I really don't know what's going on there. Can you both post the top of your admin/orders.php file down to where the first PayPal Pro modification ends?

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

... Can you both post the top of your admin/orders.php file down to where the first PayPal Pro modification ends?

 

Thank you so much for helping :)

 

I've two flavours of the error, one from my original file I modified (why doesn't that surprise me!) and one from the file that came in the package. I'll add them both in.

 

 

The file that came with the package:

 

<codebox>

<?php

/*

$Id: orders.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

//---PayPal WPP Modification START ---//

//Since the admin's configure.php file is STILL missing defines

include(DIR_FS_DOCUMENT_ROOT . DIR_WS_INCLUDES . 'configure.php');

 

include(DIR_WS_CLASSES . 'order.php');

 

</codebox>

 

And here is my modified code:

 

<codebox>

 

 

<?php

/*

$Id: orders.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

//---PayPal WPP Modification START ---//

//Since the admin's configure.php file is STILL missing defines

include(DIR_FS_DOCUMENT_ROOT . DIR_WS_INCLUDES . 'configure.php');

 

include(DIR_WS_CLASSES . 'order.php');

 

 

</codebox>

 

Do you think it would be helpful to copy the whole files in?

 

Many thanks,

 

Jo

Link to comment
Share on other sites

Hi,

 

I think I fixed the admin/orders (although I've not tested it properly yet), you were right about that function tep_hide_session_id thing, it was in fact missing from admin/includes/functions/html_output. I didn't know how to put it back in there myself but I found another copy of the file on an old backup that still had it there and swapped it over.

 

I'm going to carry on working through your advice on the paypal duplications now, my husbands got somehting called Araxis and I think i can compare codes with it if it does what I think it does!

 

Best wishes,

 

Jo

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