7 replies [Last post]
pebosi@drupal.org's picture
Offline
Uber DonorBug Finder
Joined: 09/05/2007
Juice: 47
Was this information Helpful?

Hi,

i got several orders with credit card payment, but when i click "View card details" no values are shown. Is this because the credit module, has no case like "case 'order-load':" in the uc_payment_method_credit function? or is there an other reason?

regards pebosi

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Creditcard data is not shown

If you're processing orders at checkout, it might be setup to wipe the data once a card's been run... resulting in no data visible on the order screens.

pebosi@drupal.org's picture
Offline
Uber DonorBug Finder
Joined: 09/05/2007
Juice: 47
Re: Re: Creditcard data is not shown

No, theres no proccessing. And no gateway is active for this payment method. No encryption. But its not saved...

regards pebosi

Edit: ok enabled encryption, now it works.

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Re: Re: Re: Creditcard data is not shown

I am having a problem with the "View card details." link and thought I would reply here.

My problem is when you click the link, nothing happens. CC data is being stored because when you click the "Process card" button right below the View card details. link, it pulls up a page with the proper card data --- however I get the following error at the top of the page:

* warning: in_array() [function.in-array]: Wrong datatype for second argument in /root/path/to/public_html/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module on line 1266.
    * warning: in_array() [function.in-array]: Wrong datatype for second argument in /root/path/to/public_html/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module on line 1274.
    * warning: in_array() [function.in-array]: Wrong datatype for second argument in /root/path/to/public_html/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module on line 1282.
    * warning: in_array() [function.in-array]: Wrong datatype for second argument in /root/path/to/public_html/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module on line 1290.

Anyone know what this is about? Maybe this is causing the View card details. link to not work?

I am not using any processor or any gateway, we simply transfer the card data to our invoicing software locally and run the card numbers through our local terminal machines.

So I only need the data to appear, I don't need the "Process card" button and will promptly remove it (hide it with css probably) once I figure out how to resolve the "View card details." link.

Thank you in advance!
Mike

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: Re: Re: Creditcard data is not shown

Well, AFAIK you aren't going to be able to get the full CC number later. Ubercart doesn't store this information because unless the server is super secure, it's dangerous to keep that info around.

It appears the reason you get those errors is cause the current code sorta forgot about handling the case of having no gateways enabled. At least, that is what I assume is happening here. So, I made a patch to take care of that.

AttachmentSize
uo4250.empty_gateway_txn_types.2.x.patch 524 bytes

Try FreeBASIC!
My game Lynn's Legacy

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
cha0s wrote:Well, AFAIK you
cha0s wrote:

Well, AFAIK you aren't going to be able to get the full CC number later. Ubercart doesn't store this information because unless the server is super secure, it's dangerous to keep that info around.

It appears the reason you get those errors is cause the current code sorta forgot about handling the case of having no gateways enabled. At least, that is what I assume is happening here. So, I made a patch to take care of that.

Thanks cha0s, I will apply your patch tonight after classes.

Regarding the credit card info it most certainly does store all of the information if you configure it to. I have a test version of Drupal with UC and it works perfectly fine on my test site. So I am not sure why it is not working on mine.

I am using the Admin Theme module, so my theme for my admin section is different. Could this be causing the problem? All it is is a bone stock bluemarine theme with different css colors.

Mike

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Re: cha0s wrote:Well, AFAIK you

Alright guys, I've spent some more time on this..

The html code is as follows:

<span onclick="toggle_card_details();" style="cursor: pointer;"><a id="cc_details_title" href="" onclick="return false;" style="display: none;">View card details.</a><span id="cc_details"><table style="width: auto;"><tr><td>Card Owner: </td><td>Mike Smith</td></tr><tr><td>Card Number: </td><td>1234123412341234</td></tr><tr><td>Expiration: </td><td>01/2000</td></tr><tr><td>CVV: </td><td>123</td></tr></table></span></span>

So I can see there is a javascript function being called, "toggle_card_details", and a quick search found it in the file ubercart/payment/uc_credit/uc_credit.js :

$(document).ready(
  function () {
    $('#cc_details_title').show(0);
    $('#cc_details').hide(0);
  }
);

/**
* Toggle credit card details on the order view screen.
*/
function toggle_card_details() {
  $('#cc_details').toggle();
  $('#cc_details_title').toggle();
}

So then I double checked that this .js file was being called by my theme, and sure enough it is:

<script type="text/javascript" src="/sites/all/modules/ubercart/payment/uc_credit/uc_credit.js?96796"></script>

I am not sure what the ?96796 is for... it might be to prevent the browser to cache the file, I have no clue.

Then I opened up Firebug's javascript console and again clicked repeatedly on the "View card details." link and nothing, no error, no action, no display of the span.

So it is OBVIOUS that the credit card information is present in the generated html, I just need to figure out why the javascript isn't working.

I might just remove the entire javascript functionality and just show the info by default, but I am not sure if I want to do this or not...well, not yet anyway

I'll keep this updated
Mike

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Re: Re: cha0s wrote:Well, AFAIK you

Ok, here is the temporary solution to show CC data direct on the Order View page:

In your ubercart/payment/uc_credit/uc_credit.module,

On (or near) line 568, replace:

        $output .= '<span onclick="toggle_card_details();" style="cursor: pointer;">'
                  .'<a id="cc_details_title" href="" onclick="return false;" style="display: none;">'. t('View card details.') .'</a>';

        $output .= '<span id="cc_details"><table style="width: auto;">';

with:

        $output .= '<span><table style="width: auto;">';

On (or near) line 624, replace:

        $output .= '</table></span></span>';

with:

        $output .= '</table></span>';

Now the credit card data will be displayed by default. Also, if you are not using a gateway and therefore not processing anything, then there is not need to see the "Process Card" button, so if you wish to remove this button, then remove the following contents from (or near) lines 626-629:

        // Add the form to process the card if applicable.
        if (user_access('process credit cards')) {
          $output .= drupal_get_form('uc_credit_order_view_form', $arg1->order_id);
        }

Removing this will remove the "Process Card" button.

Hope this info helps someone in the future!

Mike