Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    22
    Plugin Contributions
    0

    Default Re: Disabling MasterCard doesn't work with own payment module

    I found this function



    $ccnValidation = "var nrcField = document.checkout_payment.number.value;\n" .
    "if ( nrcField.length < " . CC_NUMBER_MIN_LENGTH . ") {\n" .
    " error_message = error_message + 'Invalid credit card number.\\n';\n" .
    " error = 1;\n" .
    "}\n";

    this check only for lenght of min. number, can this check if is there master card first number :5 ?


    here is complete function:





    function javascript_validation()
    {
    $ccvValidation = "var ccvField = document.checkout_payment.cvc.value;\n" .
    "if ( ccvField.length < " . CC_CVV_MIN_LENGTH . ") {\n" .
    " error_message = error_message + 'Invalid CCV entered.\\n';\n" .
    " error = 1;\n" .
    "}\n";
    $zipValidation = "var zipField = document.checkout_payment.zip.value;\n" .
    "if ( zipField.length < 4) {\n" .
    " error_message = error_message + 'Invalid ZIP code entered.\\n';\n" .
    " error = 1;\n" .
    "}\n";
    $addValidation = "var addField = document.checkout_payment.address.value;\n" .
    "if ( addField.length < 3) {\n" .
    " error_message = error_message + 'Invalid address entered.\\n';\n" .
    " error = 1;\n" .
    "}\n";
    $nameValidation = "var fnameField = document.checkout_payment.firstname.value;\n" .
    "var lnameField = document.checkout_payment.lastname.value;\n" .
    "var tName = fnameField + ' ' + lnameField;\n" .
    "if ( tName.length < " . CC_OWNER_MIN_LENGTH . " ) {\n" .
    " error_message = error_message + 'Input name length to low!\\n';\n" .
    " error = 1;\n" .
    "}\n";
    $ccnValidation = "var nrcField = document.checkout_payment.number.value;\n" .
    "if ( nrcField.length < " . CC_NUMBER_MIN_LENGTH . ") {\n" .
    " error_message = error_message + 'Invalid credit card number.\\n';\n" .
    " error = 1;\n" .
    "}\n";
    $valChecks = $nameValidation . $addValidation . $zipValidation . $ccvValidation . $ccnValidation;
    return($valChecks);
    }

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    22
    Plugin Contributions
    0

    Default Re: Disabling MasterCard doesn't work with own payment module

    tnx to all, i found answer how to solve my problem,

    here is script if someone have the same problem...

    ------------------------------
    $ccnValidation = "var nrcField = document.checkout_payment.number.value;\n" .
    "if ( nrcField.substring(0,1) != \"5\");{\n" .
    " error_message = error_message + 'Sorry you use master card, please use one other credit card .\\n';\n" .
    " error = 1;\n" .
    "}\n";

  3. #3
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Disabling MasterCard doesn't work with own payment module

    Thanks for posting the solution you found.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

 

 

Similar Threads

  1. Replies: 10
    Last Post: 10 Jan 2013, 08:13 PM
  2. Writing my own Payment Module?
    By Rayston in forum Addon Payment Modules
    Replies: 9
    Last Post: 29 Dec 2009, 07:42 PM
  3. Help needed with getting Paygate payment module to work
    By LeneZone in forum Addon Payment Modules
    Replies: 5
    Last Post: 4 Nov 2009, 11:43 AM
  4. MerchantAnywhere payment module - work with zen 1.3.7 ??
    By DogTags in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 29 May 2007, 01:23 PM
  5. FAQ module doesn't work
    By dealbyethan.com in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 14 Apr 2007, 03:03 AM

Posting Permissions

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