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 form

Knowledge Base Lobby : uShop Support Conference : General Questions
Nov-21-17 12:30 PM EST
Original Message
Credit card form
Author dave on 01-20-2003 at 08:33 (EST)
Using u-shop 3.50, the standard credit card form.
In the credit card form.
We have been asking the customer to enter the credit card number with a - dash between each set of four numbers the same way it is shown on the card. Most do not seem to want to do this. I agree, I should not be asking them to enter it any special way. Is there a way to make that one field be split in to four, such as, [4444] [4444] [4444] [4444], so that they can type it in without having to enter a dash or space, although, have the field or (form information) be sent to me with a dash or at least a space between four numbers. I am either getting old or it is just hard to read 16 numbers all together with no spaces. Any ideas on this?

Thank you.
TABLE OF CONTENTS

Table Of Contents
  RE: Credit card form Bill Weiner, 2003-01-21 07:50:06 (1)
            Credit card form dave, 2003-01-21 12:57:56 (2)
                 RE: Credit card form Bill Weiner, 2003-01-22 06:20:34 (3)
                      Credit Card Form Ron Harter, 2003-01-24 18:45:06 (4)
                           RE: Credit Card Form Bill Weiner, 2003-01-29 06:28:25 (5)

Messages In This Discussion
         1. RE: Credit card form
        Author Bill Weiner on 01-21-2003 at 07:50 (EST)
Below is a way to modify the ushop.pl script such that it stores the credit card number with dashes every four digits:

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

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

STEP 3: Do a search on the following line:

&validate_credit_card_parameters();

STEP 4: Immediately AFTER that line, add these 8 lines:

if (!($cc_number =~ /-/))
{
$formatted_cc = substr($cc_number,0,4) . "-";
$formatted_cc .= substr($cc_number,4,4) . "-";
$formatted_cc .= substr($cc_number,8,4) . "-";
$formatted_cc .= substr($cc_number,12,4);
$cc_number = $formatted_cc;
}

STEP 5: Save the script...as TEXT if your editor asks... and try it out!
TABLE OF CONTENTS
                 2. Credit card form
                Author dave on 01-21-2003 at 12:57 (EST)
Thank you, that worked slicker than, um, water on ice.
I must say that the customer support here is the best I have seen. How many companies will take the time to write a customer out a special script or take the time to show them something they should learn on their own.

Thanks again
TABLE OF CONTENTS
                         3. RE: Credit card form
                        Author Bill Weiner on 01-22-2003 at 06:20 (EST)
Glad that worked for you :^)
TABLE OF CONTENTS
                                 4. Credit Card Form
                                Author Ron Harter on 01-24-2003 at 18:45 (EST)
Bill,
This works fine if they use no spaces or use a dash (-) between the 4 digits but if they enter a space i.e 4111 1111 1111 1111 it comes out as 4111- 111-1 11-11 1 and drops the last 3 digits. Any way to handle this? I have "no spaces" next to the number entry box but many do it anyway.
Thanks
Ron
TABLE OF CONTENTS
                                         5. RE: Credit Card Form
                                        Author Bill Weiner on 01-29-2003 at 06:28 (EST)
Directly BEFORE the modification described above, you could add a line like this to remove any spaces from the credit card number:

$cc_number =~ s/ //g;

So the IMPROVED modification would actually look like this:

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

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

STEP 3: Do a search on the following line:

&validate_credit_card_parameters();

STEP 4: Immediately AFTER that line, add these 9 lines:

$cc_number =~ s/ //g;
if (!($cc_number =~ /-/))
{
$formatted_cc = substr($cc_number,0,4) . "-";
$formatted_cc .= substr($cc_number,4,4) . "-";
$formatted_cc .= substr($cc_number,8,4) . "-";
$formatted_cc .= substr($cc_number,12,4);
$cc_number = $formatted_cc;
}

STEP 5: Save the script...as TEXT if your editor asks... and try it out!
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.