Review Order does not seem to display credit card information... any of it!

Posts: 67
Joined: 08/10/2007

I just noticed that on "review order" page, at the bottom of it in payment information, the "card owner" field is blank, "card number" is a bunch of dashes, "expiration" is 0/0 and "cvv" is blank... even though I entered all those on the previous screen.

How come?

Won't the users be kinda thrown away by this, and confused?

Posts: 5617
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Yeah, there's something up in the loading routine. It should be saving info to the database, but I've found that PHP 4 doesn't like the code I was using to load. Can you convert to PHP 5? If not... well, the old site had a workaround in the forum but we don't have it here any more. Sticking out tongue

Posts: 67
Joined: 08/10/2007

tsk, that's the thing... I can't go up to php5 just yet (not in my power to do that).

anyone still have that workaround handy?

Posts: 67
Joined: 08/10/2007

Ok, this is what the solution was in one of the threads you listed:

---------------------------------

Hmm... ok, I see now. I think this is due to an improper usage of module_invoke_all() on my part, it just works in PHP 5 for some reason. Can you try opening uc_order.module and changing the following code in the function uc_order_load():

From:

<?php
  module_invoke_all
('order', 'load', $order, NULL);
?>

To:

<?php
 
foreach (module_implements('order') as $module) {
   
$func = $module .'_order';
   
$func('load', $order, NULL);
  }
?>

------------------------------------

however, I see that this specific solution has already been implemented in alpha7b and I am still having that problem... hmm...

Posts: 5617
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Yeah, there's some other problem related to the load routine I believe... like it's trying to load data w/ no value. It's in there somewhere but I can't remember which one. Sad

Posts: 67
Joined: 08/10/2007

think hard, my friend... it's a matter of life and death, as this is the last step in the checkout process (and without this fixed, well, cart doesn't work)

Posts: 20
Joined: 08/15/2007
Bug Finder

The code mentioned above is in
this cached google page

and yes, it's been implemented in alpha7b. My server is running php 4.4.7 and I still have the same error - credit card details not showing on the "review order" form. Unfortunately (for me!) this is on a site of mine which is about to go live and is already overdue, so I'll be staying up late hunting down this bug and kicking in the shins.

Thanks for the other links, I've gone through them but haven't found a solution. Any other suggestions? They'd be most welcome - send to roger [at] macgeek.co.za

Posts: 20
Joined: 08/15/2007
Bug Finder

At first I thought this problem was due to perhaps some Ubercart upgrade problem as I was using an older version before updating to alpha7b. So I did the geeky thing - a clean Drupal 5.2 install with all of the modules needed to test the system again...and I got the same credit card error. So I think it's fair to say this is a pretty major bug that renders Ubercart unusable for all people on php 4 who are wanting to use any form of Credit Card payment (except off-site stuff). Where's my swatter?

Posts: 20
Joined: 08/15/2007
Bug Finder

Change line 219 in uc_credit.module from

function uc_payment_method_credit($op, $arg1) {

to

function uc_payment_method_credit($op, &$arg1) {

This now works in php 4 for me - I hope it doesn't break anything in php 5? This is the suggestion made at the old site at:
www.ubercart.org/forum/development/1214/credit_card_information_isnt_passed_my_payment_gateway

Posts: 20
Joined: 08/15/2007
Bug Finder

Here's the advice I used from the cached link above. You'll see that I've added in a & before the $arg1 (actually doing the opposite of Ryan's suggestion!) - I think that means that variable is being passed by reference, but I forget my basic programming. Here goes:

the good news is that it's saving the payment method just fine. I think what's going on here is some discrepancy w/ the way references are being passed by the functions. You'll notice in uc_payment_method_credit() and uc_checkout_pane_payment() (in uc_payment.module) that the first argument is a reference &$arg1. At least here in PHP 5, the fact that I'm passing a reference from uc_checkout_pane_payment() to uc_payment_method_credit() works just fine... I'm curious if in PHP 4 it would work if you take away the & from before &$arg1 for uc_payment_method_credit().

Posts: 20
Joined: 08/15/2007
Bug Finder

Sorry, that should be line 216, not 219 in uc_credit.module

Posts: 2352
Joined: 08/07/2007
AdministratoreLiTe!

I think I found the problem. All of the checkout pane functions are getting the order as a reference so they can change it, including the payment pane. The problem is that the payment method function is getting a copy of the order, and not the reference because the function declaration is wrong. It works in PHP5 because objects are always passed by reference.

Anywho, here's the fix:
Change line 218 of uc_credit.module from

<?php
function uc_payment_method_credit($op, $arg1) {
?>

to
<?php
function uc_payment_method_credit($op, &$arg1) {
?>

I'm reasonably certain this doesn't affect anything in PHP5, so it should be in the repository soon enough. I'll also look through the other payment methods to see if they have the same problem.

Posts: 6
Joined: 08/15/2007

Good to see a solution to this. I moved to another host of mine that does use PHP5. I was fortunate that this was an option, or I would have been SOL.

Posts: 10
Joined: 08/15/2007

Hey again Lyle, I'm running into this issue as well. I'm currently seeing if our host cannot upgrade to php5 without messing with our production applications on the same host. For the time being I am trying to fix this particular issue while I wait for their response.

A bit more detail, this may need to be put into a different post but it closely relates to the initial issue described. Essentially none of the credit card information is displaying once "review order" was clicked - further, nothing was actually posted into the database under uc_payment_credit. It marks the entry and creates the rows just fine, but no data is inputted into the table besides the order number.

I'm still not very proficient with php but I'm using this as a learning experience, so any help at all would be greatly appreciated.

Harry

Posts: 5617
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Woohoo! I hope this bug is dead for good! Evil

Thanks for the help macgeek and Lyle. Glad to see this one knocked out.

Posts: 24
Joined: 03/04/2008
Bug Finder

and I am still getting this error.

    * warning: xml_parse() [function.xml-parse]: Unable to call handler _startElement() in /home/charlie/public_html/modules/ubercart/uc_store/includes/simplexml.php on line 244.
    * warning: xml_parse() [function.xml-parse]: Unable to call handler _characterData() in /home/charlie/public_html/modules/ubercart/uc_store/includes/simplexml.php on line 244.
    * warning: xml_parse() [function.xml-parse]: Unable to call handler _endElement() in /home/charlie/public_html/modules/ubercart/uc_store/includes/simplexml.php on line 244.
    * warning: xml_parse() [function.xml-parse]: Unable to call handler _endElement() in /home/charlie/public_html/modules/ubercart/uc_store/includes/simplexml.php on line 244.

My server is running PHP 5.2.5. Any ideas?

-Lindsay