Card Type Issues

marcus178 - October 2, 2009 - 09:24
Project:SagePay (former Protx) Direct Payment Gateway for Ubercart
Version:6.x-1.2
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

This is sort of a duplicated of http://drupal.org/node/576924 but I realised that was for version 5 not 6.

Anyway I have a couple of problems

1. If I disable card type selection on checkout form it does not seem to automatically recognise the card type and I get the following error when the order is submitted:

We were unable to process your credit card payment. Please verify your card details and try again. If the problem persists, contact us to complete your order.

If I enable and put in the list of card codes it works fine, however I don't like the fact that you cannot format the text that is displayed to the customer on the drop down, some will be obvious to the customer but ones such as UKE may confuse them. greg.harvey mentioned using hook_form_alter to hide the drop down but I don't understand how that will help.

2. This is probably more of a feature request but there are only the default 4 Accepted Card Types available, but Sagepay accepts many others and this is not shown at the checkout.

#1

iamtakashiirie - November 6, 2009 - 01:09
Category:bug report» feature request

I too want to have ability of adding card icons at there. Please!!

#2

marcus178 - November 7, 2009 - 16:02

I have added the card type icons by creating a custom module with the following code

function custom_form_alter(&$form, $form_state, $form_id) { 
   switch($form_id) { 
case 'uc_cart_checkout_form':
$cc_types = array('visa', 'delta','electron', 'mastercard', 'maestro', 'solo', 'amex', 'diners', 'jcb');
  foreach ($cc_types as $type) {
      $card .= ' <img src="'. base_path() . drupal_get_path('module', 'custom') .'/protx_cards/' .$type . '.gif" alt="" id="accepted_card_types" height="26px" style="position: relative; top: 5px;"/>';
    }
$form['panes']['payment']['payment_method']['#title'] = t('Accepted cards');
$form['panes']['payment']['payment_method']['#required'] = FALSE;
$form['panes']['payment']['payment_method']['credit']['#value'] = $card;
break;
   } 
}

Just copy the protx_cards directory to your custom module directory and it should do the trick.

 
 

Drupal is a registered trademark of Dries Buytaert.