Plugin Directory

Changeset 3145934


Ignore:
Timestamp:
09/03/2024 12:26:38 PM (18 months ago)
Author:
everypaypayments
Message:

Visa requirements

Location:
everypay-payment-gateway/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • everypay-payment-gateway/trunk/assets/css/everypay_modal.css

    r2518089 r3145934  
    1010    min-width: 100%;
    1111    min-height: 100%;
    12     height: 100%;
    1312    overflow: hidden;
    1413    background-color: rgb(0,0,0);
     
    6564    align-self: center;
    6665    display: flex;
     66    column-gap: 4px;
    6767    align-items: center;
    6868    margin-bottom: 1vw;
     
    7474    font-size: 13px;
    7575    color: rgba(0, 0, 0, 0.87);
     76    margin-bottom: 0;
    7677}
    7778
  • everypay-payment-gateway/trunk/assets/js/everypay.js

    r2507281 r3145934  
    7676
    7777        payload.data = {
     78            ...payload.data,
    7879            cardToken: tokenized_card.getAttribute('crd'),
    7980            cardType: tokenized_card.getAttribute('card_type'),
  • everypay-payment-gateway/trunk/assets/js/everypay_modal.js

    r2507281 r3145934  
    104104
    105105    this.createSaveCardCheckbox = function() {
    106         var payformDiv = document.querySelector('#pay-form');
     106        var payformDiv = document.querySelector('#everypay-modal-content');
    107107        if (!payformDiv || document.getElementById('everypay-save-card-box')) {
    108108            return;
  • everypay-payment-gateway/trunk/assets/js/helpers.js

    r2507281 r3145934  
    44        pk: everypayData.pk,
    55        amount: everypayData.amount,
    6        display: {
    7            staticCardPlaceholder: true
    8        }
     6        display: {
     7            staticCardPlaceholder: true
     8        }
    99    };
    1010
     
    1818                addressLine1: everypayData.billing_address
    1919            },
     20        }
     21    }
     22
     23    if (everypayData.phone && typeof everypayData.phone === 'string') {
     24        payload.data = {
     25            ...payload.data,
     26            phone: everypayData.phone,
     27        }
     28    }
     29
     30    if (everypayData.email && typeof everypayData.email === 'string') {
     31        payload.data = {
     32            ...payload.data,
     33            email: everypayData.email,
    2034        }
    2135    }
  • everypay-payment-gateway/trunk/changelog.txt

    r2518089 r3145934  
    1515= 3.5 - 2021-04-20 =
    1616* Polylang removed.
     17
     18= 3.6 - 2024-09-03 =
     19* Visa requirements
  • everypay-payment-gateway/trunk/everypay-payment-gateway.php

    r2518089 r3145934  
    44 * Plugin URI: https://wordpress.org/plugins/everypay-woocommerce-addon/
    55 * Description: This plugin adds a payment option in WooCommerce for customers to pay with their Credit Cards Via Everypay.
    6  * Version: 3.5
     6 * Version: 3.6
    77 * Author: Everypay S.A.
    88 * Author URI: https://everypay.gr
  • everypay-payment-gateway/trunk/includes/class-wc-everypay-api.php

    r2473167 r3145934  
    120120     * @return array
    121121     */
    122     private static function request(string $url, array $params = array(), string $method = 'POST')
    123     {
    124         $apiKey = self::getApiKey();
     122    private static function request(string $url, array $params = array(), string $method = 'POST')
     123    {
     124        $apiKey = self::getApiKey();
    125125
    126         if (!$apiKey) {
    127             throw new Exception('api secret key is missing');
    128         }
    129         $query = http_build_query($params, null, '&');
    130         $curl   = curl_init();
    131         curl_setopt($curl, CURLOPT_TIMEOUT, 30);
    132         curl_setopt($curl, CURLOPT_CUSTOMREQUEST, strtoupper($method));
    133         curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    134             'User-Agent: EveryPay Internal PHP Library'
    135         ));
    136         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
     126        if (!$apiKey) {
     127            throw new Exception('api secret key is missing');
     128        }
     129        $query = http_build_query($params, '', '&');
     130        $curl   = curl_init();
     131        curl_setopt($curl, CURLOPT_TIMEOUT, 30);
     132        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, strtoupper($method));
     133        curl_setopt($curl, CURLOPT_HTTPHEADER, array(
     134            'User-Agent: EveryPay Internal PHP Library'
     135        ));
     136        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    137137
    138         curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    139         curl_setopt($curl, CURLOPT_USERPWD, $apiKey . ':');
     138        curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
     139        curl_setopt($curl, CURLOPT_USERPWD, $apiKey . ':');
    140140
    141         if (!empty($params)) {
    142             $query = http_build_query($params, null, '&');
    143             if ('get' === strtolower($method)) {
    144                 $url .= (false === strpos($url, '?')) ? '?' : '&';
    145                 $url .= $query;
    146             } else {
    147                 curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
    148             }
    149         }
     141        if (!empty($params)) {
     142            $query = http_build_query($params, '', '&');
     143            if ('get' === strtolower($method)) {
     144                $url .= (false === strpos($url, '?')) ? '?' : '&';
     145                $url .= $query;
     146            } else {
     147                curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
     148            }
     149        }
    150150
    151         curl_setopt($curl, CURLOPT_URL, $url);
    152         curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    153         $result   = curl_exec($curl);
    154         $info     = curl_getinfo($curl);
     151        curl_setopt($curl, CURLOPT_URL, $url);
     152        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     153        $result   = curl_exec($curl);
     154        $info     = curl_getinfo($curl);
    155155
    156         $response = array();
     156        $response = array();
    157157
    158         if (curl_errno($curl)) {
    159             $curlError = curl_error($curl);
    160             throw new Exception($curlError);
    161         }
     158        if (curl_errno($curl)) {
     159            $curlError = curl_error($curl);
     160            throw new Exception($curlError);
     161        }
    162162
    163         if (stripos($info['content_type'], 'application/json') === false) {
    164             throw new Exception('content type is not application/json'. ' '. $query);
    165         }
     163        if (stripos($info['content_type'], 'application/json') === false) {
     164            throw new Exception('content type is not application/json' . ' ' . $query);
     165        }
    166166
    167         $response['status'] = $info['http_code'];
    168         $response['body']   = json_decode($result, true);
     167        $response['status'] = $info['http_code'];
     168        $response['body']   = json_decode($result, true);
    169169
    170         if (!isset($response['body']) || empty($response['body'])) {
    171             throw new Exception('response body is empty. '.$query);
    172         }
     170        if (!isset($response['body']) || empty($response['body'])) {
     171            throw new Exception('response body is empty. ' . $query);
     172        }
    173173
    174         if (isset($response['body']['error'])) {
    175             throw new Exception($response['body']['error']['message']. ' '. $query);
    176         }
     174        if (isset($response['body']['error'])) {
     175            throw new Exception($response['body']['error']['message'] . ' ' . $query);
     176        }
    177177
    178         return $response;
    179     }
     178        return $response;
     179    }
    180180}
  • everypay-payment-gateway/trunk/includes/class-wc-everypay-renderer.php

    r2462801 r3145934  
    1919    public function render_iframe($amount, $max_installments)
    2020    {
    21         global  $current_user;
    22         $billing_address = get_user_meta( $current_user->ID, 'billing_address_1', true );
     21        $billing_address = WC()->customer->get_billing_address();
     22        $billing_email = WC()->customer->get_billing_email();
     23        $billing_phone = WC()->customer->get_billing_phone();
     24
    2325        $total = $this->helpers->format_amount($amount);
    2426
     
    2830            'max_installments' => $this->helpers->calculate_installments($total, $max_installments),
    2931            'locale' => $this->locale,
    30             'billing_address' => $billing_address
     32            'billing_address' => $billing_address,
     33            'email' => $billing_email,
     34            'phone' => $billing_phone,
    3135        );
    3236
    33         if ($_POST['tokenized-card'] ) {
     37        if (!empty($_POST['tokenized-card'])) {
    3438            $EVDATA['tokenized'] = true;
    3539        }
    3640
    37         if ($this->tokenization_status == 'yes' && is_user_logged_in() && !$_POST['tokenized-card']) {
     41        if ($this->tokenization_status == 'yes' && is_user_logged_in() && empty($_POST['tokenized-card'])) {
    3842            $EVDATA['save_cards'] = true;
    3943        }
  • everypay-payment-gateway/trunk/includes/payment-methods/class-wc-everypay-gateway.php

    r2518089 r3145934  
    22
    33if (!defined('ABSPATH'))
    4     exit;
     4    exit;
    55
    66
     
    88{
    99
    10     /**
    11     * Everypay public key
    12     * @var string
    13     */
    14     private $everypayPublicKey;
    15 
    16     /**
    17     * Everypay secret key
    18     * @var string
    19     */
    20     private $everypaySecretKey;
     10    /**
     11    * Everypay public key
     12    * @var string
     13    */
     14    private $everypayPublicKey;
     15
     16    /**
     17    * Everypay secret key
     18    * @var string
     19    */
     20    private $everypaySecretKey;
    2121
    2222    /**
     
    3434
    3535    /**
    36     * Everypay helpers
     36    * Everypay helpers
    3737     * @var object
    3838     */
     
    4343     * @var object
    4444     */
    45     private $renderer;
     45    private $renderer;
    4646
    4747    /**
     
    5151
    5252    public function __construct()
    53     {
    54         $this->id = 'everypay';
    55         $this->icon = apply_filters('woocommerce_everypay_icon', EVERYPAY_IMAGES_URL.'/everypay.png');
    56         $this->has_fields = true;
    57         $this->method_title = 'Everypay';
    58         $this->method_description = 'Everypay is a company that provides a way for individuals and businesses to accept payments over the Internet.';
    59         $this->init_form_fields();
    60         $this->init_settings();
    61         $this->supports = array('products', 'refunds');
    62         $this->title = esc_html($this->get_option('everypay_title'));
    63         $this->description = esc_html($this->get_option('description'));
    64 
    65         $this->everypayPublicKey = esc_html($this->get_option('everypayPublicKey'));
    66         $this->everypaySecretKey = esc_html($this->get_option('everypaySecretKey'));
    67         $this->max_installments = $this->get_option('everypay_maximum_installments');
    68         $this->tokenization_status = $this->get_option('everypay_tokenization');
    69         $this->everypay_sandbox = $this->get_option('everypay_sandbox');
    70 
    71         $this->helpers = new WC_Everypay_Helpers();
    72         $this->renderer = new WC_Everypay_Renderer($this->helpers, $this->everypayPublicKey, $this->tokenization_status);
    73        
    74         if (!defined("EVERYPAY_SANDBOX")) {
    75             define( "EVERYPAY_SANDBOX", $this->everypay_sandbox == 'yes' );
    76         }
    77 
    78         if (EVERYPAY_SANDBOX) {
    79             WC_Everypay_Api::setTestMode();
    80         }
    81 
    82         add_filter('woocommerce_available_payment_gateways', array($this, 'disable_everypay_if_keys_not_set'));
    83         add_filter('query_vars', array($this, 'add_everypay_var'));
    84         add_action('wp_enqueue_scripts', array($this, 'add_everypay_js'));
    85 
    86 
    87         if (is_admin()) {
    88             new WC_Everypay_Admin($this->everypayPublicKey, $this->everypaySecretKey);
    89             add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
    90         }
    91 
    92     }
    93 
    94 
    95     private function create_payload($wc_order, $token)
    96     {
    97         $amount = $this->helpers->format_amount($wc_order->order_total);
    98         $billing_email = $wc_order->billing_email;
    99         $billing_phone = $wc_order->billing_phone;
    100         $description = get_bloginfo('name') . ' / '
    101                        . 'Order' . ' #' . $wc_order->get_order_number() . ' - '
    102                        . number_format($amount/100, 2, ',', '.') . '€';
    103 
    104         if (!$billing_email || !$billing_phone || !$description || !$token) {
    105             throw new Exception('create_payload: invalid variable');
    106         }
    107         $installments = $this->helpers->calculate_installments(
    108                 $amount,
    109                 $this->max_installments
    110         );
    111         return array(
    112             'description' => $description,
    113             'amount' => $amount,
    114             'payee_email' => $billing_email,
    115             'payee_phone' => $billing_phone,
    116             'token' => $token,
    117             'max_installments' => $installments,
    118         );
    119     }
    120 
    121     /*
     53    {
     54        $this->id = 'everypay';
     55        $this->icon = apply_filters('woocommerce_everypay_icon', EVERYPAY_IMAGES_URL . '/everypay.png');
     56        $this->has_fields = true;
     57        $this->method_title = 'Everypay';
     58        $this->method_description = 'Everypay is a company that provides a way for individuals and businesses to accept payments over the Internet.';
     59        $this->init_form_fields();
     60        $this->init_settings();
     61        $this->supports = array('products', 'refunds');
     62        $this->title = esc_html($this->get_option('everypay_title'));
     63        $this->description = esc_html($this->get_option('description'));
     64
     65        $this->everypayPublicKey = esc_html($this->get_option('everypayPublicKey'));
     66        $this->everypaySecretKey = esc_html($this->get_option('everypaySecretKey'));
     67        $this->max_installments = $this->get_option('everypay_maximum_installments');
     68        $this->tokenization_status = $this->get_option('everypay_tokenization');
     69        $this->everypay_sandbox = $this->get_option('everypay_sandbox');
     70
     71        $this->helpers = new WC_Everypay_Helpers();
     72        $this->renderer = new WC_Everypay_Renderer($this->helpers, $this->everypayPublicKey, $this->tokenization_status);
     73
     74        if (!defined("EVERYPAY_SANDBOX")) {
     75            define("EVERYPAY_SANDBOX", $this->everypay_sandbox == 'yes');
     76        }
     77
     78        if (EVERYPAY_SANDBOX) {
     79            WC_Everypay_Api::setTestMode();
     80        }
     81
     82        add_filter('woocommerce_available_payment_gateways', array($this, 'disable_everypay_if_keys_not_set'));
     83        add_filter('query_vars', array($this, 'add_everypay_var'));
     84        add_action('wp_enqueue_scripts', array($this, 'add_everypay_js'));
     85
     86
     87        if (is_admin()) {
     88            new WC_Everypay_Admin($this->everypayPublicKey, $this->everypaySecretKey);
     89            add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
     90        }
     91    }
     92
     93
     94    private function create_payload($wc_order, $token)
     95    {
     96        $amount = $this->helpers->format_amount($wc_order->get_total());
     97        $billing_email = $wc_order->get_billing_email();
     98        $billing_phone = $wc_order->get_billing_phone();
     99        $description = get_bloginfo('name') . ' / '
     100            . 'Order' . ' #' . $wc_order->get_order_number() . ' - '
     101            . number_format($amount / 100, 2, ',', '.') . '€';
     102
     103        if (!$billing_email || !$billing_phone || !$description || !$token) {
     104            throw new Exception('create_payload: invalid variable');
     105        }
     106        $installments = $this->helpers->calculate_installments(
     107            $amount,
     108            $this->max_installments
     109        );
     110
     111        return array(
     112            'description' => $description,
     113            'amount' => $amount,
     114            'payee_email' => $billing_email,
     115            'payee_phone' => $billing_phone,
     116            'token' => $token,
     117            'max_installments' => $installments,
     118        );
     119    }
     120
     121    /*
    122122     *  Process the payment
    123123     *
     
    136136            }
    137137            if (!isset($_POST['everypayToken']) || empty($_POST['everypayToken'])) {
    138                 $this->renderer->render_iframe(WC()->cart->total , $this->max_installments);
     138                $this->renderer->render_iframe(WC()->cart->total, $this->max_installments);
    139139                exit;
    140140            }
     
    145145            $payload = $this->create_payload($wc_order, $token);
    146146
    147             if (is_user_logged_in() && (isset($_POST['everypay_save_card']) || isset($_POST['tokenized-card']) ) && $this->tokenization_status == 'yes') {
    148                 (new WC_Everypay_Repository())->save_logs('tokenization_payment', implode(" ",$payload));
     147            if (is_user_logged_in() && (isset($_POST['everypay_save_card']) || isset($_POST['tokenized-card'])) && $this->tokenization_status == 'yes') {
     148                (new WC_Everypay_Repository())->save_logs('tokenization_payment', implode(" ", $payload));
    149149                $user_id = $wc_order->get_user_id();
    150150                $everypay_tokenization = new WC_Everypay_Tokenization();
    151                 $everypay_tokenization->process_tokenized_payment($user_id, $payload);
     151                $response = $everypay_tokenization->process_tokenized_payment($user_id, $payload);
    152152            } else {
    153                 (new WC_Everypay_Repository())->save_logs('payment', implode(" ",$payload));
    154                 WC_Everypay_Api::addPayment($payload);
     153                (new WC_Everypay_Repository())->save_logs('payment', implode(" ", $payload));
     154                $response = WC_Everypay_Api::addPayment($payload);
    155155            }
    156             return $this->complete_order($wc_order);
    157 
     156            return $this->complete_order($wc_order, $response['body']['token']);
    158157        } catch (Exception $e) {
    159158
     
    161160            wc_add_notice(esc_html($error), 'error');
    162161            $response_data = array(
    163                 'result' => 'failure',
    164                 'reload' => true,
    165                 'refresh' => true
     162                'result' => 'failure',
     163                'reload' => true,
     164                'refresh' => true
    166165            );
    167166            echo json_encode($response_data);
    168167            if ($order_id) {
    169                 wp_delete_post($order_id,true);
     168                wp_delete_post($order_id, true);
    170169            }
    171170            (new WC_Everypay_Repository())->save_logs('error', $e->getMessage());
    172171            exit;
    173172        }
    174 
    175     }
    176 
    177     private function complete_order($wc_order)
    178     {
    179         $dt = new DateTime("Now");
    180         $timestamp = $dt->format('Y-m-d H:i:s e');
    181 
    182         $wc_order->add_order_note('Everypay payment completed at-' .$timestamp);
    183         $wc_order->payment_complete();
    184         $wc_order->get_order();
    185         WC()->cart->empty_cart();
    186 
    187        return array(
    188             'result' => 'success',
    189             'redirect' => $this->get_return_url($wc_order)
    190         );
    191 
    192     }
     173    }
     174
     175    private function complete_order($wc_order, $token)
     176    {
     177        $dt = new DateTime("Now");
     178        $timestamp = $dt->format('Y-m-d H:i:s e');
     179
     180        $wc_order->add_order_note('Everypay payment completed at-' . $timestamp);
     181        $wc_order->update_meta_data('everypay_payment_token', $token);
     182        $wc_order->payment_complete();
     183        $wc_order->get_order();
     184        WC()->cart->empty_cart();
     185
     186        return array(
     187            'result' => 'success',
     188            'redirect' => $this->get_return_url($wc_order)
     189        );
     190    }
    193191
    194192    public function payment_fields()
     
    200198        }
    201199        $repository = new WC_Everypay_Repository();
    202         $user_id = get_current_user_id();
    203         $customer_cards = $repository->get_customer_cards($user_id);
    204 
    205         wp_enqueue_script('tokenization_js', EVERYPAY_JS_URL.'tokenization.js', array('jquery'), false, true);
     200        $user_id = get_current_user_id();
     201        $customer_cards = $repository->get_customer_cards($user_id);
     202
     203        wp_enqueue_script('tokenization_js', EVERYPAY_JS_URL . 'tokenization.js', array('jquery'), false, true);
    206204
    207205        echo '<div>';
    208206        if (!empty($customer_cards)) {
    209             $this->renderer->render_cards($customer_cards);
    210         }
     207            $this->renderer->render_cards($customer_cards);
     208        }
    211209        echo '</div>';
    212 
    213     }
    214 
    215 
    216     /**
    217      * Refund
    218      *
    219      * @param type $order_id
    220      * @param type $amount
    221      * @param type $reason
    222      * @return boolean
    223      */
    224     public function process_refund($order_id, $amount = NULL, $reason = '')
    225     {
    226         if (!$amount) {
    227             return false;
    228         }
    229 
    230         try {
    231             $params = array(
    232                 'amount' => preg_replace("/[^0-9]/", '', number_format($amount, 2)),
    233                 'description' => $reason
    234             );
    235 
    236             $token = get_post_meta( (int) $order_id, 'token', true);
    237 
    238             WC_Everypay_Api::setApiKey($this->everypaySecretKey);
    239             $refund = WC_Everypay_Api::refundPayment($token, $params);
    240 
    241             $dt = new DateTime("Now");
    242             $timestamp = $dt->format('Y-m-d H:i:s e');
    243             $refToken = $refund['body']['token'];
    244 
    245             $wc_order = new WC_Order($order_id);
    246             $wc_order->add_order_note('Everypay Refund completed at-' . $timestamp . '-with Refund Token=' . $refToken);
    247 
    248             return true;
    249 
    250         } catch (\Exception $e) {
    251             return false;
    252         }
    253     }
     210    }
     211
     212
     213    /**
     214     * Refund
     215     *
     216     * @param type $order_id
     217     * @param type $amount
     218     * @param type $reason
     219     * @return boolean
     220     */
     221    public function process_refund($order_id, $amount = NULL, $reason = '')
     222    {
     223        if (!$amount) {
     224            return false;
     225        }
     226
     227        try {
     228            $params = array(
     229                'amount' => preg_replace("/[^0-9]/", '', number_format($amount, 2)),
     230                'description' => $reason
     231            );
     232
     233            $wc_order = new WC_Order($order_id);
     234            $token = $wc_order->get_meta('everypay_payment_token');
     235
     236            WC_Everypay_Api::setApiKey($this->everypaySecretKey);
     237            $refund = WC_Everypay_Api::refundPayment($token, $params);
     238
     239            $dt = new DateTime("Now");
     240            $timestamp = $dt->format('Y-m-d H:i:s e');
     241            $refToken = $refund['body']['token'];
     242
     243            $wc_order->add_order_note('Everypay Refund completed at-' . $timestamp . '-with Refund Token=' . $refToken);
     244
     245            return true;
     246        } catch (\Exception $e) {
     247            return false;
     248        }
     249    }
    254250
    255251    /**
     
    263259        }
    264260
    265         wp_register_style( 'everypay_styles', EVERYPAY_CSS_URL.'everypay_styles.css' );
    266         wp_enqueue_style( 'everypay_styles' );
    267 
    268         wp_register_style( 'everypay_modal', EVERYPAY_CSS_URL.'everypay_modal.css' );
    269         wp_enqueue_style( 'everypay_modal' );
     261        wp_register_style('everypay_styles', EVERYPAY_CSS_URL . 'everypay_styles.css');
     262        wp_enqueue_style('everypay_styles');
     263
     264        wp_register_style('everypay_modal', EVERYPAY_CSS_URL . 'everypay_modal.css');
     265        wp_enqueue_style('everypay_modal');
    270266
    271267        if (EVERYPAY_SANDBOX) {
     
    277273        wp_enqueue_script('everypay_script');
    278274
    279         wp_register_script('everypay_helpers', EVERYPAY_JS_URL.'helpers.js');
     275        wp_register_script('everypay_helpers', EVERYPAY_JS_URL . 'helpers.js');
    280276        wp_enqueue_script('everypay_helpers');
    281277
    282         wp_register_script('everypay_modal', EVERYPAY_JS_URL.'everypay_modal.js', array(), false, true);
     278        wp_register_script('everypay_modal', EVERYPAY_JS_URL . 'everypay_modal.js', array(), false, true);
    283279        wp_enqueue_script('everypay_modal');
    284280
    285         wp_register_script('everypay', EVERYPAY_JS_URL.'everypay.js', array(), false, true);
     281        wp_register_script('everypay', EVERYPAY_JS_URL . 'everypay.js', array(), false, true);
    286282        wp_enqueue_script('everypay');
    287283    }
     
    291287        $error = 'An error occurred. Please try again.';
    292288        wc_add_notice($error, $notice_type = 'error');
    293         (new WC_Everypay_Repository())->save_logs('error', $errorMessage);
     289        (new WC_Everypay_Repository())->save_logs('error', $errorMessage);
    294290    }
    295291
     
    300296    public function init_form_fields()
    301297    {
    302         $this->form_fields = require plugin_dir_path(__FILE__). '../admin/wc-admin-form-fields.php';
     298        $this->form_fields = require plugin_dir_path(__FILE__) . '../admin/wc-admin-form-fields.php';
    303299    }
    304300
     
    306302    public function admin_options()
    307303    {
    308         ?>
    309         <table class="form-table">
     304?>
     305        <table class="form-table">
    310306            <?php $this->generate_settings_html(); ?>
    311             <tr valign="top">
    312                 <th scope="row" class="titledesc" style="padding-top:0">&nbsp;</th>
    313                 <td class="forminp" id="everypay-max_installments-table" style="padding-top:0">
    314                     <div id="installments"></div>
    315                     <div id="installment-table" style="display:none">
    316                         <table class="widefat wc_input_table table" cellspacing="0">
    317                             <thead>
    318                             <tr>
    319                                 <th>Από (Ποσό σε &euro;)</th>
    320                                 <th>Eως (Ποσό σε &euro;)</th>
    321                                 <th>Μέγιστος Αρ. Δόσεων</th>
    322                                 <th>
    323                                     <a class="button-primary" href="#" id="add-installment" style="width:101px;">
    324                                         <i class="icon icon-plus-sign"></i> <span class="ab-icon"></span>  Προσθήκη
    325                                     </a>
    326                                 </th>
    327                             </tr>
    328                             </thead>
    329                             <tbody>
    330                             </tbody>
    331                         </table>
    332                     </div>
    333                 </td>
    334             </tr>
    335         </table>
    336         <?php
     307            <tr valign="top">
     308                <th scope="row" class="titledesc" style="padding-top:0">&nbsp;</th>
     309                <td class="forminp" id="everypay-max_installments-table" style="padding-top:0">
     310                    <div id="installments"></div>
     311                    <div id="installment-table" style="display:none">
     312                        <table class="widefat wc_input_table table" cellspacing="0">
     313                            <thead>
     314                                <tr>
     315                                    <th>Από (Ποσό σε &euro;)</th>
     316                                    <th>Eως (Ποσό σε &euro;)</th>
     317                                    <th>Μέγιστος Αρ. Δόσεων</th>
     318                                    <th>
     319                                        <a class="button-primary" href="#" id="add-installment" style="width:101px;">
     320                                            <i class="icon icon-plus-sign"></i> <span class="ab-icon"></span>  Προσθήκη
     321                                        </a>
     322                                    </th>
     323                                </tr>
     324                            </thead>
     325                            <tbody>
     326                            </tbody>
     327                        </table>
     328                    </div>
     329                </td>
     330            </tr>
     331        </table>
     332<?php
    337333    }
    338334
     
    342338     * @return array
    343339     */
    344     public function add_everypay_var($vars) {
     340    public function add_everypay_var($vars)
     341    {
    345342        $vars[] = "everypayToken";
    346343        return $vars;
     
    362359        return $available_gateways;
    363360    }
    364 
    365361}
Note: See TracChangeset for help on using the changeset viewer.