function registerSettings()
    {
        ?>
		gatewayHandlers.register('<?php 
        echo addslashes(gateway_path(__FILE__));
        ?>
','testmode-settings');
		<?php 
    }
 function settings_payments()
 {
     global $Shopp;
     if (!current_user_can('manage_options')) {
         wp_die(__('You do not have sufficient permissions to access this page.'));
     }
     // $gateway_dir = SHOPP_PATH.DIRECTORY_SEPARATOR."gateways".DIRECTORY_SEPARATOR;
     $payment_gateway = gateway_path($this->Settings->get('payment_gateway'));
     if (!empty($_POST['save'])) {
         check_admin_referer('shopp-settings-payments');
         // Update the accepted credit card payment methods
         if (!empty($_POST['settings']['payment_gateway']) && file_exists(SHOPP_GATEWAYS . $_POST['settings']['payment_gateway'])) {
             $gateway = $this->scan_gateway_meta(SHOPP_GATEWAYS . $_POST['settings']['payment_gateway']);
             $ProcessorClass = $gateway->tags['class'];
             // Load the gateway in case there are any save-time processes to be run
             $Processor = $Shopp->gateway($_POST['settings']['payment_gateway'], true);
             $_POST['settings']['gateway_cardtypes'] = $_POST['settings'][$ProcessorClass]['cards'];
         }
         if (is_array($_POST['settings']['xco_gateways'])) {
             foreach ($_POST['settings']['xco_gateways'] as &$gateway) {
                 $gateway = str_replace("\\", "/", stripslashes($gateway));
                 if (!file_exists(SHOPP_GATEWAYS . $gateway)) {
                     continue;
                 }
                 $meta = $this->scan_gateway_meta(SHOPP_GATEWAYS . $gateway);
                 $_POST['settings'][$ProcessorClass]['path'] = str_replace("\\", "/", stripslashes($_POST['settings'][$ProcessorClass]['path']));
                 $ProcessorClass = $meta->tags['class'];
                 // Load the gateway in case there are any save-time processes to be run
                 $Processor = $Shopp->gateway($gateway);
             }
         }
         do_action('shopp_save_payment_settings');
         $this->settings_save();
         $payment_gateway = stripslashes($this->Settings->get('payment_gateway'));
         $updated = __('Shopp payments settings saved.', 'Shopp');
     }
     // Get all of the installed gateways
     $data = $this->settings_get_gateways();
     $gateways = array();
     $LocalProcessors = array();
     $XcoProcessors = array();
     foreach ($data as $gateway) {
         $ProcessorClass = $gateway->tags['class'];
         include_once $gateway->file;
         $processor = new $ProcessorClass();
         if (isset($processor->type) && strtolower($processor->type) == "xco") {
             $XcoProcessors[] = $processor;
         } else {
             $gateways[gateway_path($gateway->file)] = $gateway->name;
             $LocalProcessors[] = $processor;
         }
     }
     include SHOPP_ADMINPATH . "/settings/payments.php";
 }
    function settings()
    {
        ?>
			<th scope="row" valign="top"><label for="2co-enabled">2Checkout.com</label></th> 
			<td><input type="hidden" name="settings[_2Checkout][billing-required]" value="off" /><input type="hidden" name="settings[_2Checkout][enabled]" value="off" /><input type="checkbox" name="settings[_2Checkout][enabled]" value="on" id="2co-enabled"<?php 
        echo $this->settings['enabled'] == "on" ? ' checked="checked"' : '';
        ?>
/><label for="2co-enabled"> <?php 
        _e('Enable', 'Shopp');
        ?>
 2Checkout.com</label>
				<div id="2co-settings">
		
				<p><input type="text" name="settings[_2Checkout][sid]" id="2co-sid" size="10" value="<?php 
        echo $this->settings['sid'];
        ?>
"/><br />
				<?php 
        _e('Your 2Checkout vendor account number.', 'Shopp');
        ?>
</p>
				<p><label for="2co-verify"><input type="hidden" name="settings[_2Checkout][verify]" value="off" /><input type="checkbox" name="settings[_2Checkout][verify]" id="2co-verify" value="on"<?php 
        echo $this->settings['verify'] == "on" ? ' checked="checked"' : '';
        ?>
 /> <?php 
        _e('Enable order verification', 'Shopp');
        ?>
</label></p>
				<p id="2co-verify-secret" class="hidden"><input type="text" name="settings[_2Checkout][secret]" id="2co-secret" size="18" value="<?php 
        echo $this->settings['secret'];
        ?>
"/><br />
				<?php 
        _e('Your 2Checkout secret word for order verification.', 'Shopp');
        ?>
</p>				
				<p><label for="2co-testmode"><input type="hidden" name="settings[_2Checkout][testmode]" value="off" /><input type="checkbox" name="settings[_2Checkout][testmode]" id="2co-testmode" value="on"<?php 
        echo $this->settings['testmode'] == "on" ? ' checked="checked"' : '';
        ?>
 /> <?php 
        _e('Enable test mode', 'Shopp');
        ?>
</label></p>
				
				<input type="hidden" name="settings[xco_gateways][]" value="<?php 
        echo gateway_path(__FILE__);
        ?>
"  />
				
				</div>
			</td>
			<script type="text/javascript">
			(function($) {
				$(window).ready(function () {
					$('#2co-verify').change(function () {
						if ($(this).attr('checked')) $('#2co-verify-secret').show();
						else $('#2co-verify-secret').hide();
					}).change();
				});
			})(jQuery)
			</script>
		<?php 
    }
    function settings()
    {
        global $Shopp;
        $buttons = array("w=160&h=43" => "Small (160x43)", "w=168&h=44" => "Medium (168x44)", "w=180&h=46" => "Large (180x46)");
        $styles = array("white" => "On White Background", "trans" => "With Transparent Background");
        ?>
		<th scope="row" valign="top"><label for="googlecheckout-enabled">Google Checkout</label></th> 
		<td><input type="hidden" name="settings[GoogleCheckout][enabled]" value="off" id="googlecheckout-disabled"/><input type="checkbox" name="settings[GoogleCheckout][enabled]" value="on" id="googlecheckout-enabled"<?php 
        echo $this->settings['enabled'] == "on" ? ' checked="checked"' : '';
        ?>
/><label for="googlecheckout-enabled"> <?php 
        _e('Enable', 'Shopp');
        ?>
 Google Checkout</label>
			<div id="googlecheckout-settings">
		
			<p><input type="text" name="settings[GoogleCheckout][id]" id="googlecheckout-id" size="18" value="<?php 
        echo $this->settings['id'];
        ?>
"/><br />
			Enter your Google Checkout merchant ID.</p>
			<p><input type="text" name="settings[GoogleCheckout][key]" id="googlecheckout-key" size="24" value="<?php 
        echo $this->settings['key'];
        ?>
" /><br />
			Enter your Google Checkout merchant key.</p>
		
			<?php 
        if (!empty($this->settings['apiurl'])) {
            ?>
			<p><input type="text" name="settings[GoogleCheckout][apiurl]" id="googlecheckout-apiurl" size="48" value="<?php 
            echo $this->settings['apiurl'];
            ?>
" readonly="readonly" class="select" /><br />
			<strong>Copy this URL to your Google Checkout integration settings API callback URL.</strong></p>
			<?php 
        }
        ?>

			<p><select name="settings[GoogleCheckout][button]">
				<?php 
        echo menuoptions($buttons, $this->settings['button'], true);
        ?>
				</select>
				<select name="settings[GoogleCheckout][buttonstyle]">
					<?php 
        echo menuoptions($styles, $this->settings['buttonstyle'], true);
        ?>
					</select><br />Select the preferred size and style of the Google Checkout button.</p>
					<p><label for="googlecheckout-autocharge"><input type="hidden" name="settings[GoogleCheckout][autocharge]" value="off" /><input type="checkbox" name="settings[GoogleCheckout][autocharge]" id="googlecheckout-autocharge" size="48" value="on"<?php 
        echo $this->settings['autocharge'] == 'on' ? ' checked="checked"' : '';
        ?>
 /> Automatically charge orders</label></p>
			<p><label for="googlecheckout-testmode"><input type="hidden" name="settings[GoogleCheckout][testmode]" value="off" /><input type="checkbox" name="settings[GoogleCheckout][testmode]" id="googlecheckout-testmode" size="48" value="on"<?php 
        echo $this->settings['testmode'] == "on" ? ' checked="checked"' : '';
        ?>
 /> Use the <a href="http://docs.shopplugin.net/Google_Checkout_Sandbox">Google Checkout Sandbox</a></label></p>
			
			<input type="hidden" name="settings[GoogleCheckout][path]" value="<?php 
        echo gateway_path(__FILE__);
        ?>
"  />
			<input type="hidden" name="settings[xco_gateways][]" value="<?php 
        echo gateway_path(__FILE__);
        ?>
"  />
			
			</div>
		</td>
		<?php 
    }
    function settings()
    {
        ?>
			<th scope="row" valign="top"><label for="paypalexpress-enabled">PayPal Express</label></th> 
			<td><input type="hidden" name="settings[PayPalExpress][enabled]" value="off" /><input type="checkbox" name="settings[PayPalExpress][enabled]" value="on" id="paypalexpress-enabled"<?php 
        echo $this->settings['enabled'] == "on" ? ' checked="checked"' : '';
        ?>
/><label for="paypalexpress-enabled"> <?php 
        _e('Enable', 'Shopp');
        ?>
 PayPal Express</label>
				<div id="paypalexpress-settings">
		
				<p><input type="text" name="settings[PayPalExpress][username]" id="paypalxp-username" size="30" value="<?php 
        echo $this->settings['username'];
        ?>
"/><br />
				Enter your PayPal Express API Username.</p>
				<p><input type="password" name="settings[PayPalExpress][password]" id="paypalxp-password" size="16" value="<?php 
        echo $this->settings['password'];
        ?>
" /><br />
				Enter your PayPal Express API Password.</p>
				<p><input type="text" name="settings[PayPalExpress][signature]" id="paypalxp-signature" size="48" value="<?php 
        echo $this->settings['signature'];
        ?>
" /><br />
				Enter your PayPal Express API Signature.</p>
				<p><label for="paypalxp-testmode"><input type="hidden" name="settings[PayPalExpress][testmode]" value="off" /><input type="checkbox" name="settings[PayPalExpress][testmode]" id="paypalxp-testmode" value="on"<?php 
        echo $this->settings['testmode'] == "on" ? ' checked="checked"' : '';
        ?>
 /> Use the <a href="http://docs.shopplugin.net/PayPal_Sandbox" target="shoppdocs">PayPal Sandbox</a></label></p>
				
				<input type="hidden" name="settings[xco_gateways][]" value="<?php 
        echo gateway_path(__FILE__);
        ?>
"  />
				
				</div>
			</td>
		<?php 
    }
    function settings()
    {
        ?>
			<th scope="row" valign="top"><label for="paypalstandard-enabled">PayPal Standard</label></th> 
			<td><input type="hidden" name="settings[PayPalStandard][billing-required]" value="off" /><input type="hidden" name="settings[PayPalStandard][enabled]" value="off" /><input type="checkbox" name="settings[PayPalStandard][enabled]" value="on" id="paypalstandard-enabled"<?php 
        echo $this->settings['enabled'] == "on" ? ' checked="checked"' : '';
        ?>
/><label for="paypalstandard-enabled"> <?php 
        _e('Enable', 'Shopp');
        ?>
 PayPal Standard</label>
				<div id="paypalstandard-settings">
		
				<p><input type="text" name="settings[PayPalStandard][account]" id="paypalstd-account" size="30" value="<?php 
        echo $this->settings['account'];
        ?>
"/><br />
				<?php 
        _e('Enter your PayPal account e-mail.', 'Shopp');
        ?>
</p>
								
				<p><label for="paypalstd-testmode"><input type="hidden" name="settings[PayPalStandard][testmode]" value="off" /><input type="checkbox" name="settings[PayPalStandard][testmode]" id="paypalstd-testmode" value="on"<?php 
        echo $this->settings['testmode'] == "on" ? ' checked="checked"' : '';
        ?>
 /> Use the <a href="http://docs.shopplugin.net/PayPal_Sandbox" target="shoppdocs">PayPal Sandbox</a></label></p>
				
				<input type="hidden" name="settings[PayPalStandard][path]" value="<?php 
        echo gateway_path(__FILE__);
        ?>
"  />
				<input type="hidden" name="settings[xco_gateways][]" value="<?php 
        echo gateway_path(__FILE__);
        ?>
"  />
				
				</div>
			</td>
		<?php 
    }