Identify credit card types based on thier number

Ask a Question related to FileMaker, Design and Development.

  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. Similar Questions and Discussions

    1. Display Credit Card number with dynamic Dashes
      Hi, I record Credit card numbers without the dashes in them but want to display them with the dashes. is a loop needed for this? where can I find how...
    2. From validation? [ credit card ]
      I want to have a form in my director movie where the user enters their credit card details. Does anyone know how I can validate the number to see...
    3. Credit Card processing...
      Hello there.... I would like my users on my site to be able to pay with credit cards and I need an "immediate" validation and transffer... Can...
    4. [PHP] Credit card/Debit card validation
      I have a mod10 validation script written in another scripting language. I could try to convert it if you would like but I am sure that someone has...
    5. Credit card/Debit card validation
      Does anyone know of a PHP routine to validate Credit/Debit cards? I've seen some convoluted Javascript scripts but want a PHP version so validation...
  3. #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

  4. #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" <Jerry@intrec.com> wrote in message
    news:88f45ed6.0309112136.636bd1c4@posting.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

  5. #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

  6. #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

Posting Permissions

  • You may not post new threads
  • You may 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