credit.module -- Start Date & Issue Number

solarian - June 15, 2008 - 12:06
Project:Ubercart
Version:5.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

As per this thread, this patch provides:

  • Input boxes for start date & issue number on cart/checkout
  • validation routines for the same
  • code to enable these to display appropriately on cart/checkout/review
  • admin option to turn these features on or off

Start date & issue number can then be accessed by payment gateways with the following "well-known" keys:

cc_start_month
cc_start_year
cc_issue

However, since these are not guaranteed to exist it is recommended to use something like, e.g.
if (isset($order->payment_details['cc_start_month']) && isset($order->payment_details['cc_start_year'])) { ... }
if (isset($order->payment_details['cc_issue'])) { ... }

In my view, payment gateways should definitely avoid testing against the admin option
if (variable_get('uc_credit_start_enabled', FALSE) { ... }
in favour of testing "well-known" names directly.

N.B. Credit card issue number must always be treated as a string, since "1" is different from "01" and will fail validation by the acquiring bank.

#1

solarian - June 15, 2008 - 12:19
Priority:normal» critical

P.S. I meant to say that, currently, Maestro cards are apparently allowed in Ubercart but that these will silently fail validation because there is no start date & issue number; hence I think this counts as a fairly critical bug.

#2

rszrama - July 9, 2008 - 17:35
Category:bug report» feature request
Priority:critical» normal

Critical would be more show stopping than just not supporting one type of CC... however, I think you forgot to attach the patch. I'll review it when you post it. : )

EDIT: n/m - you can just let me know if the one in the thread you linked is still up to date and I can go from there.

#3

solarian - July 18, 2008 - 21:42

Apologies -- have attached the diff I did against a recent (post 1.0) version. I think it'll still work.

I felt it was critical because it would result in a loss of custom/goodwill for shoppers. But perhaps not a huge issue, all things considered.

AttachmentSize
startdate.diff9.46 KB

#4

rszrama - July 24, 2008 - 19:19
Status:patch (code needs review)» patch (reviewed & tested by the community)

That patch didn't address the maxlength on the CC number field. I upped that to 19 and applied the rest of the patch w/ a couple fixes for variable defaults consistency. I tested it on the Livetest with no trouble, but I am curious what payment gateway modules should do in the event of a card w/ no start date or issue number. For example, there will always be a value submitted for the start date, so there's no good way for the gateway module to detect whether or not it should be sending that data to the gateway or not...

Committing this to Bzr but will consider final pending your feedback. Obviously doesn't affect existing sites.

fwiw, I'd love to redesign the way CC fields are implemented in D6.

#5

solarian - July 28, 2008 - 22:20

Thanks for this, and for upping the maxlength to 19.

I can't speak for other gateways, but the one I've written only sends the start date and issue number for card types that require it.

I think the worst-case situation would only be that a blank start date would be sent to the card processing company and would be ignored, but that's just a guess.

#6

moonray - September 12, 2008 - 18:26

When can we get this into Ubercart?
Maestro through Cybersource requires the start date and issue number.
Currently, somehow, even though the card's not validated, the order still gets submitted. Might be a separate issue, though.

#7

rszrama - September 12, 2008 - 18:29

I think it is a separate issue. The patch was committed a while back but probably hasn't made it into a release yet. If so it'd be the 1.3 release.

#8

moonray - September 17, 2008 - 17:55
Status:patch (reviewed & tested by the community)» fixed

Looks like this is in UC 1.3
Marking as fixed.

#9

Anonymous (not verified) - October 1, 2008 - 18:03
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.