/**
  * Open log file for writing.
  *
  * @access private
  * @param mixed $handle
  * @return bool success
  */
 private function open($handle)
 {
     if (isset($this->_handles[$handle])) {
         return true;
     }
     if ($this->_handles[$handle] = @fopen(wc_get_log_file_path($handle), 'a')) {
         return true;
     }
     return false;
 }
 /**
  * Open log file for writing.
  *
  * @param string $handle
  * @param string $mode
  * @return bool success
  */
 protected function open($handle, $mode = 'a')
 {
     if (isset($this->_handles[$handle])) {
         return true;
     }
     if ($this->_handles[$handle] = @fopen(wc_get_log_file_path($handle), $mode)) {
         return true;
     }
     return false;
 }
<?php

if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
/**
 * Settings for TrxServices Gateway
 */
return array('enabled' => array('title' => __('Enable/Disable', 'woocommerce-trxservices'), 'label' => __('Enable TrxServices', 'woocommerce-trxservices'), 'type' => 'checkbox', 'description' => '', 'default' => 'no'), 'title' => array('title' => __('Title', 'woocommerce-trxservices'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-trxservices'), 'default' => __('TrxServices', 'woocommerce-trxservices'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'woocommerce-trxservices'), 'type' => 'text', 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-trxservices'), 'default' => 'Pay with TrxServices', 'desc_tip' => true), 'instructions' => array('title' => __('Instructions', 'woocommerce-trxservices'), 'type' => 'textarea', 'description' => __('Instructions that will be added to the thank you page and emails.', 'woocommerce-trxservices'), 'default' => '', 'desc_tip' => true), 'debug' => array('title' => __('Debug Log', 'woocommerce-trxservices'), 'type' => 'checkbox', 'label' => __('Enable logging', 'woocommerce-trxservices'), 'default' => 'no', 'description' => sprintf(__('Log TrxServices events inside <code>%s</code>', 'woocommerce-trxservices'), wc_get_log_file_path($this->id))), 'sandbox' => array('title' => __('Sandbox', 'woocommerce-trxservices'), 'label' => __('Enable Sandbox Mode', 'woocommerce-trxservices'), 'type' => 'checkbox', 'description' => __('Place the payment gateway in sandbox mode (real payments will not be taken).', 'woocommerce-trxservices'), 'default' => 'yes'), 'mode' => array('title' => __('Mode', 'woocommerce'), 'type' => 'select', 'class' => 'wc-enhanced-select', 'description' => __('Credit Sale performs a credit authorization and captures it for settlement in one request. Credit Auth only requests a credit authorization.', 'woocommerce'), 'default' => 'creditsale', 'desc_tip' => true, 'options' => array('creditsale' => __('Credit Sale', 'woocommerce-trxservices'), 'creditauth' => __('Credit Auth', 'woocommerce-trxservices'))));
 /** 
  * Initialise Gateway Settings Form Fields 
  */
 public function init_form_fields()
 {
     $form = array();
     $form['enabled'] = array('title' => __('Enable/Disable', $this->td), 'type' => 'checkbox', 'label' => __('Enable Maksuturva Payment Gateway', $this->td), 'default' => 'yes');
     $form['title'] = array('title' => __('Title', $this->td), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', $this->td), 'default' => __('Maksuturva', $this->td), 'desc_tip' => true);
     $form['description'] = array('title' => __('Customer Message', $this->td), 'type' => 'textarea', 'default' => __('Pay via Maksuturva.', $this->td), 'desc_tip' => true);
     $form['sandbox'] = array('type' => 'checkbox', 'title' => __('Sandbox mode', $this->td), 'default' => 'no', 'description' => __('Maksuturva sandbox can be used to test payments. None of the payments will be real.', $this->td), 'options' => array('yes' => '1', 'no' => '0'));
     /*$form['sandbox_testaccount'] = array(
           'type' => 'checkbox',
           'title' => __('Use test account', $this->td ),
           'default' => 'no',
           'description' => __('Maksuturva sandbox can be used with test accounts. Use only for debugging payment integration.', $this->td ),
           'options' => array( 'yes' => '1', 'no' => '0'),
       );*/
     $form['debug'] = array('type' => 'checkbox', 'title' => __('Debug Log', $this->td), 'default' => 'no', 'description' => sprintf(__('Enable logging to <code>%s</code>', $this->td), wc_get_log_file_path($this->id)), 'options' => array('yes' => '1', 'no' => '0'));
     $form['maksuturva_sellerid'] = array('type' => 'textfield', 'title' => __('Seller id', $this->td), 'desc_tip' => true, 'description' => __('The seller identification provided by Maksuturva upon your registration.', $this->td), 'default' => get_option('maksuturva_sellerid'));
     $form['maksuturva_secretkey'] = array('type' => 'textfield', 'title' => __('Secret Key', $this->td), 'desc_tip' => true, 'description' => __('Your unique secret key provided by Maksuturva.', $this->td), 'default' => get_option('maksuturva_secretkey'));
     $form['maksuturva_keyversion'] = array('type' => 'textfield', 'title' => __('Secret Key Version', $this->td), 'desc_tip' => true, 'description' => __('The version of the secret key provided by Maksuturva.', $this->td), 'default' => get_option('maksuturva_keyversion', '001'));
     /* I don't think these are needed at the UI, but enabled it for now / JH */
     $form['maksuturva_url'] = array('type' => 'textfield', 'title' => __('Gateway URL', $this->td), 'desc_tip' => true, 'description' => __('The URL used to communicate with Maksuturva. Do not change this configuration unless you know what you are doing.', $this->td), 'default' => get_option('maksuturva_url', 'https://www.maksuturva.fi'));
     $form['maksuturva_orderid_prefix'] = array('type' => 'textfield', 'title' => __('Maksuturva Payment Prefix', $this->td), 'desc_tip' => true, 'description' => __('Prefix for order identifiers. Can be used to generate unique payment ids after e.g. reinstall.', $this->td), 'default' => get_option('maksuturva_orderid_prefix', '0'));
     /*
     $form['maksuturva_encoding'] = array(
         'type' => 'select',
         'title' => __('Communication encoding', $this->td ),
         'desc_tip'    => true,
         'description' => __('Maksuturva accepts both ISO-8859-1 and UTF-8 encodings to receive the transactions.', $this->td ),
         'options' => array(
             'UTF-8' => 'UTF-8',
             'ISO-8859-1' => 'ISO-8859-1',
         ),
         'default' => get_option('maksuturva_encoding'),
     );
     */
     $form['maksuturva_emaksut'] = array('type' => 'checkbox', 'title' => __('eMaksut', $this->td), 'description' => __('Use eMaksut payment service instead of Maksuturva', $this->td), 'options' => array('no' => '0', 'yes' => '1'), 'desc_tip' => true, 'default' => get_option('maksuturva_emaksut'));
     $this->form_fields = $form;
 }
 /**
  * Initialize the fields presented on the admin/settings screen.
  *
  * @method init_form_fields
  * @return null
  */
 function init_form_fields()
 {
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable iATS Payment Gateway', 'woocommerce'), 'default' => 'yes'), 'agent_code' => array('title' => __('iATS Agent Code', 'woocommerce'), 'type' => 'text', 'description' => __('Required agent code provided by iATS.', 'woocommerce'), 'desc_tip' => true), 'password' => array('title' => __('iATS Password', 'woocommerce'), 'type' => 'password', 'description' => __('Required password provided by iATS.', 'woocommerce'), 'desc_tip' => true), 'title' => array('title' => __('Title', 'woocommerce'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce'), 'default' => __('iATS', 'woocommerce'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'woocommerce'), 'type' => 'textarea', 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce'), 'default' => __('Pay via iATS', 'woocommerce'), 'desc_tip' => true), 'cardtypes' => array('title' => __('Accepted Cards', 'woocommerce'), 'type' => 'multiselect', 'description' => __('Select which card types to accept.', 'woocommerce'), 'options' => $this->cardtypeValues), 'logging' => array('title' => __('Logging', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable Logging', 'woocommerce'), 'default' => 'no', 'description' => sprintf(__('Log all events in <code>%s</code><br /><strong>NOTE:</strong>  This will record ALL transaction information.', 'woocommerce'), wc_get_log_file_path('blackbaud'))), 'sandbox' => array('title' => __('Sandbox Transaction', 'woocommerce'), 'type' => 'select', 'description' => __('Selecting one of these overrides the credentials, card number and total in order to generate a sandbox transaction.', 'woocommerce'), 'options' => array('' => 'DISABLED', '1.00' => '1.00 - OK: 678594', '2.00' => '2.00 - REJ: 15', '3.00' => '3.00 - OK: 678594', '4.00' => '4.00 - REJ: 15', '5.00' => '5.00 - REJ: 15', '6.00' => '6.00 - OK: 678594:X', '7.00' => '7.00 - OK: 678594:Y', '8.00' => '8.00 - OK: 678594:A', '9.00' => '9.00 - OK: 678594:Z', '10.00' => '10.00 - OK: 678594:N', '15.00' => '15.00 - OK: 678594:Y (CVV2=1234) or REJ: 19', '16.00' => '16.00 - REJ: 2', '17.00' => '17.00 - REJ: 22')));
 }
 /**
  * Initialise Gateway Settings Form Fields
  *
  * @access public
  * @return void
  */
 function init_form_fields()
 {
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable 2Checkout PayPal', 'woocommerce'), 'default' => 'yes'), 'title' => array('title' => __('Title', 'woocommerce'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce'), 'default' => __('PayPal', 'woocommerce'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'woocommerce'), 'type' => 'textarea', 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce'), 'default' => __('Pay with PayPal', 'woocommerce')), 'seller_id' => array('title' => __('Seller ID', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter your 2Checkout account number.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => ''), 'secret_word' => array('title' => __('Secret Word', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter your 2Checkout Secret Word.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => ''), 'debug' => array('title' => __('Debug Log', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable logging', 'woocommerce'), 'default' => 'no', 'description' => sprintf(__('Log 2Checkout events', 'woocommerce'), wc_get_log_file_path('twocheckoutpp'))));
 }
<?php

if (!defined('ABSPATH')) {
    exit;
}
/**
 * Settings for PayPal Gateway.
 */
return array('enabled' => array('title' => __('Enable/Disable', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable PayPal standard', 'woocommerce'), 'default' => 'yes'), 'title' => array('title' => __('Title', 'woocommerce'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce'), 'default' => __('PayPal', 'woocommerce'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'woocommerce'), 'type' => 'text', 'desc_tip' => true, 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce'), 'default' => __('Pay via PayPal; you can pay with your credit card if you don\'t have a PayPal account.', 'woocommerce')), 'email' => array('title' => __('PayPal Email', 'woocommerce'), 'type' => 'email', 'description' => __('Please enter your PayPal email address; this is needed in order to take payment.', 'woocommerce'), 'default' => get_option('admin_email'), 'desc_tip' => true, 'placeholder' => '*****@*****.**'), 'testmode' => array('title' => __('PayPal Sandbox', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable PayPal sandbox', 'woocommerce'), 'default' => 'no', 'description' => sprintf(__('PayPal sandbox can be used to test payments. Sign up for a developer account <a href="%s">here</a>.', 'woocommerce'), 'https://developer.paypal.com/')), 'debug' => array('title' => __('Debug Log', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable logging', 'woocommerce'), 'default' => 'no', 'description' => sprintf(__('Log PayPal events, such as IPN requests, inside <code>%s</code>', 'woocommerce'), wc_get_log_file_path('paypal'))), 'advanced' => array('title' => __('Advanced options', 'woocommerce'), 'type' => 'title', 'description' => ''), 'receiver_email' => array('title' => __('Receiver Email', 'woocommerce'), 'type' => 'email', 'description' => __('If your main PayPal email differs from the PayPal email entered above, input your main receiver email for your PayPal account here. This is used to validate IPN requests.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => '*****@*****.**'), 'identity_token' => array('title' => __('PayPal Identity Token', 'woocommerce'), 'type' => 'text', 'description' => __('Optionally enable "Payment Data Transfer" (Profile > Profile and Settings > My Selling Tools > Website Preferences) and then copy your identity token here. This will allow payments to be verified without the need for PayPal IPN.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => ''), 'invoice_prefix' => array('title' => __('Invoice Prefix', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple stores ensure this prefix is unique as PayPal will not allow orders with the same invoice number.', 'woocommerce'), 'default' => 'WC-', 'desc_tip' => true), 'send_shipping' => array('title' => __('Shipping Details', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Send shipping details to PayPal instead of billing.', 'woocommerce'), 'description' => __('PayPal allows us to send one address. If you are using PayPal for shipping labels you may prefer to send the shipping address rather than billing.', 'woocommerce'), 'default' => 'no'), 'address_override' => array('title' => __('Address Override', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable "address_override" to prevent address information from being changed.', 'woocommerce'), 'description' => __('PayPal verifies addresses therefore this setting can cause errors (we recommend keeping it disabled).', 'woocommerce'), 'default' => 'no'), 'paymentaction' => array('title' => __('Payment Action', 'woocommerce'), 'type' => 'select', 'class' => 'wc-enhanced-select', 'description' => __('Choose whether you wish to capture funds immediately or authorize payment only.', 'woocommerce'), 'default' => 'sale', 'desc_tip' => true, 'options' => array('sale' => __('Capture', 'woocommerce'), 'authorization' => __('Authorize', 'woocommerce'))), 'page_style' => array('title' => __('Page Style', 'woocommerce'), 'type' => 'text', 'description' => __('Optionally enter the name of the page style you wish to use. These are defined within your PayPal account.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => __('Optional', 'woocommerce')), 'api_details' => array('title' => __('API Credentials', 'woocommerce'), 'type' => 'title', 'description' => sprintf(__('Enter your PayPal API credentials to process refunds via PayPal. Learn how to access your PayPal API Credentials %shere%s.', 'woocommerce'), '<a href="https://developer.paypal.com/webapps/developer/docs/classic/api/apiCredentials/#creating-classic-api-credentials">', '</a>')), 'api_username' => array('title' => __('API Username', 'woocommerce'), 'type' => 'text', 'description' => __('Get your API credentials from PayPal.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => __('Optional', 'woocommerce')), 'api_password' => array('title' => __('API Password', 'woocommerce'), 'type' => 'text', 'description' => __('Get your API credentials from PayPal.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => __('Optional', 'woocommerce')), 'api_signature' => array('title' => __('API Signature', 'woocommerce'), 'type' => 'text', 'description' => __('Get your API credentials from PayPal.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => __('Optional', 'woocommerce')));
 /**
  * Initialise Gateway Settings Form Fields
  */
 public function init_form_fields()
 {
     $this->log('    [Info] Entered init_form_fields()...');
     $log_file = 'bitpay-' . sanitize_file_name(wp_hash('bitpay')) . '-log';
     $logs_href = get_bloginfo('wpurl') . '/wp-admin/admin.php?page=wc-status&tab=logs&log_file=' . $log_file;
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'bitpay'), 'type' => 'checkbox', 'label' => __('Enable Bitcoin Payments via BitPay', 'bitpay'), 'default' => 'yes'), 'title' => array('title' => __('Title', 'bitpay'), 'type' => 'text', 'description' => __('Controls the name of this payment method as displayed to the customer during checkout.', 'bitpay'), 'default' => __('Bitcoin', 'bitpay'), 'desc_tip' => true), 'description' => array('title' => __('Customer Message', 'bitpay'), 'type' => 'textarea', 'description' => __('Message to explain how the customer will be paying for the purchase.', 'bitpay'), 'default' => 'You will be redirected to bitpay.com to complete your purchase.', 'desc_tip' => true), 'api_token' => array('type' => 'api_token'), 'transaction_speed' => array('title' => __('Risk/Speed', 'bitpay'), 'type' => 'select', 'description' => 'Choose a transaction speed.  For details, see the API documentation at bitpay.com', 'options' => array('high' => 'High', 'medium' => 'Medium', 'low' => 'Low'), 'default' => 'high', 'desc_tip' => true), 'order_states' => array('type' => 'order_states'), 'debug' => array('title' => __('Debug Log', 'bitpay'), 'type' => 'checkbox', 'label' => sprintf(__('Enable logging <a href="%s" class="button">View Logs</a>', 'bitpay'), $logs_href), 'default' => 'no', 'description' => sprintf(__('Log BitPay events, such as IPN requests, inside <code>%s</code>', 'bitpay'), wc_get_log_file_path('bitpay')), 'desc_tip' => true), 'notification_url' => array('title' => __('Notification URL', 'bitpay'), 'type' => 'url', 'description' => __('BitPay will send IPNs for orders to this URL with the BitPay invoice data', 'bitpay'), 'default' => '', 'placeholder' => WC()->api_request_url('WC_Gateway_Bitpay'), 'desc_tip' => true), 'redirect_url' => array('title' => __('Redirect URL', 'bitpay'), 'type' => 'url', 'description' => __('After paying the BitPay invoice, users will be redirected back to this URL', 'bitpay'), 'default' => '', 'placeholder' => $this->get_return_url(), 'desc_tip' => true), 'support_details' => array('title' => __('Plugin & Support Information', 'bitpay'), 'type' => 'title', 'description' => sprintf(__('This plugin version is %s and your PHP version is %s. If you need assistance, please contact support@bitpay.com.  Thank you for using BitPay!', 'bitpay'), get_option('woocommerce_bitpay_version'), PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION)));
     $this->log('    [Info] Initialized form fields: ' . var_export($this->form_fields, true));
     $this->log('    [Info] Leaving init_form_fields()...');
 }
 /**
  * Force download of log file if $_GET['download_log'] is set
  *
  * @since 4.4
  */
 public static function maybe_download_log_file()
 {
     if (isset($_GET['download_log'])) {
         // If file doesn't exist, create it
         $handle = 'wootax';
         if (function_exists('wc_get_log_file_path')) {
             $log_path = wc_get_log_file_path($handle);
         } else {
             $log_path = WC()->plugin_path() . '/logs/' . $handle . '-' . sanitize_file_name(wp_hash($handle)) . '.txt';
         }
         if (!file_exists($log_path)) {
             $fh = @fopen($log_path, 'a');
             fclose($fh);
         }
         // Force download
         header('Content-Description: File Transfer');
         header('Content-Type: application/octet-stream');
         header('Content-Disposition: attachment; filename=' . basename($log_path));
         header('Expires: 0');
         header('Cache-Control: must-revalidate');
         header('Pragma: public');
         header('Content-Length: ' . filesize($log_path));
         readfile($log_path);
         exit;
     }
 }
 /**
  * Initialise Gateway Settings Form Fields
  *
  * The standard gateway options have already been applied. 
  * Change the fields to match what the payment gateway your building requires.
  *
  * @access public
  */
 public function init_form_fields()
 {
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'woocommerce-payment-gateway-boilerplate'), 'label' => __('Enable Gateway Name', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'checkbox', 'description' => '', 'default' => 'no'), 'title' => array('title' => __('Title', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-payment-gateway-boilerplate'), 'default' => __('Gateway Name', 'woocommerce-payment-gateway-boilerplate'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'text', 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-payment-gateway-boilerplate'), 'default' => 'Pay with Gateway Name.', 'desc_tip' => true), 'instructions' => array('title' => __('Instructions', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'textarea', 'description' => __('Instructions that will be added to the thank you page and emails.', 'woocommerce-payment-gateway-boilerplate'), 'default' => '', 'desc_tip' => true), 'debug' => array('title' => __('Debug Log', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'checkbox', 'label' => __('Enable logging', 'woocommerce-payment-gateway-boilerplate'), 'default' => 'no', 'description' => sprintf(__('Log Gateway name events inside <code>%s</code>', 'woocommerce-payment-gateway-boilerplate'), wc_get_log_file_path($this->id))), 'sandbox' => array('title' => __('Sandbox', 'woocommerce-payment-gateway-boilerplate'), 'label' => __('Enable Sandbox Mode', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'checkbox', 'description' => __('Place the payment gateway in sandbox mode using sandbox API keys (real payments will not be taken).', 'woocommerce-payment-gateway-boilerplate'), 'default' => 'yes'), 'sandbox_private_key' => array('title' => __('Sandbox Private Key', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'text', 'description' => __('Get your API keys from your Gateway Name account.', 'woocommerce-payment-gateway-boilerplate'), 'default' => '', 'desc_tip' => true), 'sandbox_public_key' => array('title' => __('Sandbox Public Key', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'text', 'description' => __('Get your API keys from your Gateway Name account.', 'woocommerce-payment-gateway-boilerplate'), 'default' => '', 'desc_tip' => true), 'private_key' => array('title' => __('Private Key', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'text', 'description' => __('Get your API keys from your Gateway Name account.', 'woocommerce-payment-gateway-boilerplate'), 'default' => '', 'desc_tip' => true), 'public_key' => array('title' => __('Public Key', 'woocommerce-payment-gateway-boilerplate'), 'type' => 'text', 'description' => __('Get your API keys from your Gateway Name account.', 'woocommerce-payment-gateway-boilerplate'), 'default' => '', 'desc_tip' => true));
 }
<?php

if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
/**
 * Settings for Klarna Checkout
 */
return apply_filters('klarna_checkout_form_fields', array('enabled' => array('title' => __('Enable/Disable', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Enable Klarna Checkout', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'title' => array('title' => __('Title', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-klarna'), 'default' => __('Klarna Checkout', 'woocommerce-gateway-klarna')), 'order_settings_title' => array('title' => __('Order management settings', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'push_completion' => array('title' => __('On order completion', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Activate Klarna order automatically when WooCommerce order is marked complete.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'push_cancellation' => array('title' => __('On order cancellation', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Cancel Klarna order automatically when WooCommerce order is cancelled', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'push_update' => array('title' => __('On order update', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Update Klarna order automatically when WooCoommerce line items are updated.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'sweden_settings_title' => array('title' => __('Sweden', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_se' => array('title' => __('Eid - Sweden', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Sweden. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_se' => array('title' => __('Shared Secret - Sweden', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Sweden.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_url_se' => array('title' => __('Custom Checkout Page - Sweden', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the URL to the page that acts as Checkout Page for Klarna Checkout Sweden. This page must contain the shortcode [woocommerce_klarna_checkout].', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_thanks_url_se' => array('title' => __('Custom Thanks Page - Sweden', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Enter the URL to the page that acts as Thanks Page for Klarna Checkout Sweden. This page must contain the shortcode [woocommerce_klarna_checkout]. Leave blank to use the Custom Checkout Page as Thanks Page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'norway_settings_title' => array('title' => __('Norway', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_no' => array('title' => __('Eid - Norway', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Norway. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_no' => array('title' => __('Shared Secret - Norway', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Norway.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_url_no' => array('title' => __('Custom Checkout Page - Norway', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the URL to the page that acts as Checkout Page for Klarna Checkout Norway. This page must contain the shortcode [woocommerce_klarna_checkout].', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_thanks_url_no' => array('title' => __('Custom Thanks Page - Norway', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Enter the URL to the page that acts as Thanks Page for Klarna Checkout Norway. This page must contain the shortcode [woocommerce_klarna_checkout]. Leave blank to use the Custom Checkout Page as Thanks Page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'finland_settings_title' => array('title' => __('Finland', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_fi' => array('title' => __('Eid - Finland', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Finland. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_fi' => array('title' => __('Shared Secret - Finland', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Finland.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_url_fi' => array('title' => __('Custom Checkout Page - Finland', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the URL to the page that acts as Checkout Page for Klarna Checkout Finland. This page must contain the shortcode [woocommerce_klarna_checkout].', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_thanks_url_fi' => array('title' => __('Custom Thanks Page - Finland', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Enter the URL to the page that acts as Thanks Page for Klarna Checkout Finland. This page must contain the shortcode [woocommerce_klarna_checkout]. Leave blank to use the Custom Checkout Page as Thanks Page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'germany_settings_title' => array('title' => __('Germany', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_de' => array('title' => __('Eid - Germany', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Germany. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_de' => array('title' => __('Shared Secret - Germany', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Germany.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_url_de' => array('title' => __('Custom Checkout Page - Germany', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the URL to the page that acts as Checkout Page for Klarna Checkout Germany. This page must contain the shortcode [woocommerce_klarna_checkout].', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_thanks_url_de' => array('title' => __('Custom Thanks Page - Germany', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Enter the URL to the page that acts as Thanks Page for Klarna Checkout Germany. This page must contain the shortcode [woocommerce_klarna_checkout]. Leave blank to use the Custom Checkout Page as Thanks Page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'phone_mandatory_de' => array('title' => __('Phone Number Mandatory - Germany', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Phone number is not mandatory for Klarna Checkout in Germany by default. Check this box to make it mandatory.', 'woocommerce-gateway-klarna'), 'default' => 'no', 'desc_tip' => true), 'dhl_packstation_de' => array('title' => __('DHL Packstation Functionality - Germany', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Enable DHL packstation functionality for German customers.', 'woocommerce-gateway-klarna'), 'default' => 'no', 'desc_tip' => true), 'austria_settings_title' => array('title' => __('Austria', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_at' => array('title' => __('Eid - Austria', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Austria. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_at' => array('title' => __('Shared Secret - Austria', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Austria.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_url_at' => array('title' => __('Custom Checkout Page - Austria', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the URL to the page that acts as Checkout Page for Klarna Checkout Austria. This page must contain the shortcode [woocommerce_klarna_checkout].', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_thanks_url_at' => array('title' => __('Custom Thanks Page - Austria', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Enter the URL to the page that acts as Thanks Page for Klarna Checkout Austria. This page must contain the shortcode [woocommerce_klarna_checkout]. Leave blank to use the Custom Checkout Page as Thanks Page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'phone_mandatory_at' => array('title' => __('Phone Number Mandatory - Austria', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Phone number is not mandatory for Klarna Checkout in Austria by default. Check this box to make it mandatory.', 'woocommerce-gateway-klarna'), 'default' => 'no', 'desc_tip' => true), 'uk_settings_title' => array('title' => __('UK', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_uk' => array('title' => __('Eid - UK', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for UK. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_uk' => array('title' => __('Shared Secret - UK', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for UK.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_url_uk' => array('title' => __('Custom Checkout Page - UK', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the URL to the page that acts as Checkout Page for Klarna Checkout UK. This page must contain the shortcode [woocommerce_klarna_checkout].', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_thanks_url_uk' => array('title' => __('Custom Thanks Page - UK', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Enter the URL to the page that acts as Thanks Page for Klarna Checkout UK. This page must contain the shortcode [woocommerce_klarna_checkout]. Leave blank to use the Custom Checkout Page as Thanks Page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'uk_ship_only_to_base' => array('title' => __('Only ship to UK', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Only allow shipping to UK addresses. You need an agreement with Klarna to allow shipping to other countries.', 'woocommerce-gateway-klarna'), 'default' => 'yes'), 'us_settings_title' => array('title' => __('USA', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_us' => array('title' => __('Eid - USA', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for USA. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_us' => array('title' => __('Shared Secret - USA', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for USA.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_url_us' => array('title' => __('Custom Checkout Page - USA', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the URL to the page that acts as Checkout Page for Klarna Checkout USA. This page must contain the shortcode [woocommerce_klarna_checkout].', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'klarna_checkout_thanks_url_us' => array('title' => __('Custom Thanks Page - USA', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Enter the URL to the page that acts as Thanks Page for Klarna Checkout USA. This page must contain the shortcode [woocommerce_klarna_checkout]. Leave blank to use the Custom Checkout Page as Thanks Page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'checkout_settings_title' => array('title' => __('Checkout settings', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'default_eur_contry' => array('title' => __('Default Euro Checkout Country', 'woocommerce-gateway-klarna'), 'type' => 'select', 'options' => array('DE' => __('Germany', 'woocommerce-gateway-klarna'), 'FI' => __('Finland', 'woocommerce-gateway-klarna'), 'AT' => __('Austria', 'woocommerce-gateway-klarna')), 'description' => __('Used by the payment gateway to determine which country should be the default Checkout country if Euro is the selected currency, you as a merchant has an agreement with multiple countries that use Euro and the selected language cant be of help for this decision.', 'woocommerce-gateway-klarna'), 'default' => 'DE', 'desc_tip' => true), 'modify_standard_checkout_url' => array('title' => __('Modify Standard Checkout', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Make the Custom Checkout Page for Klarna Checkout the default checkout page (i.e. changing the url of the checkout buttons in Cart and the Widget mini cart).', 'woocommerce-gateway-klarna'), 'default' => 'yes'), 'add_std_checkout_button' => array('title' => __('Button to Standard Checkout', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Add a button when the Klarna Checkout form is displayed that links to the standard checkout page.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'std_checkout_button_label' => array('title' => __('Label for Standard Checkout Button', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the text for the button that links to the standard checkout page from the Klarna Checkout form.', 'woocommerce-gateway-klarna'), 'default' => ''), 'add_klarna_checkout_button' => array('title' => __('Button to Klarna Checkout', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Add a button in standard checkout page that links to the Klarna checkout page.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'klarna_checkout_button_label' => array('title' => __('Label for Standard Checkout Button', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the text for the button that links to the Klarna checkout page from the standard checkout page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'terms_url' => array('title' => __('Terms Page', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter the URL to the page that acts as Terms Page for Klarna Checkout. Leave blank to use the defined WooCommerce Terms Page.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'create_customer_account' => array('title' => __('Create customer account', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Automatically create an account for new customers.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'send_new_account_email' => array('title' => __('Send New account email when creating new accounts', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Send New account email', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'account_signup_text' => array('title' => __('Account Signup Text', 'woocommerce-gateway-klarna'), 'type' => 'textarea', 'description' => __('Add text above the Account Registration Form. Useful for legal text for German stores. See documentation for more information. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'account_login_text' => array('title' => __('Account Login Text', 'woocommerce-gateway-klarna'), 'type' => 'textarea', 'description' => __('Add text above the Account Login Form. Useful for legal text for German stores. See documentation for more information. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'validate_stock' => array('title' => __('Check items stock during checkout', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('If this option is checked, stock status will be checked again for all items in the cart
		 while Klarna Checkout request is being processed. Useful for high-volume stores, HTTPS is required.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'send_discounts_separately' => array('title' => __('Send discounts as separate items', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('If you enable this option discounts will be sent to Klarna as separate cart items instead of being applied to regular cart items.', 'woocommerce-gateway-klarna'), 'description' => __('Use this if you encounter rounding issues that cause WooCommerce order total not to match Klarna order total.', 'klarna'), 'default' => 'no'), 'color_settings_title' => array('title' => __('Color Settings', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'color_button' => array('title' => __('Checkout button color', 'woocommerce-gateway-klarna'), 'type' => 'color', 'description' => __('Checkout page button color', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'color_button_text' => array('title' => __('Checkout button text color', 'woocommerce-gateway-klarna'), 'type' => 'color', 'description' => __('Checkout page button text color', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'color_checkbox' => array('title' => __('Checkout checkbox color', 'woocommerce-gateway-klarna'), 'type' => 'color', 'description' => __('Checkout page checkbox color', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'color_checkbox_checkmark' => array('title' => __('Checkout checkbox checkmark color', 'woocommerce-gateway-klarna'), 'type' => 'color', 'description' => __('Checkout page checkbox checkmark color', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'color_header' => array('title' => __('Checkout header color', 'woocommerce-gateway-klarna'), 'type' => 'color', 'description' => __('Checkout page header color', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'color_link' => array('title' => __('Checkout link color', 'woocommerce-gateway-klarna'), 'type' => 'color', 'description' => __('Checkout page link color', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'test_mode_settings_title' => array('title' => __('Test Mode Settings', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'testmode' => array('title' => __('Test Mode', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Enable Klarna Test Mode. This will only work if you have a Klarna test account.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'debug' => array('title' => __('Debug', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Enable logging.', 'woocommerce-gateway-klarna'), 'description' => sprintf(__('Log Klarna events, in <code>%s</code>', 'woocommerce'), wc_get_log_file_path('klarna')), 'default' => 'no')));
 /**
  * Get debug file path
  *
  * @since 1.1
  * @param string $name
  * @return string
  */
 public static function wc_get_debug_file_path($name)
 {
     if (self::is_wc_2_2()) {
         $file = wc_get_log_file_path($name);
     } else {
         $file = 'woocommerce/logs/' . $name . '-' . sanitize_file_name(wp_hash($name)) . '.txt';
     }
     return $file;
 }
Example #13
0
?>
</h2>
			<p><?php 
esc_html_e('Your database has been updated successfully!', 'woocommerce-subscriptions');
?>
</p>
			<p class="step"><a class="button" href="<?php 
echo esc_url($about_page_url);
?>
"><?php 
esc_html_e('Continue', 'woocommerce-subscriptions');
?>
</a></p>
			<p class="log-notice"><?php 
// translators: $1: placeholder is number of weeks, 2$: path to the file
echo wp_kses(sprintf(__('To record the progress of the update a new log file was created. This file will be automatically deleted in %1$d weeks. If you would like to delete it sooner, you can find it here: %2$s', 'woocommerce-subscriptions'), esc_html(WCS_Upgrade_Logger::$weeks_until_cleanup), '<code class="log-notice">' . esc_html(wc_get_log_file_path(WCS_Upgrade_Logger::$handle)) . '</code>'), array('code' => array('class' => true)));
?>
			</p>
		</div>
		<div id="update-error">
			<h2><?php 
esc_html_e('Update Error', 'woocommerce-subscriptions');
?>
</h2>
			<p><?php 
esc_html_e('There was an error with the update. Please refresh the page and try again.', 'woocommerce-subscriptions');
?>
</p>
		</div>
	</body>
</html>
 /**
  * Initialise Gateway Settings Form Fields
  *
  * @access public
  * @return void
  */
 function init_form_fields()
 {
     $debug = __('Включить логирование (<code>woocommerce/logs/' . $this->id . '.txt</code>)', 'woocommerce');
     if (!version_compare(WOOCOMMERCE_VERSION, '2.0', '<')) {
         if (version_compare(WOOCOMMERCE_VERSION, '2.2.0', '<')) {
             $debug = str_replace($this->id, $this->id . '-' . sanitize_file_name(wp_hash($this->id)), $debug);
         } elseif (function_exists('wc_get_log_file_path')) {
             $debug = str_replace('woocommerce/logs/' . $this->id . '.txt', wc_get_log_file_path($this->id), $debug);
         }
     }
     $this->form_fields = array('enabled' => array('title' => __('Включить/Выключить', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Включен', 'woocommerce'), 'default' => 'yes'), 'title' => array('title' => __('Название', 'woocommerce'), 'type' => 'text', 'description' => __('Это название, которое пользователь видит во время проверки.', 'woocommerce'), 'default' => __('OPLATA.MD', 'woocommerce')), 'testmode' => array('title' => __('Тест режим', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Включен', 'woocommerce'), 'description' => __('В этом режиме плата за товар не снимается.<br>Для тестового режима: <label style="font-weight: 700;" for="fruitware_woocommerce_oplatamd_oplatamd_merchant">Название проекта</label>: "demoshop" и <label style="font-weight: 700;" for="fruitware_woocommerce_oplatamd_secret_key">Секретный ключ</label>: "950856916534772"', 'woocommerce'), 'default' => 'no'), 'oplatamd_merchant' => array('title' => __('Название проекта', 'woocommerce'), 'type' => 'text', 'description' => __('Пожалуйста введите Название проекта (projectsTitle).', 'woocommerce'), 'default' => 'demoshop'), 'secret_key' => array('title' => __('Секретный ключ', 'woocommerce'), 'type' => 'password', 'description' => __('Пожалуйста введите Секретный ключ (secretKey).<br />', 'woocommerce'), 'default' => ''), 'debug' => array('title' => __('Debug', 'woocommerce'), 'type' => 'checkbox', 'label' => $debug, 'default' => 'no'), 'sslverify' => array('title' => __('Verify ssl certificate', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Включен', 'woocommerce'), 'description' => __('Выключать проверку, только если есть проблема с проверкой сертификатов', 'woocommerce'), 'default' => 'yes'), 'description' => array('title' => __('Description', 'woocommerce'), 'type' => 'textarea', 'description' => __('Описанием метода оплаты которое клиент будет видеть на вашем сайте.', 'woocommerce'), 'default' => 'Оплата с помощью oplata.md.'), 'instructions' => array('title' => __('Instructions', 'woocommerce'), 'type' => 'textarea', 'description' => __('Инструкции, которые будут добавлены на страницу благодарностей.', 'woocommerce'), 'default' => 'Оплата с помощью oplata.md.'));
 }
Example #15
0
esc_html_e('Your database has been updated successfully!', 'woocommerce-subscriptions');
?>
</p>
			<p class="step"><a class="button" href="<?php 
echo esc_url($about_page_url);
?>
"><?php 
esc_html_e('Continue', 'woocommerce-subscriptions');
?>
</a></p>
			<p class="log-notice"><?php 
// translators: placeholder is number of weeks
printf(esc_html__('To record the progress of the update a new log file was created. This file will be automatically deleted in %d weeks. If you would like to delete it sooner, you can find it here:', 'woocommerce-subscriptions'), esc_html(WCS_Upgrade_Logger::$weeks_until_cleanup));
?>
				<code class="log-notice"><?php 
echo esc_html(wc_get_log_file_path(WCS_Upgrade_Logger::$handle));
?>
</code>
			</p>
		</div>
		<div id="update-error">
			<h2><?php 
esc_html_e('Update Error', 'woocommerce-subscriptions');
?>
</h2>
			<p><?php 
esc_html_e('There was an error with the update. Please refresh the page and try again.', 'woocommerce-subscriptions');
?>
</p>
		</div>
	</body>
 /**
  * Initialise Gateway Settings Form Fields
  *
  * @access public
  * @return void
  */
 function init_form_fields()
 {
     $debug = __('Включить логирование (<code>woocommerce/logs/' . $this->id . '.txt</code>)', 'robokassa-payment-gateway-saphali');
     if (!version_compare(WOOCOMMERCE_VERSION, '2.0', '<')) {
         if (version_compare(WOOCOMMERCE_VERSION, '2.2.0', '<')) {
             $debug = str_replace($this->id, $this->id . '-' . sanitize_file_name(wp_hash($this->id)), $debug);
         } elseif (function_exists('wc_get_log_file_path')) {
             $debug = str_replace('woocommerce/logs/' . $this->id . '.txt', '<a href="/wp-admin/admin.php?page=wc-status&tab=logs&log_file=' . $this->id . '-' . sanitize_file_name(wp_hash($this->id)) . '-log" target="_blank">' . wc_get_log_file_path($this->id) . '</a>', $debug);
         }
     }
     $this->form_fields = array('enabled' => array('title' => __('Включить/Выключить', 'robokassa-payment-gateway-saphali'), 'type' => 'checkbox', 'label' => __('Включен', 'robokassa-payment-gateway-saphali'), 'default' => 'yes'), 'title' => array('title' => __('Название', 'robokassa-payment-gateway-saphali'), 'type' => 'text', 'description' => __('Это название, которое пользователь видит во время проверки.', 'robokassa-payment-gateway-saphali'), 'default' => __('ROBOKASSA', 'robokassa-payment-gateway-saphali')), 'robokassa_merchant' => array('title' => __('Логин', 'robokassa-payment-gateway-saphali'), 'type' => 'text', 'description' => __('Пожалуйста введите Логин', 'robokassa-payment-gateway-saphali'), 'default' => 'demo'), 'robokassa_key1' => array('title' => __('Пароль #1', 'robokassa-payment-gateway-saphali'), 'type' => 'password', 'description' => __('Пожалуйста введите пароль №1.', 'robokassa-payment-gateway-saphali'), 'default' => ''), 'robokassa_key2' => array('title' => __('Пароль #2', 'robokassa-payment-gateway-saphali'), 'type' => 'password', 'description' => __('Пожалуйста введите пароль №2.', 'robokassa-payment-gateway-saphali'), 'default' => ''), 'testmode' => array('title' => __('Тест режим', 'robokassa-payment-gateway-saphali'), 'type' => 'checkbox', 'label' => __('Включен', 'robokassa-payment-gateway-saphali'), 'description' => __('В этом режиме плата за товар не снимается.', 'robokassa-payment-gateway-saphali'), 'default' => 'no'), 'debug' => array('title' => __('Debug', 'robokassa-payment-gateway-saphali'), 'type' => 'checkbox', 'label' => $debug, 'default' => 'no'), 'description' => array('title' => __('Description', 'robokassa-payment-gateway-saphali'), 'type' => 'textarea', 'description' => __('Описанием метода оплаты которое клиент будет видеть на вашем сайте.', 'robokassa-payment-gateway-saphali'), 'default' => 'Оплата с помощью robokassa.'), 'instructions' => array('title' => __('Instructions', 'robokassa-payment-gateway-saphali'), 'type' => 'textarea', 'description' => __('Инструкции, которые будут добавлены на страницу благодарностей.', 'robokassa-payment-gateway-saphali'), 'default' => 'Оплата с помощью robokassa.'), 'lang' => array('title' => __('Язык общения с клиентом', 'robokassa-payment-gateway-saphali'), 'type' => 'select', 'options' => array("" => 'Выбрать', "ru" => "Русский", "en" => "English"), 'description' => __('Вы определяете изначально сами, на каком языке интерфейс ROBOKASSA должен отображаться для клиента', 'robokassa-payment-gateway-saphali'), 'default' => 'ru'));
 }
<?php

if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
/**
 * Settings for Klarna Invoice
 */
return apply_filters('klarna_invoice_form_fields', array('enabled' => array('title' => __('Enable/Disable', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Enable Klarna Invoice', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'title' => array('title' => __('Title', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-klarna'), 'default' => __('Invoice', 'woocommerce-gateway-klarna')), 'description' => array('title' => __('Description', 'woocommerce-gateway-klarna'), 'type' => 'textarea', 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-klarna'), 'default' => ''), 'order_settings_title' => array('title' => __('Order management settings', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'push_completion' => array('title' => __('On order completion', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Activate Klarna order automatically when WooCommerce order is marked complete.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'push_cancellation' => array('title' => __('On order cancellation', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Cancel Klarna order automatically when WooCommerce order is cancelled', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'push_update' => array('title' => __('On order update', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Update Klarna order automatically when WooCoommerce line items are updated.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'sweden_settings_title' => array('title' => __('Sweden', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_se' => array('title' => __('Eid - Sweden', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Sweden. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_se' => array('title' => __('Shared Secret - Sweden', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Sweden.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'norway_settings_title' => array('title' => __('Norway', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_no' => array('title' => __('Eid - Norway', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Norway. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_no' => array('title' => __('Shared Secret - Norway', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Norway.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'finland_settings_title' => array('title' => __('Finland', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_fi' => array('title' => __('Eid - Finland', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Finland. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_fi' => array('title' => __('Shared Secret - Finland', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Finland.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'denmark_settings_title' => array('title' => __('Denmark', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_dk' => array('title' => __('Eid - Denmark', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Denmark. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_dk' => array('title' => __('Shared Secret - Denmark', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Denmark.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'germany_settings_title' => array('title' => __('Germany', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_de' => array('title' => __('Eid - Germany', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Germany. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_de' => array('title' => __('Shared Secret - Germany', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Germany.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'netherlands_settings_title' => array('title' => __('Netherlands', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_nl' => array('title' => __('Eid - Netherlands', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Netherlands. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_nl' => array('title' => __('Shared Secret - Netherlands', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Netherlands.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'austria_settings_title' => array('title' => __('Austria', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'eid_at' => array('title' => __('Eid - Austria', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Eid for Austria. Leave blank to disable.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'secret_at' => array('title' => __('Shared Secret - Austria', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Please enter your Klarna Shared Secret for Austria.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'checkout_settings_title' => array('title' => __('Checkout settings', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'lower_threshold' => array('title' => __('Lower threshold', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Disable Klarna Invoice if Cart Total is lower than the specified value. Leave blank to disable this feature.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'upper_threshold' => array('title' => __('Upper threshold', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Disable Klarna Invoice if Cart Total is higher than the specified value. Leave blank to disable this feature.', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'invoice_fee_id' => array('title' => __('Invoice Fee', 'woocommerce-gateway-klarna'), 'type' => 'text', 'description' => __('Create a hidden (simple) product that acts as the invoice fee. Enter the ID number in this textfield. Leave blank to disable. ', 'woocommerce-gateway-klarna'), 'default' => '', 'desc_tip' => true), 'ship_to_billing_address' => array('title' => __('Send billing address as shipping address', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Send the entered billing address in WooCommerce checkout as shipping address to Klarna.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'de_consent_terms' => array('title' => __('Klarna consent terms (DE & AT only)', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Enable Klarna consent terms checkbox in checkout. This only apply to German and Austrian merchants.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'test_mode_settings_title' => array('title' => __('Test Mode Settings', 'woocommerce-gateway-klarna'), 'type' => 'title'), 'testmode' => array('title' => __('Test Mode', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Enable Klarna Test Mode. This will only work if you have a Klarna test account.', 'woocommerce-gateway-klarna'), 'default' => 'no'), 'debug' => array('title' => __('Debug', 'woocommerce-gateway-klarna'), 'type' => 'checkbox', 'label' => __('Enable logging.', 'woocommerce-gateway-klarna'), 'description' => sprintf(__('Log Klarna events, in <code>%s</code>', 'woocommerce'), wc_get_log_file_path('klarna')), 'default' => 'no')));
 /**
  * Initialise Gateway Settings Form Fields
  *
  * @access public
  * @return void
  */
 function init_form_fields()
 {
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'alipay'), 'type' => 'checkbox', 'label' => __('Enable Alipay Payment', 'alipay'), 'default' => 'no'), 'title' => array('title' => __('Title', 'alipay'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'alipay'), 'default' => __('Alipay', 'alipay'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'alipay'), 'type' => 'textarea', 'description' => __('This controls the description which the user sees during checkout.', 'alipay'), 'default' => __('Pay via Alipay, if you don\'t have an Alipay account, you can also pay with your debit card or credit card', 'alipay'), 'desc_tip' => true), 'payment_method' => array('title' => __('Alipay Payment Gateway Type', 'alipay'), 'type' => 'select', 'description' => __('Please choose a payment method, note that the Dual requires a corporate account', 'alipay'), 'options' => array('escrow' => __('Escrow Payment', 'alipay'), 'dualfun' => __('Dual(Direct Payment + Escrow payment)', 'alipay'), 'direct' => __('Direct Payment', 'alipay')), 'desc_tip' => true), 'partnerID' => array('title' => __('Partner ID', 'alipay'), 'type' => 'text', 'description' => __('Please enter the partner ID<br />If you don\'t have one, <a href="https://b.alipay.com/newIndex.htm" target="_blank">click here</a> to get.', 'alipay'), 'css' => 'width:400px'), 'secure_key' => array('title' => __('Security Key', 'alipay'), 'type' => 'text', 'description' => __('Please enter the security key<br />If you don\'t have one, <a href="https://b.alipay.com/newIndex.htm" target="_blank">click here</a> to get.', 'alipay'), 'css' => 'width:400px'), 'alipay_account' => array('title' => __('Alipay Account', 'alipay'), 'type' => 'text', 'description' => __('Please enter your Alipay account ( Email or Phone Number ); this is needed in order to take payment.', 'alipay'), 'css' => 'width:200px', 'desc_tip' => true), 'order_prefix' => array('title' => __('Order No. Prefix', 'alipay'), 'type' => 'text', 'description' => __('eg.WC-. If you <strong>use your Alipay account for multiple stores</strong>, Please enter this prefix and make sure it is unique as Alipay will not allow orders with the same merchant order number.', 'alipay'), 'default' => 'WC-'), 'form_submission_method' => array('title' => __('Submission method', 'alipay'), 'type' => 'checkbox', 'label' => __('Use form submission method.', 'alipay'), 'description' => __('Enable this to post order data to Alipay via a form instead of using a redirect/querystring.', 'alipay'), 'default' => 'no', 'desc_tip' => true), 'order_title_format' => array('title' => __('Preferred format for order title', 'alipay'), 'type' => 'select', 'label' => __('Select your preferred order title format', 'alipay'), 'description' => __('Select the format of order title when making payment at Alipay', 'alipay'), 'options' => array('customer_name' => __('Customer Full Name|#Order ID', 'alipay'), 'product_title' => __('Name of the first Product|#Order ID', 'alipay'), 'shop_name' => sprintf(__('[Customer Full Name]\'s Order From %s|#Order ID', 'alipay'), get_bloginfo('name'))), 'desc_tip' => true), 'debug' => array('title' => __('Debug Log', 'alipay'), 'type' => 'checkbox', 'label' => __('Enable logging', 'alipay'), 'default' => 'no', 'description' => __('Log Alipay events, such as trade status, inside <code>woocommerce/logs/alipay.txt</code>', 'alipay')));
     // For WC2.2+
     if (function_exists('wc_get_log_file_path')) {
         $this->form_fields['debug']['description'] = sprintf(__('Log Alipay events, such as trade status, inside <code>%s</code>', 'alipay'), wc_get_log_file_path('alipay'));
     }
     if (!in_array($this->current_currency, array('RMB', 'CNY'))) {
         $this->form_fields['exchange_rate'] = array('title' => __('Exchange Rate', 'alipay'), 'type' => 'text', 'description' => sprintf(__("Please set the %s against Chinese Yuan exchange rate, eg if your currency is US Dollar, then you should enter 6.19", 'alipay'), $this->current_currency), 'css' => 'width:80px;', 'desc_tip' => true);
     }
 }
 /**
  * Get the full path to the log file for a given $handle
  *
  * @since 3.0.0
  * @param string $handle log handle
  * @return string
  */
 public static function wc_get_log_file_path($handle)
 {
     if (self::is_wc_version_gte_2_2()) {
         return wc_get_log_file_path($handle);
     } else {
         return sprintf('%s/plugins/woocommerce/logs/%s-%s.txt', WP_CONTENT_DIR, $handle, sanitize_file_name(wp_hash($handle)));
     }
 }
<?php

if (!defined('ABSPATH')) {
    exit;
}
/**
 * Settings for Komoju Gateway (hosted page)
 */
return array('enabled' => array('title' => __('Enable/Disable', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable Komoju', 'woocommerce'), 'default' => 'no'), 'title' => array('title' => __('Title', 'woocommerce'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce'), 'default' => __('Komoju', 'woocommerce'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'woocommerce'), 'type' => 'textarea', 'description' => __('Payment method description that the customer will see on your checkout.', 'woocommerce'), 'default' => __('Make your payment through Komoju: offline and online Japanese payments like Konbini, credit cards, WebMoney, ...', 'woocommerce'), 'desc_tip' => true), 'supported_methods' => array('title' => 'Supported methods set in Komoju', 'type' => 'title', 'id' => 'supported-methods-in-komoju'), 'credit_card' => array('title' => __('Credit Card', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Allow credit card', 'woocommerce'), 'default' => 'yes'), 'web_money' => array('title' => __('Web Money', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Allow Web Money', 'woocommerce'), 'default' => 'yes'), 'konbini' => array('title' => __('Konbini', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Allow delayed payment in convenience store', 'woocommerce'), 'description' => __('Lawson, Family Mart, Sunkus, Circle-K, Ministop, Daily Yamazaki, 7-Eleven', 'woocommerce'), 'desc_tip' => true, 'default' => 'yes'), 'bank_transfer' => array('title' => __('Bank Transfer', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Allow bank transfer', 'woocommerce'), 'default' => 'yes'), 'pay_easy' => array('title' => __('Pay Easy', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Allow delayed payment through Pay Easy', 'woocommerce'), 'default' => 'yes'), 'API_settings' => array('title' => 'API Settings', 'type' => 'title', 'id' => 'api-seetings-in-komoju'), 'accountID' => array('title' => __('Komoju merchant ID', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter your Komoju account ID.', 'woocommerce'), 'default' => '', 'desc_tip' => true), 'secretKey' => array('title' => __('Secret Key from Komoju', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter your Komoju secret key.', 'woocommerce'), 'default' => '', 'desc_tip' => true), 'callbackURL' => array('title' => __('Callback Url', 'woocommerce'), 'type' => 'text', 'description' => sprintf(__('Specify a special callback url (or leave this field empty if you don\'t know what it is). Default url is %s', 'woocommerce'), $this->get_mydefault_api_url()), 'default' => ''), 'testmode' => array('title' => __('Komoju Sandbox', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable Komoju sandbox', 'woocommerce'), 'default' => 'yes', 'description' => sprintf(__('When checked, your Komoju sandbox will be used in order to test payments. Sign up for a developer account <a href="%s">here</a>.', 'woocommerce'), 'https://sandbox.komoju.com/sign_up')), 'invoice_prefix' => array('title' => __('Invoice Prefix', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter a prefix for your invoice numbers. If you use your Komoju account for multiple stores ensure this prefix is unique.', 'woocommerce'), 'default' => 'WC-', 'desc_tip' => true), 'debug' => array('title' => __('Debug Log', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable logging', 'woocommerce'), 'default' => 'no', 'description' => sprintf(__('Log Komoju events inside <code>%s</code>', 'woocommerce'), wc_get_log_file_path('komoju'))));
 /**
  * Remove/delete the chosen file.
  *
  * @param string $handle
  *
  * @return bool
  */
 public function remove($handle)
 {
     $removed = false;
     $file = wc_get_log_file_path($handle);
     if (is_file($file) && is_writable($file)) {
         // Close first to be certain no processes keep it alive after it is unlinked.
         $this->close($handle);
         $removed = unlink($file);
     } elseif (is_file(trailingslashit(WC_LOG_DIR) . $handle . '.log') && is_writable(trailingslashit(WC_LOG_DIR) . $handle . '.log')) {
         $this->close($handle);
         $removed = unlink(trailingslashit(WC_LOG_DIR) . $handle . '.log');
     }
     do_action('woocommerce_log_remove', $handle, $removed);
     return $removed;
 }
 /**
  * Initialise Gateway Settings Form Fields
  *
  * The standard gateway options have already been applied.
  * Change the fields to match what the payment gateway your building requires.
  *
  * @access public
  */
 public function init_form_fields()
 {
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'woocommerce-stellar-gateway'), 'label' => __('Enable Stellar', 'woocommerce-stellar-gateway'), 'type' => 'checkbox', 'description' => '', 'default' => 'no'), 'title' => array('title' => __('Title', 'woocommerce-stellar-gateway'), 'type' => 'text', 'description' => __('This controls the title which the customer sees during checkout.', 'woocommerce-stellar-gateway'), 'default' => __('Stellar', 'woocommerce-stellar-gateway'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'woocommerce-stellar-gateway'), 'type' => 'text', 'description' => __('This controls the description which the customer sees during checkout.', 'woocommerce-stellar-gateway'), 'default' => __('Pay with Stellar using your favourite Stellar wallet.', 'woocommerce-stellar-gateway'), 'desc_tip' => true), 'debug' => array('title' => __('Debug Log', 'woocommerce-stellar-gateway'), 'type' => 'checkbox', 'label' => __('Enable logging', 'woocommerce-stellar-gateway'), 'default' => 'no', 'description' => sprintf(__('Log Stellar events inside <code>%s</code>', 'woocommerce-stellar-gateway'), wc_get_log_file_path($this->id))), 'account_address' => array('title' => __('Stellar Address', 'woocommerce-stellar-gateway'), 'type' => 'text', 'description' => __('Enter your Stellar address. This is where payments will be sent.', 'woocommerce-stellar-gateway'), 'default' => '', 'desc_tip' => false));
 }
 /**
  * Initialise Gateway Settings Form Fields
  *
  * @access public
  * @return void
  */
 function init_form_fields()
 {
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable 2Checkout', 'woocommerce'), 'default' => 'yes'), 'title' => array('title' => __('Title', 'woocommerce'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce'), 'default' => __('Credit Card/PayPal', 'woocommerce'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'woocommerce'), 'type' => 'textarea', 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce'), 'default' => __('Pay with Credit Card/PayPal', 'woocommerce')), 'seller_id' => array('title' => __('Seller ID', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter your 2Checkout account number; this is needed in order to take payment.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => ''), 'publishable_key' => array('title' => __('Publishable Key', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter your 2Checkout Publishable Key; this is needed in order to take payment.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => ''), 'private_key' => array('title' => __('Private Key', 'woocommerce'), 'type' => 'text', 'description' => __('Please enter your 2Checkout Private Key; this is needed in order to take payment.', 'woocommerce'), 'default' => '', 'desc_tip' => true, 'placeholder' => ''), 'sandbox' => array('title' => __('Sandbox/Production', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Use 2Checkout Sandbox', 'woocommerce'), 'default' => 'no'), 'debug' => array('title' => __('Debug Log', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable logging', 'woocommerce'), 'default' => 'no', 'description' => sprintf(__('Log 2Checkout events', 'woocommerce'), wc_get_log_file_path('twocheckout'))));
 }
Example #24
0
 public function read_content($handle)
 {
     return file_get_contents(wc_get_log_file_path($handle));
 }
Example #25
0
 /**
  * Test wc_get_log_file_path().
  *
  * @since 2.4
  */
 public function test_wc_get_log_file_path()
 {
     $log_dir = trailingslashit(WC_LOG_DIR);
     $hash_name = sanitize_file_name(wp_hash('unit-tests'));
     $this->assertEquals($log_dir . 'unit-tests-' . $hash_name . '.log', wc_get_log_file_path('unit-tests'));
 }
 /**
  * Initialize options field for payment gateway
  *
  * @return void
  * @since 1.0.0
  */
 public function init_form_fields()
 {
     $this->form_fields = apply_filters('yith_wcauthnet_credit_card_gateway_options', array('enabled' => array('title' => __('Enable/Disable', 'yith-wcauthnet'), 'type' => 'checkbox', 'label' => __('Enable Authorize.net Payment', 'yith-wcauthnet'), 'default' => 'no'), 'title' => array('title' => __('Title', 'yith-wcauthnet'), 'type' => 'text', 'description' => __('This option lets you change the title that users see during the checkout.', 'yith-wcauthnet'), 'default' => __('Authorize.net Payment', 'yith-wcauthnet'), 'desc_tip' => true), 'description' => array('title' => __('Description', 'yith-wcauthnet'), 'type' => 'textarea', 'description' => __('This option lets you change the description that users see during checkout.', 'yith-wcauthnet'), 'default' => __('Accepts Payments. Anywhere', 'yith-wcauthnet')), 'card_types' => array('title' => __('Acceptance logos', 'yith-wcauthnet'), 'type' => 'multiselect', 'desc_tip' => __('Select which credit card logo to display on your checkout page', 'yith-wcauthnet'), 'default' => array('visa', 'mastercard', 'amex', 'discover', 'diners', 'jcb'), 'class' => 'chosen_select', 'css' => 'width: 350px;', 'options' => apply_filters('yith_wcauthnet_card_types', array('visa' => __('Visa', 'yith-wcauthnet'), 'mastercard' => __('MasterCard', 'yith-wcauthnet'), 'amex' => __('American Express', 'yith-wcauthnet'), 'discover' => __('Discover', 'yith-wcauthnet'), 'diners' => __('Diner\'s Club', 'yith-wcauthnet'), 'jcb' => __('JCB', 'yith-wcauthnet')))), 'login_id' => array('title' => __('Login ID', 'yith-wcauthnet'), 'type' => 'text', 'description' => __('Univocal ID login associated to the account of the admin (it can be recovered in the "API Login ID and Transaction Key" section)', 'yith-wcauthnet')), 'transaction_key' => array('title' => __('Transaction Key', 'yith-wcauthnet'), 'type' => 'text', 'description' => __('A unique key used to validate requests to Authorize.net (it can be recovered in the "API Login ID and Transaction Key" section)', 'yith-wcauthnet')), 'md5_hash' => array('title' => __('Md5 Hash', 'yith-wcauthnet'), 'type' => 'text', 'description' => __('A unique key used to validate the answers from Authorize.net (it can be set in the "MD5 Hash" section). You can activate this mode and set these details of your Authorize.net dashboard in Account -> Md5 Hash. The check will be done only in redirect mode, as the API connection is already protected with SSL.', 'yith-wcauthnet')), 'sandbox' => array('title' => __('Enable Authorize.net sandbox', 'yith-wcauthnet'), 'type' => 'checkbox', 'description' => __('Activate the sandbox mode to test the configuration', 'yith-wcauthnet')), 'transaction_type' => array('title' => __('Transaction type', 'yith-wcauthnet'), 'type' => 'select', 'desc_tip' => __('Select which type of transaction you want to send', 'yith-wcauthnet'), 'default' => 'AUTH_CAPTURE', 'css' => 'width: 350px;', 'options' => apply_filters('yith_wcauthnet_transaction_type', array('AUTH_CAPTURE' => __('Authorize & Capture', 'yith-wcauthnet'), 'AUTH_ONLY' => __('Authorize only', 'yith-wcauthnet')))), 'debug' => array('title' => __('Debug Log', 'yith-wcauthnet'), 'type' => 'checkbox', 'description' => sprintf(__('Log of the Authorize.net events inside <code>%s</code>', 'yith-wcauthnet'), wc_get_log_file_path('authorize.net')))));
 }