Professional Web Applications Themes

Identify credit card types based on thier number - FileMaker

As a practice and learn session, I'd like to construct a FileMaker calc field that "looks" at a credit card number in a field, and then ID the card based on the first number, and then show the credit card type? Examples: Fields- CC_number <= CC number entered into this field. CC_ID.c <= CC type identified in this field. This simple calc is obviously wrong, but describes what I think it logically looks like (identify the first number and relate that to the CC type): CC_ID.c = if (left 1, 3, "AMEX"), if (left 1, 4, "Visa"), if (left 1, ...

  1. #1

    Default Identify credit card types based on thier number

    As a practice and learn session, I'd like to construct a FileMaker
    calc field that "looks" at a credit card number in a field, and then
    ID the card based on the first number, and then show the credit card
    type?

    Examples:
    Fields-
    CC_number <= CC number entered into this field.
    CC_ID.c <= CC type identified in this field.

    This simple calc is obviously wrong, but describes what I think it
    logically looks like (identify the first number and relate that to the
    CC type):

    CC_ID.c =

    if (left 1, 3, "AMEX"),
    if (left 1, 4, "Visa"),
    if (left 1, 5, "Master"),
    if (left 1, 6, "Discover")

    Jerry Cline
    proterm Guest

  2. #2

    Default Re: Identify credit card types based on thier number

    Brian Dunning has two files available that show examples of credit card
    validation at [url]http://www.briandunning.com/filemaker.shtml[/url]
    They are both free downloads and are unlocked so you can see how they work.

    Michael Myett

    proterm wrote:
    > As a practice and learn session, I'd like to construct a FileMaker
    > calc field that "looks" at a credit card number in a field, and then
    > ID the card based on the first number, and then show the credit card
    > type?
    Michael Myett Guest

  3. #3

    Default Re: Identify credit card types based on thier number

    Try:

    Choose(Left(CC, 1) - 3,
    "Amex", "Visa", "MC", "Discover"
    )

    Remember Amex uses only 15 digits.

    --
    John Weinshel
    Datagrace
    Vashon Island, WA
    (206) 463-1634
    Associate Member, Filemaker Solutions Alliance


    "proterm" <Jerryintrec.com> wrote in message
    news:88f45ed6.0309112136.636bd1c4posting.google.c om...
    > As a practice and learn session, I'd like to construct a FileMaker
    > calc field that "looks" at a credit card number in a field, and then
    > ID the card based on the first number, and then show the credit card
    > type?
    >
    > Examples:
    > Fields-
    > CC_number <= CC number entered into this field.
    > CC_ID.c <= CC type identified in this field.
    >
    > This simple calc is obviously wrong, but describes what I think it
    > logically looks like (identify the first number and relate that to the
    > CC type):
    >
    > CC_ID.c =
    >
    > if (left 1, 3, "AMEX"),
    > if (left 1, 4, "Visa"),
    > if (left 1, 5, "Master"),
    > if (left 1, 6, "Discover")
    >
    > Jerry Cline

    John Weinshel Guest

  4. #4

    Default Re: Identify credit card types based on thier number

    proterm wrote:
    > CC_ID.c =
    >
    > if (left 1, 3, "AMEX"),
    > if (left 1, 4, "Visa"),
    > if (left 1, 5, "Master"),
    > if (left 1, 6, "Discover")

    John's answer will work, but it isn't the most obvious to debug. try this:

    case(
    left(CC_number, 1)=3, "AMEX",
    left(CC_number, 1)=4, "Visa",
    left(CC_number, 1)=5, "Master",
    left(CC_number, 1)=6, "Discover")

    And not only does Amex only have 15 characters, but so do *some*
    mastercards.


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Howard Schlossberg (818) 883-2846
    FM Pro Solutions Los Angeles, California
    Associate Member, FileMaker Solutions Alliance

    Howard Schlossberg Guest

  5. #5

    Default Re: Identify credit card types based on thier number

    The several methods posted to my request were extremely helpful. The
    solutions went beyond the point of just solving the problem, they
    allowed me to go beyond the point I originally had in mind.

    Thank you for the detailed examples.

    Jerry Cline
    proterm Guest

Similar Threads

  1. Display Credit Card number with dynamic Dashes
    By Yankeet in forum Macromedia ColdFusion
    Replies: 2
    Last Post: March 22nd, 06:35 PM
  2. From validation? [ credit card ]
    By Editz webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 1
    Last Post: December 3rd, 03:31 PM
  3. [PHP] Credit card/Debit card validation
    By Matt Matijevich in forum PHP Development
    Replies: 1
    Last Post: July 9th, 10:04 PM
  4. Credit card/Debit card validation
    By Sparky Kopetzky in forum PHP Development
    Replies: 1
    Last Post: July 9th, 09:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139