Changeset 3439313
- Timestamp:
- 01/14/2026 09:18:05 AM (3 months ago)
- Location:
- fiskalpay/trunk
- Files:
-
- 23 added
- 12 edited
-
WC_Gateway_Fiskalpay.php (modified) (39 diffs)
-
assets/logo.svg (added)
-
composer.json (modified) (1 diff)
-
fiskalpay.php (modified) (2 diffs)
-
index.php (modified) (1 diff)
-
languages/fiskalpay-cs_CZ.mo (modified) (previous)
-
languages/fiskalpay-cs_CZ.po (modified) (7 diffs)
-
languages/fiskalpay-sk_SK.mo (modified) (previous)
-
languages/fiskalpay-sk_SK.po (modified) (7 diffs)
-
languages/fiskalpay.pot (modified) (4 diffs)
-
package.json (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/Application (added)
-
src/Application/AdminMenu (added)
-
src/Application/AdminMenu/AddDashboardMenuService.php (added)
-
src/Application/AdminMenu/CompanyMenuOrchestrator.php (added)
-
src/Application/AdminMenu/EnsureMainMenuService.php (added)
-
src/Application/AdminMenu/MenuRegistry.php (added)
-
src/Application/I18n (added)
-
src/Application/I18n/Translator.php (added)
-
src/Domain (added)
-
src/Domain/AdminMenu (added)
-
src/Domain/AdminMenu/MenuCapability.php (added)
-
src/Domain/AdminMenu/MenuItem.php (added)
-
src/Domain/AdminMenu/MenuPosition.php (added)
-
src/Domain/AdminMenu/MenuSlug.php (added)
-
src/Domain/AdminMenu/SubmenuItem.php (added)
-
src/Infrastructure (added)
-
src/Infrastructure/WordPress (added)
-
src/Infrastructure/WordPress/AdminMenu (added)
-
src/Infrastructure/WordPress/AdminMenu/MenuRegistrarInterface.php (added)
-
src/Infrastructure/WordPress/AdminMenu/WordPressMenuRegistrar.php (added)
-
src/Infrastructure/WordPress/I18n (added)
-
src/Infrastructure/WordPress/I18n/WpGettextTranslator.php (added)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
fiskalpay/trunk/WC_Gateway_Fiskalpay.php
r3240615 r3439313 1 1 <?php 2 declare( strict_types=1);3 4 if ( !defined('ABSPATH')) {2 declare( strict_types=1 ); 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 5 exit; 6 6 } … … 10 10 use A3Soft\A3PayPhpClient\Helper\PaymentGatewayApi\Response\PaymentInfoResponse; 11 11 use A3Soft\A3PayPhpClient\PaymentGatewayApi\PaymentGatewayRequester; 12 use A3Soft\FiskalPay\Application\AdminMenu\AddDashboardMenuService; 12 13 use A3Soft\FiskalPay\DataModel\OrderMetaData; 14 use A3Soft\FiskalPay\Domain\AdminMenu\MenuSlug; 15 use A3Soft\FiskalPay\Domain\AdminMenu\SubmenuItem; 13 16 use A3Soft\FiskalPay\Exception\InvalidApiToken; 14 17 use A3Soft\FiskalPay\Exception\InvalidPaymentInfoRequestUrl; … … 16 19 use A3Soft\FiskalPay\Exception\InvalidPostManDebugUrl; 17 20 use A3Soft\FiskalPay\Exception\UnknownFPOrderStatusException; 21 use A3Soft\FiskalPay\Infrastructure\WordPress\I18n\WpGettextTranslator; 22 use A3Soft\FiskalPay\Infrastructure\WordPress\AdminMenu\MenuRegistrarInterface; 23 use A3Soft\FiskalPay\Infrastructure\WordPress\AdminMenu\WordPressMenuRegistrar; 18 24 use A3Soft\FiskalPay\Service\OrderProcessor; 19 25 use JetBrains\PhpStorm\ArrayShape; … … 30 36 * @extends WC_Payment_Gateway 31 37 */ 32 class WC_Gateway_Fiskalpay extends WC_Payment_Gateway 33 { 34 /** 35 * @var WC_Gateway_Fiskalpay|null 36 */ 38 class WC_Gateway_Fiskalpay extends WC_Payment_Gateway { 37 39 public static ?WC_Gateway_Fiskalpay $instance = null; 38 40 /** … … 47 49 private string $postManDebugUrl; 48 50 /** 49 * @var WC_Logger |WC_Logger_Interface|null50 */ 51 private WC_Logger$wcLogger;51 * @var WC_Logger_Interface|null 52 */ 53 private ?WC_Logger_Interface $wcLogger; 52 54 53 55 private bool $debugMode; … … 58 60 * 59 61 */ 60 public function __construct() 61 { 62 if (self::$instance == null) { 62 public function __construct() { 63 if ( self::$instance == null ) { 63 64 self::$instance = $this; 64 65 } 65 66 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' ); 79 80 $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' ); 88 89 89 90 $this->description = $this->method_description; 90 91 91 92 $this->supports = [ 92 'products',93 'products', 93 94 ]; 94 95 … … 97 98 98 99 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 ); 128 132 } 129 133 … … 133 137 * @return array 134 138 */ 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' ); 140 143 141 144 return $new_columns; 142 145 } 143 146 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 ); 151 153 } 152 154 } … … 158 160 * @return void 159 161 */ 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(); 163 164 $orderState = 'wc-' . $order->get_status(); 164 165 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 ) { 168 169 case OrderProcessor::WCOrderStatuses['processing']: 169 170 case OrderProcessor::WCOrderStatuses['pendingPayment']: 170 171 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>'; 178 177 } 178 break; 179 } 179 180 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 } 184 185 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 } 189 190 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 } 194 195 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 } 199 200 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 } 204 205 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 } 209 210 } 210 211 echo '</p>'; 211 212 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>'; 215 216 } 216 217 } … … 221 222 * @return void 222 223 */ 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 ) { 226 226 return; 227 227 } 228 228 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>'; 239 239 } 240 240 … … 242 242 } 243 243 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 ) ) { 248 248 return; 249 249 } 250 250 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>'; 252 252 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>'; 259 259 260 260 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>'; 267 267 } 268 268 echo '</tbody></table><hr>'; … … 273 273 * @return string 274 274 */ 275 public function getVersion(): string 276 { 275 public function getVersion(): string { 277 276 return $this->pluginData['Version']; 278 277 } … … 282 281 * @return string 283 282 */ 284 public function getPluginDescription(): string 285 { 283 public function getPluginDescription(): string { 286 284 return 'WC ' . $this->pluginData['Name'] . ' v' . $this->pluginData['Version']; 287 285 } … … 290 288 * @return WC_Gateway_Fiskalpay 291 289 */ 292 public static function create(): WC_Gateway_Fiskalpay 293 { 290 public static function create(): WC_Gateway_Fiskalpay { 294 291 return self::$instance ?? new self(); 295 292 } … … 298 295 * @return void 299 296 */ 300 public function admin_options(): void 301 { 297 public function admin_options(): void { 302 298 $this->checkConfiguration(); 303 299 $this->display_errors(); … … 308 304 * @return void 309 305 */ 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é !' ); 314 309 } 315 310 } … … 319 314 * @return void 320 315 */ 321 public function init_form_fields(): void 322 { 316 public function init_form_fields(): void { 323 317 $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 ], 376 377 ]; 377 378 } … … 383 384 * @return false|string 384 385 */ 385 public function generate_notifyUrl_html($fieldKey, $fieldValue): bool|string 386 { 386 public function generate_notifyUrl_html( $fieldKey, $fieldValue ): bool|string { 387 387 ob_start(); 388 388 ?> 389 <tr valign="top">389 <tr> 390 390 <th scope="row" class="titledesc"> 391 391 <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> 393 395 </th> 394 396 <td class="forminp"> 395 397 <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> 399 403 </legend> 400 404 <div style="display: flex; align-items: center"> 401 405 <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 ?>"> 404 409 <svg style="width: 1rem;" data-slot="icon" aria-hidden="true" fill="none" stroke-width="1.5" 405 410 stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> … … 419 424 * @return bool 420 425 */ 421 public function is_available(): bool 422 { 426 public function is_available(): bool { 423 427 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 ) { 426 430 return false; 427 431 } 428 432 429 433 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' ) ); 435 439 } 436 440 … … 441 445 * @return string 442 446 */ 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ľúč!" ); 447 450 448 451 return ''; … … 450 453 451 454 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 ); 452 466 } 453 467 … … 459 473 * @return string 460 474 */ 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; 465 483 } 466 484 … … 471 489 * @return string 472 490 */ 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!" ); 494 494 495 495 return ''; … … 503 503 * @throws UnknownFPOrderStatusException 504 504 */ 505 public function onNotifyCallback(): void 506 { 505 public function onNotifyCallback(): void { 507 506 require_once ABSPATH . '/wp-admin/includes/file.php'; 508 507 WP_Filesystem(); … … 510 509 global $wp_filesystem; 511 510 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' ); 527 526 } 528 527 529 528 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' ); 535 534 } 536 535 537 536 try { 538 $order = OrderProcessor::GetOrderIdByPaymentId( $paymentNotifyData->getPaymentId());539 if ( !$order) {537 $order = OrderProcessor::GetOrderIdByPaymentId( $paymentNotifyData->getPaymentId() ); 538 if ( ! $order ) { 540 539 throw new Exception(); 541 540 } 542 541 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' ); 547 546 } 548 547 549 548 550 549 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 ) { 564 563 $order->payment_complete(); 565 564 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 ); 569 568 $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() ); 574 573 $order->save_meta_data(); 575 574 } 576 575 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 ); 583 582 $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() ); 589 588 $order->save_meta_data(); 590 589 } 591 die( 'OK');590 die( 'OK' ); 592 591 } 593 592 … … 595 594 * @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} 596 595 */ 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 { 599 608 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' ), 609 618 ]; 610 619 } 611 620 612 621 /** 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 * 614 624 * @param string $serverKey 615 625 * @param string $defValue 626 * 616 627 * @return string 617 628 */ 618 private function sanitizeServerEntry( string $serverKey, string $defValue = 'UNKNOWN'): string619 {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; 624 635 } 625 636 … … 631 642 * @return string 632 643 */ 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 ] ) { 639 649 $found = true; 640 650 } 641 651 } 642 652 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' ); 646 656 } 647 657 … … 655 665 * @return PaymentInfoResponse|null 656 666 */ 657 private function createInfoRequest(string $paymentId, string $currency): ?PaymentInfoResponse 658 { 667 private function createInfoRequest( string $paymentId, string $currency ): ?PaymentInfoResponse { 659 668 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() ); 667 676 } 668 677 … … 676 685 * @return array|string[] 677 686 */ 678 public function process_payment($order_id): array 679 { 687 public function process_payment( $order_id ): array { 680 688 $transactionId = 'null'; 681 689 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 ); 684 692 $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() 693 701 ); 694 $redirectUrl = $orderProcessor->payOrder($transactionId, $order->get_currency());702 $redirectUrl = $orderProcessor->payOrder( $transactionId, $order->get_currency() ); 695 703 696 704 return [ 697 'result'=> 'success',698 'redirect' => $redirectUrl,705 'result' => 'success', 706 'redirect' => $redirectUrl, 699 707 ]; 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() ); 704 712 705 713 return [ 706 'result' => 'failed',714 'result' => 'failed', 707 715 ]; 708 716 } … … 714 722 * @return bool 715 723 */ 716 public function isValidToken(string $currency = 'EUR'): bool 717 { 724 public function isValidToken( string $currency = 'EUR' ): bool { 718 725 $token = null; 719 switch ( $currency) {726 switch ( $currency ) { 720 727 case 'EUR': 721 {722 $token = $this->get_option('token');723 break;724 }728 { 729 $token = $this->get_option( 'token' ); 730 break; 731 } 725 732 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 } 730 742 default: 731 {732 break;733 }734 } 735 736 return ! !$token;743 { 744 break; 745 } 746 } 747 748 return ! ! $token; 737 749 } 738 750 … … 740 752 * @return bool 741 753 */ 742 #[Pure] public function isValidPaymentRequestUrl(): bool743 {744 return wc_is_valid_url( $this->paymentRequestUrl);754 #[Pure] 755 public function isValidPaymentRequestUrl(): bool { 756 return wc_is_valid_url( $this->paymentRequestUrl ); 745 757 } 746 758 … … 748 760 * @return bool 749 761 */ 750 #[Pure] public function isValidPaymentInfoRequestUrl(): bool751 {752 return wc_is_valid_url( $this->paymentInfoRequestUrl);762 #[Pure] 763 public function isValidPaymentInfoRequestUrl(): bool { 764 return wc_is_valid_url( $this->paymentInfoRequestUrl ); 753 765 } 754 766 … … 756 768 * @return bool 757 769 */ 758 #[Pure] public function isValidPostManDebugUrl(): bool759 {760 return wc_is_valid_url( $this->postManDebugUrl);770 #[Pure] 771 public function isValidPostManDebugUrl(): bool { 772 return wc_is_valid_url( $this->postManDebugUrl ); 761 773 } 762 774 … … 764 776 * @throws InvalidPaymentRequestUrl 765 777 */ 766 public function getPaymentRequestLink() 767 { 768 if (!$this->isValidPaymentRequestUrl()) { 778 public function getPaymentRequestLink() { 779 if ( ! $this->isValidPaymentRequestUrl() ) { 769 780 throw new InvalidPaymentRequestUrl(); 770 781 } … … 777 788 * @throws InvalidPaymentInfoRequestUrl 778 789 */ 779 public function getPaymentInfoRequestLink(): string 780 { 781 if (!$this->isValidPaymentInfoRequestUrl()) { 790 public function getPaymentInfoRequestLink(): string { 791 if ( ! $this->isValidPaymentInfoRequestUrl() ) { 782 792 throw new InvalidPaymentInfoRequestUrl(); 783 793 } … … 792 802 * @throws InvalidApiToken 793 803 */ 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 ) ) { 797 806 throw new InvalidApiToken(); 798 807 } 799 808 800 switch ( $currency) {809 switch ( $currency ) { 801 810 case 'EUR': 802 {803 return $this->get_option('token');804 }811 { 812 return $this->get_option( 'token' ); 813 } 805 814 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 } 809 822 default: 810 {811 throw new InvalidApiToken();812 }823 { 824 throw new InvalidApiToken(); 825 } 813 826 } 814 827 } … … 818 831 * @throws InvalidPostManDebugUrl 819 832 */ 820 public function getPostManDebugUrl(): string 821 { 822 if (!$this->isValidPostManDebugUrl()) { 833 public function getPostManDebugUrl(): string { 834 if ( ! $this->isValidPostManDebugUrl() ) { 823 835 throw new InvalidPostManDebugUrl(); 824 836 } … … 827 839 } 828 840 829 public function isDebug(): bool 830 { 841 public function isDebug(): bool { 831 842 return $this->debugMode; 832 843 } … … 834 845 /** 835 846 * Adds a json log to paymentNotificationLog 847 * 836 848 * @param WP_Filesystem_Direct $wp_filesystem 837 849 * @param string $rawBody 850 * 838 851 * @return void 839 852 */ 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 { 842 854 $data = $this->getConnectionClientInfo(); 843 855 844 856 $data['body'] = $rawBody; 845 857 846 $paymentNotificationMessage = wp_json_encode( $data) . PHP_EOL;858 $paymentNotificationMessage = wp_json_encode( $data ) . PHP_EOL; 847 859 848 860 $logDirPath = wp_upload_dir()['basedir'] . '/wc-logs/'; 849 861 850 if ( !file_exists($logDirPath)) {851 $wp_filesystem->mkdir( $logDirPath, 0775);862 if ( ! file_exists( $logDirPath ) ) { 863 $wp_filesystem->mkdir( $logDirPath, 0775 ); 852 864 } 853 865 854 866 // 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 } 860 928 } -
fiskalpay/trunk/composer.json
r3240615 r3439313 3 3 "description": "Woocommerce payment gateway module ensuring payments using FiskalPRO payment gateway", 4 4 "type": "woocommerce-module", 5 "version": "1.1.1 7",5 "version": "1.1.18", 6 6 "minimum-stability": "stable", 7 7 "autoload": { -
fiskalpay/trunk/fiskalpay.php
r3240618 r3439313 6 6 * Plugin Name: FiskalPAY 7 7 * Description: Payment by FiskalPay payment gateway 8 * Version: 1.1.1 78 * Version: 1.1.18 9 9 * Requires at least: 5.3 10 * Tested up to: 6. 711 * Requires PHP: 8.112 * Author: A3Soft s.r.o.13 * Author URI: https://fiskalpro.sk14 * Text Domain: fiskalpay10 * 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 15 15 * Domain Path: /languages 16 16 * License: GPLv2 or later 17 17 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 18 18 * WC requires at least: 7.1.0 19 * WC tested up to: 9. 5.219 * WC tested up to: 9.6.1 20 20 * Requires Plugins: woocommerce 21 21 */ … … 25 25 } 26 26 27 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound 27 28 if (! in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { 28 29 // WooCommerce is not active -
fiskalpay/trunk/index.php
r3239213 r3439313 3 3 declare(strict_types=1); 4 4 5 if (! defined('ABSPATH')) { 6 exit; // Exit if accessed directly 7 } 5 8 # Silence is golden. -
fiskalpay/trunk/languages/fiskalpay-cs_CZ.po
r3239213 r3439313 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: FiskalPAY 1.1.1 3\n"5 "Project-Id-Version: FiskalPAY 1.1.14\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fiskalpay\n" 7 "POT-Creation-Date: 202 4-12-23 11:36+0100\n"8 "PO-Revision-Date: 202 4-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" 9 9 "Last-Translator: Tomáš Bílik <tomas.bilik@a3soft.sk>\n" 10 10 "Language-Team: tomas.bilik@a3soft.sk\n" … … 17 17 18 18 #. Plugin Name of the plugin 19 #: fiskalpay.php 19 #: fiskalpay.php WC_Gateway_Fiskalpay.php:888 WC_Gateway_Fiskalpay.php:889 20 20 msgid "FiskalPAY" 21 21 msgstr "FiskalPAY" … … 36 36 msgstr "https://fiskalpro.sk" 37 37 38 #: fiskalpay.php:3 638 #: fiskalpay.php:38 39 39 msgid "FiskalPAY requires WooCommerce to be installed and active." 40 40 msgstr "FiskalPAY vyžaduje, aby byl WooCommerce nainstalován a aktivní." 41 41 42 #: src/Service/OrderProcessor.php:14 042 #: src/Service/OrderProcessor.php:148 43 43 msgid "Awaiting payment by FiskalPAY payment gateway" 44 44 msgstr "Očekávaní platby prostřednictví platební brány FiskalPAY" 45 45 46 #: src/Service/OrderProcessor.php:5 7646 #: src/Service/OrderProcessor.php:585 47 47 msgid "Shipping method - " 48 48 msgstr "Doprava - " 49 49 50 #: src/Service/OrderProcessor.php:62 050 #: src/Service/OrderProcessor.php:629 51 51 msgid "Discount - " 52 52 msgstr "Sleva - " 53 53 54 #: WC_Gateway_Fiskalpay.php: 59 WC_Gateway_Fiskalpay.php:6054 #: WC_Gateway_Fiskalpay.php:78 WC_Gateway_Fiskalpay.php:79 55 55 msgid "FiskalPAY payment gateway" 56 56 msgstr "Platební brána FiskalPAY" 57 57 58 #: WC_Gateway_Fiskalpay.php: 6258 #: WC_Gateway_Fiskalpay.php:81 59 59 msgid "" 60 60 "Choose a payment method via the FiskalPAY payment gateway. You can complete " … … 65 65 "možností:" 66 66 67 #: WC_Gateway_Fiskalpay.php: 6467 #: WC_Gateway_Fiskalpay.php:83 68 68 msgid "Credit/Debit Cards" 69 69 msgstr "Kreditní/Debetní karty" 70 70 71 #: WC_Gateway_Fiskalpay.php: 6871 #: WC_Gateway_Fiskalpay.php:87 72 72 msgid "" 73 73 "All transactions are encrypted and meet the highest security standards to " … … 77 77 "aby byla zajištěna ochrana vašich finančních informací." 78 78 79 #: WC_Gateway_Fiskalpay.php: 6979 #: WC_Gateway_Fiskalpay.php:88 80 80 msgid "" 81 81 "After clicking the \"Pay\" button, you will be redirected to the payment " … … 85 85 "brány, kde můžete pohodlně dokončit objednávku." 86 86 87 #: WC_Gateway_Fiskalpay.php:1 20 WC_Gateway_Fiskalpay.php:18688 #: WC_Gateway_Fiskalpay.php:2 0987 #: WC_Gateway_Fiskalpay.php:142 WC_Gateway_Fiskalpay.php:215 88 #: WC_Gateway_Fiskalpay.php:238 89 89 msgid "Transaction Id" 90 90 msgstr "Id Transakce" 91 91 92 #: WC_Gateway_Fiskalpay.php:1 4492 #: WC_Gateway_Fiskalpay.php:166 93 93 msgid "Order Status:" 94 94 msgstr "Stav objednávky:" 95 95 96 #: WC_Gateway_Fiskalpay.php:1 5196 #: WC_Gateway_Fiskalpay.php:174 97 97 msgid "Paid" 98 98 msgstr "Zaplacená" 99 99 100 #: WC_Gateway_Fiskalpay.php:1 53100 #: WC_Gateway_Fiskalpay.php:176 101 101 msgid "Not Paid" 102 102 msgstr "Nezaplacená" 103 103 104 #: WC_Gateway_Fiskalpay.php:1 58104 #: WC_Gateway_Fiskalpay.php:182 105 105 msgid "Completed" 106 106 msgstr "Uzavřena" 107 107 108 #: WC_Gateway_Fiskalpay.php:1 62108 #: WC_Gateway_Fiskalpay.php:187 109 109 msgid "Cancelled" 110 110 msgstr "Zrušena" 111 111 112 #: WC_Gateway_Fiskalpay.php:1 66112 #: WC_Gateway_Fiskalpay.php:192 113 113 msgid "Refunded" 114 114 msgstr "Prostředky byly vráceny" 115 115 116 #: WC_Gateway_Fiskalpay.php:1 70116 #: WC_Gateway_Fiskalpay.php:197 117 117 msgid "Failed" 118 118 msgstr "Objednávka selhala" 119 119 120 #: WC_Gateway_Fiskalpay.php: 174120 #: WC_Gateway_Fiskalpay.php:202 121 121 msgid "Draft" 122 122 msgstr "Objednávka je ve stavu konceptu" 123 123 124 #: WC_Gateway_Fiskalpay.php: 178124 #: WC_Gateway_Fiskalpay.php:207 125 125 msgid "Unknown" 126 126 msgstr "Neznámý stav" 127 127 128 #: WC_Gateway_Fiskalpay.php:2 05128 #: WC_Gateway_Fiskalpay.php:234 129 129 msgid "Payment Id" 130 130 msgstr "Id Platby" 131 131 132 #: WC_Gateway_Fiskalpay.php:2 22132 #: WC_Gateway_Fiskalpay.php:251 133 133 msgid "transactions" 134 134 msgstr "transakce" 135 135 136 #: WC_Gateway_Fiskalpay.php:2 24136 #: WC_Gateway_Fiskalpay.php:253 137 137 msgid "Date" 138 138 msgstr "Datum" 139 139 140 #: WC_Gateway_Fiskalpay.php:2 25140 #: WC_Gateway_Fiskalpay.php:254 141 141 msgid "Transaction ID" 142 142 msgstr "Id Transakce" 143 143 144 #: WC_Gateway_Fiskalpay.php:2 26144 #: WC_Gateway_Fiskalpay.php:255 145 145 msgid "Payment ID" 146 146 msgstr "Id Platby" 147 147 148 #: WC_Gateway_Fiskalpay.php:2 27148 #: WC_Gateway_Fiskalpay.php:256 149 149 msgid "Info" 150 150 msgstr "Info" 151 151 152 #: WC_Gateway_Fiskalpay.php:2 28152 #: WC_Gateway_Fiskalpay.php:257 153 153 msgid "Order state" 154 154 msgstr "Stav objednávky" 155 155 156 #: WC_Gateway_Fiskalpay.php:2 37156 #: WC_Gateway_Fiskalpay.php:266 157 157 msgid "Unknown state" 158 158 msgstr "Neznámý stav" 159 159 160 #: WC_Gateway_Fiskalpay.php: 274 WC_Gateway_Fiskalpay.php:280160 #: WC_Gateway_Fiskalpay.php:319 WC_Gateway_Fiskalpay.php:325 161 161 msgid "Enable/Disable" 162 162 msgstr "Povolit/Zakázat" 163 163 164 #: WC_Gateway_Fiskalpay.php: 276164 #: WC_Gateway_Fiskalpay.php:321 165 165 msgid "Enable FiskalPAY Payment" 166 166 msgstr "Povolit platby prostřednictvím platební brány FiskalPAY" 167 167 168 #: WC_Gateway_Fiskalpay.php: 282168 #: WC_Gateway_Fiskalpay.php:327 169 169 msgid "Enable Debug mode" 170 170 msgstr "Povolit Debug mód" 171 171 172 #: WC_Gateway_Fiskalpay.php:3 21172 #: WC_Gateway_Fiskalpay.php:373 173 173 msgid "" 174 174 "Url which will be called alongside payment url on checkout, the copy of json " … … 180 180 "režimem ladění)" 181 181 182 #: WC_Gateway_Fiskalpay.php: 624182 #: WC_Gateway_Fiskalpay.php:709 183 183 msgid "An error occurred while processing order by FiskalPAY! Transaction id: " 184 184 msgstr "Při zpracování objednávky FiskalPAY došlo k chybě! ID transakce: " 185 186 #: WC_Gateway_Fiskalpay.php:873 187 msgid "FiskalPRO" 188 msgstr "FiskalPRO" 189 190 #: WC_Gateway_Fiskalpay.php:874 191 msgid "FiskalPRO Plugins" 192 msgstr "Pluginy FiskalPRO" 193 194 #: WC_Gateway_Fiskalpay.php:875 195 msgid "Configuration" 196 msgstr "Konfigurace" -
fiskalpay/trunk/languages/fiskalpay-sk_SK.po
r3239213 r3439313 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: FiskalPAY 1.1.1 3\n"5 "Project-Id-Version: FiskalPAY 1.1.14\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fiskalpay\n" 7 "POT-Creation-Date: 202 4-12-23 11:36+0100\n"8 "PO-Revision-Date: 202 4-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" 9 9 "Last-Translator: Tomáš Bílik <tomas.bilik@a3soft.sk>\n" 10 10 "Language-Team: tomas.bilik@a3soft.sk\n" … … 17 17 18 18 #. Plugin Name of the plugin 19 #: fiskalpay.php 19 #: fiskalpay.php WC_Gateway_Fiskalpay.php:888 WC_Gateway_Fiskalpay.php:889 20 20 msgid "FiskalPAY" 21 21 msgstr "FiskalPAY" … … 36 36 msgstr "https://fiskalpro.sk" 37 37 38 #: fiskalpay.php:3 638 #: fiskalpay.php:38 39 39 msgid "FiskalPAY requires WooCommerce to be installed and active." 40 40 msgstr "FiskalPAY vyžaduje, aby bol nainštalovaný a aktívny WooCommerce." 41 41 42 #: src/Service/OrderProcessor.php:14 042 #: src/Service/OrderProcessor.php:148 43 43 msgid "Awaiting payment by FiskalPAY payment gateway" 44 44 msgstr "Čakanie na platbu prostredníctvom platobnej brány FiskalPay" 45 45 46 #: src/Service/OrderProcessor.php:5 7646 #: src/Service/OrderProcessor.php:585 47 47 msgid "Shipping method - " 48 48 msgstr "Doprava - " 49 49 50 #: src/Service/OrderProcessor.php:62 050 #: src/Service/OrderProcessor.php:629 51 51 msgid "Discount - " 52 52 msgstr "Zľava - " 53 53 54 #: WC_Gateway_Fiskalpay.php: 59 WC_Gateway_Fiskalpay.php:6054 #: WC_Gateway_Fiskalpay.php:78 WC_Gateway_Fiskalpay.php:79 55 55 msgid "FiskalPAY payment gateway" 56 56 msgstr "Platobná brána FiskalPAY" 57 57 58 #: WC_Gateway_Fiskalpay.php: 6258 #: WC_Gateway_Fiskalpay.php:81 59 59 msgid "" 60 60 "Choose a payment method via the FiskalPAY payment gateway. You can complete " … … 64 64 "rýchlu platbu zrealizujete pomocou viacerých možností:" 65 65 66 #: WC_Gateway_Fiskalpay.php: 6466 #: WC_Gateway_Fiskalpay.php:83 67 67 msgid "Credit/Debit Cards" 68 68 msgstr "Kreditné/Debetné karty" 69 69 70 #: WC_Gateway_Fiskalpay.php: 6870 #: WC_Gateway_Fiskalpay.php:87 71 71 msgid "" 72 72 "All transactions are encrypted and meet the highest security standards to " … … 76 76 "čím zabezpečujú ochranu vašich finančných údajov." 77 77 78 #: WC_Gateway_Fiskalpay.php: 6978 #: WC_Gateway_Fiskalpay.php:88 79 79 msgid "" 80 80 "After clicking the \"Pay\" button, you will be redirected to the payment " … … 84 84 "platobnej brány, kde môžete pohodlne dokončiť svoju objednávku." 85 85 86 #: WC_Gateway_Fiskalpay.php:1 20 WC_Gateway_Fiskalpay.php:18687 #: WC_Gateway_Fiskalpay.php:2 0986 #: WC_Gateway_Fiskalpay.php:142 WC_Gateway_Fiskalpay.php:215 87 #: WC_Gateway_Fiskalpay.php:238 88 88 msgid "Transaction Id" 89 89 msgstr "Id Transakcie" 90 90 91 #: WC_Gateway_Fiskalpay.php:1 4491 #: WC_Gateway_Fiskalpay.php:166 92 92 msgid "Order Status:" 93 93 msgstr "Stav objednávky:" 94 94 95 #: WC_Gateway_Fiskalpay.php:1 5195 #: WC_Gateway_Fiskalpay.php:174 96 96 msgid "Paid" 97 97 msgstr "Zaplatená" 98 98 99 #: WC_Gateway_Fiskalpay.php:1 5399 #: WC_Gateway_Fiskalpay.php:176 100 100 msgid "Not Paid" 101 101 msgstr "Nezaplatená" 102 102 103 #: WC_Gateway_Fiskalpay.php:1 58103 #: WC_Gateway_Fiskalpay.php:182 104 104 msgid "Completed" 105 105 msgstr "Uzatvorená" 106 106 107 #: WC_Gateway_Fiskalpay.php:1 62107 #: WC_Gateway_Fiskalpay.php:187 108 108 msgid "Cancelled" 109 109 msgstr "Zrušená" 110 110 111 #: WC_Gateway_Fiskalpay.php:1 66111 #: WC_Gateway_Fiskalpay.php:192 112 112 msgid "Refunded" 113 113 msgstr "Prostriedky boli vrátené" 114 114 115 #: WC_Gateway_Fiskalpay.php:1 70115 #: WC_Gateway_Fiskalpay.php:197 116 116 msgid "Failed" 117 117 msgstr "Objednávka zlyhala" 118 118 119 #: WC_Gateway_Fiskalpay.php: 174119 #: WC_Gateway_Fiskalpay.php:202 120 120 msgid "Draft" 121 121 msgstr "Objednávka je v stave konceptu" 122 122 123 #: WC_Gateway_Fiskalpay.php: 178123 #: WC_Gateway_Fiskalpay.php:207 124 124 msgid "Unknown" 125 125 msgstr "Neznámy stav" 126 126 127 #: WC_Gateway_Fiskalpay.php:2 05127 #: WC_Gateway_Fiskalpay.php:234 128 128 msgid "Payment Id" 129 129 msgstr "Id Platby" 130 130 131 #: WC_Gateway_Fiskalpay.php:2 22131 #: WC_Gateway_Fiskalpay.php:251 132 132 msgid "transactions" 133 133 msgstr "transakcie" 134 134 135 #: WC_Gateway_Fiskalpay.php:2 24135 #: WC_Gateway_Fiskalpay.php:253 136 136 msgid "Date" 137 137 msgstr "Dátum" 138 138 139 #: WC_Gateway_Fiskalpay.php:2 25139 #: WC_Gateway_Fiskalpay.php:254 140 140 msgid "Transaction ID" 141 141 msgstr "Id Transakcie" 142 142 143 #: WC_Gateway_Fiskalpay.php:2 26143 #: WC_Gateway_Fiskalpay.php:255 144 144 msgid "Payment ID" 145 145 msgstr "Id Platby" 146 146 147 #: WC_Gateway_Fiskalpay.php:2 27147 #: WC_Gateway_Fiskalpay.php:256 148 148 msgid "Info" 149 149 msgstr "Info" 150 150 151 #: WC_Gateway_Fiskalpay.php:2 28151 #: WC_Gateway_Fiskalpay.php:257 152 152 msgid "Order state" 153 153 msgstr "Stav objednávky" 154 154 155 #: WC_Gateway_Fiskalpay.php:2 37155 #: WC_Gateway_Fiskalpay.php:266 156 156 msgid "Unknown state" 157 157 msgstr "Neznámy stav" 158 158 159 #: WC_Gateway_Fiskalpay.php: 274 WC_Gateway_Fiskalpay.php:280159 #: WC_Gateway_Fiskalpay.php:319 WC_Gateway_Fiskalpay.php:325 160 160 msgid "Enable/Disable" 161 161 msgstr "Povoliť/Zakázať" 162 162 163 #: WC_Gateway_Fiskalpay.php: 276163 #: WC_Gateway_Fiskalpay.php:321 164 164 msgid "Enable FiskalPAY Payment" 165 165 msgstr "Povoliť platbu prostredníctvom platobnej brány FiskalPay" 166 166 167 #: WC_Gateway_Fiskalpay.php: 282167 #: WC_Gateway_Fiskalpay.php:327 168 168 msgid "Enable Debug mode" 169 169 msgstr "Povoliť Debug mód" 170 170 171 #: WC_Gateway_Fiskalpay.php:3 21171 #: WC_Gateway_Fiskalpay.php:373 172 172 msgid "" 173 173 "Url which will be called alongside payment url on checkout, the copy of json " … … 179 179 "režimom ladenia)" 180 180 181 #: WC_Gateway_Fiskalpay.php: 624181 #: WC_Gateway_Fiskalpay.php:709 182 182 msgid "An error occurred while processing order by FiskalPAY! Transaction id: " 183 183 msgstr "Pri spracovaní objednávky FiskalPAY sa vyskytla chyba! ID transakcie: " 184 185 #: WC_Gateway_Fiskalpay.php:873 186 msgid "FiskalPRO" 187 msgstr "FiskalPRO" 188 189 #: WC_Gateway_Fiskalpay.php:874 190 msgid "FiskalPRO Plugins" 191 msgstr "Pluginy FiskalPRO" 192 193 #: WC_Gateway_Fiskalpay.php:875 194 msgid "Configuration" 195 msgstr "Konfigurácia" -
fiskalpay/trunk/languages/fiskalpay.pot
r3239213 r3439313 1 # Copyright (C) 202 5A3Soft s.r.o.1 # Copyright (C) 2026 A3Soft s.r.o. 2 2 # This file is distributed under the GPLv2 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: FiskalPAY 1.1.1 5\n"5 "Project-Id-Version: FiskalPAY 1.1.18\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fiskalpay\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 5-02-07T14:31:35+00:00\n"12 "POT-Creation-Date: 2026-01-12T08:47:56+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 17 17 #. Plugin Name of the plugin 18 18 #: fiskalpay.php 19 #: WC_Gateway_Fiskalpay.php:889 20 #: WC_Gateway_Fiskalpay.php:890 19 21 msgid "FiskalPAY" 20 22 msgstr "" … … 35 37 msgstr "" 36 38 37 #: fiskalpay.php:3 739 #: fiskalpay.php:39 38 40 msgid "FiskalPAY requires WooCommerce to be installed and active." 39 41 msgstr "" 40 42 41 #: src/Service/OrderProcessor.php:14 643 #: src/Service/OrderProcessor.php:148 42 44 msgid "Awaiting payment by FiskalPAY payment gateway" 43 45 msgstr "" 44 46 45 #: src/Service/OrderProcessor.php:58 347 #: src/Service/OrderProcessor.php:585 46 48 msgid "Shipping method - " 47 49 msgstr "" 48 50 49 #: src/Service/OrderProcessor.php:62 751 #: src/Service/OrderProcessor.php:629 50 52 msgid "Discount - " 51 53 msgstr "" 52 54 53 #: WC_Gateway_Fiskalpay.php:7 354 #: WC_Gateway_Fiskalpay.php:7 455 #: WC_Gateway_Fiskalpay.php:78 56 #: WC_Gateway_Fiskalpay.php:79 55 57 msgid "FiskalPAY payment gateway" 56 58 msgstr "" 57 59 58 #: WC_Gateway_Fiskalpay.php: 7660 #: WC_Gateway_Fiskalpay.php:81 59 61 msgid "Choose a payment method via the FiskalPAY payment gateway. You can complete your secure, modern, and fast payment using the following options:" 60 62 msgstr "" 61 63 62 #: WC_Gateway_Fiskalpay.php: 7864 #: WC_Gateway_Fiskalpay.php:83 63 65 msgid "Credit/Debit Cards" 64 66 msgstr "" 65 67 66 #: WC_Gateway_Fiskalpay.php:8 268 #: WC_Gateway_Fiskalpay.php:87 67 69 msgid "All transactions are encrypted and meet the highest security standards to ensure the protection of your financial information." 68 70 msgstr "" 69 71 70 #: WC_Gateway_Fiskalpay.php:8 372 #: WC_Gateway_Fiskalpay.php:88 71 73 msgid "After clicking the \"Pay\" button, you will be redirected to the payment gateway page where you can conveniently complete your order." 72 74 msgstr "" 73 75 74 #: WC_Gateway_Fiskalpay.php:1 3575 #: WC_Gateway_Fiskalpay.php:21 076 #: WC_Gateway_Fiskalpay.php:23 476 #: WC_Gateway_Fiskalpay.php:142 77 #: WC_Gateway_Fiskalpay.php:215 78 #: WC_Gateway_Fiskalpay.php:238 77 79 msgid "Transaction Id" 78 80 msgstr "" 79 81 80 #: WC_Gateway_Fiskalpay.php:16 182 #: WC_Gateway_Fiskalpay.php:166 81 83 msgid "Order Status:" 82 84 msgstr "" 83 85 84 #: WC_Gateway_Fiskalpay.php:1 6986 #: WC_Gateway_Fiskalpay.php:174 85 87 msgid "Paid" 86 88 msgstr "" 87 89 88 #: WC_Gateway_Fiskalpay.php:17 190 #: WC_Gateway_Fiskalpay.php:176 89 91 msgid "Not Paid" 90 92 msgstr "" 91 93 92 #: WC_Gateway_Fiskalpay.php:1 7794 #: WC_Gateway_Fiskalpay.php:182 93 95 msgid "Completed" 94 96 msgstr "" 95 97 96 #: WC_Gateway_Fiskalpay.php:18 298 #: WC_Gateway_Fiskalpay.php:187 97 99 msgid "Cancelled" 98 100 msgstr "" 99 101 100 #: WC_Gateway_Fiskalpay.php:1 87102 #: WC_Gateway_Fiskalpay.php:192 101 103 msgid "Refunded" 102 104 msgstr "" 103 105 104 #: WC_Gateway_Fiskalpay.php:19 2106 #: WC_Gateway_Fiskalpay.php:197 105 107 msgid "Failed" 106 108 msgstr "" 107 109 108 #: WC_Gateway_Fiskalpay.php: 197110 #: WC_Gateway_Fiskalpay.php:202 109 111 msgid "Draft" 110 112 msgstr "" 111 113 112 #: WC_Gateway_Fiskalpay.php:20 2114 #: WC_Gateway_Fiskalpay.php:207 113 115 msgid "Unknown" 114 116 msgstr "" 115 117 116 #: WC_Gateway_Fiskalpay.php:23 0118 #: WC_Gateway_Fiskalpay.php:234 117 119 msgid "Payment Id" 118 120 msgstr "" 119 121 120 #: WC_Gateway_Fiskalpay.php:2 47122 #: WC_Gateway_Fiskalpay.php:251 121 123 msgid "transactions" 122 124 msgstr "" 123 125 124 #: WC_Gateway_Fiskalpay.php:2 49126 #: WC_Gateway_Fiskalpay.php:253 125 127 msgid "Date" 126 128 msgstr "" 127 129 128 #: WC_Gateway_Fiskalpay.php:25 0130 #: WC_Gateway_Fiskalpay.php:254 129 131 msgid "Transaction ID" 130 132 msgstr "" 131 133 132 #: WC_Gateway_Fiskalpay.php:25 1134 #: WC_Gateway_Fiskalpay.php:255 133 135 msgid "Payment ID" 134 136 msgstr "" 135 137 136 #: WC_Gateway_Fiskalpay.php:25 2138 #: WC_Gateway_Fiskalpay.php:256 137 139 msgid "Info" 138 140 msgstr "" 139 141 140 #: WC_Gateway_Fiskalpay.php:25 3142 #: WC_Gateway_Fiskalpay.php:257 141 143 msgid "Order state" 142 144 msgstr "" 143 145 144 #: WC_Gateway_Fiskalpay.php:26 2146 #: WC_Gateway_Fiskalpay.php:266 145 147 msgid "Unknown state" 146 148 msgstr "" 147 149 148 #: WC_Gateway_Fiskalpay.php:3 21149 #: WC_Gateway_Fiskalpay.php:32 7150 #: WC_Gateway_Fiskalpay.php:319 151 #: WC_Gateway_Fiskalpay.php:325 150 152 msgid "Enable/Disable" 151 153 msgstr "" 152 154 153 #: WC_Gateway_Fiskalpay.php:32 3155 #: WC_Gateway_Fiskalpay.php:321 154 156 msgid "Enable FiskalPAY Payment" 155 157 msgstr "" 156 158 157 #: WC_Gateway_Fiskalpay.php:32 9159 #: WC_Gateway_Fiskalpay.php:327 158 160 msgid "Enable Debug mode" 159 161 msgstr "" 160 162 161 #: WC_Gateway_Fiskalpay.php:3 68163 #: WC_Gateway_Fiskalpay.php:373 162 164 msgid "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)" 163 165 msgstr "" 164 166 165 #: WC_Gateway_Fiskalpay.php: 696167 #: WC_Gateway_Fiskalpay.php:709 166 168 msgid "An error occurred while processing order by FiskalPAY! Transaction id: " 167 169 msgstr "" 170 171 #: WC_Gateway_Fiskalpay.php:873 172 msgid "FiskalPRO" 173 msgstr "" 174 175 #: WC_Gateway_Fiskalpay.php:874 176 msgid "FiskalPRO Plugins" 177 msgstr "" 178 179 #: WC_Gateway_Fiskalpay.php:875 180 msgid "Configuration" 181 msgstr "" -
fiskalpay/trunk/package.json
r3240615 r3439313 1 1 { 2 2 "name": "woocommerce-fiskalpay", 3 "version": "1.1.1 7",3 "version": "1.1.18", 4 4 "description": "", 5 5 "main": "index.js", -
fiskalpay/trunk/readme.txt
r3240615 r3439313 2 2 Contributors: a3soft 3 3 Tags: payment gateway, WooCommerce, fiskalpay, payments, pcidss 4 Tested up to: 6. 74 Tested up to: 6.9 5 5 Requires Plugins: woocommerce 6 Stable tag: 1.1.1 76 Stable tag: 1.1.18 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 62 62 63 63 == Changelog == 64 = 1.1.18 = 65 * Added support for HUF token 66 * Configuration now available under FiskalPRO main menu 67 64 68 = 1.1.17 = 69 * Fixed bug in notifyHandler, when was called error occurred (bad variable) 65 70 * Requires php version 8.1, because php 8.0 is outdated 66 71 -
fiskalpay/trunk/uninstall.php
r3239213 r3439313 3 3 declare(strict_types=1); 4 4 5 // if uninstall.php is not called by WordPress, die 5 if (! defined('ABSPATH')) { 6 exit; // Exit if accessed directly 7 } 8 6 9 if (! defined('WP_UNINSTALL_PLUGIN')) { 7 10 die;
Note: See TracChangeset
for help on using the changeset viewer.