uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Products
       uTest
       uReserve
       uShop
       uStorekeeper
       uGolf
       uDirectory
       uSignIn
 Tech Support
       Support Policy
       Knowledge Base
            uTest
            uReserve
            uShop
            uStorekeeper
            uGolf
            uDirectory
            uSignIn
       Documentation
       Reference Sites
 Legal
       Software Piracy
       Legal Notices
       Privacy Policy
       Licensing
 Miscellaneous
       Reseller Info
       Contact Us
       Site Map
Credit Card additional field

Knowledge Base Lobby : uShop Support Conference : Programmer Tips
Nov-18-17 08:27 PM EST
Original Message
Credit Card additional field
Author Pete Burford on 06-10-2002 at 08:48 (EST)
In the UK, we have a type of debit card (Switch) which needs the Start date as well as all the other normal CC fields. WHere do I modify the .pl files to accomodate this. I have already modified the Creditcard template.html file.
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  RE: Credit Card additional field Bill Weiner, 2002-06-11 04:35:05 (1)
            Start Date Pete Burford, 2002-06-12 05:54:42 (2)

Messages In This Discussion
         1. RE: Credit Card additional field
        Author Bill Weiner on 06-11-2002 at 04:35 (EST)
The creditcard_template.html file currently allows for 5 credit card fields:

1. cc_type
2. cc_name_on_card
3. cc_number
4. cc_expiration
5. cc_issue

Are you already utilizing the "cc_issue" number field? If not, that would be the easiest thing to do. Just add that "cc_issue" field to your template and give it any label you want.

Otherwise, if you are already using the "cc_issue" number to collect the switch number or issue number, then there are a couple options... both of which try to avoid adding an additional field to the data format because that would open a whole can of worms.

Option 1: The easiest thing to do would be to just change the label of one of your fields on the creditcart_template.html file to collect the additional "start date". For example, you could change the "Expiration Date" label to something like:

"Start Date & Expiration Date:"

... possible with some format instructions such as (MM/YYYY - MM/YYYY):

"Start Date & Expiration Date: (MM/YYYY - MM/YYYY)"

... then the customer would just know to enter both dates in that cc_expiration field. And no changes to the CGI script would be required.

Option 2: A second (more complicated option) would be to add an additional field for the "cc_start_date" to the creditcard_template.html file... and then modify the script to append the additional field onto the cc_expiration date. (The reason for this appending again is to avoid adding an additional field to the data format of the order file.) Here more details on how to do that:

(Assuming that the new field on your creditcard_template has a "name" of "cc_start_date")

STEP 1: Make a backup of your ushop-lib.pl script... just in case.

STEP 2: Open your ushop-lib.pl script with any text editor such as WordPad.

STEP 3: Do a search on the following line:

sub validate_credit_card_parameters

(This will get you to the start of the subroutine that processes the credit card fields.)

STEP 4: Within that subroutine, locate the following line:

$cc_issue = &validate_string($cc_issue);

STEP 5: Immediately AFTER that "$cc_issue = &validate_string($cc_issue);" line, add these three lines:

$cc_start_date = $form_text{'cc_start_date'};
$cc_start_date = &validate_string($cc_start_date);
$cc_expiration .= ", $cc_start_date";

(Those three lines will get and validate the "cc_start_date" field from the form and then append the value onto the expiration field.)

STEP 6: Save the script... as TEXT if your editor asks... and try it out!
TABLE OF CONTENTS
                 2. Start Date
                Author Pete Burford on 06-12-2002 at 05:54 (EST)
Didn't work had to change this:
$cc_expiration .= ", $cc_start_date";
to this:
$cc_expiration .= "&pip; $cc_start_date";
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.