Alpha Video Training
Results 1 to 6 of 6

Thread: Credit Card Field

  1. #1
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Unhappy Credit Card Field

    Hi All

    I'm looking to use a field validation rule to run the ccvalid() code, then encrypt the credit card number using the OnDepart form event with the encrypt_string() code.

    So far I've built a test table called "cardno" that contains two fields labeled "Cardno" and "Cardno_id". I've also built a test form that contains both fields and a variable labeled "vcardno".

    Code in the field rule validation is CCVALID("vcardno", 0)
    Code for the variable is vcardno = ""
    Code in the OnDepart Event is encrypt_string("vcardno")

    When I enter a valid credit card number I get a "Field Value not valid: CARDNO" and the data is not encrypted.

    Any suggestions on how to correct this?

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Credit Card Field

    I think your usage is slightly off.

    CCVALID("vcardno", 0)
    says is the text "vcardno" a valid credit card number?

    To pass the credit card number stored in the vcardno variable you want
    CCVALID(vcardno, 0)

    Similarly for the encryption you want
    encrypt_string(vcardno)
    Last edited by Stan Mathews; 03-27-2012 at 02:08 PM.

  3. #3
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Credit Card Field

    Hi Stan

    Thanks for the feedback.

    I've made the changes you recommended, but now it does nothing.

    I've attached a copy of the test database.

    cardno.zip

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Credit Card Field

    what's the data type for your variable ( vcardno ) ? The function is expecting a character string, not a numeric data type.

    Belay that... the problem is simpler.

    Your field rule doesn't know what value is to be found in the variable you pass to the function.

    Change the validation expression to reference the field name, instead of the variable.

    i.e.

    Code:
    CCVALID(CARDNO, 0)
    Last edited by Tom Cone Jr; 03-27-2012 at 02:27 PM.

  5. #5
    Member SNusa's Avatar
    Real Name
    Robert Tupper
    Join Date
    Dec 2007
    Location
    Northeast, USA
    Posts
    893

    Default Re: Credit Card Field

    If you're doing this for a client, be sure you aren't breaking any credit card industry compliance regulations by storing it in a .dbf like that!
    (Today's regulations are absurd, IMHO, and are merely "smoke and mirrors" to the real problems at hand. But still, you could expose yourself to liability.)

    Lets see, you can give a number over the phone to a complete stranger, along with CCV.... But you can't do what? ~ absurd IMHO!
    (I have no idea what the actual legal requirements are today, as presented by the card issuers /industry.)
    Robert T. ~ "I enjoy manipulating data... just not my data."
    It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
    RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Credit Card Field

    Try this. You were at cross purposes with the field rule validation. Once the ondepart event encrypted it the value is no longer valid.

    Remove the field rule validation, moved the ondepart event code to the candepart event.

    cardno.zip

Similar Threads

  1. Credit Card Acceptance
    By Mike Reed in forum Alpha Five Version 10 - Desktop Applications
    Replies: 2
    Last Post: 04-02-2011, 11:42 PM
  2. Credit Card Software
    By Jason Wilson in forum Alpha Five Version 5
    Replies: 0
    Last Post: 01-25-2004, 04:04 PM
  3. Credit Card Usage
    By David Fieldsend in forum Alpha Five Version 5
    Replies: 1
    Last Post: 11-17-2003, 03:20 AM
  4. Credit Card Validation
    By Dan Blank in forum Alpha Five Version 5
    Replies: 5
    Last Post: 03-09-2003, 12:38 PM
  5. Rebate: Received credit to credit card
    By Bernard Posner in forum Alpha Five Version 5
    Replies: 2
    Last Post: 07-29-2002, 07:30 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
  •