$versions{'AuthorizeNetSIM-mgr_lib.pl'} = '06.6.00.0000';
#
# For the Credit Card Processing Gateway AuthorizeNet
# SIM version
# Requires AgoraCart version 06.6.00.000 or above.
#
#####################################################################
#
# AgoraCart and all associated files, except where noted, are
# Copyright 2001 to Present jointly by K-Factor Technologies, Inc.
# and by C E Mayo (aka Mister Ed) at AgoraCart.com & K-Factor.net
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This copyright notice may not be removed or altered in any way.
#
#######################################################################
#                    Order Form Definition Variables
#######################################################################
add_codehook( 'gateway_admin_screen',  'AuthNetSIM_mgr_check' );
add_codehook( 'gateway_admin_settings', 'AuthNetSIM_settings' );
$mc_gateways .= "|AuthorizeNetSIM::AuthorizeNet SIM";
$tstamptemp = time;
##############################################################################
sub AuthNetSIM_settings {
    if ( $sc_gateway_name eq 'AuthorizeNetSIM' ) {

        $AuthNetSIM_x_description = my_escape( $in{'AuthNetSIM_x_description'} );
        $AuthNetSIM_x_header_html_payment_form = my_escape( $in{'AuthNetSIM_x_header_html_payment_form'} );
        $AuthNetSIM_x_footer_html_payment_form = my_escape( $in{'AuthNetSIM_x_footer_html_payment_form'} );
        $AuthNetSIM_x_header_html_receipt = my_escape( $in{'AuthNetSIM_x_header_html_receipt'} );
        $AuthNetSIM_x_footer_html_receipt = my_escape( $in{'AuthNetSIM_x_footer_html_receipt'} );
        $AuthNetSIM_x_header_email_receipt = my_escape( $in{'AuthNetSIM_x_header_email_receipt'} );
        $AuthNetSIM_x_footer_email_receipt = my_escape( $in{'AuthNetSIM_x_footer_email_receipt'} );
        $AuthnetSIM_verify_message = my_escape( $in{'AuthnetSIM_verify_message'} );
        $AuthNetSIM_tos_display_address = my_escape( $in{'AuthNetSIM_tos_display_address'} );
        $AuthNetSIM_top_message = my_escape( $in{'AuthNetSIM_top_message'} );
        $AuthNetSIM_special_message = my_escape( $in{'AuthNetSIM_special_message'} );

        open( GW, "> $gateway_settings" )
          || my_die("Can't Open $gateway_settings");
        print( GW "\$AuthNetSIM_gateway_username = '$in{'AuthNetSIM_gateway_username'}';\n" );
        print( GW "\$AuthNetSIM_txnkey = '$in{'AuthNetSIM_txnkey'}';\n" );
        print( GW "\$AuthNetSIM_tstamp2 = '$in{'AuthNetSIM_tstamp2'}';\n" );
        print( GW "\$AuthNetSIM_tstamp3 = '$in{'AuthNetSIM_tstamp3'}';\n" );
        if ( $in{'live_mode'} eq 'no' ) {
            print( GW "\$AuthNetSIM_order_script_url = \"https://test.authorize.net/gateway/transact.dll\";\n" );
        }
        else {
            print( GW "\$AuthNetSIM_order_script_url = \"https://secure2.authorize.net/gateway/transact.dll\";\n" );
        }
        print( GW "\$AuthNetSIM_x_logo_url = \"$in{'AuthNetSIM_x_logo_url'}\";\n" );
        print( GW "\$AuthNetSIM_x_color_background = \"$in{'AuthNetSIM_x_color_background'}\";\n" );
        print( GW "\$AuthNetSIM_x_color_link = \"$in{'AuthNetSIM_x_color_link'}\";\n" );
        print( GW "\$AuthNetSIM_x_color_text = \"$in{'AuthNetSIM_x_color_text'}\";\n" );
        print( GW "\$AuthNetSIM_x_description = \"$AuthNetSIM_x_description\";\n" );
        print( GW "\$AuthNetSIM_x_header_html_payment_form = qq|$AuthNetSIM_x_header_html_payment_form|;\n" );
        print( GW "\$AuthNetSIM_x_footer_html_payment_form = qq|$AuthNetSIM_x_footer_html_payment_form|;\n" );
        print( GW "\$AuthNetSIM_x_header_html_receipt = qq|$AuthNetSIM_x_header_html_receipt|;\n" );
        print( GW "\$AuthNetSIM_x_footer_html_receipt = qq|$AuthNetSIM_x_footer_html_receipt|;\n" );
        print( GW "\$AuthNetSIM_x_header_email_receipt = qq|$AuthNetSIM_x_header_email_receipt|;\n" );
        print( GW "\$AuthNetSIM_x_footer_email_receipt = qq|$AuthNetSIM_x_footer_email_receipt|;\n" );
        print( GW "\$AuthNetSIM_x_receipt_link_text = qq|$in{'AuthNetSIM_x_receipt_link_text'}|;\n" );
        print( GW "\$AuthNetSIM_merchant_live_mode = \"$in{'live_mode'}\";\n" );
        print( GW "\$AuthnetSIM_verify_message = \"$AuthnetSIM_verify_message\";\n" );
        print( GW "\$AuthNetSIM_display_checkout_tos = \"$in{'AuthNetSIM_display_checkout_tos'}\";\n" );
        print( GW "\$AuthNetSIM_tos_display_address = qq|$AuthNetSIM_tos_display_address|;\n" );
        print( GW "\$AuthNetSIM_sale_mode = '$in{'AuthNetSIM_sale_mode'}';\n" );
        print( GW "\$AuthNetSIM_email_template = \"$in{'AuthNetSIM_email_template'}\";\n" );
        print( GW "\$AuthNetSIM_admin_email_template = \"$in{'AuthNetSIM_admin_email_template'}\";\n" );
        print( GW "\$AuthNetSIM_verifytable = \"$in{'AuthNetSIM_verifytable'}\";\n" );
        print( GW "\$AuthNetSIM_thankstable = \"$in{'AuthNetSIM_thankstable'}\";\n" );
        print( GW "\$AuthNetSIM_top_message = \"$AuthNetSIM_top_message\";\n" );
        print( GW "\$AuthNetSIM_special_message = \"$AuthNetSIM_special_message\";\n" );
        print( GW "\$AuthNetSIM_show_table = \"$in{'show_table'}\";\n" );

        print( GW "#\n1\;\n" );
        close(GW);

    }
}
##############################################################################
sub AuthNetSIM_mgr_check {
    if ( $sc_gateway_name eq 'AuthorizeNetSIM' ) {
        print_AuthNetSIM_mgr_form();
        call_exit();
    }
}
##############################################################################
sub print_AuthNetSIM_mgr_form {

    print &$manager_page_header( 'AuthorizeNet SIM Gateway', '', '', '', '' );

    $mc_email_admin_plates = read_templatedirs($sc_emailPlates_dir, 'admin_emailPlate');
    $mc_email_plates = read_templatedirs($sc_emailPlates_dir, 'emailPlate');
    $mc_verifytable_plates = read_templatedirs($sc_cartverifyplates_dir, 'verifyTable');
    $mc_thanktable_plates = read_templatedirs($sc_thankyouplates_dir, 'thanksTable');


    if ( $AuthNetSIM_x_receipt_link_text eq '' )  {
        $AuthNetSIM_x_receipt_link_text = q{YOU MUST CLICK HERE TO FINALIZE YOUR ORDER!};
    }

    print <<ENDOFTEXT;
<h1 class='mgr-page-title'>AuthorizeNet SIM</h1>
<p><br></p>

<p class="well">$msg<br><br><b>How this solution works:</b> This is solution is a legacy payment method that is still supported by Authorize.Net. The customer fills out a secure form in your store's checkout, then submits to a verify page where they double check their shipping information, and then they are sent to a hosted form at Authorize.net where they enter their payment details and make payment. Upon completion, they are sent back to your store where a confirmation is emailed tothe customer and a thank you page displayed.</p>
<p><br></p>

ENDOFTEXT

if ( $in{'system_edit_success'} ) {
    $page_output .= qq|
<div class="row col-xs-12 col-sm-12 col-md-12 col-lg-12 hidden-xs">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 bg-success">
<h4 class="text-primary mgr-center">AuthorizeNet SIM settings have been successfully updated</h4>
</div>
</div>
<p><br><br><br><br><br></p>
|;
}

    print <<ENDOFTEXT;

<form action="manager.cgi" method="post"><input type="hidden" name="mgr_seshun" value="$in{'mgr_seshun'}">


<p><b>Run in Production/Live mode? &nbsp; <a data-toggle="collapse" href="#setAuthNettoTLive" aria-expanded="false" aria-controls="setAuthNettoTLive"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><select name="live_mode">
<option selected>$AuthNetSIM_merchant_live_mode</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="setAuthNettoTLive">
    <div class="well">
    <p><b>yes</b> switches the AuthorizeNet SIM gateway to a production / live mode.</p>
    <p><b>no</b> switches the AuthorizeNet SIM gateway to a test mode mode.</p>
    </div>
</div>

<p><hr></p>

<p><b>API Login ID:</b><input name="AuthNetSIM_gateway_username" type="text" class="form-control" maxlength="50" value="$AuthNetSIM_gateway_username" required></p>
<p><hr></p>

<p><b>Transaction Key: &nbsp; <a data-toggle="collapse" href="#authnetTransID" aria-expanded="false" aria-controls="authnetTransID"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="AuthNetSIM_txnkey" type="text" class="form-control" maxlength="50" value="$AuthNetSIM_txnkey" required></p>
<div class="collapse" id="authnetTransID">
  <div class="well">
    <p><b>Transaction Key</b><br>
    To get the actual 'Transaction Key' value for above go into your control panel at Authorize.net<br><br>
    1) Click on settings<br>
    2) Click on 'Obtain Transaction Key' under the security section.<br>
    3) Enter your 'Secret Answer' and click Submit. Your secret answer should be what you used when you first set up your account.</p>
    <p><br></p>
    <p>NOTE: Someone reported that after you generate/change the Transaction Key it may take about a half hour for this to become active.... if you experience problems at first you may want to wait a while to make sure that this is not the problem.</p>
  </div>
</div>

<p><hr></p>

<p><b>Time Stamp: &nbsp; <a data-toggle="collapse" href="#authnetTimeStamp" aria-expanded="false" aria-controls="authnetTimeStamp"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="tstamptemp" type="text" class="form-control" maxlength="30" value="$tstamptemp"></p>
<div class="collapse" id="authnetTimeStamp">
  <div class="well">
    <p>If you get error 97 you may have to adjust your timestamp to match Authorize.net's clock. If no errors, do not make any adjustments to the timestamp.</p>
    <p>Format: UTC time in seconds since January 1, 1970.</p>
    <p>Notes: Coordinated Universal Time (UTC) is an international atomic standard of time (sometimes referred to as GMT). Using a local time zone timestamp will cause authentication to fail.</p>
    <p>If the timestamp is more than 1 hour old or more than 15 minutes into the future, it is rejected.</p>
    <p>Adjustment: 60 = 1 minute, 3600 = 1 hour</p>
  </div>
</div>
<p><br></p>
Adjust up or down:
<select name="AuthNetSIM_tstamp3">
<option>$AuthNetSIM_tstamp3</option>
<option>add</option>
<option>subtract</option>
</select><br><br>
How many seconds:<br>
<input name="AuthNetSIM_tstamp2" type="text" size=20
value='$AuthNetSIM_tstamp2'><br>

<p><hr></p>

<p><b>Secure URL to the Authorize.Net server: &nbsp; <a data-toggle="collapse" href="#authnetOrderURL" aria-expanded="false" aria-controls="authnetOrderURL"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="order_url" type="text" class="form-control" maxlength="80" value="$AuthNetSIM_order_script_url"></p>
<div class="collapse" id="authnetOrderURL">
  <div class="well">
    <p>This will be automatically populated via the <b>Run in Production/Live mode</b> answer supplied above.</p>
    <p>Production/Live URL: https://secure2.authorize.net/gateway/transact.dll</p>
    <p>Test URL (must have test account setup): https://test.authorize.net/gateway/transact.dll</p>
  </div>
</div>

<p><hr></p>


<p><b>Order Description: &nbsp; <a data-toggle="collapse" href="#authnetOrderDescript" aria-expanded="false" aria-controls="authnetOrderDescript"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="AuthNetSIM_x_description" type="text" class="form-control" maxlength="80" value="$AuthNetSIM_x_description"></p>
<div class="collapse" id="authnetOrderDescript">
  <div class="well">
    <p>Used as the email title for customer confirmation emails from your store.</p>
    <p>For this field to be included on the hosted payment form at Authorize.Net, the View attribute for the field must
be configured in the Merchant Interface payment form settings.</p>
  </div>
</div>

<p><hr></p>

<p><b>Transaction Type: &nbsp; <a data-toggle="collapse" href="#authnetTransType" aria-expanded="false" aria-controls="authnetTransType"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><select name="AuthNetSIM_sale_mode">
<option selected>$AuthNetSIM_sale_mode</option>
<option>AUTH_CAPTURE</option>
<option>AUTH_ONLY</option>
</select></p>
<div class="collapse" id="authnetTransType">
    <div class="well">
        <p><b>AUTH_CAPTURE</b> Is the default and will authorize and capture the sale/order/funds.</p>
        <p><b>AUTH_ONLY</b> authorizes the funds only. To capture &amp; complete the sales, you must visit the merchant control panel at Authorize.net to perform such processes.</p>
    </div>
</div>

<p><hr></p>
<p><br></p>

<h3 class='mgr-page-title'>Customize Cart Form Msgs, Receipts, &amp; Emails</h3>
<p><br></p>

<p><b>Order Form - Top Message: &nbsp; <a data-toggle="collapse" href="#authnetFormTopMess" aria-expanded="false" aria-controls="authnetFormTopMess"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthNetSIM_top_message" class="form-control" maxlength="300" rows=8 wrap="on">$AuthNetSIM_top_message</textarea></p>
<div class="collapse" id="authnetFormTopMess">
    <div class="well">
        <p>Allows you to place a message above the Payment Information area and just below the cart total boxes.</p>
        <p>HTML formatting (for text color, font, spacing, etc) is accepted.</p>
        <p>Leave blank if not needed.</p>
    </div>
</div>

<p><hr></p>

<p><b>Order Form - Special Instructions Message: &nbsp; <a data-toggle="collapse" href="#authnetFormSpecMess" aria-expanded="false" aria-controls="authnetFormSpecMess"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthNetSIM_special_message" class="form-control" maxlength="300" rows=8 wrap="on">$AuthNetSIM_special_message</textarea></p>
<div class="collapse" id="authnetFormSpecMess">
    <div class="well">
        <p>Allows you to place a message above the discount code and/or comments box towards the bottom of the Customer Information area in a default order form.</p>
        <p>HTML formatting (for text color, font, spacing, etc) is accepted.</p>
        <p>Leave blank if not needed.</p>
    </div>
</div>

<p><hr></p>

<p><b>Verify Page - Special Instructions Message: &nbsp; <a data-toggle="collapse" href="#authnetVerifyTopMess" aria-expanded="false" aria-controls="authnetVerifyTopMess"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthnetSIM_verify_message" class="form-control" maxlength="300" rows=8 wrap="on">$AuthnetSIM_verify_message</textarea></p>
<div class="collapse" id="authnetVerifyTopMess">
    <div class="well">
        <p>Top message for confirmation page, the page just before going to the hosted page at the gateway. This allows you to place a message above the Payment Information area and just below the cart total boxes.</p>
        <p>HTML formatting (for text color, font, spacing, etc) is accepted.</p>
        <p>Leave blank if not needed.</p>
    </div>
</div>

<p><hr></p>

<p><b>Display ToS &amp; Refund Policy checkbox? &nbsp; <a data-toggle="collapse" href="#authnetDisplayTOS" aria-expanded="false" aria-controls="authnetDisplayTOS"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><select name="AuthNetSIM_display_checkout_tos" required>
<option>$AuthNetSIM_display_checkout_tos</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="authnetDisplayTOS">
    <div class="well">
        <p><b>yes</b> displays <b>Terms of Service and Refund Policy</b> checkbox, and the field is set as <i>required</i> in order for customer to proceed with the additional checkout steps.</p>
        <p><b>no</b> nothing is displayed.</p>
        <p><b>Best Practice:</b> set to <i>YES</i>. Some countries and/or payment processors require customers to be notified of the return and shipping policies, and this is a good place to remind them to read and agree your store/site policies.
    </div>
</div>

<p><br></p>

<p><b>Business address &amp; contact information for your business: &nbsp; <a data-toggle="collapse" href="#authnetTOSaddress" aria-expanded="false" aria-controls="authnetTOSaddress"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><textarea name="AuthNetSIM_tos_display_address" type="text" class="form-control" required maxlength="400" rows=5 wrap="on">$AuthNetSIM_tos_display_address</textarea></p>
<div class="collapse" id="authnetTOSaddress">
  <div class="well">
    <p>Displays the required business address and contact infomration if the <b>Display TOS</b> option is enabled above.</p>
    <p>Should be legal address for the business location for full disclosure and other privacy requirements mandated by credit card companies as well as government enitities that require such notices.</p>
    <p>HTML formatting (for text color, font, spacing, etc) is accepted.</p>
  </div>
</div>

<p><hr></p>

<p><b>Select Email Template for Emails Sent to Customers: &nbsp; <a data-toggle="collapse" href="#authnetEmailTemp" aria-expanded="false" aria-controls="authnetEmailTemp"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><select name="AuthNetSIM_email_template" required>
<option>$AuthNetSIM_email_template</option>
$mc_email_plates
</select></p>
<div class="collapse" id="authnetEmailTemp">
    <div class="well">
        <p>This is the template used to generate the email confirmations sent to your customers.</p>
    </div>
</div>

<p><hr></p>

<p><b>Select Email Template for Emails Sent to Site Admin: &nbsp; <a data-toggle="collapse" href="#authnetAdminEmailTemp" aria-expanded="false" aria-controls="authnetAdminEmailTemp"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><select name="AuthNetSIM_admin_email_template" required>
<option>$AuthNetSIM_admin_email_template</option>
$mc_email_admin_plates
</select></p>
<div class="collapse" id="authnetAdminEmailTemp">
    <div class="well">
        <p>This is the template used to generate the email confirmations sent to you.</p>
    </div>
</div>

<p><hr></p>

<p><b>Select the Verify Table Template for the Checkout Verify Page: &nbsp; <a data-toggle="collapse" href="#authnetVerifyCheckoutTemp" aria-expanded="false" aria-controls="authnetVerifyCheckoutTemp"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><select name="AuthNetSIM_verifytable" required>
<option>$AuthNetSIM_verifytable</option>
$mc_verifytable_plates
</select></p>
<div class="collapse" id="authnetVerifyCheckoutTemp">
    <div class="well">
        <p>This is the template used to generate the verify page that the customer uses to verify their order information.</p>
        <p>It is the page displayed immediately before going to the the hosted payment page at Authorize.net</p>
    </div>
</div>

<p><hr></p>

<p><b>Select the Thankyou Table Template for the Successful Payment Return Page: &nbsp; <a data-toggle="collapse" href="#authnetThanksTemp" aria-expanded="false" aria-controls="authnetThanksTemp"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><select name="AuthNetSIM_thankstable" required>
<option>$AuthNetSIM_thankstable</option>
$mc_thanktable_plates
</select></p>
<div class="collapse" id="authnetThanksTemp">
    <div class="well">
        <p>This is the template used to generate the thankyou page that the customer lands on at your store after completing their payment at the hosted form at Authorize.net.</p>
    </div>
</div>

<p><hr></p>

<p><b>Show cart contents table on browser receipt after order completion? &nbsp; <a data-toggle="collapse" href="#authnetShowCartTable" aria-expanded="false" aria-controls="authnetShowCartTable"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><select name="show_table" required>
<option>$AuthNetSIM_show_table</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="authnetShowCartTable">
    <div class="well">
        <p>If you wish the customer to see a cart contents tble showing what they ordered on th thankyou page, after the payment has been completed, then set to YES.</p>
    </div>
</div>

<p><hr></p>
<p><br></p>

<h3 class='mgr-page-title'>Customize Hosted Form &amp; Receipt at Authorize.Net</h3>
<p><br></p>

<p><b>AuthNet Hosted Form - Logo URL: &nbsp; <a data-toggle="collapse" href="#authnetHostedLogo" aria-expanded="false" aria-controls="authnetHostedLogo"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="AuthNetSIM_x_logo_url" type="text" class="form-control" maxlength="100" value="$AuthNetSIM_x_logo_url"></p>
<div class="collapse" id="authnetHostedLogo">
  <div class="well">
    <p>Complete URL to the logo you'd like to display on the hosted order form displayed at Authorize.net.</p>
    <p>This <b>MUST</b> be a secure https URL.</p>
    <p>Leave blank, if not needed.</p>
  </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Form - Background Color: &nbsp; <a data-toggle="collapse" href="#authnetBGcolor" aria-expanded="false" aria-controls="authnetBGcolor"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="AuthNetSIM_x_color_background">
<option>$AuthNetSIM_x_color_background</option>
<option value="">None</option>
<option value="#00FFFF">AQUA</option>
<option value="#000000">BLACK</option>
<option value="#0000FF">BLUE</option>
<option value="#FF00FF">FUCHSIA</option>
<option value="#808080">GRAY</option>
<option value="#008000">GREEN</option>
<option value="#00FF00">LIME</option>
<option value="#800000">MAROON</option>
<option value="#000080">NAVY</option>
<option value="#808000">OLIVE</option>
<option value="#800080">PURPLE</option>
<option value="#FF0000">RED</option>
<option value="#C0C0C0">SILVER</option>
<option value="#008080">TEAL</option>
<option value="#FFFFFF">WHITE</option>
<option value="#FFFF00">YELLOW</option>
</select></p>
<div class="collapse" id="authnetBGcolor">
  <div class="well">
    <p>Background color of the hosted order form displayed at Authorize.net.</p>
    <p>Leave blank, if not needed.</p>
  </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Form - Text Color: &nbsp; <a data-toggle="collapse" href="#authnetTextColor" aria-expanded="false" aria-controls="authnetTextColor"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="AuthNetSIM_x_color_text">
<option>$AuthNetSIM_x_color_text</option>
<option value="">None</option>
<option value="#00FFFF">AQUA</option>
<option value="#000000">BLACK</option>
<option value="#0000FF">BLUE</option>
<option value="#FF00FF">FUCHSIA</option>
<option value="#808080">GRAY</option>
<option value="#008000">GREEN</option>
<option value="#00FF00">LIME</option>
<option value="#800000">MAROON</option>
<option value="#000080">NAVY</option>
<option value="#808000">OLIVE</option>
<option value="#800080">PURPLE</option>
<option value="#FF0000">RED</option>
<option value="#C0C0C0">SILVER</option>
<option value="#008080">TEAL</option>
<option value="#FFFFFF">WHITE</option>
<option value="#FFFF00">YELLOW</option>
</select></p>
<div class="collapse" id="authnetTextColor">
  <div class="well">
    <p>Text color used within the hosted order form displayed at Authorize.net.</p>
    <p>Leave blank, if not needed.</p>
  </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Form - Link Color: &nbsp; <a data-toggle="collapse" href="#authnetLinkColor" aria-expanded="false" aria-controls="authnetLinkColor"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="AuthNetSIM_x_color_link">
<option>$AuthNetSIM_x_color_link</option>
<option value="">None</option>
<option value="#00FFFF">AQUA</option>
<option value="#000000">BLACK</option>
<option value="#0000FF">BLUE</option>
<option value="#FF00FF">FUCHSIA</option>
<option value="#808080">GRAY</option>
<option value="#008000">GREEN</option>
<option value="#00FF00">LIME</option>
<option value="#800000">MAROON</option>
<option value="#000080">NAVY</option>
<option value="#808000">OLIVE</option>
<option value="#800080">PURPLE</option>
<option value="#FF0000">RED</option>
<option value="#C0C0C0">SILVER</option>
<option value="#008080">TEAL</option>
<option value="#FFFFFF">WHITE</option>
<option value="#FFFF00">YELLOW</option>
</select></p>
<div class="collapse" id="authnetLinkColor">
  <div class="well">
    <p>Color of HTML links used within the hosted order form displayed at Authorize.net.</p>
    <p>Leave blank, if not needed.</p>
  </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Form - Receipt Page Link / Button Text: &nbsp; <a data-toggle="collapse" href="#authnetLinkText" aria-expanded="false" aria-controls="authnetLinkText"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="AuthNetSIM_x_receipt_link_text" type="text" class="form-control" maxlength="50" value="$AuthNetSIM_x_receipt_link_text"></p>
<div class="collapse" id="authnetLinkText">
  <div class="well">
    <p>The text of the link or button that directs the customer back to the your store.</p>
    <p>50 character maximum.</p>
  </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Form - Top Header/Text: &nbsp; <a data-toggle="collapse" href="#authnetTopHeader" aria-expanded="false" aria-controls="authnetTopHeader"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthNetSIM_x_header_html_payment_form" class="form-control" maxlength="400" rows=6 wrap="on">$AuthNetSIM_x_header_html_payment_form</textarea></p>
<div class="collapse" id="authnetTopHeader">
    <div class="well">
        <p>The text submitted in this field is displayed as the header on the hosted payment form.</p>
        <p>Avoid using double quotes.</p>
    </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Form - Bottom Footer/Text: &nbsp; <a data-toggle="collapse" href="#authnetBottFooter" aria-expanded="false" aria-controls="authnetBottFooter"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthNetSIM_x_footer_html_payment_form" class="form-control" maxlength="400" rows=6 wrap="on">$AuthNetSIM_x_footer_html_payment_form</textarea></p>
<div class="collapse" id="authnetBottFooter">
    <div class="well">
        <p>The text submitted in this field is displayed as the footer on the hosted payment form.</p>
        <p>Avoid using double quotes.</p>
    </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Receipt - Top Header/Text: &nbsp; <a data-toggle="collapse" href="#authnetRTopHeader" aria-expanded="false" aria-controls="authnetRTopHeader"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthNetSIM_x_header_html_receipt" class="form-control" maxlength="400" rows=6 wrap="on">$AuthNetSIM_x_header_html_receipt</textarea></p>
<div class="collapse" id="authnetRTopHeader">
    <div class="well">
        <p>The text submitted in this field is displayed at the top of the hosted receipt page.</p>
        <p>Avoid using double quotes.</p>
    </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Receipt - Bottom Footer/Text: &nbsp; <a data-toggle="collapse" href="#authnetRBottFooter" aria-expanded="false" aria-controls="authnetRBottFooter"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthNetSIM_x_footer_html_receipt" class="form-control" maxlength="400" rows=6 wrap="on">$AuthNetSIM_x_footer_html_receipt</textarea></p>
<div class="collapse" id="authnetRBottFooter">
    <div class="well">
        <p>The text that you submit in this field is displayed at the bottom of the hosted receipt page.</p>
        <p>Avoid using double quotes.</p>
    </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Customer Email - Top Header/Text: &nbsp; <a data-toggle="collapse" href="#authnetETopHeader" aria-expanded="false" aria-controls="authnetETopHeader"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthNetSIM_x_header_email_receipt" class="form-control" maxlength="400" rows=6 wrap="on">$AuthNetSIM_x_header_email_receipt</textarea></p>
<div class="collapse" id="authnetETopHeader">
    <div class="well">
        <p>This text appears as the header of the email receipt sent to the customer from Authorize.net</p>
        <p>These emails are separate from the emails with cart details that are sent to the customer from your store.</p>
    </div>
</div>

<p><hr></p>

<p><b>AuthNet Hosted Customer Email - Bottom Footer/Text: &nbsp; <a data-toggle="collapse" href="#authnetEBottFooter" aria-expanded="false" aria-controls="authnetEBottFooter"><i class="fa fa-info-circle"></i></a></b> <span style="padding-left: 20px;"></span><textarea name="AuthNetSIM_x_footer_email_receipt" class="form-control" maxlength="400" rows=6 wrap="on">$AuthNetSIM_x_footer_email_receipt</textarea></p>
<div class="collapse" id="authnetEBottFooter">
    <div class="well">
    <p>This text appears as the footer of the email receipt sent to the customer from Authorize.net</p>
    <p>These emails are separate from the emails with cart details that are sent to the customer from your store.</p>
    </div>
</div>

<p><br></p>
<p><br></p>

<input type="hidden" name="system_edit_success" value="yes">
<input name="GatewaySettings" type="hidden" value="Submit">
<input type="hidden" name="gateway" value="AuthorizeNetSIM">
<button class="btn btn-primary btn-lg mgr-center" style="display: block;">Submit AuthorizeNet SIM Settings Updates</button>
<p><br><br><br></p>
</form>

ENDOFTEXT
    print &$manager_page_footer;
}
##############################################################################
1;
