Announcement

Collapse
No announcement yet.

Edit Credit Card Failure Messages in Miva

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Edit Credit Card Failure Messages in Miva

    I currently use Cybersource to process credit cards, and sometimes there are issues because my bank is international. Cybersource tells me that successful customers get transfered back to the site (invoice) and unsuccessful customers get transfered back to my site where there is an error message.

    I want to be able to craft the error message telling them about paypal as an option. How do I customize the payment error messages in Miva...I could not find it anywhere...

    #2
    Re: Edit Credit Card Failure Messages in Miva

    Those messages come from Cybersource and not our software, so they're not directly editable anywhere.

    However you can use a conditional via template code to intercept and change them.
    Thanks,

    Rick Wilson
    CEO
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Edit Credit Card Failure Messages in Miva

      Rick, thanks for the quick response

      Not sure how template code works. Is that a module that I buy or is that some kind of custom coding in Miva? What page on Miva do they appear? Thanks for your time.

      Originally posted by Rick Wilson View Post
      Those messages come from Cybersource and not our software, so they're not directly editable anywhere.

      However you can use a conditional via template code to intercept and change them.

      Comment


        #4
        Re: Edit Credit Card Failure Messages in Miva

        Template Code is the HTML, etc... Under the Pages tab in the admin. I've asked someone from my team to provide more info.
        Thanks,

        Rick Wilson
        CEO
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment


          #5
          Re: Edit Credit Card Failure Messages in Miva

          The error messages are controlled by page template code on the OPAY page.

          Here is the default code:
          Code:
          <mvt:if expr="l.settings:messages:error_message_count">
          	<div class="error-message">
          		<mvt:foreach iterator="error" array="messages:error_messages">
          			&mvt:error;
          		</mvt:foreach>
          	</div>
          </mvt:if>
          The actual error message that gets returned will depend on what the error is and the gateway you are using.

          However you can add a conditional around the the error message output that checks for certain responses and then display your own.

          Example:

          Code:
          <mvt:if expr="l.settings:messages:error_message_count">
          	<div class="error-message">
          		<mvt:foreach iterator="error" array="messages:error_messages">
          			<mvt:if expr="l.settings:error EQ 'One or more required fields were not filled out correctly.' ">
          				Custom Error Message 
          			<mvt:elseif expr="l.settings:error EQ 'xxxxxx' ">
          				Custom Error Message
          			<mvt:else>
          				&mvt:error; 
          			</mvt:if>
          		</mvt:foreach>
          	</div>
          </mvt:if>
          Brennan Heyde
          VP Product
          Miva, Inc.
          [email protected]
          https://www.miva.com

          Comment


            #6
            Re: Edit Credit Card Failure Messages in Miva

            I use PayPal. Is there a message array for error codes? For example, 15005.
            Last edited by alphabet; 09-26-12, 08:38 AM. Reason: typo
            http://www.alphabetsigns.com/

            Comment


              #7
              Re: Edit Credit Card Failure Messages in Miva

              Where are you seeing paypal errors? There shouldn't be any error messages with PayPal on OPAY since the payment piece is handled on PayPals website.

              If you're using express checkout, I know paypal has a address validation check, that if you enter in an incorrect address then select paypal on OSEL, if the address is incorrect, Miva will take you back to OCST with an error message saying to that he address, zip and state don't match.
              Brennan Heyde
              VP Product
              Miva, Inc.
              [email protected]
              https://www.miva.com

              Comment


                #8
                Re: Edit Credit Card Failure Messages in Miva

                Sorry Brennan,

                I'm using PayPal Payments Pro.
                http://www.alphabetsigns.com/

                Comment


                  #9
                  Re: Edit Credit Card Failure Messages in Miva

                  oh got it. Then the code above should work for you as well. You just need to find the exact error message PayFlow Pro returns and test for it in the conditional statements.

                  Or if you know they return certain error codes you could modify the code above slightly to see if an error code is contained within the response error message.

                  Ex:


                  Code:
                  <mvt:if expr="l.settings:messages:error_message_count">    
                      <div class="error-message">        
                          <mvt:foreach iterator="error" array="messages:error_messages">            
                              <mvt:if expr=" '15005' CIN l.settings:error">                
                                  Custom Error Message             
                              <mvt:elseif expr="l.settings:error EQ 'xxxxxx' ">                
                                  Custom Error Message            
                              <mvt:else>                
                                  &mvt:error;            
                               </mvt:if>        
                          </mvt:foreach>    
                      </div>
                  </mvt:if>
                  The CIN operator will do a string comparison, basically "Does the text 15005 appear within the error message"
                  Last edited by Brennan; 09-26-12, 08:53 AM.
                  Brennan Heyde
                  VP Product
                  Miva, Inc.
                  [email protected]
                  https://www.miva.com

                  Comment


                    #10
                    Re: Edit Credit Card Failure Messages in Miva

                    Thank you.
                    http://www.alphabetsigns.com/

                    Comment


                      #11
                      Re: Edit Credit Card Failure Messages in Miva

                      I had problems finding the l.settings:messages:error_messages array.

                      I have a MMUI store and use PayPal Website Payments Pro.

                      I have the messages item assigned to the OPAY page so I then assigned the mmui_messages item but could still not return the error messages as a local variable.

                      My token list returned:

                      Code:
                      g.error_code     &mvt:global:error_code;     EOF
                      g.error_db_eof     &mvt:global:error_db_eof;     1
                      g.error_message     &mvt:global:error_message;     No records found: MER-TUI-DTB-00120
                      g.error_message_count     &mvt:global:error_message_count;     1
                      g.error_messages[1]     &mvt:global:error_messages[1];     Unable to authorize payment: This transaction cannot be processed. Please enter a valid credit card number and type. (10527) // Error 10527 for testing purposes
                      So I needed to use the toolbelt to reference the global array as a local all_settings array.


                      Code:
                          <mvt:item name="ry_toolbelt" param="reference|l.all_settings:error_messages|g.error_messages" />
                          <mvt:if expr="g.error_message_count">    
                              <div>        
                                  <mvt:foreach iterator="error_message" array="error_messages">            
                                      <mvt:if expr="l.all_settings:error_message CIN '15005'">                
                                          <span style="color:red;">This transaction has been declined by your credit card company. We have no knowledge why this transaction has been declined, it could be for any number of reasons. Please contact your credit card company and try again or use a different credit card. Error 15005.</span>             
                                  <mvt:else>                
                                          <span style="color:red;">&mvt:error_message;</span>            
                                       </mvt:if>        
                                  </mvt:foreach>    
                              </div>
                          </mvt:if>
                      Why are my error_messages being returned as a global variable instead of local?
                      http://www.alphabetsigns.com/

                      Comment


                        #12
                        Re: Edit Credit Card Failure Messages in Miva

                        Brennan,

                        Thanks for the info, I am not as interested in changing the error message, but adding something in when an error message appears, so based on what you said above I should do the following...correct?

                        <mvt:if expr="l.settings:messages:error_message_count">
                        <div class="error-message">
                        <mvt:foreach iterator="error" array="messages:error_messages">
                        &mvt:error; (place my custom message here)
                        </mvt:foreach>
                        </div>
                        </mvt:if>

                        Thanks for your time...

                        Comment


                          #13
                          Re: Edit Credit Card Failure Messages in Miva

                          Yes that is how you would do it. Just keep in mind, that custom messaging will show for all error massages on that page.
                          Brennan Heyde
                          VP Product
                          Miva, Inc.
                          [email protected]
                          https://www.miva.com

                          Comment


                            #14
                            Re: Edit Credit Card Failure Messages in Miva

                            Brennan,

                            I went to the OPAY page and looked for the error message area to make that change and it does not appear on my site. This is what I had?

                            <mvt:if expr="NOT ISNULL l.settings:payment:message">
                            <mvt:item name="fonts" param="body_font">
                            &mvt:payment:message;<br>
                            </mvt:item>
                            </mvt:if>
                            <table border="0" cellpadding="2" cellspacing="0">
                            <mvt:foreach array="payment:fields" iterator="field">
                            <tr><td align="left" valign="middle">
                            <mvt:item name="fonts" param="body_font">
                            <mvt:if expr="l.settings:field:invalid">
                            <font color="red"><b>&mvt:field:prompt;</b></font>
                            <mvt:else>
                            <b>&mvt:field:prompt;</b>
                            </mvt:if>
                            </mvt:item>

                            Comment


                              #15
                              Re: Edit Credit Card Failure Messages in Miva

                              For anyone looking for code on how to change the error messages in MMUI it needs to be done though Javascript:

                              Code:
                              <head>
                              <style>
                              #error-messages{
                                   display:none;
                              }
                              </style>
                               
                              <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
                              <script>
                              $(document).ready(function() {
                                  // get the html contents of the error-messages div
                                  var message = $('#error-messages').html();
                               
                                      if(message.indexOf("One or more required fields were not filled out correctly.") != -1){
                                       //error message was found, lets change it
                                          $('#error-messages').html('<font color="red"><b>This is the new error message</b></font><br><br>');
                                       }
                               
                                      //show the messages div
                                       $('#error-messages').show();
                               
                                       });
                              </script>
                              </head>
                               
                              <div id="error-messsages">
                                  <mvt:item name="messages" />
                              </div>
                              Last edited by Brennan; 10-11-12, 08:32 AM.
                              Brennan Heyde
                              VP Product
                              Miva, Inc.
                              [email protected]
                              https://www.miva.com

                              Comment

                              Working...
                              X