Plugin Directory

Changeset 3439313


Ignore:
Timestamp:
01/14/2026 09:18:05 AM (3 months ago)
Author:
a3soft
Message:
  • Added support for HUF token
  • Configuration now available under FiskalPRO main menu
Location:
fiskalpay/trunk
Files:
23 added
12 edited

Legend:

Unmodified
Added
Removed
  • fiskalpay/trunk/WC_Gateway_Fiskalpay.php

    r3240615 r3439313  
    11<?php
    2 declare(strict_types=1);
    3 
    4 if (!defined('ABSPATH')) {
     2declare( strict_types=1 );
     3
     4if ( ! defined( 'ABSPATH' ) ) {
    55    exit;
    66}
     
    1010use A3Soft\A3PayPhpClient\Helper\PaymentGatewayApi\Response\PaymentInfoResponse;
    1111use A3Soft\A3PayPhpClient\PaymentGatewayApi\PaymentGatewayRequester;
     12use A3Soft\FiskalPay\Application\AdminMenu\AddDashboardMenuService;
    1213use A3Soft\FiskalPay\DataModel\OrderMetaData;
     14use A3Soft\FiskalPay\Domain\AdminMenu\MenuSlug;
     15use A3Soft\FiskalPay\Domain\AdminMenu\SubmenuItem;
    1316use A3Soft\FiskalPay\Exception\InvalidApiToken;
    1417use A3Soft\FiskalPay\Exception\InvalidPaymentInfoRequestUrl;
     
    1619use A3Soft\FiskalPay\Exception\InvalidPostManDebugUrl;
    1720use A3Soft\FiskalPay\Exception\UnknownFPOrderStatusException;
     21use A3Soft\FiskalPay\Infrastructure\WordPress\I18n\WpGettextTranslator;
     22use A3Soft\FiskalPay\Infrastructure\WordPress\AdminMenu\MenuRegistrarInterface;
     23use A3Soft\FiskalPay\Infrastructure\WordPress\AdminMenu\WordPressMenuRegistrar;
    1824use A3Soft\FiskalPay\Service\OrderProcessor;
    1925use JetBrains\PhpStorm\ArrayShape;
     
    3036 * @extends     WC_Payment_Gateway
    3137 */
    32 class WC_Gateway_Fiskalpay extends WC_Payment_Gateway
    33 {
    34     /**
    35      * @var WC_Gateway_Fiskalpay|null
    36      */
     38class WC_Gateway_Fiskalpay extends WC_Payment_Gateway {
    3739    public static ?WC_Gateway_Fiskalpay $instance = null;
    3840    /**
     
    4749    private string $postManDebugUrl;
    4850    /**
    49      * @var WC_Logger|WC_Logger_Interface|null
    50      */
    51     private WC_Logger $wcLogger;
     51     * @var WC_Logger_Interface|null
     52     */
     53    private ?WC_Logger_Interface $wcLogger;
    5254
    5355    private bool $debugMode;
     
    5860     *
    5961     */
    60     public function __construct()
    61     {
    62         if (self::$instance == null) {
     62    public function __construct() {
     63        if ( self::$instance == null ) {
    6364            self::$instance = $this;
    6465        }
    6566
    66         if (!function_exists('get_plugin_data')) {
    67             require_once(ABSPATH . 'wp-admin/includes/plugin.php');
    68         }
    69 
    70         $plugin_file = __DIR__ . '/fiskalpay.php';
    71         $this->pluginData = get_plugin_data($plugin_file);
    72 
    73         $this->wcLogger = wc_get_logger();
    74         $this->id = 'fiskalpay_gateway';
    75         $this->has_fields = false;
    76         $this->icon = plugin_dir_url(__FILE__) . 'public/img/logo.png';
    77         $this->title = __('FiskalPAY payment gateway', 'fiskalpay');
    78         $this->method_title = __('FiskalPAY payment gateway', 'fiskalpay');
     67        if ( ! function_exists( 'get_plugin_data' ) ) {
     68            require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
     69        }
     70
     71        $plugin_file      = __DIR__ . '/fiskalpay.php';
     72        $this->pluginData = get_plugin_data( $plugin_file );
     73
     74        $this->wcLogger           = wc_get_logger();
     75        $this->id                 = 'fiskalpay_gateway';
     76        $this->has_fields         = false;
     77        $this->icon               = plugin_dir_url( __FILE__ ) . 'public/img/logo.png';
     78        $this->title              = __( 'FiskalPAY payment gateway', 'fiskalpay' );
     79        $this->method_title       = __( 'FiskalPAY payment gateway', 'fiskalpay' );
    7980        $this->method_description =
    80             '<p style="line-height: 1.6;">' . __('Choose a payment method via the FiskalPAY payment gateway. You can complete your secure, modern, and fast payment using the following options:', 'fiskalpay') . '</p>' .
    81             '<ul style="list-style-type: circle; padding: 0;">' .
    82             '<li style="margin: 0 10px; color: #444444;"><b>' . __('Credit/Debit Cards', 'fiskalpay') . '</b> VISA, Mastercard, Maestro</li>' .
    83             '<li style="margin: 0 10px; color: #444444;">' . '<b>Google Pay</b></li>' .
    84             '<li style="margin: 0 10px; color: #444444;">' . '<b>Apple Pay</b></li>' .
    85             '</ul>' .
    86             '<p style="line-height: 1.6;">' . __('All transactions are encrypted and meet the highest security standards to ensure the protection of your financial information.', 'fiskalpay') .
    87             '<p style="line-height: 1.6;">' . __('After clicking the "Pay" button, you will be redirected to the payment gateway page where you can conveniently complete your order.', 'fiskalpay');
     81                '<p style="line-height: 1.6;">' . __( 'Choose a payment method via the FiskalPAY payment gateway. You can complete your secure, modern, and fast payment using the following options:', 'fiskalpay' ) . '</p>' .
     82                '<ul style="list-style-type: circle; padding: 0;">' .
     83                '<li style="margin: 0 10px; color: #444444;"><b>' . __( 'Credit/Debit Cards', 'fiskalpay' ) . '</b> VISA, Mastercard, Maestro</li>' .
     84                '<li style="margin: 0 10px; color: #444444;">' . '<b>Google Pay</b></li>' .
     85                '<li style="margin: 0 10px; color: #444444;">' . '<b>Apple Pay</b></li>' .
     86                '</ul>' .
     87                '<p style="line-height: 1.6;">' . __( 'All transactions are encrypted and meet the highest security standards to ensure the protection of your financial information.', 'fiskalpay' ) .
     88                '<p style="line-height: 1.6;">' . __( 'After clicking the "Pay" button, you will be redirected to the payment gateway page where you can conveniently complete your order.', 'fiskalpay' );
    8889
    8990        $this->description = $this->method_description;
    9091
    9192        $this->supports = [
    92             'products',
     93                'products',
    9394        ];
    9495
     
    9798
    9899
    99         $this->paymentRequestUrl = $this->get_option('paymentRequestUrl');
    100         $this->paymentInfoRequestUrl = $this->get_option('paymentInfoRequestUrl');
    101         $this->debugMode = $this->get_option('debugMode', 'no') === 'yes';
    102         $this->postManDebugUrl = $this->get_option('postManDebugUrl');
    103 
    104         add_action('woocommerce_update_options_payment_gateways_' . $this->id, [
    105             $this,
    106             'process_admin_options',
    107         ]);
    108         add_action('woocommerce_api_wc_gateway_fiskalpay', [$this, 'onNotifyCallback']);
    109 
    110         add_action('woocommerce_order_details_after_order_table', [
    111             $this,
    112             'display_fields_on_view_order_page',
    113         ]);
    114         add_action('woocommerce_admin_order_data_after_payment_info', [
    115             $this,
    116             'display_payment_id_field_on_view_order_page',
    117         ]);
    118 
    119         add_filter('manage_woocommerce_page_wc-orders_columns', [
    120             $this,
    121             'add_transaction_id_column_to_orders',
    122         ]);
    123 
    124         add_action('manage_woocommerce_page_wc-orders_custom_column', [
    125             $this,
    126             'populate_transaction_id_column_to_orders',
    127         ], 10, 2);
     100        $this->paymentRequestUrl     = $this->get_option( 'paymentRequestUrl' );
     101        $this->paymentInfoRequestUrl = $this->get_option( 'paymentInfoRequestUrl' );
     102        $this->debugMode             = $this->get_option( 'debugMode', 'no' ) === 'yes';
     103        $this->postManDebugUrl       = $this->get_option( 'postManDebugUrl' );
     104
     105
     106        add_action( 'admin_menu', [ $this, 'addConfigAdminMenu' ] );
     107
     108        add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, [
     109                $this,
     110                'process_admin_options',
     111        ] );
     112        add_action( 'woocommerce_api_wc_gateway_fiskalpay', [ $this, 'onNotifyCallback' ] );
     113
     114        add_action( 'woocommerce_order_details_after_order_table', [
     115                $this,
     116                'display_fields_on_view_order_page',
     117        ] );
     118        add_action( 'woocommerce_admin_order_data_after_payment_info', [
     119                $this,
     120                'display_payment_id_field_on_view_order_page',
     121        ] );
     122
     123        add_filter( 'manage_woocommerce_page_wc-orders_columns', [
     124                $this,
     125                'add_transaction_id_column_to_orders',
     126        ] );
     127
     128        add_action( 'manage_woocommerce_page_wc-orders_custom_column', [
     129                $this,
     130                'populate_transaction_id_column_to_orders',
     131        ], 10, 2 );
    128132    }
    129133
     
    133137     * @return array
    134138     */
    135     public static function add_transaction_id_column_to_orders($columns): array
    136     {
    137         $new_columns = (is_array($columns)) ? $columns : [];
    138 
    139         $new_columns['transaction_id'] = __('Transaction Id', 'fiskalpay');
     139    public static function add_transaction_id_column_to_orders( $columns ): array {
     140        $new_columns = ( is_array( $columns ) ) ? $columns : [];
     141
     142        $new_columns['transaction_id'] = __( 'Transaction Id', 'fiskalpay' );
    140143
    141144        return $new_columns;
    142145    }
    143146
    144     public static function populate_transaction_id_column_to_orders(string $column, WC_Order $WC_order): void
    145     {
    146 
    147         if ($column === 'transaction_id') {
    148             $transactionIdField = $WC_order->get_meta(OrderProcessor::orderMetaKeys['transactionId'], true);
    149             if ($transactionIdField) {
    150                 echo esc_html($transactionIdField);
     147    public static function populate_transaction_id_column_to_orders( string $column, WC_Order $WC_order ): void {
     148
     149        if ( $column === 'transaction_id' ) {
     150            $transactionIdField = $WC_order->get_meta( OrderProcessor::orderMetaKeys['transactionId'], true );
     151            if ( $transactionIdField ) {
     152                echo esc_html( $transactionIdField );
    151153            }
    152154        }
     
    158160     * @return void
    159161     */
    160     public static function display_fields_on_view_order_page(WC_Order $order): void
    161     {
    162         $isPaid = $order->is_paid();
     162    public static function display_fields_on_view_order_page( WC_Order $order ): void {
     163        $isPaid     = $order->is_paid();
    163164        $orderState = 'wc-' . $order->get_status();
    164165
    165         echo '<p><strong>' . esc_html__('Order Status:', 'fiskalpay') . '</strong> ';
    166 
    167         switch ($orderState) {
     166        echo '<p><strong>' . esc_html__( 'Order Status:', 'fiskalpay' ) . '</strong> ';
     167
     168        switch ( $orderState ) {
    168169            case OrderProcessor::WCOrderStatuses['processing']:
    169170            case OrderProcessor::WCOrderStatuses['pendingPayment']:
    170171            case OrderProcessor::WCOrderStatuses['onHold']:
    171                 {
    172                     if ($isPaid) {
    173                         echo '<span style="color: green;">' . esc_html__('Paid', 'fiskalpay') . '</span>';
    174                     } else {
    175                         echo '<span style="color: red;">' . esc_html__('Not Paid', 'fiskalpay') . '</span>';
    176                     }
    177                     break;
     172            {
     173                if ( $isPaid ) {
     174                    echo '<span style="color: green;">' . esc_html__( 'Paid', 'fiskalpay' ) . '</span>';
     175                } else {
     176                    echo '<span style="color: red;">' . esc_html__( 'Not Paid', 'fiskalpay' ) . '</span>';
    178177                }
     178                break;
     179            }
    179180            case OrderProcessor::WCOrderStatuses['completed']:
    180                 {
    181                     echo '<span>' . esc_html__('Completed', 'fiskalpay') . '</span>';
    182                     break;
    183                 }
     181            {
     182                echo '<span>' . esc_html__( 'Completed', 'fiskalpay' ) . '</span>';
     183                break;
     184            }
    184185            case OrderProcessor::WCOrderStatuses['cancelled']:
    185                 {
    186                     echo '<span style="color: red;">' . esc_html__('Cancelled', 'fiskalpay') . '</span>';
    187                     break;
    188                 }
     186            {
     187                echo '<span style="color: red;">' . esc_html__( 'Cancelled', 'fiskalpay' ) . '</span>';
     188                break;
     189            }
    189190            case OrderProcessor::WCOrderStatuses['refunded']:
    190                 {
    191                     echo '<span style="color: red;">' . esc_html__('Refunded', 'fiskalpay') . '</span>';
    192                     break;
    193                 }
     191            {
     192                echo '<span style="color: red;">' . esc_html__( 'Refunded', 'fiskalpay' ) . '</span>';
     193                break;
     194            }
    194195            case OrderProcessor::WCOrderStatuses['failed']:
    195                 {
    196                     echo '<span style="color: red;">' . esc_html__('Failed', 'fiskalpay') . '</span>';
    197                     break;
    198                 }
     196            {
     197                echo '<span style="color: red;">' . esc_html__( 'Failed', 'fiskalpay' ) . '</span>';
     198                break;
     199            }
    199200            case OrderProcessor::WCOrderStatuses['draft']:
    200                 {
    201                     echo '<span style="color: red;">' . esc_html__('Draft', 'fiskalpay') . '</span>';
    202                     break;
    203                 }
     201            {
     202                echo '<span style="color: red;">' . esc_html__( 'Draft', 'fiskalpay' ) . '</span>';
     203                break;
     204            }
    204205            default:
    205                 {
    206                     echo '<span>' . esc_html__('Unknown', 'fiskalpay') . '</span>';
    207                     break;
    208                 }
     206            {
     207                echo '<span>' . esc_html__( 'Unknown', 'fiskalpay' ) . '</span>';
     208                break;
     209            }
    209210        }
    210211        echo '</p>';
    211212
    212         $payment_id_field = $order->get_meta(OrderProcessor::orderMetaKeys['transactionId'], true);
    213         if ($payment_id_field) {
    214             echo '<p><strong>' . esc_html__('Transaction Id', 'fiskalpay') . ':</strong> ' . esc_html($payment_id_field) . '</p>';
     213        $payment_id_field = $order->get_meta( OrderProcessor::orderMetaKeys['transactionId'], true );
     214        if ( $payment_id_field ) {
     215            echo '<p><strong>' . esc_html__( 'Transaction Id', 'fiskalpay' ) . ':</strong> ' . esc_html( $payment_id_field ) . '</p>';
    215216        }
    216217    }
     
    221222     * @return void
    222223     */
    223     public function display_payment_id_field_on_view_order_page(WC_Order $order): void
    224     {
    225         if ($order->get_payment_method() != $this->id) {
     224    public function display_payment_id_field_on_view_order_page( WC_Order $order ): void {
     225        if ( $order->get_payment_method() != $this->id ) {
    226226            return;
    227227        }
    228228
    229         $orderMeta = $order->get_meta(OrderMetaData::MetaKey);
    230 
    231         if (empty($orderMeta)) {
    232             $paymentIdField = $order->get_meta(OrderProcessor::orderMetaKeys['paymentId'], true);
    233             if ($paymentIdField) {
    234                 echo '<p class="form-field form-field-wide"><strong>' . esc_html__('Payment Id', 'fiskalpay') . ':</strong> ' . esc_html($paymentIdField) . '</p>';
    235             }
    236             $transactionIdField = $order->get_meta(OrderProcessor::orderMetaKeys['transactionId'], true);
    237             if ($transactionIdField) {
    238                 echo '<p class="form-field form-field-wide"><strong>' . esc_html__('Transaction Id', 'fiskalpay') . ':</strong> ' . esc_html($transactionIdField) . '</p>';
     229        $orderMeta = $order->get_meta( OrderMetaData::MetaKey );
     230
     231        if ( empty( $orderMeta ) ) {
     232            $paymentIdField = $order->get_meta( OrderProcessor::orderMetaKeys['paymentId'], true );
     233            if ( $paymentIdField ) {
     234                echo '<p class="form-field form-field-wide"><strong>' . esc_html__( 'Payment Id', 'fiskalpay' ) . ':</strong> ' . esc_html( $paymentIdField ) . '</p>';
     235            }
     236            $transactionIdField = $order->get_meta( OrderProcessor::orderMetaKeys['transactionId'], true );
     237            if ( $transactionIdField ) {
     238                echo '<p class="form-field form-field-wide"><strong>' . esc_html__( 'Transaction Id', 'fiskalpay' ) . ':</strong> ' . esc_html( $transactionIdField ) . '</p>';
    239239            }
    240240
     
    242242        }
    243243
    244         $orderMetaData = new OrderMetaData($order->get_id(), $orderMeta);
    245         $orderMetaRecords = array_reverse($orderMetaData->getMetaRecords());
    246 
    247         if (empty($orderMetaRecords)) {
     244        $orderMetaData    = new OrderMetaData( $order->get_id(), $orderMeta );
     245        $orderMetaRecords = array_reverse( $orderMetaData->getMetaRecords() );
     246
     247        if ( empty( $orderMetaRecords ) ) {
    248248            return;
    249249        }
    250250
    251         echo '<hr><h1>' . esc_html($this->title) . ' ' . esc_html__('transactions', 'fiskalpay') . '</h1>';
     251        echo '<hr><h1>' . esc_html( $this->title ) . ' ' . esc_html__( 'transactions', 'fiskalpay' ) . '</h1>';
    252252        echo '<table style="width: 100%;"><thead><tr><td>' .
    253             esc_html__('Date', 'fiskalpay') .
    254             '</td><td>' . esc_html__('Transaction ID', 'fiskalpay') .
    255             '</td><td>' . esc_html__('Payment ID', 'fiskalpay') .
    256             '</td><td>' . esc_html__('Info', 'fiskalpay') .
    257             '</td><td>' . esc_html__('Order state', 'fiskalpay') .
    258             '</td></tr></thead>';
     253             esc_html__( 'Date', 'fiskalpay' ) .
     254             '</td><td>' . esc_html__( 'Transaction ID', 'fiskalpay' ) .
     255             '</td><td>' . esc_html__( 'Payment ID', 'fiskalpay' ) .
     256             '</td><td>' . esc_html__( 'Info', 'fiskalpay' ) .
     257             '</td><td>' . esc_html__( 'Order state', 'fiskalpay' ) .
     258             '</td></tr></thead>';
    259259
    260260        echo '<tbody>';
    261         foreach ($orderMetaRecords as $metaRecord) {
    262             echo '<tr><td>' . esc_html($metaRecord->getDateCreated()->format('d.m.Y H:i:s') ?? '') .
    263                 '</td><td>' . esc_html($metaRecord->getTransactionId() ?? '') .
    264                 '</td><td>' . esc_html($metaRecord->getPaymentId() ?? '') .
    265                 '</td><td>' . esc_html($metaRecord->getInfo() ?? '') .
    266                 '</td><td>' . esc_html($metaRecord->getOrderState() ? wc_get_order_status_name($metaRecord->getOrderState()) : esc_html__('Unknown state', 'fiskalpay')) . '</td></tr>';
     261        foreach ( $orderMetaRecords as $metaRecord ) {
     262            echo '<tr><td>' . esc_html( $metaRecord->getDateCreated()->format( 'd.m.Y H:i:s' ) ?? '' ) .
     263                 '</td><td>' . esc_html( $metaRecord->getTransactionId() ?? '' ) .
     264                 '</td><td>' . esc_html( $metaRecord->getPaymentId() ?? '' ) .
     265                 '</td><td>' . esc_html( $metaRecord->getInfo() ?? '' ) .
     266                 '</td><td>' . esc_html( $metaRecord->getOrderState() ? wc_get_order_status_name( $metaRecord->getOrderState() ) : esc_html__( 'Unknown state', 'fiskalpay' ) ) . '</td></tr>';
    267267        }
    268268        echo '</tbody></table><hr>';
     
    273273     * @return string
    274274     */
    275     public function getVersion(): string
    276     {
     275    public function getVersion(): string {
    277276        return $this->pluginData['Version'];
    278277    }
     
    282281     * @return string
    283282     */
    284     public function getPluginDescription(): string
    285     {
     283    public function getPluginDescription(): string {
    286284        return 'WC ' . $this->pluginData['Name'] . ' v' . $this->pluginData['Version'];
    287285    }
     
    290288     * @return WC_Gateway_Fiskalpay
    291289     */
    292     public static function create(): WC_Gateway_Fiskalpay
    293     {
     290    public static function create(): WC_Gateway_Fiskalpay {
    294291        return self::$instance ?? new self();
    295292    }
     
    298295     * @return void
    299296     */
    300     public function admin_options(): void
    301     {
     297    public function admin_options(): void {
    302298        $this->checkConfiguration();
    303299        $this->display_errors();
     
    308304     * @return void
    309305     */
    310     public function checkConfiguration(): void
    311     {
    312         if (!$this->is_available()) {
    313             $this->add_error('Nastavenie brány nie je dokončené !');
     306    public function checkConfiguration(): void {
     307        if ( ! $this->is_available() ) {
     308            $this->add_error( 'Nastavenie brány nie je dokončené !' );
    314309        }
    315310    }
     
    319314     * @return void
    320315     */
    321     public function init_form_fields(): void
    322     {
     316    public function init_form_fields(): void {
    323317        $this->form_fields = [
    324             'enabled' => [
    325                 'title' => __('Enable/Disable', 'fiskalpay'),
    326                 'type' => 'checkbox',
    327                 'label' => __('Enable FiskalPAY Payment', 'fiskalpay'),
    328                 'default' => 'yes',
    329             ],
    330             'debugMode' => [
    331                 'title' => __('Enable/Disable', 'fiskalpay'),
    332                 'type' => 'checkbox',
    333                 'label' => __('Enable Debug mode', 'fiskalpay'),
    334                 'default' => 'no',
    335             ],
    336             'notifyUrl' => [
    337                 'title' => 'Notify url',
    338                 'type' => 'notifyUrl',
    339                 'notifyUrl' => add_query_arg('wc-api', 'WC_Gateway_Fiskalpay', home_url('/')),
    340             ],
    341             'token' => [
    342                 'title' => 'EUR Token',
    343                 'type' => 'text',
    344                 'description' => 'Api EUR token',
    345                 'default' => '',
    346                 'desc_tip' => true,
    347             ],
    348             'tokenCzk' => [
    349                 'title' => 'CZK Token',
    350                 'type' => 'text',
    351                 'description' => 'Api CZK token',
    352                 'default' => '',
    353                 'desc_tip' => true,
    354             ],
    355             'paymentRequestUrl' => [
    356                 'title' => 'Payment request url',
    357                 'type' => 'text',
    358                 'description' => 'Payment request url',
    359                 'default' => '',
    360                 'desc_tip' => true,
    361             ],
    362             'paymentInfoRequestUrl' => [
    363                 'title' => 'Payment info request url',
    364                 'type' => 'text',
    365                 'description' => 'Payment info request url',
    366                 'default' => '',
    367                 'desc_tip' => true,
    368             ],
    369             'postManDebugUrl' => [
    370                 'title' => 'PostMan debug url',
    371                 'type' => 'text',
    372                 'description' => __('Url which will be called alongside payment url on checkout, the copy of json data will be send here for the debugging purpose. (only work with debug mode on)', 'fiskalpay'),
    373                 'default' => '',
    374                 'desc_tip' => true,
    375             ],
     318                'enabled'               => [
     319                        'title'   => __( 'Enable/Disable', 'fiskalpay' ),
     320                        'type'    => 'checkbox',
     321                        'label'   => __( 'Enable FiskalPAY Payment', 'fiskalpay' ),
     322                        'default' => 'yes',
     323                ],
     324                'debugMode'             => [
     325                        'title'   => __( 'Enable/Disable', 'fiskalpay' ),
     326                        'type'    => 'checkbox',
     327                        'label'   => __( 'Enable Debug mode', 'fiskalpay' ),
     328                        'default' => 'no',
     329                ],
     330                'notifyUrl'             => [
     331                        'title'     => 'Notify url',
     332                        'type'      => 'notifyUrl',
     333                        'notifyUrl' => add_query_arg( 'wc-api', 'WC_Gateway_Fiskalpay', home_url( '/' ) ),
     334                ],
     335                'token'                 => [
     336                        'title'       => 'EUR Token',
     337                        'type'        => 'text',
     338                        'description' => 'Api EUR token',
     339                        'default'     => '',
     340                        'desc_tip'    => true,
     341                ],
     342                'tokenCzk'              => [
     343                        'title'       => 'CZK Token',
     344                        'type'        => 'text',
     345                        'description' => 'Api CZK token',
     346                        'default'     => '',
     347                        'desc_tip'    => true,
     348                ],
     349                'tokenHuf'              => [
     350                        'title'       => 'HUF Token',
     351                        'type'        => 'text',
     352                        'description' => 'Api HUF token',
     353                        'default'     => '',
     354                        'desc_tip'    => true,
     355                ],
     356                'paymentRequestUrl'     => [
     357                        'title'       => 'Payment request url',
     358                        'type'        => 'text',
     359                        'description' => 'Payment request url',
     360                        'default'     => '',
     361                        'desc_tip'    => true,
     362                ],
     363                'paymentInfoRequestUrl' => [
     364                        'title'       => 'Payment info request url',
     365                        'type'        => 'text',
     366                        'description' => 'Payment info request url',
     367                        'default'     => '',
     368                        'desc_tip'    => true,
     369                ],
     370                'postManDebugUrl'       => [
     371                        'title'       => 'PostMan debug url',
     372                        'type'        => 'text',
     373                        'description' => __( 'Url which will be called alongside payment url on checkout, the copy of json data will be send here for the debugging purpose. (only work with debug mode on)', 'fiskalpay' ),
     374                        'default'     => '',
     375                        'desc_tip'    => true,
     376                ],
    376377        ];
    377378    }
     
    383384     * @return false|string
    384385     */
    385     public function generate_notifyUrl_html($fieldKey, $fieldValue): bool|string
    386     {
     386    public function generate_notifyUrl_html( $fieldKey, $fieldValue ): bool|string {
    387387        ob_start();
    388388        ?>
    389         <tr valign="top">
     389        <tr>
    390390            <th scope="row" class="titledesc">
    391391                <label style="cursor: pointer"
    392                        for="<?php echo esc_attr($fieldKey); ?>"><?php echo wp_kses_post($fieldValue['title']); ?></label>
     392                       for="<?php
     393                       echo esc_attr( $fieldKey ); ?>"><?php
     394                    echo wp_kses_post( $fieldValue['title'] ); ?></label>
    393395            </th>
    394396            <td class="forminp">
    395397                <fieldset style="display: inline-block; cursor:pointer;"
    396                           onclick="alert('notifyUrl bola skopírovaná do schránky!'); navigator.clipboard.writeText('<?php echo esc_html($fieldValue['notifyUrl']) // WPCS: XSS ok.
    397         ?>');">
    398                     <legend class="screen-reader-text"><span><?php echo wp_kses_post($fieldValue['title']); ?></span>
     398                          onclick="alert('notifyUrl bola skopírovaná do schránky!'); navigator.clipboard.writeText('<?php
     399                          echo esc_html( $fieldValue['notifyUrl'] ) // WPCS: XSS ok.
     400                          ?>');">
     401                    <legend class="screen-reader-text"><span><?php
     402                            echo wp_kses_post( $fieldValue['title'] ); ?></span>
    399403                    </legend>
    400404                    <div style="display: flex; align-items: center">
    401405                        <input type="text" style="cursor: pointer; pointer-events: none" disabled
    402                                value="<?php echo esc_html($fieldValue['notifyUrl']) // WPCS: XSS ok.
    403         ?>">
     406                               value="<?php
     407                               echo esc_html( $fieldValue['notifyUrl'] ) // WPCS: XSS ok.
     408                               ?>">
    404409                        <svg style="width: 1rem;" data-slot="icon" aria-hidden="true" fill="none" stroke-width="1.5"
    405410                             stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
     
    419424     * @return bool
    420425     */
    421     public function is_available(): bool
    422     {
     426    public function is_available(): bool {
    423427        try {
    424             $this->getToken(get_woocommerce_currency());
    425         } catch (InvalidApiToken $invalid_api_token) {
     428            $this->getToken( get_woocommerce_currency() );
     429        } catch ( InvalidApiToken $invalid_api_token ) {
    426430            return false;
    427431        }
    428432
    429433        return
    430             parent::is_available() &&
    431             $this->get_option('paymentRequestUrl') &&
    432             wc_is_valid_url($this->get_option('paymentRequestUrl')) &&
    433             $this->get_option('paymentInfoRequestUrl') &&
    434             wc_is_valid_url($this->get_option('paymentInfoRequestUrl'));
     434                parent::is_available() &&
     435                $this->get_option( 'paymentRequestUrl' ) &&
     436                wc_is_valid_url( $this->get_option( 'paymentRequestUrl' ) ) &&
     437                $this->get_option( 'paymentInfoRequestUrl' ) &&
     438                wc_is_valid_url( $this->get_option( 'paymentInfoRequestUrl' ) );
    435439    }
    436440
     
    441445     * @return string
    442446     */
    443     public function validate_token_field($key, $value): string
    444     {
    445         if (!$value) {
    446             WC_Admin_Settings::add_error("Pole \"{$this->form_fields[$key]['title']}\" neobsahuje platný API kľúč!");
     447    public function validate_token_field( $key, $value ): string {
     448        if ( ! $value ) {
     449            WC_Admin_Settings::add_error( "Pole \"{$this->form_fields[$key]['title']}\" neobsahuje platný API kľúč!" );
    447450
    448451            return '';
     
    450453
    451454        return $value;
     455    }
     456
     457
     458    public function validate_tokenCzk_field( $key, $value ): string {
     459
     460        return $this->validate_token_field( $key, $value );
     461    }
     462
     463    public function validate_tokenHuf_field( $key, $value ): string {
     464
     465        return $this->validate_token_field( $key, $value );
    452466    }
    453467
     
    459473     * @return string
    460474     */
    461     public function validate_tokenCzk_field($key, $value): string
    462     {
    463 
    464         return $this->validate_token_field($key, $value);
     475    public function validate_paymentRequestUrl_field( $key, $value ): string {
     476        if ( ! $value || ! wc_is_valid_url( $value ) ) {
     477            WC_Admin_Settings::add_error( "Pole \"{$this->form_fields[$key]['title']}\" neobsahuje platnú URL adresu!" );
     478
     479            return '';
     480        }
     481
     482        return $value;
    465483    }
    466484
     
    471489     * @return string
    472490     */
    473     public function validate_paymentRequestUrl_field($key, $value): string
    474     {
    475         if (!$value || !wc_is_valid_url($value)) {
    476             WC_Admin_Settings::add_error("Pole \"{$this->form_fields[$key]['title']}\" neobsahuje platnú URL adresu!");
    477 
    478             return '';
    479         }
    480 
    481         return $value;
    482     }
    483 
    484     /**
    485      * @param $key
    486      * @param $value
    487      *
    488      * @return string
    489      */
    490     public function validate_paymentInfoRequestUrl_field($key, $value): string
    491     {
    492         if (!$value || !wc_is_valid_url($value)) {
    493             WC_Admin_Settings::add_error("Pole \"{$this->form_fields[$key]['title']}\" neobsahuje platnú URL adresu!");
     491    public function validate_paymentInfoRequestUrl_field( $key, $value ): string {
     492        if ( ! $value || ! wc_is_valid_url( $value ) ) {
     493            WC_Admin_Settings::add_error( "Pole \"{$this->form_fields[$key]['title']}\" neobsahuje platnú URL adresu!" );
    494494
    495495            return '';
     
    503503     * @throws UnknownFPOrderStatusException
    504504     */
    505     public function onNotifyCallback(): void
    506     {
     505    public function onNotifyCallback(): void {
    507506        require_once ABSPATH . '/wp-admin/includes/file.php';
    508507        WP_Filesystem();
     
    510509        global $wp_filesystem;
    511510
    512         $rawBody = $wp_filesystem->get_contents('php://input');
    513 
    514         $this->addNotificationLogMessage($wp_filesystem, $rawBody ?? 'Empty');
    515 
    516         if (!$rawBody) {
    517             http_response_code(400);
    518             die('invalid data');
    519         }
    520 
    521         $parsedJson = json_decode($rawBody, true);
    522 
    523         if (json_last_error()) {
    524             $this->wcLogger->add('wc_gateway_fiskalpay', json_last_error_msg());
    525             http_response_code(400);
    526             die('cannot parse json');
     511        $rawBody = $wp_filesystem->get_contents( 'php://input' );
     512
     513        $this->addNotificationLogMessage( $wp_filesystem, $rawBody ?? 'Empty' );
     514
     515        if ( ! $rawBody ) {
     516            http_response_code( 400 );
     517            die( 'invalid data' );
     518        }
     519
     520        $parsedJson = json_decode( $rawBody, true );
     521
     522        if ( json_last_error() ) {
     523            $this->wcLogger->add( 'wc_gateway_fiskalpay', json_last_error_msg() );
     524            http_response_code( 400 );
     525            die( 'cannot parse json' );
    527526        }
    528527
    529528        try {
    530             $paymentNotifyData = PaymentNotifyData::fromArray($parsedJson);
    531         } catch (Exception $e) {
    532             $this->wcLogger->add('wc_gateway_fiskalpay', "Message: " . $e->getMessage() . "\nStack trace: " . $e->getTraceAsString());
    533             http_response_code(500);
    534             die('invalid input data');
     529            $paymentNotifyData = PaymentNotifyData::fromArray( $parsedJson );
     530        } catch ( Exception $e ) {
     531            $this->wcLogger->add( 'wc_gateway_fiskalpay', "Message: " . $e->getMessage() . "\nStack trace: " . $e->getTraceAsString() );
     532            http_response_code( 500 );
     533            die( 'invalid input data' );
    535534        }
    536535
    537536        try {
    538             $order = OrderProcessor::GetOrderIdByPaymentId($paymentNotifyData->getPaymentId());
    539             if (!$order) {
     537            $order = OrderProcessor::GetOrderIdByPaymentId( $paymentNotifyData->getPaymentId() );
     538            if ( ! $order ) {
    540539                throw new Exception();
    541540            }
    542541
    543         } catch (Exception $exception) {
    544             $this->wcLogger->add('wc_gateway_fiskalpay', "Payment id \"{$paymentNotifyData->getPaymentId()}\" not found, in " . __FILE__ . ' on line ' . __LINE__);
    545             http_response_code(500);
    546             die('invalid payment id');
     542        } catch ( Exception $exception ) {
     543            $this->wcLogger->add( 'wc_gateway_fiskalpay', "Payment id \"{$paymentNotifyData->getPaymentId()}\" not found, in " . __FILE__ . ' on line ' . __LINE__ );
     544            http_response_code( 500 );
     545            die( 'invalid payment id' );
    547546        }
    548547
    549548
    550549        try {
    551             $orderState = $this->requestOrderState($paymentNotifyData->getPaymentId(), $order->get_currency());
    552         } catch (Exception $e) {
    553             $this->wcLogger->add('wc_gateway_fiskalpay', $e->getMessage() . ', in file ' . $e->getFile() . ' on line ' . $e->getLine());
    554             http_response_code(500);
    555             die('cannot obtain orderState from request');
    556         }
    557         $wpOrderState = OrderProcessor::ConvertOrderStatusFromFPToWC($orderState);
    558 
    559         if ($wpOrderState === ('wc-' . $order->get_status())) {
    560             die('order state is already same');
    561         }
    562 
    563         if ($orderState === PaymentInfoResponse::StatusAuthorized) {
     550            $orderState = $this->requestOrderState( $paymentNotifyData->getPaymentId(), $order->get_currency() );
     551        } catch ( Exception $e ) {
     552            $this->wcLogger->add( 'wc_gateway_fiskalpay', $e->getMessage() . ', in file ' . $e->getFile() . ' on line ' . $e->getLine() );
     553            http_response_code( 500 );
     554            die( 'cannot obtain orderState from request' );
     555        }
     556        $wpOrderState = OrderProcessor::ConvertOrderStatusFromFPToWC( $orderState );
     557
     558        if ( $wpOrderState === ( 'wc-' . $order->get_status() ) ) {
     559            die( 'order state is already same' );
     560        }
     561
     562        if ( $orderState === PaymentInfoResponse::StatusAuthorized ) {
    564563            $order->payment_complete();
    565564
    566             $orderMeta = $order->get_meta(OrderMetaData::MetaKey);
    567             if (!empty($orderMeta)) {
    568                 $orderMetaData = new OrderMetaData($order->get_id(), $orderMeta);
     565            $orderMeta = $order->get_meta( OrderMetaData::MetaKey );
     566            if ( ! empty( $orderMeta ) ) {
     567                $orderMetaData = new OrderMetaData( $order->get_id(), $orderMeta );
    569568                $orderMetaData
    570                     ->getMetaRecordByPaymentId($paymentNotifyData->getPaymentId())
    571                     ->setOrderState($order->get_status())
    572                     ->setInfo($paymentNotifyData->getStatus());
    573                 $order->update_meta_data(OrderMetaData::MetaKey, $orderMetaData->toArray());
     569                        ->getMetaRecordByPaymentId( $paymentNotifyData->getPaymentId() )
     570                        ->setOrderState( $order->get_status() )
     571                        ->setInfo( $paymentNotifyData->getStatus() );
     572                $order->update_meta_data( OrderMetaData::MetaKey, $orderMetaData->toArray() );
    574573                $order->save_meta_data();
    575574            }
    576575
    577             die('ok');
    578         }
    579         $order->update_status($wpOrderState);
    580         $orderMeta = $order->get_meta(OrderMetaData::MetaKey);
    581         if (!empty($orderMeta)) {
    582             $orderMetaData = new OrderMetaData($order->get_id(), $orderMeta);
     576            die( 'ok' );
     577        }
     578        $order->update_status( $wpOrderState );
     579        $orderMeta = $order->get_meta( OrderMetaData::MetaKey );
     580        if ( ! empty( $orderMeta ) ) {
     581            $orderMetaData = new OrderMetaData( $order->get_id(), $orderMeta );
    583582            $orderMetaData
    584                 ->getMetaRecordByPaymentId($paymentNotifyData->getPaymentId())
    585                 ->setOrderState($order->get_status())
    586                 ->setInfo($paymentNotifyData->getStatus());
    587 
    588             $order->update_meta_data(OrderMetaData::MetaKey, $orderMetaData->toArray());
     583                    ->getMetaRecordByPaymentId( $paymentNotifyData->getPaymentId() )
     584                    ->setOrderState( $order->get_status() )
     585                    ->setInfo( $paymentNotifyData->getStatus() );
     586
     587            $order->update_meta_data( OrderMetaData::MetaKey, $orderMetaData->toArray() );
    589588            $order->save_meta_data();
    590589        }
    591         die('OK');
     590        die( 'OK' );
    592591    }
    593592
     
    595594     * @return array{timestamp: false|string, method: mixed|string, endpoint: mixed|string, query_string: mixed|string, client_ip: mixed|string, client_port: mixed|string, user_agent: mixed|string, referer: mixed|string, protocol: mixed|string}
    596595     */
    597     #[ArrayShape(['timestamp' => 'string', 'method' => 'mixed|string', 'endpoint' => 'mixed|string', 'query_string' => 'mixed|string', 'client_ip' => 'mixed|string', 'client_port' => 'mixed|string', 'user_agent' => 'mixed|string', 'referer' => 'mixed|string', 'protocol' => 'mixed|string'])] private function getConnectionClientInfo(): array
    598     {
     596    #[ArrayShape( [
     597            'timestamp'    => 'string',
     598            'method'       => 'mixed|string',
     599            'endpoint'     => 'mixed|string',
     600            'query_string' => 'mixed|string',
     601            'client_ip'    => 'mixed|string',
     602            'client_port'  => 'mixed|string',
     603            'user_agent'   => 'mixed|string',
     604            'referer'      => 'mixed|string',
     605            'protocol'     => 'mixed|string',
     606    ] )]
     607    private function getConnectionClientInfo(): array {
    599608        return [
    600             'timestamp' => gmdate(format: 'Y-m-d\TH:i:s\Z'),
    601             'method' => $this->sanitizeServerEntry('REQUEST_METHOD'),
    602             'endpoint' => $this->sanitizeServerEntry('REQUEST_URI'),
    603             'query_string' => $this->sanitizeServerEntry('QUERY_STRING', ''),
    604             'client_ip' => $this->sanitizeServerEntry('REMOTE_ADDR'),
    605             'client_port' => $this->sanitizeServerEntry('REMOTE_PORT'),
    606             'user_agent' => $this->sanitizeServerEntry('HTTP_USER_AGENT'),
    607             'referer' => $this->sanitizeServerEntry('HTTP_REFERER', ''),
    608             'protocol' => $this->sanitizeServerEntry('SERVER_PROTOCOL'),
     609                'timestamp'    => gmdate( format: 'Y-m-d\TH:i:s\Z' ),
     610                'method'       => $this->sanitizeServerEntry( 'REQUEST_METHOD' ),
     611                'endpoint'     => $this->sanitizeServerEntry( 'REQUEST_URI' ),
     612                'query_string' => $this->sanitizeServerEntry( 'QUERY_STRING', '' ),
     613                'client_ip'    => $this->sanitizeServerEntry( 'REMOTE_ADDR' ),
     614                'client_port'  => $this->sanitizeServerEntry( 'REMOTE_PORT' ),
     615                'user_agent'   => $this->sanitizeServerEntry( 'HTTP_USER_AGENT' ),
     616                'referer'      => $this->sanitizeServerEntry( 'HTTP_REFERER', '' ),
     617                'protocol'     => $this->sanitizeServerEntry( 'SERVER_PROTOCOL' ),
    609618        ];
    610619    }
    611620
    612621    /**
    613      * Check if server value of key is string, sanitize it OR returns $defValue
     622     * Check if the server value of the key is string, sanitize it, OR returns $defValue
     623     *
    614624     * @param string $serverKey
    615625     * @param string $defValue
     626     *
    616627     * @return string
    617628     */
    618     private function sanitizeServerEntry(string $serverKey, string $defValue = 'UNKNOWN'): string
    619     {
    620         if (isset($_SERVER[$serverKey]) && is_string($_SERVER[$serverKey])) {
    621             return wp_unslash($_SERVER[$serverKey]);
    622         }
    623         return "UNKNOWN";
     629    private function sanitizeServerEntry( string $serverKey, string $defValue = 'UNKNOWN' ): string {
     630        if ( isset( $_SERVER[ $serverKey ] ) && is_string( $_SERVER[ $serverKey ] ) ) {
     631            return sanitize_text_field(wp_unslash( $_SERVER[ $serverKey ] ));
     632        }
     633
     634        return $defValue;
    624635    }
    625636
     
    631642     * @return string
    632643     */
    633     private function requestOrderState(string $paymentId, $currency): string
    634     {
    635         $infoResponse = $this->createInfoRequest($paymentId, $currency);
    636         $found = false;
    637         for ($i = 0; $i < count(PaymentInfoResponse::Statuses); $i++) {
    638             if ($infoResponse->getStatus() == PaymentInfoResponse::Statuses[$i]) {
     644    private function requestOrderState( string $paymentId, $currency ): string {
     645        $infoResponse = $this->createInfoRequest( $paymentId, $currency );
     646        $found        = false;
     647        for ( $i = 0; $i < count( PaymentInfoResponse::Statuses ); $i ++ ) {
     648            if ( $infoResponse->getStatus() == PaymentInfoResponse::Statuses[ $i ] ) {
    639649                $found = true;
    640650            }
    641651        }
    642652
    643         if (!$found) {
    644             $this->wcLogger->add('wc_gateway_fiskalpay', "Payment info response status was not found ! [status: {$infoResponse->getStatus()}");
    645             die('invalid payment info response status');
     653        if ( ! $found ) {
     654            $this->wcLogger->add( 'wc_gateway_fiskalpay', "Payment info response status was not found ! [status: {$infoResponse->getStatus()}" );
     655            die( 'invalid payment info response status' );
    646656        }
    647657
     
    655665     * @return PaymentInfoResponse|null
    656666     */
    657     private function createInfoRequest(string $paymentId, string $currency): ?PaymentInfoResponse
    658     {
     667    private function createInfoRequest( string $paymentId, string $currency ): ?PaymentInfoResponse {
    659668        try {
    660             $paymentGatewayRequester = new PaymentGatewayRequester($this->getPaymentInfoRequestLink(), $this->getToken($currency));
    661             $paymentInfoRequest = new PaymentInfoRequest($paymentId);
    662             $paymentInfoGuzzleResponse = $paymentGatewayRequester->makeRequest($paymentInfoRequest);
    663 
    664             return PaymentInfoResponse::fromArray(json_decode($paymentInfoGuzzleResponse->getBody(), true));
    665         } catch (Throwable $e) {
    666             $this->wcLogger->add('wc-gateway-fiskalpay', $e->getMessage());
     669            $paymentGatewayRequester   = new PaymentGatewayRequester( $this->getPaymentInfoRequestLink(), $this->getToken( $currency ) );
     670            $paymentInfoRequest        = new PaymentInfoRequest( $paymentId );
     671            $paymentInfoGuzzleResponse = $paymentGatewayRequester->makeRequest( $paymentInfoRequest );
     672
     673            return PaymentInfoResponse::fromArray( json_decode( $paymentInfoGuzzleResponse->getBody(), true ) );
     674        } catch ( Throwable $e ) {
     675            $this->wcLogger->add( 'wc-gateway-fiskalpay', $e->getMessage() );
    667676        }
    668677
     
    676685     * @return array|string[]
    677686     */
    678     public function process_payment($order_id): array
    679     {
     687    public function process_payment( $order_id ): array {
    680688        $transactionId = 'null';
    681689        try {
    682             $transactionId = Uuid::uuid4()->toString();
    683             $order = new WC_Order($order_id);
     690            $transactionId  = Uuid::uuid4()->toString();
     691            $order          = new WC_Order( $order_id );
    684692            $orderProcessor = new OrderProcessor(
    685                 $this,
    686                 $order,
    687                 wc()->cart,
    688                 wc()->customer,
    689                 function (int $orderId) use ($order) {
    690                     return $order->get_checkout_order_received_url();
    691                 },
    692                 $this->getPluginDescription()
     693                    $this,
     694                    $order,
     695                    wc()->cart,
     696                    wc()->customer,
     697                    function ( int $orderId ) use ( $order ) {
     698                        return $order->get_checkout_order_received_url();
     699                    },
     700                    $this->getPluginDescription()
    693701            );
    694             $redirectUrl = $orderProcessor->payOrder($transactionId, $order->get_currency());
     702            $redirectUrl    = $orderProcessor->payOrder( $transactionId, $order->get_currency() );
    695703
    696704            return [
    697                 'result' => 'success',
    698                 'redirect' => $redirectUrl,
     705                    'result'  => 'success',
     706                    'redirect' => $redirectUrl,
    699707            ];
    700         } catch (Exception $exception) {
    701             wc_add_notice(__('An error occurred while processing order by FiskalPAY! Transaction id: ', 'fiskalpay') . $transactionId, 'error');
    702             $this->wcLogger->add('wc_gateway_fiskalpay', 'Caught exception: ' . $exception->getMessage());
    703             $this->wcLogger->add('wc_gateway_fiskalpay', 'Stack trace: ' . $exception->getTraceAsString());
     708        } catch ( Exception $exception ) {
     709            wc_add_notice( __( 'An error occurred while processing order by FiskalPAY! Transaction id: ', 'fiskalpay' ) . $transactionId, 'error' );
     710            $this->wcLogger->add( 'wc_gateway_fiskalpay', 'Caught exception: ' . $exception->getMessage() );
     711            $this->wcLogger->add( 'wc_gateway_fiskalpay', 'Stack trace: ' . $exception->getTraceAsString() );
    704712
    705713            return [
    706                 'result' => 'failed',
     714                    'result' => 'failed',
    707715            ];
    708716        }
     
    714722     * @return bool
    715723     */
    716     public function isValidToken(string $currency = 'EUR'): bool
    717     {
     724    public function isValidToken( string $currency = 'EUR' ): bool {
    718725        $token = null;
    719         switch ($currency) {
     726        switch ( $currency ) {
    720727            case 'EUR':
    721                 {
    722                     $token = $this->get_option('token');
    723                     break;
    724                 }
     728            {
     729                $token = $this->get_option( 'token' );
     730                break;
     731            }
    725732            case 'CZK':
    726                 {
    727                     $token = $this->get_option('tokenCzk');
    728                     break;
    729                 }
     733            {
     734                $token = $this->get_option( 'tokenCzk' );
     735                break;
     736            }
     737            case 'HUF':
     738            {
     739                $token = $this->get_option( 'tokenHuf' );
     740                break;
     741            }
    730742            default:
    731                 {
    732                     break;
    733                 }
    734         }
    735 
    736         return !!$token;
     743            {
     744                break;
     745            }
     746        }
     747
     748        return ! ! $token;
    737749    }
    738750
     
    740752     * @return bool
    741753     */
    742     #[Pure] public function isValidPaymentRequestUrl(): bool
    743     {
    744         return wc_is_valid_url($this->paymentRequestUrl);
     754    #[Pure]
     755    public function isValidPaymentRequestUrl(): bool {
     756        return wc_is_valid_url( $this->paymentRequestUrl );
    745757    }
    746758
     
    748760     * @return bool
    749761     */
    750     #[Pure] public function isValidPaymentInfoRequestUrl(): bool
    751     {
    752         return wc_is_valid_url($this->paymentInfoRequestUrl);
     762    #[Pure]
     763    public function isValidPaymentInfoRequestUrl(): bool {
     764        return wc_is_valid_url( $this->paymentInfoRequestUrl );
    753765    }
    754766
     
    756768     * @return bool
    757769     */
    758     #[Pure] public function isValidPostManDebugUrl(): bool
    759     {
    760         return wc_is_valid_url($this->postManDebugUrl);
     770    #[Pure]
     771    public function isValidPostManDebugUrl(): bool {
     772        return wc_is_valid_url( $this->postManDebugUrl );
    761773    }
    762774
     
    764776     * @throws InvalidPaymentRequestUrl
    765777     */
    766     public function getPaymentRequestLink()
    767     {
    768         if (!$this->isValidPaymentRequestUrl()) {
     778    public function getPaymentRequestLink() {
     779        if ( ! $this->isValidPaymentRequestUrl() ) {
    769780            throw new InvalidPaymentRequestUrl();
    770781        }
     
    777788     * @throws InvalidPaymentInfoRequestUrl
    778789     */
    779     public function getPaymentInfoRequestLink(): string
    780     {
    781         if (!$this->isValidPaymentInfoRequestUrl()) {
     790    public function getPaymentInfoRequestLink(): string {
     791        if ( ! $this->isValidPaymentInfoRequestUrl() ) {
    782792            throw new InvalidPaymentInfoRequestUrl();
    783793        }
     
    792802     * @throws InvalidApiToken
    793803     */
    794     public function getToken(string $currency = 'EUR'): string
    795     {
    796         if (!$this->isValidToken($currency)) {
     804    public function getToken( string $currency = 'EUR' ): string {
     805        if ( ! $this->isValidToken( $currency ) ) {
    797806            throw new InvalidApiToken();
    798807        }
    799808
    800         switch ($currency) {
     809        switch ( $currency ) {
    801810            case 'EUR':
    802                 {
    803                     return $this->get_option('token');
    804                 }
     811            {
     812                return $this->get_option( 'token' );
     813            }
    805814            case 'CZK':
    806                 {
    807                     return $this->get_option('tokenCzk');
    808                 }
     815            {
     816                return $this->get_option( 'tokenCzk' );
     817            }
     818            case 'HUF':
     819            {
     820                return $this->get_option( 'tokenHuf' );
     821            }
    809822            default:
    810                 {
    811                     throw new InvalidApiToken();
    812                 }
     823            {
     824                throw new InvalidApiToken();
     825            }
    813826        }
    814827    }
     
    818831     * @throws InvalidPostManDebugUrl
    819832     */
    820     public function getPostManDebugUrl(): string
    821     {
    822         if (!$this->isValidPostManDebugUrl()) {
     833    public function getPostManDebugUrl(): string {
     834        if ( ! $this->isValidPostManDebugUrl() ) {
    823835            throw new InvalidPostManDebugUrl();
    824836        }
     
    827839    }
    828840
    829     public function isDebug(): bool
    830     {
     841    public function isDebug(): bool {
    831842        return $this->debugMode;
    832843    }
     
    834845    /**
    835846     * Adds a json log to paymentNotificationLog
     847     *
    836848     * @param WP_Filesystem_Direct $wp_filesystem
    837849     * @param string $rawBody
     850     *
    838851     * @return void
    839852     */
    840     private function addNotificationLogMessage(WP_Filesystem_Direct $wp_filesystem, string $rawBody): void
    841     {
     853    private function addNotificationLogMessage( WP_Filesystem_Direct $wp_filesystem, string $rawBody ): void {
    842854        $data = $this->getConnectionClientInfo();
    843855
    844856        $data['body'] = $rawBody;
    845857
    846         $paymentNotificationMessage = wp_json_encode($data) . PHP_EOL;
     858        $paymentNotificationMessage = wp_json_encode( $data ) . PHP_EOL;
    847859
    848860        $logDirPath = wp_upload_dir()['basedir'] . '/wc-logs/';
    849861
    850         if (!file_exists($logDirPath)) {
    851             $wp_filesystem->mkdir($logDirPath, 0775);
     862        if ( ! file_exists( $logDirPath ) ) {
     863            $wp_filesystem->mkdir( $logDirPath, 0775 );
    852864        }
    853865
    854866        // Using file_put_contents instead of $wp_filesystem->put_contents because we need APPEND mode
    855         file_put_contents($logDirPath . 'paymentNotificationLog.log', $paymentNotificationMessage, FILE_APPEND);
    856 
    857     }
    858 
    859 
     867        file_put_contents( $logDirPath . 'paymentNotificationLog.log', $paymentNotificationMessage, FILE_APPEND );
     868
     869    }
     870
     871    private function getTranslatorForMainMenu(): WpGettextTranslator {
     872        return new WpGettextTranslator('fiskalpay', [
     873                'ui.admin.menu.mainMenuTitle' => __('FiskalPRO', 'fiskalpay'),
     874                'ui.admin.dashboard.plugins' => __('FiskalPRO Plugins', 'fiskalpay'),
     875                'ui.admin.dashboard.configuration' => __('Configuration', 'fiskalpay'),
     876        ]);
     877
     878    }
     879
     880    private function createMenus(  ): void {
     881
     882        try {
     883        /** @var MenuRegistrarInterface $menuRegistrar */
     884        $menuRegistrar        = new WordPressMenuRegistrar();
     885        $dashboardMenuService = new AddDashboardMenuService( $menuRegistrar, $this->getTranslatorForMainMenu(), __FILE__, 'assets/logo.svg' );
     886        $mainMenu             = $dashboardMenuService->execute();
     887
     888        $subMenu = new SubmenuItem(
     889                __('FiskalPAY', 'fiskalpay'),
     890                __('FiskalPAY', 'fiskalpay'),
     891                new MenuSlug( 'wc-fiskalpay' ),
     892                $mainMenu->getCapability(),
     893                $mainMenu->getSlug(),
     894                [ $this, 'fiskalpayRenderSettingsPage' ],
     895        );
     896
     897        $menuRegistrar->registerMenuItem( $subMenu );
     898        }catch (Throwable $e){
     899            wc_get_logger()->error('Failed to register FiskalPAY menu item: ' . $e->getMessage(), 'wc-gateway-fiskalpay');
     900        }
     901    }
     902
     903    public function addConfigAdminMenu(): void {
     904        $this->createMenus();
     905    }
     906
     907    function fiskalpayRenderSettingsPage(): void {
     908        if ( isset( $_POST['save'] ) ) {
     909            check_admin_referer( 'woocommerce-settings' ); // rovnaký nonce používa WC settings
     910            $this->process_admin_options();
     911            echo '<div class="notice notice-success"><p>Nastavenia uložené.</p></div>';
     912        }
     913
     914        echo '<div class="wrap"><h1>FiskalPAY – Nastavenia</h1>';
     915
     916        echo '<form method="post" action="">';
     917        wp_nonce_field( 'woocommerce-settings' );
     918
     919        echo '<table class="form-table">';
     920        // toto je “motor”, ktorý používa gateway settings (WC_Settings_API)
     921        $this->generate_settings_html();
     922        echo '</table>';
     923
     924        submit_button( 'Uložiť nastavenia', 'primary', 'save' );
     925
     926        echo '</form></div>';
     927    }
    860928}
  • fiskalpay/trunk/composer.json

    r3240615 r3439313  
    33  "description": "Woocommerce payment gateway module ensuring payments using FiskalPRO payment gateway",
    44  "type": "woocommerce-module",
    5   "version": "1.1.17",
     5  "version": "1.1.18",
    66  "minimum-stability": "stable",
    77  "autoload": {
  • fiskalpay/trunk/fiskalpay.php

    r3240618 r3439313  
    66 * Plugin Name: FiskalPAY
    77 * Description: Payment by FiskalPay payment gateway
    8  * Version: 1.1.17
     8 * Version: 1.1.18
    99 * Requires at least: 5.3
    10  * Tested up to: 6.7
    11  * Requires PHP:      8.1
    12  * Author:            A3Soft s.r.o.
    13  * Author URI:        https://fiskalpro.sk
    14  * Text Domain:       fiskalpay
     10 * Tested up to: 6.9
     11 * Requires PHP: 8.1
     12 * Author: A3Soft s.r.o.
     13 * Author URI: https://fiskalpro.sk
     14 * Text Domain: fiskalpay
    1515 * Domain Path: /languages
    1616 * License: GPLv2 or later
    1717 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1818 * WC requires at least: 7.1.0
    19  * WC tested up to: 9.5.2
     19 * WC tested up to: 9.6.1
    2020 * Requires Plugins: woocommerce
    2121 */
     
    2525}
    2626
     27// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
    2728if (! in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
    2829    // WooCommerce is not active
  • fiskalpay/trunk/index.php

    r3239213 r3439313  
    33declare(strict_types=1);
    44
     5if (! defined('ABSPATH')) {
     6    exit; // Exit if accessed directly
     7}
    58# Silence is golden.
  • fiskalpay/trunk/languages/fiskalpay-cs_CZ.po

    r3239213 r3439313  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: FiskalPAY 1.1.13\n"
     5"Project-Id-Version: FiskalPAY 1.1.14\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fiskalpay\n"
    7 "POT-Creation-Date: 2024-12-23 11:36+0100\n"
    8 "PO-Revision-Date: 2024-12-23 11:41+0100\n"
     7"POT-Creation-Date: 2025-12-29T12:35:10+00:00\n"
     8"PO-Revision-Date: 2025-12-29 14:23+0100\n"
    99"Last-Translator: Tomáš Bílik <tomas.bilik@a3soft.sk>\n"
    1010"Language-Team: tomas.bilik@a3soft.sk\n"
     
    1717
    1818#. Plugin Name of the plugin
    19 #: fiskalpay.php
     19#: fiskalpay.php WC_Gateway_Fiskalpay.php:888 WC_Gateway_Fiskalpay.php:889
    2020msgid "FiskalPAY"
    2121msgstr "FiskalPAY"
     
    3636msgstr "https://fiskalpro.sk"
    3737
    38 #: fiskalpay.php:36
     38#: fiskalpay.php:38
    3939msgid "FiskalPAY requires WooCommerce to be installed and active."
    4040msgstr "FiskalPAY vyžaduje, aby byl WooCommerce nainstalován a aktivní."
    4141
    42 #: src/Service/OrderProcessor.php:140
     42#: src/Service/OrderProcessor.php:148
    4343msgid "Awaiting payment by FiskalPAY payment gateway"
    4444msgstr "Očekávaní platby prostřednictví platební brány FiskalPAY"
    4545
    46 #: src/Service/OrderProcessor.php:576
     46#: src/Service/OrderProcessor.php:585
    4747msgid "Shipping method - "
    4848msgstr "Doprava - "
    4949
    50 #: src/Service/OrderProcessor.php:620
     50#: src/Service/OrderProcessor.php:629
    5151msgid "Discount - "
    5252msgstr "Sleva - "
    5353
    54 #: WC_Gateway_Fiskalpay.php:59 WC_Gateway_Fiskalpay.php:60
     54#: WC_Gateway_Fiskalpay.php:78 WC_Gateway_Fiskalpay.php:79
    5555msgid "FiskalPAY payment gateway"
    5656msgstr "Platební brána FiskalPAY"
    5757
    58 #: WC_Gateway_Fiskalpay.php:62
     58#: WC_Gateway_Fiskalpay.php:81
    5959msgid ""
    6060"Choose a payment method via the FiskalPAY payment gateway. You can complete "
     
    6565"možností:"
    6666
    67 #: WC_Gateway_Fiskalpay.php:64
     67#: WC_Gateway_Fiskalpay.php:83
    6868msgid "Credit/Debit Cards"
    6969msgstr "Kreditní/Debetní karty"
    7070
    71 #: WC_Gateway_Fiskalpay.php:68
     71#: WC_Gateway_Fiskalpay.php:87
    7272msgid ""
    7373"All transactions are encrypted and meet the highest security standards to "
     
    7777"aby byla zajištěna ochrana vašich finančních informací."
    7878
    79 #: WC_Gateway_Fiskalpay.php:69
     79#: WC_Gateway_Fiskalpay.php:88
    8080msgid ""
    8181"After clicking the \"Pay\" button, you will be redirected to the payment "
     
    8585"brány, kde můžete pohodlně dokončit objednávku."
    8686
    87 #: WC_Gateway_Fiskalpay.php:120 WC_Gateway_Fiskalpay.php:186
    88 #: WC_Gateway_Fiskalpay.php:209
     87#: WC_Gateway_Fiskalpay.php:142 WC_Gateway_Fiskalpay.php:215
     88#: WC_Gateway_Fiskalpay.php:238
    8989msgid "Transaction Id"
    9090msgstr "Id Transakce"
    9191
    92 #: WC_Gateway_Fiskalpay.php:144
     92#: WC_Gateway_Fiskalpay.php:166
    9393msgid "Order Status:"
    9494msgstr "Stav objednávky:"
    9595
    96 #: WC_Gateway_Fiskalpay.php:151
     96#: WC_Gateway_Fiskalpay.php:174
    9797msgid "Paid"
    9898msgstr "Zaplacená"
    9999
    100 #: WC_Gateway_Fiskalpay.php:153
     100#: WC_Gateway_Fiskalpay.php:176
    101101msgid "Not Paid"
    102102msgstr "Nezaplacená"
    103103
    104 #: WC_Gateway_Fiskalpay.php:158
     104#: WC_Gateway_Fiskalpay.php:182
    105105msgid "Completed"
    106106msgstr "Uzavřena"
    107107
    108 #: WC_Gateway_Fiskalpay.php:162
     108#: WC_Gateway_Fiskalpay.php:187
    109109msgid "Cancelled"
    110110msgstr "Zrušena"
    111111
    112 #: WC_Gateway_Fiskalpay.php:166
     112#: WC_Gateway_Fiskalpay.php:192
    113113msgid "Refunded"
    114114msgstr "Prostředky byly vráceny"
    115115
    116 #: WC_Gateway_Fiskalpay.php:170
     116#: WC_Gateway_Fiskalpay.php:197
    117117msgid "Failed"
    118118msgstr "Objednávka selhala"
    119119
    120 #: WC_Gateway_Fiskalpay.php:174
     120#: WC_Gateway_Fiskalpay.php:202
    121121msgid "Draft"
    122122msgstr "Objednávka je ve stavu konceptu"
    123123
    124 #: WC_Gateway_Fiskalpay.php:178
     124#: WC_Gateway_Fiskalpay.php:207
    125125msgid "Unknown"
    126126msgstr "Neznámý stav"
    127127
    128 #: WC_Gateway_Fiskalpay.php:205
     128#: WC_Gateway_Fiskalpay.php:234
    129129msgid "Payment Id"
    130130msgstr "Id Platby"
    131131
    132 #: WC_Gateway_Fiskalpay.php:222
     132#: WC_Gateway_Fiskalpay.php:251
    133133msgid "transactions"
    134134msgstr "transakce"
    135135
    136 #: WC_Gateway_Fiskalpay.php:224
     136#: WC_Gateway_Fiskalpay.php:253
    137137msgid "Date"
    138138msgstr "Datum"
    139139
    140 #: WC_Gateway_Fiskalpay.php:225
     140#: WC_Gateway_Fiskalpay.php:254
    141141msgid "Transaction ID"
    142142msgstr "Id Transakce"
    143143
    144 #: WC_Gateway_Fiskalpay.php:226
     144#: WC_Gateway_Fiskalpay.php:255
    145145msgid "Payment ID"
    146146msgstr "Id Platby"
    147147
    148 #: WC_Gateway_Fiskalpay.php:227
     148#: WC_Gateway_Fiskalpay.php:256
    149149msgid "Info"
    150150msgstr "Info"
    151151
    152 #: WC_Gateway_Fiskalpay.php:228
     152#: WC_Gateway_Fiskalpay.php:257
    153153msgid "Order state"
    154154msgstr "Stav objednávky"
    155155
    156 #: WC_Gateway_Fiskalpay.php:237
     156#: WC_Gateway_Fiskalpay.php:266
    157157msgid "Unknown state"
    158158msgstr "Neznámý stav"
    159159
    160 #: WC_Gateway_Fiskalpay.php:274 WC_Gateway_Fiskalpay.php:280
     160#: WC_Gateway_Fiskalpay.php:319 WC_Gateway_Fiskalpay.php:325
    161161msgid "Enable/Disable"
    162162msgstr "Povolit/Zakázat"
    163163
    164 #: WC_Gateway_Fiskalpay.php:276
     164#: WC_Gateway_Fiskalpay.php:321
    165165msgid "Enable FiskalPAY Payment"
    166166msgstr "Povolit platby prostřednictvím platební brány FiskalPAY"
    167167
    168 #: WC_Gateway_Fiskalpay.php:282
     168#: WC_Gateway_Fiskalpay.php:327
    169169msgid "Enable Debug mode"
    170170msgstr "Povolit Debug mód"
    171171
    172 #: WC_Gateway_Fiskalpay.php:321
     172#: WC_Gateway_Fiskalpay.php:373
    173173msgid ""
    174174"Url which will be called alongside payment url on checkout, the copy of json "
     
    180180"režimem ladění)"
    181181
    182 #: WC_Gateway_Fiskalpay.php:624
     182#: WC_Gateway_Fiskalpay.php:709
    183183msgid "An error occurred while processing order by FiskalPAY! Transaction id: "
    184184msgstr "Při zpracování objednávky FiskalPAY došlo k chybě! ID transakce: "
     185
     186#: WC_Gateway_Fiskalpay.php:873
     187msgid "FiskalPRO"
     188msgstr "FiskalPRO"
     189
     190#: WC_Gateway_Fiskalpay.php:874
     191msgid "FiskalPRO Plugins"
     192msgstr "Pluginy FiskalPRO"
     193
     194#: WC_Gateway_Fiskalpay.php:875
     195msgid "Configuration"
     196msgstr "Konfigurace"
  • fiskalpay/trunk/languages/fiskalpay-sk_SK.po

    r3239213 r3439313  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: FiskalPAY 1.1.13\n"
     5"Project-Id-Version: FiskalPAY 1.1.14\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fiskalpay\n"
    7 "POT-Creation-Date: 2024-12-23 11:36+0100\n"
    8 "PO-Revision-Date: 2024-12-23 11:42+0100\n"
     7"POT-Creation-Date: 2025-12-29T12:35:10+00:00\n"
     8"PO-Revision-Date: 2025-12-29 14:24+0100\n"
    99"Last-Translator: Tomáš Bílik <tomas.bilik@a3soft.sk>\n"
    1010"Language-Team: tomas.bilik@a3soft.sk\n"
     
    1717
    1818#. Plugin Name of the plugin
    19 #: fiskalpay.php
     19#: fiskalpay.php WC_Gateway_Fiskalpay.php:888 WC_Gateway_Fiskalpay.php:889
    2020msgid "FiskalPAY"
    2121msgstr "FiskalPAY"
     
    3636msgstr "https://fiskalpro.sk"
    3737
    38 #: fiskalpay.php:36
     38#: fiskalpay.php:38
    3939msgid "FiskalPAY requires WooCommerce to be installed and active."
    4040msgstr "FiskalPAY vyžaduje, aby bol nainštalovaný a aktívny WooCommerce."
    4141
    42 #: src/Service/OrderProcessor.php:140
     42#: src/Service/OrderProcessor.php:148
    4343msgid "Awaiting payment by FiskalPAY payment gateway"
    4444msgstr "Čakanie na platbu prostredníctvom platobnej brány FiskalPay"
    4545
    46 #: src/Service/OrderProcessor.php:576
     46#: src/Service/OrderProcessor.php:585
    4747msgid "Shipping method - "
    4848msgstr "Doprava - "
    4949
    50 #: src/Service/OrderProcessor.php:620
     50#: src/Service/OrderProcessor.php:629
    5151msgid "Discount - "
    5252msgstr "Zľava - "
    5353
    54 #: WC_Gateway_Fiskalpay.php:59 WC_Gateway_Fiskalpay.php:60
     54#: WC_Gateway_Fiskalpay.php:78 WC_Gateway_Fiskalpay.php:79
    5555msgid "FiskalPAY payment gateway"
    5656msgstr "Platobná brána FiskalPAY"
    5757
    58 #: WC_Gateway_Fiskalpay.php:62
     58#: WC_Gateway_Fiskalpay.php:81
    5959msgid ""
    6060"Choose a payment method via the FiskalPAY payment gateway. You can complete "
     
    6464"rýchlu platbu zrealizujete pomocou viacerých možností:"
    6565
    66 #: WC_Gateway_Fiskalpay.php:64
     66#: WC_Gateway_Fiskalpay.php:83
    6767msgid "Credit/Debit Cards"
    6868msgstr "Kreditné/Debetné karty"
    6969
    70 #: WC_Gateway_Fiskalpay.php:68
     70#: WC_Gateway_Fiskalpay.php:87
    7171msgid ""
    7272"All transactions are encrypted and meet the highest security standards to "
     
    7676"čím zabezpečujú ochranu vašich finančných údajov."
    7777
    78 #: WC_Gateway_Fiskalpay.php:69
     78#: WC_Gateway_Fiskalpay.php:88
    7979msgid ""
    8080"After clicking the \"Pay\" button, you will be redirected to the payment "
     
    8484"platobnej brány, kde môžete pohodlne dokončiť svoju objednávku."
    8585
    86 #: WC_Gateway_Fiskalpay.php:120 WC_Gateway_Fiskalpay.php:186
    87 #: WC_Gateway_Fiskalpay.php:209
     86#: WC_Gateway_Fiskalpay.php:142 WC_Gateway_Fiskalpay.php:215
     87#: WC_Gateway_Fiskalpay.php:238
    8888msgid "Transaction Id"
    8989msgstr "Id Transakcie"
    9090
    91 #: WC_Gateway_Fiskalpay.php:144
     91#: WC_Gateway_Fiskalpay.php:166
    9292msgid "Order Status:"
    9393msgstr "Stav objednávky:"
    9494
    95 #: WC_Gateway_Fiskalpay.php:151
     95#: WC_Gateway_Fiskalpay.php:174
    9696msgid "Paid"
    9797msgstr "Zaplatená"
    9898
    99 #: WC_Gateway_Fiskalpay.php:153
     99#: WC_Gateway_Fiskalpay.php:176
    100100msgid "Not Paid"
    101101msgstr "Nezaplatená"
    102102
    103 #: WC_Gateway_Fiskalpay.php:158
     103#: WC_Gateway_Fiskalpay.php:182
    104104msgid "Completed"
    105105msgstr "Uzatvorená"
    106106
    107 #: WC_Gateway_Fiskalpay.php:162
     107#: WC_Gateway_Fiskalpay.php:187
    108108msgid "Cancelled"
    109109msgstr "Zrušená"
    110110
    111 #: WC_Gateway_Fiskalpay.php:166
     111#: WC_Gateway_Fiskalpay.php:192
    112112msgid "Refunded"
    113113msgstr "Prostriedky boli vrátené"
    114114
    115 #: WC_Gateway_Fiskalpay.php:170
     115#: WC_Gateway_Fiskalpay.php:197
    116116msgid "Failed"
    117117msgstr "Objednávka zlyhala"
    118118
    119 #: WC_Gateway_Fiskalpay.php:174
     119#: WC_Gateway_Fiskalpay.php:202
    120120msgid "Draft"
    121121msgstr "Objednávka je v stave konceptu"
    122122
    123 #: WC_Gateway_Fiskalpay.php:178
     123#: WC_Gateway_Fiskalpay.php:207
    124124msgid "Unknown"
    125125msgstr "Neznámy stav"
    126126
    127 #: WC_Gateway_Fiskalpay.php:205
     127#: WC_Gateway_Fiskalpay.php:234
    128128msgid "Payment Id"
    129129msgstr "Id Platby"
    130130
    131 #: WC_Gateway_Fiskalpay.php:222
     131#: WC_Gateway_Fiskalpay.php:251
    132132msgid "transactions"
    133133msgstr "transakcie"
    134134
    135 #: WC_Gateway_Fiskalpay.php:224
     135#: WC_Gateway_Fiskalpay.php:253
    136136msgid "Date"
    137137msgstr "Dátum"
    138138
    139 #: WC_Gateway_Fiskalpay.php:225
     139#: WC_Gateway_Fiskalpay.php:254
    140140msgid "Transaction ID"
    141141msgstr "Id Transakcie"
    142142
    143 #: WC_Gateway_Fiskalpay.php:226
     143#: WC_Gateway_Fiskalpay.php:255
    144144msgid "Payment ID"
    145145msgstr "Id Platby"
    146146
    147 #: WC_Gateway_Fiskalpay.php:227
     147#: WC_Gateway_Fiskalpay.php:256
    148148msgid "Info"
    149149msgstr "Info"
    150150
    151 #: WC_Gateway_Fiskalpay.php:228
     151#: WC_Gateway_Fiskalpay.php:257
    152152msgid "Order state"
    153153msgstr "Stav objednávky"
    154154
    155 #: WC_Gateway_Fiskalpay.php:237
     155#: WC_Gateway_Fiskalpay.php:266
    156156msgid "Unknown state"
    157157msgstr "Neznámy stav"
    158158
    159 #: WC_Gateway_Fiskalpay.php:274 WC_Gateway_Fiskalpay.php:280
     159#: WC_Gateway_Fiskalpay.php:319 WC_Gateway_Fiskalpay.php:325
    160160msgid "Enable/Disable"
    161161msgstr "Povoliť/Zakázať"
    162162
    163 #: WC_Gateway_Fiskalpay.php:276
     163#: WC_Gateway_Fiskalpay.php:321
    164164msgid "Enable FiskalPAY Payment"
    165165msgstr "Povoliť platbu prostredníctvom platobnej brány FiskalPay"
    166166
    167 #: WC_Gateway_Fiskalpay.php:282
     167#: WC_Gateway_Fiskalpay.php:327
    168168msgid "Enable Debug mode"
    169169msgstr "Povoliť Debug mód"
    170170
    171 #: WC_Gateway_Fiskalpay.php:321
     171#: WC_Gateway_Fiskalpay.php:373
    172172msgid ""
    173173"Url which will be called alongside payment url on checkout, the copy of json "
     
    179179"režimom ladenia)"
    180180
    181 #: WC_Gateway_Fiskalpay.php:624
     181#: WC_Gateway_Fiskalpay.php:709
    182182msgid "An error occurred while processing order by FiskalPAY! Transaction id: "
    183183msgstr "Pri spracovaní objednávky FiskalPAY sa vyskytla chyba! ID transakcie: "
     184
     185#: WC_Gateway_Fiskalpay.php:873
     186msgid "FiskalPRO"
     187msgstr "FiskalPRO"
     188
     189#: WC_Gateway_Fiskalpay.php:874
     190msgid "FiskalPRO Plugins"
     191msgstr "Pluginy FiskalPRO"
     192
     193#: WC_Gateway_Fiskalpay.php:875
     194msgid "Configuration"
     195msgstr "Konfigurácia"
  • fiskalpay/trunk/languages/fiskalpay.pot

    r3239213 r3439313  
    1 # Copyright (C) 2025 A3Soft s.r.o.
     1# Copyright (C) 2026 A3Soft s.r.o.
    22# This file is distributed under the GPLv2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: FiskalPAY 1.1.15\n"
     5"Project-Id-Version: FiskalPAY 1.1.18\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fiskalpay\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-02-07T14:31:35+00:00\n"
     12"POT-Creation-Date: 2026-01-12T08:47:56+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    1717#. Plugin Name of the plugin
    1818#: fiskalpay.php
     19#: WC_Gateway_Fiskalpay.php:889
     20#: WC_Gateway_Fiskalpay.php:890
    1921msgid "FiskalPAY"
    2022msgstr ""
     
    3537msgstr ""
    3638
    37 #: fiskalpay.php:37
     39#: fiskalpay.php:39
    3840msgid "FiskalPAY requires WooCommerce to be installed and active."
    3941msgstr ""
    4042
    41 #: src/Service/OrderProcessor.php:146
     43#: src/Service/OrderProcessor.php:148
    4244msgid "Awaiting payment by FiskalPAY payment gateway"
    4345msgstr ""
    4446
    45 #: src/Service/OrderProcessor.php:583
     47#: src/Service/OrderProcessor.php:585
    4648msgid "Shipping method - "
    4749msgstr ""
    4850
    49 #: src/Service/OrderProcessor.php:627
     51#: src/Service/OrderProcessor.php:629
    5052msgid "Discount - "
    5153msgstr ""
    5254
    53 #: WC_Gateway_Fiskalpay.php:73
    54 #: WC_Gateway_Fiskalpay.php:74
     55#: WC_Gateway_Fiskalpay.php:78
     56#: WC_Gateway_Fiskalpay.php:79
    5557msgid "FiskalPAY payment gateway"
    5658msgstr ""
    5759
    58 #: WC_Gateway_Fiskalpay.php:76
     60#: WC_Gateway_Fiskalpay.php:81
    5961msgid "Choose a payment method via the FiskalPAY payment gateway. You can complete your secure, modern, and fast payment using the following options:"
    6062msgstr ""
    6163
    62 #: WC_Gateway_Fiskalpay.php:78
     64#: WC_Gateway_Fiskalpay.php:83
    6365msgid "Credit/Debit Cards"
    6466msgstr ""
    6567
    66 #: WC_Gateway_Fiskalpay.php:82
     68#: WC_Gateway_Fiskalpay.php:87
    6769msgid "All transactions are encrypted and meet the highest security standards to ensure the protection of your financial information."
    6870msgstr ""
    6971
    70 #: WC_Gateway_Fiskalpay.php:83
     72#: WC_Gateway_Fiskalpay.php:88
    7173msgid "After clicking the \"Pay\" button, you will be redirected to the payment gateway page where you can conveniently complete your order."
    7274msgstr ""
    7375
    74 #: WC_Gateway_Fiskalpay.php:135
    75 #: WC_Gateway_Fiskalpay.php:210
    76 #: WC_Gateway_Fiskalpay.php:234
     76#: WC_Gateway_Fiskalpay.php:142
     77#: WC_Gateway_Fiskalpay.php:215
     78#: WC_Gateway_Fiskalpay.php:238
    7779msgid "Transaction Id"
    7880msgstr ""
    7981
    80 #: WC_Gateway_Fiskalpay.php:161
     82#: WC_Gateway_Fiskalpay.php:166
    8183msgid "Order Status:"
    8284msgstr ""
    8385
    84 #: WC_Gateway_Fiskalpay.php:169
     86#: WC_Gateway_Fiskalpay.php:174
    8587msgid "Paid"
    8688msgstr ""
    8789
    88 #: WC_Gateway_Fiskalpay.php:171
     90#: WC_Gateway_Fiskalpay.php:176
    8991msgid "Not Paid"
    9092msgstr ""
    9193
    92 #: WC_Gateway_Fiskalpay.php:177
     94#: WC_Gateway_Fiskalpay.php:182
    9395msgid "Completed"
    9496msgstr ""
    9597
    96 #: WC_Gateway_Fiskalpay.php:182
     98#: WC_Gateway_Fiskalpay.php:187
    9799msgid "Cancelled"
    98100msgstr ""
    99101
    100 #: WC_Gateway_Fiskalpay.php:187
     102#: WC_Gateway_Fiskalpay.php:192
    101103msgid "Refunded"
    102104msgstr ""
    103105
    104 #: WC_Gateway_Fiskalpay.php:192
     106#: WC_Gateway_Fiskalpay.php:197
    105107msgid "Failed"
    106108msgstr ""
    107109
    108 #: WC_Gateway_Fiskalpay.php:197
     110#: WC_Gateway_Fiskalpay.php:202
    109111msgid "Draft"
    110112msgstr ""
    111113
    112 #: WC_Gateway_Fiskalpay.php:202
     114#: WC_Gateway_Fiskalpay.php:207
    113115msgid "Unknown"
    114116msgstr ""
    115117
    116 #: WC_Gateway_Fiskalpay.php:230
     118#: WC_Gateway_Fiskalpay.php:234
    117119msgid "Payment Id"
    118120msgstr ""
    119121
    120 #: WC_Gateway_Fiskalpay.php:247
     122#: WC_Gateway_Fiskalpay.php:251
    121123msgid "transactions"
    122124msgstr ""
    123125
    124 #: WC_Gateway_Fiskalpay.php:249
     126#: WC_Gateway_Fiskalpay.php:253
    125127msgid "Date"
    126128msgstr ""
    127129
    128 #: WC_Gateway_Fiskalpay.php:250
     130#: WC_Gateway_Fiskalpay.php:254
    129131msgid "Transaction ID"
    130132msgstr ""
    131133
    132 #: WC_Gateway_Fiskalpay.php:251
     134#: WC_Gateway_Fiskalpay.php:255
    133135msgid "Payment ID"
    134136msgstr ""
    135137
    136 #: WC_Gateway_Fiskalpay.php:252
     138#: WC_Gateway_Fiskalpay.php:256
    137139msgid "Info"
    138140msgstr ""
    139141
    140 #: WC_Gateway_Fiskalpay.php:253
     142#: WC_Gateway_Fiskalpay.php:257
    141143msgid "Order state"
    142144msgstr ""
    143145
    144 #: WC_Gateway_Fiskalpay.php:262
     146#: WC_Gateway_Fiskalpay.php:266
    145147msgid "Unknown state"
    146148msgstr ""
    147149
    148 #: WC_Gateway_Fiskalpay.php:321
    149 #: WC_Gateway_Fiskalpay.php:327
     150#: WC_Gateway_Fiskalpay.php:319
     151#: WC_Gateway_Fiskalpay.php:325
    150152msgid "Enable/Disable"
    151153msgstr ""
    152154
    153 #: WC_Gateway_Fiskalpay.php:323
     155#: WC_Gateway_Fiskalpay.php:321
    154156msgid "Enable FiskalPAY Payment"
    155157msgstr ""
    156158
    157 #: WC_Gateway_Fiskalpay.php:329
     159#: WC_Gateway_Fiskalpay.php:327
    158160msgid "Enable Debug mode"
    159161msgstr ""
    160162
    161 #: WC_Gateway_Fiskalpay.php:368
     163#: WC_Gateway_Fiskalpay.php:373
    162164msgid "Url which will be called alongside payment url on checkout, the copy of json data will be send here for the debugging purpose. (only work with debug mode on)"
    163165msgstr ""
    164166
    165 #: WC_Gateway_Fiskalpay.php:696
     167#: WC_Gateway_Fiskalpay.php:709
    166168msgid "An error occurred while processing order by FiskalPAY! Transaction id: "
    167169msgstr ""
     170
     171#: WC_Gateway_Fiskalpay.php:873
     172msgid "FiskalPRO"
     173msgstr ""
     174
     175#: WC_Gateway_Fiskalpay.php:874
     176msgid "FiskalPRO Plugins"
     177msgstr ""
     178
     179#: WC_Gateway_Fiskalpay.php:875
     180msgid "Configuration"
     181msgstr ""
  • fiskalpay/trunk/package.json

    r3240615 r3439313  
    11{
    22  "name": "woocommerce-fiskalpay",
    3   "version": "1.1.17",
     3  "version": "1.1.18",
    44  "description": "",
    55  "main": "index.js",
  • fiskalpay/trunk/readme.txt

    r3240615 r3439313  
    22Contributors: a3soft
    33Tags: payment gateway, WooCommerce, fiskalpay, payments, pcidss
    4 Tested up to: 6.7
     4Tested up to: 6.9
    55Requires Plugins: woocommerce
    6 Stable tag: 1.1.17
     6Stable tag: 1.1.18
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6262
    6363== Changelog ==
     64= 1.1.18 =
     65* Added support for HUF token
     66* Configuration now available under FiskalPRO main menu
     67
    6468= 1.1.17 =
     69* Fixed bug in notifyHandler, when was called error occurred (bad variable)
    6570* Requires php version 8.1, because php 8.0 is outdated
    6671
  • fiskalpay/trunk/uninstall.php

    r3239213 r3439313  
    33declare(strict_types=1);
    44
    5 // if uninstall.php is not called by WordPress, die
     5if (! defined('ABSPATH')) {
     6    exit; // Exit if accessed directly
     7}
     8
    69if (! defined('WP_UNINSTALL_PLUGIN')) {
    710    die;
Note: See TracChangeset for help on using the changeset viewer.