Plugin Directory

Changeset 3036865


Ignore:
Timestamp:
02/16/2024 01:34:40 PM (2 years ago)
Author:
best2pay
Message:

updated to ver 2.2.0

Location:
best2pay-payment-method-visamastercard
Files:
38 added
6 edited

Legend:

Unmodified
Added
Removed
  • best2pay-payment-method-visamastercard/trunk/best2pay-payment_method.php

    r3011458 r3036865  
    11<?php
    22declare(strict_types=1);
    3 
    43
    54/*
     
    1716    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1817*/
     18
    1919/**
    20  * Plugin Name: Best2Pay payment method (Visa/MasterCard/MIR)
     20 * Plugin Name: Best2Pay payment module
    2121 * Plugin URI: https://best2pay.net/
    2222 * Description: Receive payments via Visa/Mastercard/MIR easily with Best2Pay bank cards processing
    23  * Version: 2.1.5
     23 * Version: 2.2.0
    2424 * Author: Best2Pay
    25  * Tested up to: 6.3.2
     25 * Tested up to: 6.4.3
    2626 * License: GPL3
    2727 *
     
    3535add_action('plugins_loaded', 'init_woocommerce_best2pay', 0);
    3636
    37 function init_woocommerce_best2pay()
    38 {
     37function init_woocommerce_best2pay() {
    3938    if(!class_exists('WC_Payment_Gateway')){
    4039        return;
    4140    }
    42    
     41
    4342    load_plugin_textdomain('best2pay-payment_method', false, dirname(plugin_basename(__FILE__)) . '/languages');
    44    
    45     class woocommerce_best2pay extends WC_Payment_Gateway
    46     {
     43
     44    class woocommerce_best2pay extends WC_Payment_Gateway {
    4745        const PLUGIN_SITE = 'https://best2pay.net';
    4846        const SHOP_CART_MAX_LENGTH = 1000;
     
    5553            'loan' => '/webapi/custom/unicheckout/PurchaseWithLoanManager'
    5654        ];
    57        
     55
    5856        const OLD_TO_NEW_PAYMENT_METHODS = [
    5957            'Purchase' => 'acquiring',
     
    6361            'PurchaseSBP' => 'sbp'
    6462        ];
     63
    6564        private const OPERATION_TYPES = [
    6665            'PURCHASE',
     
    7069            'COMPLETE'
    7170        ];
     71
    7272        private const PAID_OPERATION_TYPES = [
    7373            'PURCHASE',
     
    7575            'AUTHORIZE',
    7676        ];
     77
    7778        private const OPERATION_APPROVED = 'APPROVED';
    7879        private const OPERATION_COMPLETE = 'COMPLETE';
     
    9091        protected string $testmode;
    9192        protected string $hash_algo;
     93        protected string $notify_customer_enabled;
    9294        protected string $registered_status;
    9395        protected string $authorized_status;
    9496        protected string $loan_status;
    9597        protected string $completed_status;
     98        protected string $agreement_status;
     99        protected string $payment_expected_status;
    96100        protected string $canceled_status;
    97101        protected string $payment_method;
     
    101105        protected string $fiscal_positions;
    102106        protected array $shop_cart;
     107        protected string $logo_field;
     108        protected string $remove_logo_field;
    103109        /**
    104110         * Init fields, set settings, register hooks
    105111         */
    106         public function __construct()
    107         {
     112        public function __construct() {
    108113            require_once ABSPATH . 'wp-admin/includes/file.php';
     114
    109115            // plugin settings
    110116            $this->id = 'best2pay';
     
    115121                '[email protected]'
    116122            );
    117             $this->title = __('Best2Pay', 'best2pay-payment_method');
    118             $this->description = sprintf(
    119                 __('Payments with bank cards via the <a href="%s" target="_blank">Best2Pay</a> payment system.', 'best2pay-payment_method'),
    120                 self::PLUGIN_SITE
    121             );
    122123            $this->icon = plugins_url('assets/img/best2pay.png', __FILE__);
    123124            $this->has_fields = true;
    124125            $this->notify_url = add_query_arg('wc-api', 'best2pay_notify', home_url('/'));
    125126            $this->callback_url = add_query_arg('wc-api', 'best2pay', home_url('/'));
    126            
     127
    127128            // means that the gateway accept refunds
    128129            $this->supports = array('refunds', 'products');
    129            
     130
    130131            $this->init_form_fields();
    131132            $this->init_settings();
    132            
     133
    133134            // variables
     135            $this->title = !empty($this->settings['title']) ? $this->settings['title'] : $this->method_title;
     136            $this->description = !empty($this->settings['description']) ? $this->settings['description'] : sprintf(
     137                __('Payments with bank cards via the <a href="%s" target="_blank">Best2Pay</a> payment system.', 'best2pay-payment_method'),
     138                self::PLUGIN_SITE
     139            );
     140            $this->logo = $this->settings['logo'] ?? '';
    134141            $this->sector = $this->settings['sector'];
    135142            $this->password = $this->settings['password'];
     
    137144            $this->payment_method = $this->settings['payment_method'] ?? '';
    138145            $this->tax = $this->settings['tax'] ?? '6';
    139             $this->hash_algo = $this->settings['hash_algo'] ?? 'md5';
    140            
     146            $this->hash_algo = !empty($this->settings['hash_algo']) ? $this->settings['hash_algo'] : 'md5';
     147            $this->notify_customer_enabled = $this->settings['notify_customer_enabled'] ?? '';
     148
    141149            //statuses
    142150            $this->registered_status = $this->settings['registered_status'] ?? '';
     
    145153            $this->completed_status = $this->settings['completed_status'] ?? '';
    146154            $this->canceled_status = $this->settings['canceled_status'] ?? '';
    147            
     155            $this->agreement_status = $this->settings['agreement_status'] ?? '';
     156            $this->payment_expected_status = $this->settings['payment_expected_status'] ?? '';
     157
    148158            $this->currency = $this->get_currency(get_woocommerce_currency());
    149159            $this->url = $this->best2pay_get_url();
    150            
     160            $this->logo_field = $this->plugin_id . $this->id . '_logo';
     161            $this->remove_logo_field = $this->plugin_id . $this->id . '_remove_logo';
     162
    151163            switch($this->payment_method) {
    152164                case 'halva':
    153165                case 'halva_two_steps':
    154                     $this->title = __('Pay for your order in installments', 'best2pay-payment_method'); //'Оплатить заказ Частями';
    155                     $this->icon = plugins_url('assets/img/halva.svg', __FILE__);
     166                    $this->title = __('Pay for your order in installments', 'best2pay-payment_method');
     167                    $this->icon = plugins_url('assets/img/svkb.svg', __FILE__);
    156168                    $this->description = '<iframe style="width:100%;height:180px;border:none;min-width: 440px;margin-left: -50px;"
    157                         src="' . plugins_url('halva_widget.php', __FILE__) . '?amount='
     169                        src="' . plugins_url('svkb_widget.php', __FILE__) . '?amount='
    158170                        . print_r((isset(WC()->cart->cart_contents_total)) ? WC()->cart->cart_contents_total : '', true) . '"></iframe>';
    159171                    break;
    160                 case 'sbp':
    161                     $this->title = __('Pay by QR', 'best2pay-payment_method'); //'Оплатить по QR';
    162                     $this->icon = null;
     172                default:
     173                    if($this->logo)
     174                        $this->icon = wp_get_attachment_url($this->logo);
    163175                    break;
    164176            }
     177
    165178            // actions
    166179            add_action('init', array($this, 'successful_request'));
     
    170183            add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
    171184            add_action('woocommerce_order_item_add_action_buttons', array($this, 'wc_order_item_add_complete_button'), 10, 1);
    172         }
    173        
     185            add_filter('woocommerce_generate_image_html', 'woocommerce_generate_image_html');
     186            add_action("woocommerce_order_status_changed", array($this, 'wc_best2pay_order_payment_change'), 10, 4);
     187        }
     188
     189        public function generate_image_html( $key, $data ) {
     190            $field_key = $this->get_field_key( $key );
     191            $defaults  = array(
     192                'title'             => '',
     193                'disabled'          => false,
     194                'class'             => '',
     195                'css'               => '',
     196                'placeholder'       => '',
     197                'type'              => 'file',
     198                'desc_tip'          => false,
     199                'description'       => '',
     200                'custom_attributes' => array(),
     201            );
     202
     203            $data = wp_parse_args( $data, $defaults );
     204
     205            ob_start();?>
     206            <tr valign="top">
     207                <th scope="row" class="titledesc">
     208                    <label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?> <?php echo $this->get_tooltip_html( $data );?></label>
     209                </th>
     210                <td class="forminp">
     211                    <fieldset>
     212                        <legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
     213                        <input class="input-text regular-input" type="file" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" accept="image/*">
     214                    </fieldset>
     215                    <?php if(!empty($this->logo)){
     216                        $logo_meta = wp_get_attachment_metadata($this->logo);?>
     217                        <img src="<?php echo wp_get_attachment_url($this->logo) ?>" alt="" width="100" style="margin: 10px">
     218                        <div>(<?php echo $logo_meta['width'] . 'x' . $logo_meta['height'];?>)</div>
     219                        <br>
     220                        <label for="<?php echo esc_attr( $this->remove_logo_field ); ?>">
     221                            <input class="" type="checkbox" name="<?php echo esc_attr( $this->remove_logo_field ); ?>" id="<?php echo esc_attr( $this->remove_logo_field ); ?>" style="" value="1"> <?php echo wp_kses_post( __('Remove logo', 'best2pay-payment_method') ); ?></label>
     222                        <?php
     223                    } else { ?>
     224                        <img src="<?php echo plugins_url('assets/img/best2pay.png', plugin_basename(__FILE__)); ?>" alt="" width="100" style="margin: 10px">
     225                    <?php } ?>
     226                </td>
     227            </tr>
     228            <?php return ob_get_clean();
     229        }
     230
    174231        /**
    175232         * Initialise Gateway Settings Form Fields
     
    177234         * @return void
    178235         */
    179         public function init_form_fields()
    180         {
     236        public function init_form_fields() {
    181237            $wc_statuses = wc_get_order_statuses();
    182            
    183             //  array to generate admin form
     238
    184239            $this->form_fields = array(
    185240                'enabled' => array(
     
    189244                    'default' => 'yes'
    190245                ),
    191                
     246                'title' => array(
     247                    'title' => __('Title', 'best2pay-payment_method'),
     248                    'type' => 'text',
     249                    'description' => __('Custom title for payment type', 'best2pay-payment_method'),
     250                    'desc_tip' => true,
     251                    'default' => '',
     252                    'placeholder' => $this->method_title
     253                ),
     254                'description' => array(
     255                    'title' => __('Description', 'best2pay-payment_method'),
     256                    'type' => 'textarea',
     257                    'description' => __('Custom description for payment type', 'best2pay-payment_method'),
     258                    'desc_tip' => true,
     259                    'default' => '',
     260                    'css' => 'width: 400px;'
     261                ),
     262                'logo' => array(
     263                    'title' => __('Logo', 'best2pay-payment_method'),
     264                    'type' => 'image',
     265                    'description' => __('Custom logo for payment type', 'best2pay-payment_method'),
     266                    'desc_tip' => true,
     267                    'default' => ''
     268                ),
    192269                'sector' => array(
    193270                    'title' => __('Sector ID', 'best2pay-payment_method'),
     
    197274                    'default' => ''
    198275                ),
    199                
    200276                'password' => array(
    201277                    'title' => __('Password', 'best2pay-payment_method'),
     
    205281                    'default' => ''
    206282                ),
    207                
    208283                'testmode' => array(
    209284                    'title' => __('Test Mode', 'best2pay-payment_method'),
     
    214289                    ),
    215290                    'description' => __('Select test or live mode', 'best2pay-payment_method'),
    216                     'desc_tip' => true,
    217                 ),
    218                
     291                    'desc_tip' => true
     292                ),
    219293                'payment_method' => array(
    220294                    'title' => __('Payment method', 'best2pay-payment_method'),
     
    223297                        'acquiring' => __('Standard acquiring (one-stage payment)', 'best2pay-payment_method'),
    224298                        'acquiring_two_steps' => __('Standard acquiring (two-stage payment)', 'best2pay-payment_method') . ' *',
    225                         'halva' => __('Halva Chastyami (one-stage payment)', 'best2pay-payment_method'),
    226                         'halva_two_steps' => __('Halva Chastyami (two-stage payment)', 'best2pay-payment_method') . ' *',
     299                        'halva' => __('Plait (one-stage payment)', 'best2pay-payment_method'),
     300                        'halva_two_steps' => __('Plait (two-stage payment)', 'best2pay-payment_method') . ' *',
    227301                        'sbp' => __('Fast Payment System', 'best2pay-payment_method'),
    228302                        'loan' => __('Loan', 'best2pay-payment_method')
    229303                    ),
    230304                    'description' => '* ' . __('Payment occurs after confirmation by the manager in the personal account', 'best2pay-payment_method'),
    231                     'desc_tip' => true,
    232                 ),
    233                
     305                    'desc_tip' => true
     306                ),
    234307                'tax' => array(
    235308                    'title' => __('TAX', 'best2pay-payment_method'),
     
    243316                        6 => __('Not subject to VAT', 'best2pay-payment_method'),
    244317                    ),
    245                     'default' => '6',
    246                 ),
    247                
     318                    'default' => '6'
     319                ),
    248320                'notify_url' => array(
    249321                    'title' => __('Notify URL', 'best2pay-payment_method'),
     
    254326                    'custom_attributes' => array(
    255327                        'readonly' => 'readonly',
    256                     ),
    257                 ),
    258                
     328                    )
     329                ),
    259330                'hash_algo' => array(
    260331                    'title' => __('Data encryption algorithm', 'best2pay-payment_method'),
     
    266337                    'description' => __('Must match your sector encryption settings in your personal account', 'best2pay-payment_method'),
    267338                    'desc_tip' => true,
    268                     'default' => 'md5',
    269                 ),
    270                
     339                    'default' => 'md5'
     340                ),
    271341                'custom_statuses_header' => array(
    272342                    'title' => __('Custom statuses for orders', 'best2pay-payment_method'),
    273                     'type' => 'title',
    274                 ),
    275                
    276                 // custom order statuses
     343                    'type' => 'title'
     344                ),
    277345                'registered_status' => array(
    278346                    'title' => __('Order registered', 'best2pay-payment_method'),
    279347                    'type' => 'select',
    280                     'options' => $wc_statuses,
     348                    'options' => $wc_statuses
    281349                ),
    282350                'authorized_status' => array(
    283351                    'title' => __('Order authorized', 'best2pay-payment_method'),
    284352                    'type' => 'select',
    285                     'options' => $wc_statuses,
     353                    'options' => $wc_statuses
    286354                ),
    287355                'loan_status' => array(
    288356                    'title' => __('Loan agreement approved but not signed', 'best2pay-payment_method'),
    289357                    'type' => 'select',
    290                     'options' => $wc_statuses,
     358                    'options' => $wc_statuses
    291359                ),
    292360                'completed_status' => array(
    293361                    'title' => __('Order successfully paid', 'best2pay-payment_method'),
    294362                    'type' => 'select',
    295                     'options' => $wc_statuses,
     363                    'options' => $wc_statuses
    296364                ),
    297365                'canceled_status' => array(
    298366                    'title' => __('Order canceled', 'best2pay-payment_method'),
    299367                    'type' => 'select',
     368                    'options' => $wc_statuses
     369                ),
     370                'notify_customer_enabled' => array(
     371                    'title' => __('Issuing an invoice for payment', 'best2pay-payment_method'),
     372                    'type' => 'checkbox',
     373                    'label' => __('Enable issuing an invoice for payment by email of the payer', 'best2pay-payment_method'),
     374                    'default' => 'no'
     375                ),
     376                'agreement_status' => array(
     377                    'title' => __('Order agreement', 'best2pay-payment_method'),
     378                    'type' => 'select',
    300379                    'options' => $wc_statuses,
    301                 ),
    302                
     380                    'default' => 'wc-on-hold'
     381                ),
     382                'payment_expected_status' => array(
     383                    'title' => __('Payment expected', 'best2pay-payment_method'),
     384                    'type' => 'select',
     385                    'options' => $wc_statuses,
     386                    'default' => 'wc-pending'
     387                )
    303388            );
    304            
    305         }
    306        
    307         /**
    308          * Overwritten WC function.
    309          * Register order @ Best2Pay and redirect user to payment form
    310          *
    311          * @param $order_id
    312          * @return string[]
    313          **/
    314         public function process_payment($order_id)
    315         {
    316             $order = wc_get_order($order_id);
     389
     390            wp_enqueue_script('admin-best2pay-script', plugins_url('assets/js/admin.js', __FILE__));
     391        }
     392
     393        public function wc_best2pay_order_payment_change ($order_id, $status_from, $status_to, $order) {
     394            if($order->payment_method === 'best2pay' && ($status_from === 'on-hold' && $status_to === 'pending')) {
     395                $this->process_payment_registration($order);
     396            }
     397        }
     398
     399        public function process_payment_registration($order) {
    317400            $order_amount = $this->centify($order->get_total());
    318            
     401
    319402            $this->calc_fiscal_position_shop_cart($order, $order_amount);
    320            
     403
    321404            $args = array(
    322405                'sector' => $this->sector,
     
    332415                'signature' => $this->generate_sign([$this->sector, $order_amount, $this->currency], true)
    333416            );
    334            
     417
     418            if($this->notify_customer_enabled === 'yes') {
     419                $args = array_merge($args, ['notify_customer' => 1]);
     420            }
     421
    335422            try {
    336423                $response = $this->send_request($this->url . '/webapi/Register', ['body' => $args]);
    337424                if (is_wp_error($response))
    338425                    throw new Exception($response->get_error_message());
     426
    339427                $response = $response['body'] ?? $response;
     428
    340429                $b2p_order_id = (int) $response;
    341430                if ($b2p_order_id == 0)
    342431                    throw new Exception(__('Failed to register order', 'best2pay-payment_method') . '<br>' . $response );
     432
    343433            } catch(Exception $e) {
    344434                $this->log($e->getMessage(), ['args' => $args, 'response' => $response]);
    345435                wc_add_notice($e->getMessage(), 'error' );
     436
    346437                return [
    347438                    'result' => 'failure',
     
    349440                ];
    350441            }
    351            
     442
    352443            update_post_meta($order->get_id(), 'best2pay_order_id', $b2p_order_id);
    353444            update_post_meta($order->get_id(), 'best2pay_order_state', self::ORDER_REGISTERED);
    354445            $order->add_order_note(__('Order registered successfully', 'best2pay-payment_method') . " (ID: $b2p_order_id)");
    355            
     446
     447            return $b2p_order_id;
     448        }
     449
     450        public function process_payment_payform($pay_order_id) : string {
    356451            $data = [
    357452                'sector' => $this->sector,
    358                 'id' => $b2p_order_id
     453                'id' => $pay_order_id
    359454            ];
     455
    360456            if(($this->payment_method === 'halva' || $this->payment_method === 'halva_two_steps') && $this->shop_cart) {
    361457                $shop_cart_encoded = base64_encode(json_encode($this->shop_cart, JSON_UNESCAPED_UNICODE));
     458
    362459                if(strlen($shop_cart_encoded) > self::SHOP_CART_MAX_LENGTH)
    363460                    $shop_cart_encoded = '';
     461
    364462                $data['shop_cart'] = $shop_cart_encoded;
    365463            }
     464
    366465            $this->sign_data($data, true);
    367466            $payment_path = self::PAYMENT_PATHS_BY_METHOD[$this->payment_method];
    368             $payment_url = $this->url . $payment_path . '?' . http_build_query($data);
     467
     468            return $this->url . $payment_path . '?' . http_build_query($data);
     469        }
     470
     471        public function process_admin_options() {
     472            if(!empty($_POST[$this->remove_logo_field]) && !empty($this->logo)){
     473                if(wp_delete_attachment($this->logo))
     474                    $this->update_option('logo');
     475            } else if (!empty($_FILES[$this->logo_field]['name'])) {
     476                require_once( ABSPATH . 'wp-admin/includes/image.php' );
     477                require_once( ABSPATH . 'wp-admin/includes/file.php' );
     478                require_once( ABSPATH . 'wp-admin/includes/media.php' );
     479                if(!file_is_valid_image($_FILES[$this->logo_field]['tmp_name']))
     480                    return false;
     481
     482                $attachment_id = media_handle_upload($this->logo_field, 0 );
     483                if (is_wp_error($attachment_id))
     484                    return $attachment_id->get_error_message();
     485
     486                // remove old attachment
     487                if(!empty($this->logo))
     488                    wp_delete_attachment($this->logo);
     489
     490                $this->update_option('logo', $attachment_id);
     491            }
     492
     493            $this->init_settings();
     494
     495            $post_data = $this->get_post_data();
     496
     497            foreach ( $this->get_form_fields() as $key => $field ) {
     498                if(in_array($this->get_field_type( $field ), ['title', 'image'])) continue;
     499
     500                try {
     501                    $this->settings[ $key ] = $this->get_field_value( $key, $field, $post_data );
     502                } catch ( Exception $e ) {
     503                    $this->add_error( $e->getMessage() );
     504                }
     505            }
     506
     507            return update_option( $this->get_option_key(), apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ) );
     508        }
     509
     510        /**
     511         * Overwritten WC function.
     512         * Register order @ Best2Pay and redirect user to payment form
     513         *
     514         * @param $order_id
     515         * @return string[]
     516         **/
     517        public function process_payment($order_id) {
     518            $order = wc_get_order($order_id);
     519
     520            if($this->notify_customer_enabled === 'yes' && $order->get_status() !== $this->agreement_status && !get_post_meta($order_id, 'best2pay_order_moderated', true)) {
     521                $order->add_order_note(__('Order successfully create', 'best2pay-payment_method'));
     522                $order->update_status($this->agreement_status);
     523
     524                update_post_meta($order->get_id(), 'best2pay_order_moderated', 'yes');
     525
     526                WC()->cart->empty_cart();
     527
     528                return array(
     529                    'result'   => 'success',
     530                    'redirect' => $this->get_return_url($order),
     531                );
     532            }
     533
     534            $register_order_id = get_post_meta($order_id, 'best2pay_order_id', true);
     535
     536            if($register_order_id) {
     537                $payment_url = $this->process_payment_payform(intval($register_order_id));
     538            } else {
     539                $pay_order_id = intval($this->process_payment_registration($order));
     540                $payment_url = $this->process_payment_payform($pay_order_id);
     541            }
     542
    369543            return array(
    370544                'result' => 'success',
     
    372546            );
    373547        }
    374        
     548
    375549        /**
    376550         * Callback from payment gateway was received
    377551         **/
    378         public function callback_from_gateway()
    379         {
     552        public function callback_from_gateway() {
    380553            $response = '';
    381554            $order = [];
    382555            $checkout_url = apply_filters('woocommerce_get_checkout_url', wc_get_checkout_url());
     556
    383557            try{
    384                 // processing center order ID
    385558                $pc_order_id = intval($_REQUEST['id']);
    386559                if(!$pc_order_id)
    387560                    throw new Exception(__('Failed to get Best2pay order ID', 'best2pay-payment_method'));
     561
    388562                $pc_operation_id = intval($_REQUEST['operation']);
    389563                if(!$pc_operation_id)
    390564                    throw new Exception(__('Failed to get Best2pay operation ID', 'best2pay-payment_method'));
     565
    391566                $order_id = intval($_REQUEST['reference']);
    392567                if(!$order_id)
    393568                    throw new Exception(__('Undefined order ID', 'best2pay-payment_method'));
     569
    394570                $order = wc_get_order($order_id);
    395571                if(!$order)
    396572                    throw new Exception(__('Failed to get order information', 'best2pay-payment_method'));
     573               
     574                $db_pc_order_id = (int) get_post_meta($order_id, 'best2pay_order_id', true);
     575                if($db_pc_order_id !== $pc_order_id)
     576                    throw new Exception(__('Request data is not valid', 'best2pay-payment_method'));
    397577               
    398578                // if order already paid
     
    402582                    exit();
    403583                }
    404                
     584
    405585                $pc_order = $this->get_pc_order($pc_order_id);
    406586                $this->pc_order_validation($pc_order);
     
    408588                if(!$operation)
    409589                    throw new Exception(__('Could not find operation', 'best2pay-payment_method') . " ( $pc_operation_id )");
     590
    410591                $this->pc_order_operation_validation($operation, true);
    411                
     592
    412593                $pc_order_params = $this->get_pc_order_params($pc_order);
    413594                $is_loan = (!empty($pc_order_params['vda_application_id']) || !empty($pc_order_params['fb_application_id']));
     595
    414596                // There is no valid operation amount in case of LOAN (VsegdaDa\FinBox)
    415597                if(!$is_loan)
     
    418600                $message = __('Failed to pay for the order', 'best2pay-payment_method') . ":\n" . $e->getMessage();
    419601                $this->log($message, ['data' => $data ?? '', 'response' => $response]);
     602
    420603                if($order)
    421604                    $order->add_order_note(nl2br($message));
     605
    422606                wc_add_notice(nl2br($message), 'error');
    423607                wp_redirect($checkout_url);
     608
    424609                exit();
    425610            }
     611
    426612            if($pc_order_state !== $pc_order['state']) {
    427                 // updating order status
    428613                $order_status = $this->get_custom_order_status($operation['type'], $is_loan);
    429614                $order->update_status($order_status);
    430                 // updating order metadata
    431615                update_post_meta($order_id, 'best2pay_order_state', $pc_order['state']);
    432                
    433                 // updating order real payment method
    434616                $payment_method = get_post_meta($order_id, 'best2pay_payment_method', true);
     617
    435618                if(!$payment_method){
    436619                    $is_halva = !empty($pc_order_params['buyIdSumAmount']);
     
    438621                    update_post_meta($order_id, 'best2pay_payment_method', $payment_method);
    439622                }
     623
    440624                $order->add_order_note(__('Payment completed successfully', 'best2pay-payment_method'));
    441625            }
     626
    442627            wp_redirect($this->get_return_url($order));
     628
    443629            exit();
    444630        }
    445        
     631
    446632        /**
    447633         * Payment notify from gateway was received
    448634         **/
    449         public function notify_from_gateway()
    450         {
     635        public function notify_from_gateway() {
    451636            global $wp_filesystem;
    452637            $order = [];
    453638            $pc_operation = [];
     639
    454640            if (empty($wp_filesystem))
    455641                WP_Filesystem();
     642
    456643            try {
    457644                $response = $wp_filesystem->get_contents('php://input');
     
    460647                if(!$order_id)
    461648                    throw new Exception(__('Undefined order ID', 'best2pay-payment_method'));
     649
    462650                $order = wc_get_order($order_id);
    463651                if(!$order)
    464652                    throw new Exception(__('Failed to get order information', 'best2pay-payment_method'));
    465                
    466                 // if order already completed\refunded
     653
    467654                $pc_order_state = get_post_meta($order_id, 'best2pay_order_state', true);
    468                
    469655                if ($pc_order_state === self::ORDER_CANCELED || $pc_order_state === self::ORDER_BLOCKED || $pc_order_state === self::ORDER_EXPIRED)
    470656                    throw new Exception(sprintf(__('The order has already been %s', 'best2pay-payment_method'), $pc_order_state));
     657
    471658                $this->pc_operation_validation($pc_operation);
    472                
    473659                $pc_order = $this->get_pc_order((int) $pc_operation['order_id']);
    474660                $this->pc_order_validation($pc_order);
    475                
    476661                $pc_order_params = $this->get_pc_order_params($pc_order);
    477662                $is_loan = (!empty($pc_order_params['vda_application_id']) || !empty($pc_order_params['fb_application_id']));
     663
    478664                // There is no valid operation amount in case of LOAN (VsegdaDa\FinBox)
    479665                if(!$is_loan)
    480666                    $this->operation_amount_validation($pc_operation, $this->centify($order->get_total()));
    481                
    482667            } catch(Exception $e) {
    483668                $message = sprintf(__('Failed to complete request for operation %s from the processing center', 'best2pay-payment_method'), $pc_operation['type']) . PHP_EOL . $e->getMessage();
    484669                $this->log($message, $pc_operation);
     670
    485671                if($order)
    486672                    $order->add_order_note($message);
     673
    487674                exit($message);
    488675            }
    489             // updating order real payment method
     676
    490677            $payment_method = get_post_meta($order_id, 'best2pay_payment_method', true);
     678
    491679            if(!$payment_method){
    492680                $is_halva = !empty($pc_order_params['buyIdSumAmount']);
     
    494682                update_post_meta($order_id, 'best2pay_payment_method', $payment_method);
    495683            }
    496            
    497             // updating order status
     684
    498685            $order_status = $this->get_custom_order_status($pc_operation['type']);
    499686            $order->update_status($order_status);
    500             // updating order metadata
    501687            update_post_meta($order_id, 'best2pay_order_state', $pc_order['state']);
    502688            $message = sprintf(__('Request for operation %s from the processing center was completed successfully', 'best2pay-payment_method'), $pc_operation['type']);
    503689            $order->add_order_note($message);
     690
    504691            exit('ok');
    505692        }
    506        
     693
    507694        public function complete_payment(){
    508695            echo $this->payment_action(self::OPERATION_COMPLETE);
     696
    509697            exit();
    510698        }
    511        
     699
    512700        /**
    513701         * Inherited method Process refund.
     
    521709         * @return boolean True or false based on success, or a WP_Error object.
    522710         */
    523         public function process_refund($order_id, $amount = null, $reason = '')
    524         {
     711        public function process_refund($order_id, $amount = null, $reason = '') {
    525712            return $this->payment_action(self::OPERATION_REFUND, $order_id, $amount, $reason);
    526713        }
    527        
     714
    528715        /**
    529716         * Check operation state for hold order and set complete state
     
    531718         * @return string void
    532719         */
    533         public function payment_action($type, $order_id = 0, $amount = null, $reason = '')
    534         {
     720        public function payment_action($type, $order_id = 0, $amount = null, $reason = '') {
    535721            try{
    536722                $order = [];
    537723                $operation = [];
    538                
     724
    539725                // get variables from request and checking token for custom 'complete' action
    540726                if($type === self::OPERATION_COMPLETE){
     
    544730                        throw new Exception(__('Operation failed. Please refresh the page', 'best2pay-payment_method'));
    545731                }
    546                
     732
    547733                if(!$order_id)
    548734                    throw new Exception(__('Undefined order ID', 'best2pay-payment_method'));
     735
    549736                $order = wc_get_order($order_id);
    550737                if(!$order)
    551738                    throw new Exception(__('Failed to get order information', 'best2pay-payment_method'));
     739
    552740                $pc_order_id = get_post_meta($order_id, 'best2pay_order_id', true);
    553741                if(!$pc_order_id)
    554742                    throw new Exception(__('Failed to get Best2pay order ID', 'best2pay-payment_method'));
    555                
     743
    556744                $payment_method = get_post_meta($order_id, 'best2pay_payment_method', true);
    557                 // converting old method to new
    558745                $payment_method = self::OLD_TO_NEW_PAYMENT_METHODS[$payment_method] ?? $payment_method;
    559746                $request_path = self::get_action_path($type, $payment_method);
    560747                if(!$request_path)
    561748                    throw new Exception(__('Failed to get operation request path', 'best2pay-payment_method'));
    562                 // full refund for AUTHORIZED orders only
     749
    563750                $pc_order_state = get_post_meta($order_id, 'best2pay_order_state', true);
    564751                if($amount && $amount !== $order->get_total() && $type === self::OPERATION_REFUND && $pc_order_state === self::ORDER_AUTHORIZED){
    565752                    throw new Exception(__('For orders with AUTHORIZED status, only full refunds are available', 'best2pay-payment_method'));
    566753                }
     754
    567755                // hardcode loan amount = 0! we use loans only without prepayment! otherwise we need to save and use the prepayment amount!!
    568                 if($payment_method === 'loan')
     756                if($payment_method === 'loan') {
    569757                    $amount = 0;
    570                 elseif($amount)
     758                } elseif($amount) {
    571759                    $amount = $this->centify($amount);
    572                 else
     760                } else {
    573761                    $amount = $this->centify($order->get_total());
    574                
     762                }
     763
    575764                $data = [
    576765                    'sector' => $this->sector,
     
    579768                    'currency' => $this->currency
    580769                ];
     770
    581771                $this->sign_data($data, true);
    582772                $response = $this->send_request($this->url . $request_path, ['body' => $data]);
     
    585775                if($operation['type'] !== $type)
    586776                    throw new Exception(__('Operation type and action type are not equal', 'best2pay-payment_method'));
    587                 // for COMPLETED orders the operation amount may not be equal to the order amount(partial refund/complete)
    588777            } catch(Exception $e) {
    589778                $comment = $this->get_action_comment($type)['fail'] . PHP_EOL . $e->getMessage();
     
    591780                if($order)
    592781                    $order->add_order_note($comment);
     782
    593783                return json_encode([
    594784                    'success' => false,
     
    596786                ]);
    597787            }
    598            
     788
    599789            $order_status = $this->get_custom_order_status($operation['type']);
    600790            if($order_status)
    601791                $order->update_status($order_status);
     792
    602793            update_post_meta($order_id, 'best2pay_order_state', $operation['order_state']);
     794
    603795            $comment = $this->get_action_comment($type)['success'];
    604796            if($reason){
    605797                $comment .= PHP_EOL . esc_html($reason);
    606798            }
    607            
     799
    608800            $order->add_order_note($comment);
     801
    609802            return json_encode([
    610803                'success' => true,
     
    612805            ]);
    613806        }
    614        
     807
    615808        /**
    616809         * Draw Complete button for authorized orders
     
    618811         * @return void
    619812         */
    620         function wc_order_item_add_complete_button($order)
    621         {
     813        function wc_order_item_add_complete_button($order) {
    622814            if($order->get_payment_method() == $this->id){
    623815                $pc_order_state = get_post_meta($order->get_id(), 'best2pay_order_state', true);
     816
    624817                if($pc_order_state === self::ORDER_AUTHORIZED){
    625818                    $label = __('Complete payment', 'best2pay-payment_method');
    626                     $nonce_complete = wp_create_nonce('best2pay_complete' . $order->get_id());
    627                     ?>
     819                    $nonce_complete = wp_create_nonce('best2pay_complete' . $order->get_id());?>
     820
    628821                    <script src="<?php echo plugins_url('assets/js/scripts.js', plugin_basename(__FILE__)); ?>"></script>
    629822                    <input type="hidden" id="nonce_best2pay_complete" value="<?php echo $nonce_complete; ?>">
    630                     <button type="button" id="button_best2pay_complete"
    631                                     class="button custom-items"><?php echo $label; ?></button>
    632                     <?php
    633                 }
    634             }
    635         }
    636        
    637         private function calc_fiscal_position_shop_cart($order, $order_amount)
    638         {
     823                    <button type="button" id="button_best2pay_complete" class="button custom-items"><?php echo $label; ?></button>
     824                <?php }
     825            }
     826        }
     827
     828        private function calc_fiscal_position_shop_cart($order, $order_amount) {
    639829            $fiscal_positions = '';
    640830            $fiscal_amount = 0;
     
    642832            $shop_cart_key = 0;
    643833            $order_items = $order->get_items();
    644            
     834
    645835            foreach($order_items as $item) {
    646836                $item_data = $item->get_data();
     
    653843                $fiscal_positions .= str_replace([';', '|'], '', $item_data['name']) . '|';
    654844                $fiscal_amount += $item_data['quantity'] * $element_price;
    655                
    656845                $shop_cart[$shop_cart_key]['quantityGoods'] = (int)$item['quantity'];
    657846                $shop_cart[$shop_cart_key]['goodCost'] = $item_price - $item_discount;
     
    659848                $shop_cart_key++;
    660849            }
    661            
     850
    662851            $shipping_amount = $order->get_shipping_total();
     852
    663853            if ($shipping_amount){
    664854                $fiscal_positions .= '1;' . $this->centify($shipping_amount) . ';6;Доставка|';
    665855                $fiscal_amount += $this->centify($shipping_amount);
    666                
    667856                $shop_cart[$shop_cart_key]['quantityGoods'] = 1;
    668857                $shop_cart[$shop_cart_key]['goodCost'] = $shipping_amount;
    669858                $shop_cart[$shop_cart_key]['name'] = 'Доставка';
    670859            }
     860
    671861            $fiscalDiff = abs($fiscal_amount - $order_amount);
     862
    672863            if ($fiscalDiff){
    673864                $fiscal_positions .= '1;' . $fiscalDiff . ';6;Скидка;14|';
    674865                $shop_cart = [];
    675866            }
     867
    676868            $this->fiscal_positions = substr($fiscal_positions, 0, -1);
    677869            $this->shop_cart = $shop_cart;
    678870        }
    679        
    680         private function get_pc_order($pc_order_id)
    681         {
     871
     872        private function get_pc_order($pc_order_id) {
    682873            if(!$pc_order_id)
    683874                throw new Exception(__('Missing PC order ID', 'best2pay-payment_method'));
     875
    684876            $data = [
    685877                'sector' => $this->sector,
    686878                'id' => $pc_order_id,
    687879            ];
     880
    688881            $this->sign_data($data, true);
    689882            $response = $this->send_request($this->url . '/webapi/Order', ['body' => $data]);
     883
    690884            return $this->parse_xml($response['body']);
    691885        }
    692        
    693         private function get_pc_order_operation($pc_order, $pc_operation_id)
    694         {
     886
     887        private function get_pc_order_operation($pc_order, $pc_operation_id) {
    695888            if(empty($pc_order['operations']['operation']))
    696889                throw new Exception(__('There are no operations in the order', 'best2pay-payment_method'));
    697             // "operation" may contain one or few operations (array)
     890
    698891            $operations = isset($pc_order['operations']['operation'][0]) ? $pc_order['operations']['operation'] : [$pc_order['operations']['operation']];
     892
    699893            foreach($operations as $operation) {
    700894                if(empty($operation['id'])) continue;
     
    702896                    return $operation;
    703897            }
     898
    704899            return [];
    705900        }
    706        
    707         private function get_pc_order_params($pc_order)
    708         {
     901
     902        private function get_pc_order_params($pc_order) {
    709903            $params = [];
     904
    710905            if(empty($pc_order['parameters']['parameter'])) return $params;
    711906            foreach($pc_order['parameters']['parameter'] as $param) {
     
    718913                $params[$key] = $param['value'] ?? 'null';
    719914            }
     915
    720916            return $params;
    721917        }
    722        
    723         public function pc_operation_validation($response): void
    724         {
     918
     919        public function pc_operation_validation($response): void {
    725920            if(empty($response['reason_code']) && !empty($response['code']) && !empty($response['description']))
    726921                throw new Exception("$response[description] (error code $response[code])");
     922
    727923            if(empty($response['signature']))
    728924                throw new Exception(__('Signature is missing', 'best2pay-payment_method'));
     925
    729926            $xml_string = self::xml_values_to_string($response);
    730927            $signature = $this->generate_sign($xml_string, true);
    731928            if ($signature !== $response['signature'])
    732929                throw new Exception(__('Invalid signature', 'best2pay-payment_method'));
     930
    733931            if(!in_array($response['type'], self::OPERATION_TYPES))
    734932                throw new Exception(__('Unknown operation type', 'best2pay-payment_method') . ' : ' . $response['type']);
     933
    735934            if($response['state'] !== self::OPERATION_APPROVED)
    736935                throw new Exception(__('Operation not approved', 'best2pay-payment_method'));
    737936        }
    738        
    739         public function pc_order_validation($order): void
    740         {
     937
     938        public function pc_order_validation($order): void {
    741939            if(empty($order['reason_code']) && !empty($order['code']) && !empty($order['description']))
    742940                throw new Exception("$order[description] (error code $order[code])");
     941
    743942            if(empty($order['signature']))
    744943                throw new Exception(__('Signature is missing', 'best2pay-payment_method'));
     944
    745945            $xml_string = self::xml_values_to_string($order);
    746946            $signature = $this->generate_sign($xml_string, true);
     
    748948                throw new Exception(__('Invalid signature', 'best2pay-payment_method'));
    749949        }
    750         public function pc_order_operation_validation($operation, $is_payment = false): void
    751         {
     950
     951        public function pc_order_operation_validation($operation, $is_payment = false): void {
    752952            if(empty($operation['reason_code']) && !empty($operation['code']) && !empty($operation['description']))
    753953                throw new Exception(__('An error occurred during the operation', 'best2pay-payment_method') . "($operation[code] : $operation[description])");
     954
    754955            if(!in_array($operation['type'], self::OPERATION_TYPES))
    755956                throw new Exception(__('Unknown operation type', 'best2pay-payment_method') . ' : ' . $operation['type']);
     957
    756958            if($operation['state'] !== self::OPERATION_APPROVED)
    757959                throw new Exception(__('Operation not approved', 'best2pay-payment_method'));
     960
    758961            if($is_payment && !in_array($operation['type'], self::PAID_OPERATION_TYPES)) {
    759962                throw new Exception(__('Unknown payment operation type', 'best2pay-payment_method') . ' : ' . $operation['type']);
    760963            }
    761964        }
    762        
    763         public static function xml_values_to_string($xml_array): string
    764         {
     965
     966        public static function xml_values_to_string($xml_array): string {
    765967            if(!is_array($xml_array)) return '';
     968
    766969            $res = '';
    767970            foreach($xml_array as $key => $value) {
     
    769972                $res .= is_string($value) ? $value : self::xml_values_to_string($value);
    770973            }
     974
    771975            return $res;
    772976        }
    773        
    774         public function get_operation_amount($operation): int
    775         {
     977
     978        public function get_operation_amount($operation): int {
    776979            return !empty($operation['buyIdSumAmount']) ? (int) $operation['buyIdSumAmount'] : (int) $operation['amount'];
    777980        }
    778        
    779         private function operation_amount_validation($operation, $order_amount): void
    780         {
     981
     982        private function operation_amount_validation($operation, $order_amount): void {
    781983            $operation_amount = self::get_operation_amount($operation);
     984
    782985            if (!$operation_amount || $operation_amount !== $order_amount)
    783986                throw new \Exception(__('Invalid operation amount', 'best2pay-payment_method'));
    784987        }
    785        
    786         public function get_custom_order_status($operation_type, $is_loan = false)
    787         {
     988
     989        public function get_custom_order_status($operation_type, $is_loan = false) {
    788990            switch($operation_type){
    789991                case 'PURCHASE':
     
    796998                    return $this->canceled_status ?? false;
    797999            }
     1000
    7981001            return false;
    7991002        }
    800        
    801         private function get_action_path($action_type, $payment_type)
    802         {
     1003
     1004        private function get_action_path($action_type, $payment_type) {
    8031005            $prefix = ($payment_type == 'halva' || $payment_type == 'halva_two_steps') ? '/webapi/custom/svkb/' : '/webapi/';
     1006
    8041007            switch($action_type) {
    8051008                case self::OPERATION_COMPLETE: return $prefix . 'Complete';
    8061009                case self::OPERATION_REFUND: return $prefix . 'Reverse';
    8071010            }
     1011
    8081012            return false;
    8091013        }
    810        
    811         private function get_action_comment($action)
    812         {
     1014
     1015        private function get_action_comment($action) {
    8131016            switch($action) {
    8141017                case self::OPERATION_COMPLETE: return [
     
    8221025            }
    8231026        }
    824        
    825         private function get_pc_payment_method($operation_type, $is_halva, $is_loan)
    826         {
     1027
     1028        private function get_pc_payment_method($operation_type, $is_halva, $is_loan) {
    8271029            switch($operation_type) {
    8281030                case 'PURCHASE':
     
    8411043            return '';
    8421044        }
    843        
    844         private function send_request($url, $args, $method = 'post', int $repeat = 3)
    845         {
     1045
     1046        private function send_request($url, $args, $method = 'post', int $repeat = 3) {
    8461047            $method = (strtolower($method) === 'get') ? 'get' : 'post';
    8471048            $repeat = !$repeat ? 1 : $repeat;
     
    8531054                sleep(2);
    8541055            }
     1056
    8551057            return $response;
    8561058        }
    857        
     1059
    8581060        /**
    8591061         * Admin Panel Options
    8601062         **/
    861         public function admin_options()
    862         {
    863             ?>
     1063        public function admin_options() {?>
    8641064            <h3><?php _e('Best2Pay', 'best2pay-payment_method'); ?></h3>
    8651065            <p><?php echo sprintf(__('Payments with bank cards via the <a href="%s" target="_blank">Best2Pay</a> payment system.', 'best2pay-payment_method'), self::PLUGIN_SITE); ?></p>
    8661066            <table class="form-table">
    867                 <?php
    868                 // Generate the HTML For the settings form.
    869                 $this->generate_settings_html();
    870                 ?>
    871             </table><!--/.form-table-->
    872             <?php
    873         }
    874        
     1067                <?php $this->generate_settings_html(); ?>
     1068            </table>
     1069        <?php }
     1070
    8751071        /**
    8761072         * Get current currency code
     
    8781074         * @return string
    8791075         */
    880         public function get_currency($wc_currency): string
    881         {
     1076        public function get_currency($wc_currency): string {
    8821077            switch($wc_currency) {
    8831078                case 'EUR': return '978';
    8841079                case 'USD': return '840';
     1080
    8851081                default: return '643';
    8861082            }
    8871083        }
    888        
     1084
    8891085        /**
    8901086         * @param array $data
     
    8921088         * @return void
    8931089         */
    894         public function sign_data(&$data, $password = false): void
    895         {
     1090        public function sign_data(&$data, $password = false): void {
    8961091            unset($data['signature']);
     1092
    8971093            $sign = implode('', $data);
    8981094            if($password)
    8991095                $sign .= $this->password;
     1096
    9001097            $data['signature'] = base64_encode($this->sign_hash($sign));
    9011098        }
    902        
    903         public function generate_sign($data, $password = false): string
    904         {
     1099
     1100        public function generate_sign($data, $password = false): string {
    9051101            $string = is_array($data) ? implode('', $data) : (string) $data;
    9061102            if($password)
    9071103                $string .= $this->password;
     1104
    9081105            return base64_encode($this->sign_hash($string));
    9091106        }
    910        
    911         private function sign_hash($data)
    912         {
     1107
     1108        private function sign_hash($data) {
    9131109            return hash($this->hash_algo, $data);
    9141110        }
    915        
     1111
    9161112        /**
    9171113         * Changes a currency unit to a derived equivalent currency unit
     
    9201116         * @return int
    9211117         */
    922         public function centify($value): int
    923         {
     1118        public function centify($value): int {
    9241119            return intval(strval($value * 100));
    9251120        }
    926        
    927         private function best2pay_get_url(): string
    928         {
     1121
     1122        private function best2pay_get_url(): string {
    9291123            $best2pay_url = "https://test.best2pay.net";
     1124
    9301125            if ($this->testmode == "0"){
    9311126                $best2pay_url = "https://pay.best2pay.net";
    9321127            }
     1128
    9331129            return $best2pay_url;
    9341130        }
    935        
     1131
    9361132        /**
    9371133         * Parse $xml from PC with removing element with values = '' or null
     
    9391135         * @return false|mixed
    9401136         */
    941         public function parse_xml(string $string)
    942         {
     1137        public function parse_xml(string $string) {
    9431138            if (!$string)
    9441139                throw new Exception(__('Server response is empty', 'best2pay-payment_method'));
     1140
    9451141            $xml = simplexml_load_string($string);
    9461142            if (!$xml)
    9471143                throw new Exception(__('Invalid XML from response', 'best2pay-payment_method'));
     1144
    9481145            $valid_xml = json_decode(json_encode($xml), true);
    9491146            if (!$valid_xml)
    9501147                throw new Exception(__('Unable to decode xml', 'best2pay-payment_method'));
     1148
    9511149            return $valid_xml;
    9521150        }
    953        
     1151
    9541152        /**
    9551153         * Write log-messages in file when it accessible in FS on hosting
     
    9581156         * @param array $data
    9591157         */
    960         public function log(string $message, array $data = [])
    961         {
     1158        public function log(string $message, array $data = []) {
    9621159            $log = "\n[" . date("H:i:s d.m.Y") . '] ' . $message;
    9631160            if($data)
    9641161                $log .= "\n" . var_export($data, true);
     1162
    9651163            file_put_contents(ABSPATH . $this->id . '.log', $log, FILE_APPEND);
    9661164        }
    967        
    968     } // class
     1165    }
     1166
    9691167    /**
    9701168     * Add this gateway to the list of available payment gateways
     
    9731171     * @return mixed
    9741172     */
    975     function add_best2pay_gateway($methods)
    976     {
     1173    function add_best2pay_gateway($methods) {
    9771174        $methods[] = 'woocommerce_best2pay';
     1175
    9781176        return $methods;
    9791177    }
    980    
     1178
    9811179    add_filter('woocommerce_payment_gateways', 'add_best2pay_gateway');
    982    
     1180
    9831181    add_filter(
    9841182        'plugin_action_links_' . plugin_basename( __FILE__ ),
     
    9921190            if (!class_exists('woocommerce'))
    9931191                return $links;
    994            
     1192
    9951193            array_unshift(
    9961194                $links,
     
    10011199                )
    10021200            );
    1003            
     1201
    10041202            return $links;
    10051203        }
  • best2pay-payment-method-visamastercard/trunk/languages/best2pay-payment_method-ru_RU.po

    r3011458 r3036865  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Best2Pay payment method (Visa/MasterCard/MIR) 2.1.0\n"
     5"Project-Id-Version: Best2Pay payment module 2.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/best2pay-payment-method-visamastercard\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1616
    1717#. Plugin Name of the plugin
    18 msgid "Best2Pay payment method (Visa/MasterCard/MIR)"
    19 msgstr "Оплата с Best2Pay (Visa/MasterCard/МИР)"
     18msgid "Best2Pay payment module"
     19msgstr "Модуль оплаты Best2Pay"
    2020
    2121#. Plugin URI of the plugin
     
    2828
    2929#. Author of the plugin
    30 #: best2pay-payment_method.php:110
    31 #: best2pay-payment_method.php:111
    32 #: best2pay-payment_method.php:855
     30#: best2pay-payment_method.php:113
     31#: best2pay-payment_method.php:981
    3332msgid "Best2Pay"
    3433msgstr "Best2Pay"
    3534
     35#: best2pay-payment_method.php:115
    3636msgid "To accept payments through the plugin, you need to apply to connect to Best2pay on the website <a href=\"%1$s\" target=\"_blank\">%1$s</a> and enter into an agreement with the company.<br/>Support email: <a href=\"mailto:%2$s\">%2$s</a>"
    3737msgstr ""
     
    3939"<a href=\"%1$s\" target=\"_blank\">%1$s</a> и заключить договор с компанией.<br/>Электронная почта службы поддержки: <a href=\"mailto:%2$s\">%2$s</a>"
    4040
    41 #: best2pay-payment_method.php:112
    42 #: best2pay-payment_method.php:856
     41#: best2pay-payment_method.php:133
     42#: best2pay-payment_method.php:982
    4343msgid "Payments with bank cards via the <a href=\"%s\" target=\"_blank\">Best2Pay</a> payment system."
    4444msgstr ""
     
    4646"href=\"%s\" target=\"_blank\">Best2Pay</a>."
    4747
    48 #: best2pay-payment_method.php:145
     48#: best2pay-payment_method.php:159
    4949msgid "Pay for your order in installments"
    5050msgstr "Оплатите заказ частями"
    5151
    52 #: best2pay-payment_method.php:152
    53 msgid "Pay by QR"
    54 msgstr "Оплата по QR"
    55 
    56 #: best2pay-payment_method.php:177
     52#: best2pay-payment_method.php:215
     53msgid "Remove logo"
     54msgstr "Удалить логотип"
     55
     56#: best2pay-payment_method.php:241
    5757msgid "Enable/Disable"
    5858msgstr "Включить/Выключить"
    5959
    60 #: best2pay-payment_method.php:179
     60#: best2pay-payment_method.php:243
    6161msgid "Enable Best2Pay checkout method"
    6262msgstr "Включить использование метода платежа Best2Pay"
    6363
    64 #: best2pay-payment_method.php:184
     64#: best2pay-payment_method.php:248
     65msgid "Title"
     66msgstr "Название"
     67
     68#: best2pay-payment_method.php:250
     69msgid "Custom title for payment type"
     70msgstr "Свое название для типа платежа"
     71
     72#: best2pay-payment_method.php:257
     73msgid "Description"
     74msgstr "Описание"
     75
     76#: best2pay-payment_method.php:259
     77msgid "Custom description for payment type"
     78msgstr "Свое описание для типа платежа"
     79
     80#: best2pay-payment_method.php:266
     81msgid "Logo"
     82msgstr "Логотип"
     83
     84#: best2pay-payment_method.php:268
     85msgid "Custom logo for payment type"
     86msgstr "Свой логотип для типа платежа"
     87
     88#: best2pay-payment_method.php:274
    6589msgid "Sector ID"
    6690msgstr "Sector ID"
    6791
    68 #: best2pay-payment_method.php:186
     92#: best2pay-payment_method.php:276
    6993msgid "Your shop identifier at Best2Pay"
    7094msgstr "Идентификатор вашего магазина в системе Best2Pay"
    7195
    72 #: best2pay-payment_method.php:192
     96#: best2pay-payment_method.php:282
    7397msgid "Password"
    7498msgstr "Пароль"
    7599
    76 #: best2pay-payment_method.php:194
     100#: best2pay-payment_method.php:284
    77101msgid "Password to use for digital signature"
    78102msgstr "Пароль для цифровой подписи"
    79103
    80 #: best2pay-payment_method.php:200
     104#: best2pay-payment_method.php:290
    81105msgid "Test Mode"
    82106msgstr "Тестовый режим"
    83107
    84 #: best2pay-payment_method.php:203
     108#: best2pay-payment_method.php:293
    85109msgid "Test mode - real payments will not be processed"
    86110msgstr "Тестовый режим - средства с карты не списываются"
    87111
    88 #: best2pay-payment_method.php:204
     112#: best2pay-payment_method.php:294
    89113msgid "Production mode - payments will be processed"
    90114msgstr "Рабочий режим - средства списываются с карты"
    91115
    92 #: best2pay-payment_method.php:206
     116#: best2pay-payment_method.php:296
    93117msgid "Select test or live mode"
    94118msgstr "Выберите тестовый или рабочий режим"
    95119
    96 #: best2pay-payment_method.php:211
     120#: best2pay-payment_method.php:301
    97121msgid "Payment method"
    98122msgstr "Способ оплаты"
    99123
    100 #: best2pay-payment_method.php:214
     124#: best2pay-payment_method.php:304
    101125msgid "Standard acquiring (one-stage payment)"
    102126msgstr "Стандартный эквайринг (одностадийная оплата)"
    103127
    104 #: best2pay-payment_method.php:215
     128#: best2pay-payment_method.php:305
    105129msgid "Standard acquiring (two-stage payment)"
    106130msgstr "Стандартный эквайринг (двухстадийная оплата)"
    107131
    108 #: best2pay-payment_method.php:216
    109 msgid "Halva Chastyami (one-stage payment)"
    110 msgstr "Только Халва Частями (одностадийная оплата)"
    111 
    112 #: best2pay-payment_method.php:217
    113 msgid "Halva Chastyami (two-stage payment)"
    114 msgstr "Только Халва Частями (двухстадийная оплата)"
    115 
    116 #: best2pay-payment_method.php:218
     132#: best2pay-payment_method.php:306
     133msgid "Plait (one-stage payment)"
     134msgstr "Плайт (одностадийная оплата)"
     135
     136#: best2pay-payment_method.php:307
     137msgid "Plait (two-stage payment)"
     138msgstr "Плайт (двухстадийная оплата)"
     139
     140#: best2pay-payment_method.php:308
    117141msgid "Fast Payment System"
    118142msgstr "Система Быстрых Платежей (СБП)"
    119143
    120 #: best2pay-payment_method.php:219
     144#: best2pay-payment_method.php:309
    121145msgid "Loan"
    122146msgstr "Кредитование"
    123147
    124 #: best2pay-payment_method.php:221
     148#: best2pay-payment_method.php:311
    125149msgid "Payment occurs after confirmation by the manager in the personal account"
    126150msgstr "Оплата происходит после подтверждения менеджером в ЛК"
    127151
    128 #: best2pay-payment_method.php:226
     152#: best2pay-payment_method.php:316
    129153msgid "TAX"
    130154msgstr "Налог"
    131155
    132 #: best2pay-payment_method.php:229
     156#: best2pay-payment_method.php:319
    133157msgid "VAT rate 20%"
    134158msgstr "ставка НДС 20%"
    135159
    136 #: best2pay-payment_method.php:230
     160#: best2pay-payment_method.php:320
    137161msgid "VAT rate 10%"
    138162msgstr "ставка НДС 10%"
    139163
    140 #: best2pay-payment_method.php:231
     164#: best2pay-payment_method.php:321
    141165msgid "VAT rate calc. 20/120"
    142166msgstr "ставка НДС расч. 20/120"
    143167
    144 #: best2pay-payment_method.php:232
     168#: best2pay-payment_method.php:322
    145169msgid "VAT rate calc. 10/110"
    146170msgstr "ставка НДС расч. 10/110"
    147171
    148 #: best2pay-payment_method.php:233
     172#: best2pay-payment_method.php:323
    149173msgid "VAT rate 0%"
    150174msgstr "ставка НДС 0%"
    151175
    152 #: best2pay-payment_method.php:234
     176#: best2pay-payment_method.php:324
    153177msgid "Not subject to VAT"
    154178msgstr "НДС не облагается"
    155179
    156 #: best2pay-payment_method.php:240
     180#: best2pay-payment_method.php:330
    157181msgid "Notify URL"
    158182msgstr "URL для уведомлений"
    159183
    160 #: best2pay-payment_method.php:242
     184#: best2pay-payment_method.php:332
    161185msgid "Report this URL to Best2Pay technical support to receive payment notifications"
    162186msgstr "Сообщите в службу технической поддержки Best2Pay этот URL для получения уведомлений о платеже"
    163187
    164 #: best2pay-payment_method.php:251
     188#: best2pay-payment_method.php:341
    165189msgid "Data encryption algorithm"
    166190msgstr "Алгоритм шифрования данных"
    167191
    168 #: best2pay-payment_method.php:257
     192#: best2pay-payment_method.php:347
    169193msgid "Must match your sector encryption settings in your personal account"
    170194msgstr "Должен соответствовать настройкам шифрования вашего сектора в личном кабинете"
    171195
    172 #: best2pay-payment_method.php:263
     196#: best2pay-payment_method.php:353
    173197msgid "Custom statuses for orders"
    174198msgstr "Настраиваемые статусы для заказов"
    175199
    176 #: best2pay-payment_method.php:269
     200#: best2pay-payment_method.php:359
    177201msgid "Order registered"
    178202msgstr "Заказ зарегистрирован"
    179203
    180 #: best2pay-payment_method.php:274
     204#: best2pay-payment_method.php:364
    181205msgid "Order authorized"
    182206msgstr "Средства захолдированы"
    183207
    184 #: best2pay-payment_method.php:279
     208#: best2pay-payment_method.php:369
    185209msgid "Loan agreement approved but not signed"
    186210msgstr "Кредитный договор одобрен, но не подписан"
    187211
    188 #: best2pay-payment_method.php:284
     212#: best2pay-payment_method.php:374
    189213msgid "Order successfully paid"
    190214msgstr "Заказ успешно оплачен"
    191215
    192 #: best2pay-payment_method.php:289
     216#: best2pay-payment_method.php:379
    193217msgid "Order canceled"
    194218msgstr "Платеж отменен"
    195219
    196 #: best2pay-payment_method.php:317
     220#: best2pay-payment_method.php:371
     221msgid "Issuing an invoice for payment"
     222msgstr "Выставление счёта на оплату"
     223
     224#: best2pay-payment_method.php:373
     225msgid "Enable issuing an invoice for payment by email of the payer"
     226msgstr "Включить выставление счёта на оплату на email плательщика"
     227
     228#: best2pay-payment_method.php:377
     229msgid "Order agreement"
     230msgstr "Заказ на согласовании"
     231
     232#: best2pay-payment_method.php:383
     233msgid "Payment expected"
     234msgstr "Ожидается оплата"
     235
     236#: best2pay-payment_method.php:443
    197237msgid "Order #%s"
    198238msgstr "Заказ №%s"
    199239
    200 #: best2pay-payment_method.php:333
     240#: best2pay-payment_method.php:459
    201241msgid "Failed to register order"
    202242msgstr "Не удалось зарегистрировать заказ"
    203243
    204 #: best2pay-payment_method.php:345
     244#: best2pay-payment_method.php:471
    205245msgid "Order registered successfully"
    206246msgstr "Заказ успешно зарегистрирован"
    207247
    208 #: best2pay-payment_method.php:378
    209 #: best2pay-payment_method.php:545
     248#: best2pay-payment_method.php:504
     249#: best2pay-payment_method.php:671
    210250msgid "Failed to get Best2pay order ID"
    211251msgstr "Не удалось получить ID заказа Best2pay"
    212252
    213 #: best2pay-payment_method.php:381
     253#: best2pay-payment_method.php:507
    214254msgid "Failed to get Best2pay operation ID"
    215255msgstr "Не удалось получить ID операции Best2pay"
    216256
    217 #: best2pay-payment_method.php:384
    218 #: best2pay-payment_method.php:452
    219 #: best2pay-payment_method.php:539
     257#: best2pay-payment_method.php:510
     258#: best2pay-payment_method.php:578
     259#: best2pay-payment_method.php:665
    220260msgid "Undefined order ID"
    221261msgstr "Неопределенный ID заказа"
    222262
    223 #: best2pay-payment_method.php:387
    224 #: best2pay-payment_method.php:455
    225 #: best2pay-payment_method.php:542
     263#: best2pay-payment_method.php:513
     264#: best2pay-payment_method.php:581
     265#: best2pay-payment_method.php:668
    226266msgid "Failed to get order information"
    227267msgstr "Не удалось получить информацию о заказе"
    228268
    229 #: best2pay-payment_method.php:400
     269#: best2pay-payment_method.php:526
    230270msgid "Could not find operation"
    231271msgstr "Не удалось найти операцию"
    232272
    233 #: best2pay-payment_method.php:409
     273#: best2pay-payment_method.php:535
    234274msgid "Failed to pay for the order"
    235275msgstr "Не удалось оплатить заказ"
    236276
    237 #: best2pay-payment_method.php:431
     277#: best2pay-payment_method.php:557
    238278msgid "Payment completed successfully"
    239279msgstr "Платеж успешно завершен"
    240280
    241 #: best2pay-payment_method.php:461
     281#: best2pay-payment_method.php:587
    242282msgid "The order has already been %s"
    243283msgstr "Заказ уже %s"
    244284
    245 #: best2pay-payment_method.php:474
     285#: best2pay-payment_method.php:600
    246286msgid "Failed to complete request for operation %s from the processing center"
    247287msgstr "Не удалось выполнить запрос операции %s от процессингового центра"
    248288
    249 #: best2pay-payment_method.php:493
     289#: best2pay-payment_method.php:619
    250290msgid "Request for operation %s from the processing center was completed successfully"
    251291msgstr "Запрос операции %s от процессингового центра выполнен успешно"
    252292
    253 #: best2pay-payment_method.php:535
     293#: best2pay-payment_method.php:661
    254294msgid "Operation failed. Please refresh the page"
    255295msgstr "Не удалось выполнить операцию. Обновите страницу"
    256296
    257 #: best2pay-payment_method.php:552
     297#: best2pay-payment_method.php:678
    258298msgid "Failed to get operation request path"
    259299msgstr "Не удалось получить путь запроса операции"
    260300
    261 #: best2pay-payment_method.php:556
     301#: best2pay-payment_method.php:682
    262302msgid "For orders with AUTHORIZED status, only full refunds are available"
    263303msgstr "Для заказов со статусом AUTHORIZED возможен только полный возврат средств"
    264304
    265 #: best2pay-payment_method.php:577
     305#: best2pay-payment_method.php:703
    266306msgid "Operation type and action type are not equal"
    267307msgstr "Тип операции и тип действия не совпадают"
    268308
    269 #: best2pay-payment_method.php:616
     309#: best2pay-payment_method.php:742
    270310msgid "Complete payment"
    271311msgstr "Списать средства"
    272312
    273 #: best2pay-payment_method.php:674
     313#: best2pay-payment_method.php:800
    274314msgid "Missing PC order ID"
    275315msgstr "Отсутствует ID заказа Пц"
    276316
    277 #: best2pay-payment_method.php:687
     317#: best2pay-payment_method.php:813
    278318msgid "There are no operations in the order"
    279319msgstr "Операции заказа не найдены"
    280320
    281 #: best2pay-payment_method.php:719
    282 #: best2pay-payment_method.php:735
     321#: best2pay-payment_method.php:845
     322#: best2pay-payment_method.php:861
    283323msgid "Signature is missing"
    284324msgstr "Отсутствует подпись"
    285325
    286 #: best2pay-payment_method.php:723
    287 #: best2pay-payment_method.php:739
     326#: best2pay-payment_method.php:849
     327#: best2pay-payment_method.php:865
    288328msgid "Invalid signature"
    289329msgstr "Неверная подпись"
    290330
    291 #: best2pay-payment_method.php:725
    292 #: best2pay-payment_method.php:746
     331#: best2pay-payment_method.php:851
     332#: best2pay-payment_method.php:872
    293333msgid "Unknown operation type"
    294334msgstr "Неизвестный тип операции"
    295335
    296 #: best2pay-payment_method.php:727
    297 #: best2pay-payment_method.php:748
     336#: best2pay-payment_method.php:853
     337#: best2pay-payment_method.php:874
    298338msgid "Operation not approved"
    299339msgstr "Операция не одобрена"
    300340
    301 #: best2pay-payment_method.php:744
     341#: best2pay-payment_method.php:870
    302342msgid "An error occurred during the operation"
    303343msgstr "Во время операции произошла ошибка"
    304344
    305 #: best2pay-payment_method.php:750
     345#: best2pay-payment_method.php:876
    306346msgid "Unknown payment operation type"
    307347msgstr "Неизвестный тип платежной операции"
    308348
    309 #: best2pay-payment_method.php:774
     349#: best2pay-payment_method.php:900
    310350msgid "Invalid operation amount"
    311351msgstr "Неверная сумма операции"
    312352
    313 #: best2pay-payment_method.php:806
     353#: best2pay-payment_method.php:932
    314354msgid "Funds for the order have been successfully debited"
    315355msgstr "Средства за заказ успешно списаны"
    316356
    317 #: best2pay-payment_method.php:807
     357#: best2pay-payment_method.php:933
    318358msgid "Failed to complete payment"
    319359msgstr "Не удалось завершить платеж"
    320360
    321 #: best2pay-payment_method.php:810
     361#: best2pay-payment_method.php:936
    322362msgid "Payment refunded successfully"
    323363msgstr "Платеж успешно возвращен"
    324364
    325 #: best2pay-payment_method.php:811
     365#: best2pay-payment_method.php:937
    326366msgid "Failed to refund payment"
    327367msgstr "Не удалось вернуть платеж"
    328368
    329 #: best2pay-payment_method.php:935
     369#: best2pay-payment_method.php:1061
    330370msgid "Server response is empty"
    331371msgstr "Ответ сервера пуст"
    332372
    333 #: best2pay-payment_method.php:938
     373#: best2pay-payment_method.php:1064
    334374msgid "Invalid XML from response"
    335375msgstr "Неверный XML в ответе"
    336376
    337 #: best2pay-payment_method.php:941
     377#: best2pay-payment_method.php:1067
    338378msgid "Unable to decode xml"
    339379msgstr "Невозможно декодировать XML"
    340380
    341 #: best2pay-payment_method.php:991
     381#: best2pay-payment_method.php:1117
    342382msgid "Settings"
    343383msgstr "Настройки"
  • best2pay-payment-method-visamastercard/trunk/languages/best2pay-payment_method.pot

    r3011458 r3036865  
    1 # Copyright (C) 2023 Best2Pay
     1# Copyright (C) 2024 Best2Pay
    22# This file is distributed under the GPL3.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Best2Pay payment method (Visa/MasterCard/MIR) 2.1.5\n"
    6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/trunk\n"
     5"Project-Id-Version: Best2Pay payment module 2.2\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/best2pay\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    88"Language-Team: LANGUAGE <[email protected]>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-11-17T14:41:40+03:00\n"
     12"POT-Creation-Date: 2024-02-06T18:05:18+03:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.8.1\n"
     14"X-Generator: WP-CLI 2.9.0\n"
    1515"X-Domain: best2pay-payment_method\n"
    1616
    1717#. Plugin Name of the plugin
    18 msgid "Best2Pay payment method (Visa/MasterCard/MIR)"
     18msgid "Best2Pay payment module"
    1919msgstr ""
    2020
     
    2828
    2929#. Author of the plugin
    30 #: best2pay-payment_method.php:110
    31 #: best2pay-payment_method.php:111
    32 #: best2pay-payment_method.php:855
     30#: best2pay-payment_method.php:117
     31#: best2pay-payment_method.php:1059
    3332msgid "Best2Pay"
    3433msgstr ""
    3534
    36 #: best2pay-payment_method.php:112
    37 #: best2pay-payment_method.php:856
     35#: best2pay-payment_method.php:119
     36msgid "To accept payments through the plugin, you need to apply to connect to Best2pay on the website <a href=\"%1$s\" target=\"_blank\">%1$s</a> and enter into an agreement with the company.<br/>Support email: <a href=\"mailto:%2$s\">%2$s</a>"
     37msgstr ""
     38
     39#: best2pay-payment_method.php:137
     40#: best2pay-payment_method.php:1060
    3841msgid "Payments with bank cards via the <a href=\"%s\" target=\"_blank\">Best2Pay</a> payment system."
    3942msgstr ""
    4043
    41 #: best2pay-payment_method.php:145
     44#: best2pay-payment_method.php:166
    4245msgid "Pay for your order in installments"
    4346msgstr ""
    4447
    45 #: best2pay-payment_method.php:152
    46 msgid "Pay by QR"
    47 msgstr ""
    48 
    49 #: best2pay-payment_method.php:177
     48#: best2pay-payment_method.php:221
     49msgid "Remove logo"
     50msgstr ""
     51
     52#: best2pay-payment_method.php:241
    5053msgid "Enable/Disable"
    5154msgstr ""
    5255
    53 #: best2pay-payment_method.php:179
     56#: best2pay-payment_method.php:243
    5457msgid "Enable Best2Pay checkout method"
    5558msgstr ""
    5659
    57 #: best2pay-payment_method.php:184
     60#: best2pay-payment_method.php:247
     61msgid "Title"
     62msgstr ""
     63
     64#: best2pay-payment_method.php:249
     65msgid "Custom title for payment type"
     66msgstr ""
     67
     68#: best2pay-payment_method.php:255
     69msgid "Description"
     70msgstr ""
     71
     72#: best2pay-payment_method.php:257
     73msgid "Custom description for payment type"
     74msgstr ""
     75
     76#: best2pay-payment_method.php:263
     77msgid "Logo"
     78msgstr ""
     79
     80#: best2pay-payment_method.php:265
     81msgid "Custom logo for payment type"
     82msgstr ""
     83
     84#: best2pay-payment_method.php:270
    5885msgid "Sector ID"
    5986msgstr ""
    6087
    61 #: best2pay-payment_method.php:186
     88#: best2pay-payment_method.php:272
    6289msgid "Your shop identifier at Best2Pay"
    6390msgstr ""
    6491
    65 #: best2pay-payment_method.php:192
     92#: best2pay-payment_method.php:277
    6693msgid "Password"
    6794msgstr ""
    6895
    69 #: best2pay-payment_method.php:194
     96#: best2pay-payment_method.php:279
    7097msgid "Password to use for digital signature"
    7198msgstr ""
    7299
    73 #: best2pay-payment_method.php:200
     100#: best2pay-payment_method.php:284
    74101msgid "Test Mode"
    75102msgstr ""
    76103
    77 #: best2pay-payment_method.php:203
     104#: best2pay-payment_method.php:287
    78105msgid "Test mode - real payments will not be processed"
    79106msgstr ""
    80107
    81 #: best2pay-payment_method.php:204
     108#: best2pay-payment_method.php:288
    82109msgid "Production mode - payments will be processed"
    83110msgstr ""
    84111
    85 #: best2pay-payment_method.php:206
     112#: best2pay-payment_method.php:290
    86113msgid "Select test or live mode"
    87114msgstr ""
    88115
    89 #: best2pay-payment_method.php:211
     116#: best2pay-payment_method.php:294
    90117msgid "Payment method"
    91118msgstr ""
    92119
    93 #: best2pay-payment_method.php:214
     120#: best2pay-payment_method.php:297
    94121msgid "Standard acquiring (one-stage payment)"
    95122msgstr ""
    96123
    97 #: best2pay-payment_method.php:215
     124#: best2pay-payment_method.php:298
    98125msgid "Standard acquiring (two-stage payment)"
    99126msgstr ""
    100127
    101 #: best2pay-payment_method.php:216
    102 msgid "Halva Chastyami (one-stage payment)"
    103 msgstr ""
    104 
    105 #: best2pay-payment_method.php:217
    106 msgid "Halva Chastyami (two-stage payment)"
    107 msgstr ""
    108 
    109 #: best2pay-payment_method.php:218
     128#: best2pay-payment_method.php:299
     129msgid "Plait (one-stage payment)"
     130msgstr ""
     131
     132#: best2pay-payment_method.php:300
     133msgid "Plait (two-stage payment)"
     134msgstr ""
     135
     136#: best2pay-payment_method.php:301
    110137msgid "Fast Payment System"
    111138msgstr ""
    112139
    113 #: best2pay-payment_method.php:219
     140#: best2pay-payment_method.php:302
    114141msgid "Loan"
    115142msgstr ""
    116143
    117 #: best2pay-payment_method.php:221
     144#: best2pay-payment_method.php:304
    118145msgid "Payment occurs after confirmation by the manager in the personal account"
    119146msgstr ""
    120147
    121 #: best2pay-payment_method.php:226
     148#: best2pay-payment_method.php:308
    122149msgid "TAX"
    123150msgstr ""
    124151
    125 #: best2pay-payment_method.php:229
     152#: best2pay-payment_method.php:311
    126153msgid "VAT rate 20%"
    127154msgstr ""
    128155
    129 #: best2pay-payment_method.php:230
     156#: best2pay-payment_method.php:312
    130157msgid "VAT rate 10%"
    131158msgstr ""
    132159
    133 #: best2pay-payment_method.php:231
     160#: best2pay-payment_method.php:313
    134161msgid "VAT rate calc. 20/120"
    135162msgstr ""
    136163
    137 #: best2pay-payment_method.php:232
     164#: best2pay-payment_method.php:314
    138165msgid "VAT rate calc. 10/110"
    139166msgstr ""
    140167
    141 #: best2pay-payment_method.php:233
     168#: best2pay-payment_method.php:315
    142169msgid "VAT rate 0%"
    143170msgstr ""
    144171
    145 #: best2pay-payment_method.php:234
     172#: best2pay-payment_method.php:316
    146173msgid "Not subject to VAT"
    147174msgstr ""
    148175
    149 #: best2pay-payment_method.php:240
     176#: best2pay-payment_method.php:321
    150177msgid "Notify URL"
    151178msgstr ""
    152179
    153 #: best2pay-payment_method.php:242
     180#: best2pay-payment_method.php:323
    154181msgid "Report this URL to Best2Pay technical support to receive payment notifications"
    155182msgstr ""
    156183
    157 #: best2pay-payment_method.php:251
     184#: best2pay-payment_method.php:331
    158185msgid "Data encryption algorithm"
    159186msgstr ""
    160187
    161 #: best2pay-payment_method.php:257
     188#: best2pay-payment_method.php:337
    162189msgid "Must match your sector encryption settings in your personal account"
    163190msgstr ""
    164191
    165 #: best2pay-payment_method.php:263
     192#: best2pay-payment_method.php:342
    166193msgid "Custom statuses for orders"
    167194msgstr ""
    168195
    169 #: best2pay-payment_method.php:269
     196#: best2pay-payment_method.php:346
    170197msgid "Order registered"
    171198msgstr ""
    172199
    173 #: best2pay-payment_method.php:274
     200#: best2pay-payment_method.php:351
    174201msgid "Order authorized"
    175202msgstr ""
    176203
    177 #: best2pay-payment_method.php:279
     204#: best2pay-payment_method.php:356
    178205msgid "Loan agreement approved but not signed"
    179206msgstr ""
    180207
    181 #: best2pay-payment_method.php:284
     208#: best2pay-payment_method.php:361
    182209msgid "Order successfully paid"
    183210msgstr ""
    184211
    185 #: best2pay-payment_method.php:289
     212#: best2pay-payment_method.php:366
    186213msgid "Order canceled"
    187214msgstr ""
    188215
    189 #: best2pay-payment_method.php:317
     216#: best2pay-payment_method.php:371
     217msgid "Issuing an invoice for payment"
     218msgstr ""
     219
     220#: best2pay-payment_method.php:373
     221msgid "Enable issuing an invoice for payment by email of the payer"
     222msgstr ""
     223
     224#: best2pay-payment_method.php:377
     225msgid "Order agreement"
     226msgstr ""
     227
     228#: best2pay-payment_method.php:383
     229msgid "Payment expected"
     230msgstr ""
     231
     232#: best2pay-payment_method.php:409
    190233msgid "Order #%s"
    191234msgstr ""
    192235
    193 #: best2pay-payment_method.php:333
     236#: best2pay-payment_method.php:431
    194237msgid "Failed to register order"
    195238msgstr ""
    196239
    197 #: best2pay-payment_method.php:345
     240#: best2pay-payment_method.php:445
    198241msgid "Order registered successfully"
    199242msgstr ""
    200243
    201 #: best2pay-payment_method.php:378
    202 #: best2pay-payment_method.php:545
     244#: best2pay-payment_method.php:521
     245msgid "Order successfully create"
     246msgstr ""
     247
     248#: best2pay-payment_method.php:560
     249#: best2pay-payment_method.php:737
    203250msgid "Failed to get Best2pay order ID"
    204251msgstr ""
    205252
    206 #: best2pay-payment_method.php:381
     253#: best2pay-payment_method.php:564
    207254msgid "Failed to get Best2pay operation ID"
    208255msgstr ""
    209256
    210 #: best2pay-payment_method.php:384
    211 #: best2pay-payment_method.php:452
    212 #: best2pay-payment_method.php:539
     257#: best2pay-payment_method.php:568
     258#: best2pay-payment_method.php:643
     259#: best2pay-payment_method.php:729
    213260msgid "Undefined order ID"
    214261msgstr ""
    215262
    216 #: best2pay-payment_method.php:387
    217 #: best2pay-payment_method.php:455
    218 #: best2pay-payment_method.php:542
     263#: best2pay-payment_method.php:572
     264#: best2pay-payment_method.php:647
     265#: best2pay-payment_method.php:733
    219266msgid "Failed to get order information"
    220267msgstr ""
    221268
    222 #: best2pay-payment_method.php:400
     269#: best2pay-payment_method.php:584
    223270msgid "Could not find operation"
    224271msgstr ""
    225272
    226 #: best2pay-payment_method.php:409
     273#: best2pay-payment_method.php:595
    227274msgid "Failed to pay for the order"
    228275msgstr ""
    229276
    230 #: best2pay-payment_method.php:431
     277#: best2pay-payment_method.php:619
    231278msgid "Payment completed successfully"
    232279msgstr ""
    233280
    234 #: best2pay-payment_method.php:461
     281#: best2pay-payment_method.php:651
    235282msgid "The order has already been %s"
    236283msgstr ""
    237284
    238 #: best2pay-payment_method.php:474
     285#: best2pay-payment_method.php:663
    239286msgid "Failed to complete request for operation %s from the processing center"
    240287msgstr ""
    241288
    242 #: best2pay-payment_method.php:493
     289#: best2pay-payment_method.php:683
    243290msgid "Request for operation %s from the processing center was completed successfully"
    244291msgstr ""
    245292
    246 #: best2pay-payment_method.php:535
     293#: best2pay-payment_method.php:725
    247294msgid "Operation failed. Please refresh the page"
    248295msgstr ""
    249296
    250 #: best2pay-payment_method.php:552
     297#: best2pay-payment_method.php:743
    251298msgid "Failed to get operation request path"
    252299msgstr ""
    253300
    254 #: best2pay-payment_method.php:556
     301#: best2pay-payment_method.php:747
    255302msgid "For orders with AUTHORIZED status, only full refunds are available"
    256303msgstr ""
    257304
    258 #: best2pay-payment_method.php:577
     305#: best2pay-payment_method.php:771
    259306msgid "Operation type and action type are not equal"
    260307msgstr ""
    261308
    262 #: best2pay-payment_method.php:616
     309#: best2pay-payment_method.php:813
    263310msgid "Complete payment"
    264311msgstr ""
    265312
    266 #: best2pay-payment_method.php:674
     313#: best2pay-payment_method.php:869
    267314msgid "Missing PC order ID"
    268315msgstr ""
    269316
    270 #: best2pay-payment_method.php:687
     317#: best2pay-payment_method.php:884
    271318msgid "There are no operations in the order"
    272319msgstr ""
    273320
    274 #: best2pay-payment_method.php:719
    275 #: best2pay-payment_method.php:735
     321#: best2pay-payment_method.php:919
     322#: best2pay-payment_method.php:938
    276323msgid "Signature is missing"
    277324msgstr ""
    278325
    279 #: best2pay-payment_method.php:723
    280 #: best2pay-payment_method.php:739
     326#: best2pay-payment_method.php:924
     327#: best2pay-payment_method.php:943
    281328msgid "Invalid signature"
    282329msgstr ""
    283330
    284 #: best2pay-payment_method.php:725
    285 #: best2pay-payment_method.php:746
     331#: best2pay-payment_method.php:927
     332#: best2pay-payment_method.php:951
    286333msgid "Unknown operation type"
    287334msgstr ""
    288335
    289 #: best2pay-payment_method.php:727
    290 #: best2pay-payment_method.php:748
     336#: best2pay-payment_method.php:930
     337#: best2pay-payment_method.php:954
    291338msgid "Operation not approved"
    292339msgstr ""
    293340
    294 #: best2pay-payment_method.php:744
     341#: best2pay-payment_method.php:948
    295342msgid "An error occurred during the operation"
    296343msgstr ""
    297344
    298 #: best2pay-payment_method.php:750
     345#: best2pay-payment_method.php:957
    299346msgid "Unknown payment operation type"
    300347msgstr ""
    301348
    302 #: best2pay-payment_method.php:774
     349#: best2pay-payment_method.php:981
    303350msgid "Invalid operation amount"
    304351msgstr ""
    305352
    306 #: best2pay-payment_method.php:806
     353#: best2pay-payment_method.php:1013
    307354msgid "Funds for the order have been successfully debited"
    308355msgstr ""
    309356
    310 #: best2pay-payment_method.php:807
     357#: best2pay-payment_method.php:1014
    311358msgid "Failed to complete payment"
    312359msgstr ""
    313360
    314 #: best2pay-payment_method.php:810
     361#: best2pay-payment_method.php:1017
    315362msgid "Payment refunded successfully"
    316363msgstr ""
    317364
    318 #: best2pay-payment_method.php:811
     365#: best2pay-payment_method.php:1018
    319366msgid "Failed to refund payment"
    320367msgstr ""
    321368
    322 #: best2pay-payment_method.php:935
     369#: best2pay-payment_method.php:1134
    323370msgid "Server response is empty"
    324371msgstr ""
    325372
    326 #: best2pay-payment_method.php:938
     373#: best2pay-payment_method.php:1138
    327374msgid "Invalid XML from response"
    328375msgstr ""
    329376
    330 #: best2pay-payment_method.php:941
     377#: best2pay-payment_method.php:1142
    331378msgid "Unable to decode xml"
    332379msgstr ""
    333380
    334 #: best2pay-payment_method.php:991
     381#: best2pay-payment_method.php:1193
    335382msgid "Settings"
    336383msgstr ""
  • best2pay-payment-method-visamastercard/trunk/readme.txt

    r3011458 r3036865  
    1 === best2pay payment method ===
     1=== Модуль оплаты Best2Pay ===
    22Contributors: best2pay
    3 Tags: e-commerce, payments, best2pay, платежные системы
    4 Tested up to: 6.3.2
     3Tags: woocommerce, payments, best2pay, платежные системы
    54Requires at least: 4.7
     5Tested up to: 6.4.3
    66Requires PHP: 7.4
    7 Stable tag: 2.0.1
     7Stable tag: 2.2.0
     8WC requires at least: 6.0
     9WC tested up to: 8.5.1
    810License: GPLv3
    911License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1012
    1113== Description ==
     14
    1215Плагин «Best2pay» – платежное решение для сайтов на WooCommerce:
    13 *  включает 7 cпособов приема платежей,
    14 *  подходит для юрлиц и ИП,
    15 *  деньги поступают на банковский счет компании.
    16 * Соблюдение 54 ФЗ
     16- Включает 7 cпособов приема платежей
     17- Подходит для юрлиц и ИП
     18- Деньги поступают на банковский счет компании
     19- Соблюдение 54 ФЗ
    1720
    18 Настройка плагина
    19 Чтобы принимать платежи через плагин, нужно подать заявку на подключение к Best2pay на сайте https://best2pay.net и заключить договор с компанией.
     21= Тарифы =
     22
     23Подключение Bes2pay и настройка плагина – бесплатно. Комиссия за прием платежей – от 3,2%.
     24
     25= Все возможности Best2pay =
     26
     27После подключения Best2pay доступны:
     28- 12 способов приема платежей. Интернет-банки, СБП, виртуальные карты. Вы сами выбираете, какие способы нужны, и перечисляете их в договоре. Кнопки оплаты можно разместить на своем сайте или на сайте Best2pay: выберите подходящий вариант при настройке плагина.
     29- Личный кабинет на сайте Best2pay. В нем можно делать возвраты платежей, выставлять и отправлять счета, общаться с менеджерами.
     30
     31== Installation ==
     32
     33Чтобы принимать платежи через плагин, нужно подать заявку на подключение к Best2pay на сайте https://best2pay.net и заключить договор с компанией.
    2034После этого вы получите нужные настройки.
    2135Поддержка передачи данных чека:
    22 1. Через Bes2pay вы настраивали отправку чеков в налоговую (по 54-ФЗ)
     361. Отправка чеков через Bes2pay в налоговую (по 54-ФЗ)
    23372. Через подключённых партнёров.
    2438
    25 Тарифы
    26 Подключение Bes2pay и настройка плагина – бесплатно. Комиссия за прием платежей – от 3,2%.
     39== Screenshots ==
    2740
    28 Все возможности Best2pay
    29 После подключения Best2pay доступны:
    30 * 12 способов приема платежей. Интернет-банки, СБП, виртуальные карты. Вы сами выбираете, какие способы нужны, и перечисляете их в договоре. Кнопки оплаты можно разместить на своем сайте или на сайте Best2pay: выберите подходящий вариант при настройке плагина.
    31 * Личный кабинет на сайте Best2pay. В нем можно делать возвраты платежей, выставлять и отправлять счета, общаться с менеджерами.
    32 
    33 == Screenshots ==
    34411. Страница настроек плагина
Note: See TracChangeset for help on using the changeset viewer.