Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2008
    Posts
    71
    Plugin Contributions
    0

    Default wanting to style the error message when credit card declined

    When my credit card gets declined, it sends back to payment step 2 with a tiny text saying "your credit card was declined..."
    -basic white text over normal background color (black)
    -it is at the utmost top of the page above everything!
    -Version 1.3.8
    -This is from a gateway services module for my CC purcahses
    -- Below is (some of) the source code I get back with the page that has the error message at the top of it


    Wondering how I can make this bigger and maybe even add a red background to the message

    HTML Code:
    ****There is Some Code Above This*****
    function couponpopupWindow(url) {
      window.open(url,'couponpopupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=320,screenX=150,screenY=150,top=150,left=150')
    }
    function submitFunction($gv,$total) {
      if ($gv >=$total) {
        submitter = 1;	
      }
    }
    
    function methodSelect(theMethod) {
      if (document.getElementById(theMethod)) {
        document.getElementById(theMethod).checked = 'checked';
      }
    }
    
    //--></script>
    </head>
    
    <body id="checkoutpaymentBody">
    
    <div id="mainWrapper">
    
    Your credit card was declined. Please try another card or contact your bank for more info.
    
    <!--bof-header logo and navigation display-->
    
    <div id="headerWrapper">
    <!--bof-navigation display-->
    <div id="navMainWrapper">
    <div id="navMain">
    *******There Is More Code Below This*******

  2. #2
    Join Date
    Apr 2008
    Location
    Covington, Washington, United States
    Posts
    205
    Plugin Contributions
    1

    Default Re: wanting to style the error message when credit card declined

    Dan, what is website please

  3. #3
    Join Date
    Nov 2008
    Posts
    71
    Plugin Contributions
    0

    Default Re: wanting to style the error message when credit card declined


  4. #4
    Join Date
    Apr 2008
    Location
    Covington, Washington, United States
    Posts
    205
    Plugin Contributions
    1

    Default Re: wanting to style the error message when credit card declined

    OK thank you, I will take a look in a bit, have a few things i have to take care of tonight, but should be a quick css class definition....

  5. #5
    Join Date
    Apr 2008
    Location
    Covington, Washington, United States
    Posts
    205
    Plugin Contributions
    1

    Default Re: wanting to style the error message when credit card declined

    Dan, quick FYI, when you click on your logo you get taken to lulu.com.... don't know if that is by design or what...

    Onto the issue @ hand...

    when I enter an incorrect cc # after I press continue it is highlighted in red... when I enter a real cc # with incorrect exp and security code, it doesn't display an error at all... What payment module are you using...?

  6. #6
    Join Date
    Apr 2008
    Location
    Covington, Washington, United States
    Posts
    205
    Plugin Contributions
    1

    Default Re: wanting to style the error message when credit card declined

    Dan,

    I'm sorry, you are absolutely right, it is indeed up there...

    OK, in your code below it looks like you copy and pasted what was displayed. You will need to locate the file that produces this text. Around the text make a div with a created class...
    <div class="ccDecline">Your credit card was declined. Please try another card or contact your bank for more info.</div>
    .

    Once you create that div in that file, open you includes/templates/yourtemplate/css/ stylesheet.css file and add the following the end of the document:

    .ccDecline {
    background-color:#FF0000;
    font-weight: bold;
    }
    This should do it....

    The trouble will be finding the document that produces the message. It will likely be in a variable. So look up that string in your admin panel. Lookup admin>tools>developers toolkit

    in the last field type 4-5 words from the string, (Your credit card was declined) will work. In the dropdown next to it select catalog. Your results searching for the page this string is in will be displayed. sift through there to find the page that produces this string. Add the div above, and your set :)

  7. #7
    Join Date
    Nov 2008
    Posts
    71
    Plugin Contributions
    0

    Default Re: wanting to style the error message when credit card declined

    Neither attemp worked... when I try and modify the file that has the _DECLINED_ message in any way, it produces a blank page during checkout.:

    ****FROM THE: languages/english/modules/payment/


    <?php
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_TITLE', 'Gateway Services (Credit Card)');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_PUBLIC_TITLE', 'Credit Card');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_DESCRIPTION', '<strong>Gateway Services Credit Card Module</strong><br><br>Credit Card Test Info:<br>CC Number: 4111111111111111<br>CC Expiry: Any valid expiration');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_JS_CSC', '* The credit card security code must be 3 characters (4 for American Express).\n');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_ERROR_CSC', 'The credit card security code must be 3 characters (4 for American Express).');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_ERROR', 'Credit Card Error!');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_CARD_SECURITY_CODE', 'Credit Card Security Code:');
    define('MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_CSC_DESCRIPTION', '(located on the back of the credit card)');
    ?>



    ---This is the entire page for the .php document. The weird thing is that if it is a wrong # entered for the credit card an error message is in the middle of the page with red background? The error message at the top only comes up when the "...credit card has been declined....."



    ****here is some .php from where the error message is generated in the : /modules/payment/


    function before_process() {

    if ($_GET['response'] == '1') return;
    if ($_GET['response'] == '2') {
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
    }
    // Code 3 is an error - but anything else is an error too (IMHO)
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_ERROR_MESSAGE), 'SSL', true, false));
    }

    function after_process() {
    return false;
    }

    function get_error() {

    $error = array('title' => MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_ERROR,
    'error' => stripslashes(urldecode($_GET['error'])));

    return $error;
    }

    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GATEWAY_SERVICES_CC_STATUS'");
    $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
    }

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: wanting to style the error message when credit card declined

    I suspect your payment module wasn't written for the version of Zen Cart that you're using.

    The current version of Zen Cart doesn't rely on the &error_message= parameter to display payment messages.

    It would instead be written something like this:
    Code:
    if ($_GET['response'] == '2') {
      $messageStack->add_session('checkout_payment', MODULE_PAYMENT_GATEWAY_SERVICES_CC_TEXT_DECLINED_MESSAGE, 'error');
      zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
    }
    GET[response]==3 would be done similarly.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Nov 2008
    Posts
    71
    Plugin Contributions
    0

    Default Re: wanting to style the error message when credit card declined

    So I tried it just as you wrote it for the message stack, and it gave me a blank page during checkout... any other ideas?

  10. #10
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: wanting to style the error message when credit card declined

    A blank page means you've created a PHP syntax error, either by directly editing a file incorrectly, or required files are not found.

    There is a debug logging utility in step 2a of this FAQ article dealing with Blank Pages: https://www.zen-cart.com/tutorials/index.php?article=82
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v151 When Credit Card is Declined
    By Frank S. in forum Addon Payment Modules
    Replies: 1
    Last Post: 4 Oct 2013, 07:38 PM
  2. v150 Error message when wanting to change the order status
    By kath7_hoffi in forum Managing Customers and Orders
    Replies: 2
    Last Post: 22 Jan 2013, 11:09 PM
  3. Credit Card Declined when purchasing downloadable products.
    By bigjoed in forum Setting Up Categories, Products, Attributes
    Replies: 21
    Last Post: 26 Jul 2008, 07:05 PM
  4. error message when credit card module disabled
    By jilly1217 in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 23 Nov 2006, 02:30 AM
  5. Credit card declined when company is entered
    By wmonet in forum General Questions
    Replies: 1
    Last Post: 22 Nov 2006, 05:43 PM

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