Changeset 3036865
- Timestamp:
- 02/16/2024 01:34:40 PM (2 years ago)
- Location:
- best2pay-payment-method-visamastercard
- Files:
-
- 38 added
- 6 edited
-
tags/2.1.5 (added)
-
tags/2.1.5/assets (added)
-
tags/2.1.5/assets/fonts (added)
-
tags/2.1.5/assets/fonts/Montserrat-Bold.eot (added)
-
tags/2.1.5/assets/fonts/Montserrat-Bold.ttf (added)
-
tags/2.1.5/assets/fonts/Montserrat-Bold.woff (added)
-
tags/2.1.5/assets/fonts/Montserrat-Medium.eot (added)
-
tags/2.1.5/assets/fonts/Montserrat-Medium.ttf (added)
-
tags/2.1.5/assets/fonts/Montserrat-Medium.woff (added)
-
tags/2.1.5/assets/fonts/Montserrat-Regular.eot (added)
-
tags/2.1.5/assets/fonts/Montserrat-Regular.ttf (added)
-
tags/2.1.5/assets/fonts/Montserrat-Regular.woff (added)
-
tags/2.1.5/assets/fonts/Montserrat-SemiBold.eot (added)
-
tags/2.1.5/assets/fonts/Montserrat-SemiBold.ttf (added)
-
tags/2.1.5/assets/fonts/Montserrat-SemiBold.woff (added)
-
tags/2.1.5/assets/fonts/montserrat-v25-latin-regular.eot (added)
-
tags/2.1.5/assets/fonts/montserrat-v25-latin-regular.svg (added)
-
tags/2.1.5/assets/fonts/montserrat-v25-latin-regular.ttf (added)
-
tags/2.1.5/assets/fonts/montserrat-v25-latin-regular.woff (added)
-
tags/2.1.5/assets/fonts/montserrat-v25-latin-regular.woff2 (added)
-
tags/2.1.5/assets/fonts/montserrat.css (added)
-
tags/2.1.5/assets/img (added)
-
tags/2.1.5/assets/img/best2pay.png (added)
-
tags/2.1.5/assets/img/halva.svg (added)
-
tags/2.1.5/assets/img/halva_logo.svg (added)
-
tags/2.1.5/assets/js (added)
-
tags/2.1.5/assets/js/scripts.js (added)
-
tags/2.1.5/best2pay-payment_method.php (added)
-
tags/2.1.5/halva_widget.php (added)
-
tags/2.1.5/languages (added)
-
tags/2.1.5/languages/best2pay-payment_method-ru_RU.mo (added)
-
tags/2.1.5/languages/best2pay-payment_method-ru_RU.po (added)
-
tags/2.1.5/languages/best2pay-payment_method.pot (added)
-
tags/2.1.5/readme.txt (added)
-
trunk/assets/img/best2pay.png (modified) (previous)
-
trunk/assets/img/svkb.svg (added)
-
trunk/assets/img/svkb_logo.svg (added)
-
trunk/assets/js/admin.js (added)
-
trunk/best2pay-payment_method.php (modified) (59 diffs)
-
trunk/languages/best2pay-payment_method-ru_RU.mo (modified) (previous)
-
trunk/languages/best2pay-payment_method-ru_RU.po (modified) (5 diffs)
-
trunk/languages/best2pay-payment_method.pot (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/svkb_widget.php (added)
Legend:
- Unmodified
- Added
- Removed
-
best2pay-payment-method-visamastercard/trunk/best2pay-payment_method.php
r3011458 r3036865 1 1 <?php 2 2 declare(strict_types=1); 3 4 3 5 4 /* … … 17 16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 17 */ 18 19 19 /** 20 * Plugin Name: Best2Pay payment m ethod (Visa/MasterCard/MIR)20 * Plugin Name: Best2Pay payment module 21 21 * Plugin URI: https://best2pay.net/ 22 22 * Description: Receive payments via Visa/Mastercard/MIR easily with Best2Pay bank cards processing 23 * Version: 2. 1.523 * Version: 2.2.0 24 24 * Author: Best2Pay 25 * Tested up to: 6. 3.225 * Tested up to: 6.4.3 26 26 * License: GPL3 27 27 * … … 35 35 add_action('plugins_loaded', 'init_woocommerce_best2pay', 0); 36 36 37 function init_woocommerce_best2pay() 38 { 37 function init_woocommerce_best2pay() { 39 38 if(!class_exists('WC_Payment_Gateway')){ 40 39 return; 41 40 } 42 41 43 42 load_plugin_textdomain('best2pay-payment_method', false, dirname(plugin_basename(__FILE__)) . '/languages'); 44 45 class woocommerce_best2pay extends WC_Payment_Gateway 46 { 43 44 class woocommerce_best2pay extends WC_Payment_Gateway { 47 45 const PLUGIN_SITE = 'https://best2pay.net'; 48 46 const SHOP_CART_MAX_LENGTH = 1000; … … 55 53 'loan' => '/webapi/custom/unicheckout/PurchaseWithLoanManager' 56 54 ]; 57 55 58 56 const OLD_TO_NEW_PAYMENT_METHODS = [ 59 57 'Purchase' => 'acquiring', … … 63 61 'PurchaseSBP' => 'sbp' 64 62 ]; 63 65 64 private const OPERATION_TYPES = [ 66 65 'PURCHASE', … … 70 69 'COMPLETE' 71 70 ]; 71 72 72 private const PAID_OPERATION_TYPES = [ 73 73 'PURCHASE', … … 75 75 'AUTHORIZE', 76 76 ]; 77 77 78 private const OPERATION_APPROVED = 'APPROVED'; 78 79 private const OPERATION_COMPLETE = 'COMPLETE'; … … 90 91 protected string $testmode; 91 92 protected string $hash_algo; 93 protected string $notify_customer_enabled; 92 94 protected string $registered_status; 93 95 protected string $authorized_status; 94 96 protected string $loan_status; 95 97 protected string $completed_status; 98 protected string $agreement_status; 99 protected string $payment_expected_status; 96 100 protected string $canceled_status; 97 101 protected string $payment_method; … … 101 105 protected string $fiscal_positions; 102 106 protected array $shop_cart; 107 protected string $logo_field; 108 protected string $remove_logo_field; 103 109 /** 104 110 * Init fields, set settings, register hooks 105 111 */ 106 public function __construct() 107 { 112 public function __construct() { 108 113 require_once ABSPATH . 'wp-admin/includes/file.php'; 114 109 115 // plugin settings 110 116 $this->id = 'best2pay'; … … 115 121 '[email protected]' 116 122 ); 117 $this->title = __('Best2Pay', 'best2pay-payment_method');118 $this->description = sprintf(119 __('Payments with bank cards via the <a href="%s" target="_blank">Best2Pay</a> payment system.', 'best2pay-payment_method'),120 self::PLUGIN_SITE121 );122 123 $this->icon = plugins_url('assets/img/best2pay.png', __FILE__); 123 124 $this->has_fields = true; 124 125 $this->notify_url = add_query_arg('wc-api', 'best2pay_notify', home_url('/')); 125 126 $this->callback_url = add_query_arg('wc-api', 'best2pay', home_url('/')); 126 127 127 128 // means that the gateway accept refunds 128 129 $this->supports = array('refunds', 'products'); 129 130 130 131 $this->init_form_fields(); 131 132 $this->init_settings(); 132 133 133 134 // variables 135 $this->title = !empty($this->settings['title']) ? $this->settings['title'] : $this->method_title; 136 $this->description = !empty($this->settings['description']) ? $this->settings['description'] : sprintf( 137 __('Payments with bank cards via the <a href="%s" target="_blank">Best2Pay</a> payment system.', 'best2pay-payment_method'), 138 self::PLUGIN_SITE 139 ); 140 $this->logo = $this->settings['logo'] ?? ''; 134 141 $this->sector = $this->settings['sector']; 135 142 $this->password = $this->settings['password']; … … 137 144 $this->payment_method = $this->settings['payment_method'] ?? ''; 138 145 $this->tax = $this->settings['tax'] ?? '6'; 139 $this->hash_algo = $this->settings['hash_algo'] ?? 'md5'; 140 146 $this->hash_algo = !empty($this->settings['hash_algo']) ? $this->settings['hash_algo'] : 'md5'; 147 $this->notify_customer_enabled = $this->settings['notify_customer_enabled'] ?? ''; 148 141 149 //statuses 142 150 $this->registered_status = $this->settings['registered_status'] ?? ''; … … 145 153 $this->completed_status = $this->settings['completed_status'] ?? ''; 146 154 $this->canceled_status = $this->settings['canceled_status'] ?? ''; 147 155 $this->agreement_status = $this->settings['agreement_status'] ?? ''; 156 $this->payment_expected_status = $this->settings['payment_expected_status'] ?? ''; 157 148 158 $this->currency = $this->get_currency(get_woocommerce_currency()); 149 159 $this->url = $this->best2pay_get_url(); 150 160 $this->logo_field = $this->plugin_id . $this->id . '_logo'; 161 $this->remove_logo_field = $this->plugin_id . $this->id . '_remove_logo'; 162 151 163 switch($this->payment_method) { 152 164 case 'halva': 153 165 case 'halva_two_steps': 154 $this->title = __('Pay for your order in installments', 'best2pay-payment_method'); //'Оплатить заказ Частями';155 $this->icon = plugins_url('assets/img/ halva.svg', __FILE__);166 $this->title = __('Pay for your order in installments', 'best2pay-payment_method'); 167 $this->icon = plugins_url('assets/img/svkb.svg', __FILE__); 156 168 $this->description = '<iframe style="width:100%;height:180px;border:none;min-width: 440px;margin-left: -50px;" 157 src="' . plugins_url(' halva_widget.php', __FILE__) . '?amount='169 src="' . plugins_url('svkb_widget.php', __FILE__) . '?amount=' 158 170 . print_r((isset(WC()->cart->cart_contents_total)) ? WC()->cart->cart_contents_total : '', true) . '"></iframe>'; 159 171 break; 160 case 'sbp':161 $this->title = __('Pay by QR', 'best2pay-payment_method'); //'Оплатить по QR';162 $this->icon = null;172 default: 173 if($this->logo) 174 $this->icon = wp_get_attachment_url($this->logo); 163 175 break; 164 176 } 177 165 178 // actions 166 179 add_action('init', array($this, 'successful_request')); … … 170 183 add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); 171 184 add_action('woocommerce_order_item_add_action_buttons', array($this, 'wc_order_item_add_complete_button'), 10, 1); 172 } 173 185 add_filter('woocommerce_generate_image_html', 'woocommerce_generate_image_html'); 186 add_action("woocommerce_order_status_changed", array($this, 'wc_best2pay_order_payment_change'), 10, 4); 187 } 188 189 public function generate_image_html( $key, $data ) { 190 $field_key = $this->get_field_key( $key ); 191 $defaults = array( 192 'title' => '', 193 'disabled' => false, 194 'class' => '', 195 'css' => '', 196 'placeholder' => '', 197 'type' => 'file', 198 'desc_tip' => false, 199 'description' => '', 200 'custom_attributes' => array(), 201 ); 202 203 $data = wp_parse_args( $data, $defaults ); 204 205 ob_start();?> 206 <tr valign="top"> 207 <th scope="row" class="titledesc"> 208 <label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?> <?php echo $this->get_tooltip_html( $data );?></label> 209 </th> 210 <td class="forminp"> 211 <fieldset> 212 <legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend> 213 <input class="input-text regular-input" type="file" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" accept="image/*"> 214 </fieldset> 215 <?php if(!empty($this->logo)){ 216 $logo_meta = wp_get_attachment_metadata($this->logo);?> 217 <img src="<?php echo wp_get_attachment_url($this->logo) ?>" alt="" width="100" style="margin: 10px"> 218 <div>(<?php echo $logo_meta['width'] . 'x' . $logo_meta['height'];?>)</div> 219 <br> 220 <label for="<?php echo esc_attr( $this->remove_logo_field ); ?>"> 221 <input class="" type="checkbox" name="<?php echo esc_attr( $this->remove_logo_field ); ?>" id="<?php echo esc_attr( $this->remove_logo_field ); ?>" style="" value="1"> <?php echo wp_kses_post( __('Remove logo', 'best2pay-payment_method') ); ?></label> 222 <?php 223 } else { ?> 224 <img src="<?php echo plugins_url('assets/img/best2pay.png', plugin_basename(__FILE__)); ?>" alt="" width="100" style="margin: 10px"> 225 <?php } ?> 226 </td> 227 </tr> 228 <?php return ob_get_clean(); 229 } 230 174 231 /** 175 232 * Initialise Gateway Settings Form Fields … … 177 234 * @return void 178 235 */ 179 public function init_form_fields() 180 { 236 public function init_form_fields() { 181 237 $wc_statuses = wc_get_order_statuses(); 182 183 // array to generate admin form 238 184 239 $this->form_fields = array( 185 240 'enabled' => array( … … 189 244 'default' => 'yes' 190 245 ), 191 246 'title' => array( 247 'title' => __('Title', 'best2pay-payment_method'), 248 'type' => 'text', 249 'description' => __('Custom title for payment type', 'best2pay-payment_method'), 250 'desc_tip' => true, 251 'default' => '', 252 'placeholder' => $this->method_title 253 ), 254 'description' => array( 255 'title' => __('Description', 'best2pay-payment_method'), 256 'type' => 'textarea', 257 'description' => __('Custom description for payment type', 'best2pay-payment_method'), 258 'desc_tip' => true, 259 'default' => '', 260 'css' => 'width: 400px;' 261 ), 262 'logo' => array( 263 'title' => __('Logo', 'best2pay-payment_method'), 264 'type' => 'image', 265 'description' => __('Custom logo for payment type', 'best2pay-payment_method'), 266 'desc_tip' => true, 267 'default' => '' 268 ), 192 269 'sector' => array( 193 270 'title' => __('Sector ID', 'best2pay-payment_method'), … … 197 274 'default' => '' 198 275 ), 199 200 276 'password' => array( 201 277 'title' => __('Password', 'best2pay-payment_method'), … … 205 281 'default' => '' 206 282 ), 207 208 283 'testmode' => array( 209 284 'title' => __('Test Mode', 'best2pay-payment_method'), … … 214 289 ), 215 290 'description' => __('Select test or live mode', 'best2pay-payment_method'), 216 'desc_tip' => true, 217 ), 218 291 'desc_tip' => true 292 ), 219 293 'payment_method' => array( 220 294 'title' => __('Payment method', 'best2pay-payment_method'), … … 223 297 'acquiring' => __('Standard acquiring (one-stage payment)', 'best2pay-payment_method'), 224 298 'acquiring_two_steps' => __('Standard acquiring (two-stage payment)', 'best2pay-payment_method') . ' *', 225 'halva' => __(' Halva Chastyami(one-stage payment)', 'best2pay-payment_method'),226 'halva_two_steps' => __(' Halva Chastyami(two-stage payment)', 'best2pay-payment_method') . ' *',299 'halva' => __('Plait (one-stage payment)', 'best2pay-payment_method'), 300 'halva_two_steps' => __('Plait (two-stage payment)', 'best2pay-payment_method') . ' *', 227 301 'sbp' => __('Fast Payment System', 'best2pay-payment_method'), 228 302 'loan' => __('Loan', 'best2pay-payment_method') 229 303 ), 230 304 'description' => '* ' . __('Payment occurs after confirmation by the manager in the personal account', 'best2pay-payment_method'), 231 'desc_tip' => true, 232 ), 233 305 'desc_tip' => true 306 ), 234 307 'tax' => array( 235 308 'title' => __('TAX', 'best2pay-payment_method'), … … 243 316 6 => __('Not subject to VAT', 'best2pay-payment_method'), 244 317 ), 245 'default' => '6', 246 ), 247 318 'default' => '6' 319 ), 248 320 'notify_url' => array( 249 321 'title' => __('Notify URL', 'best2pay-payment_method'), … … 254 326 'custom_attributes' => array( 255 327 'readonly' => 'readonly', 256 ), 257 ), 258 328 ) 329 ), 259 330 'hash_algo' => array( 260 331 'title' => __('Data encryption algorithm', 'best2pay-payment_method'), … … 266 337 'description' => __('Must match your sector encryption settings in your personal account', 'best2pay-payment_method'), 267 338 'desc_tip' => true, 268 'default' => 'md5', 269 ), 270 339 'default' => 'md5' 340 ), 271 341 'custom_statuses_header' => array( 272 342 'title' => __('Custom statuses for orders', 'best2pay-payment_method'), 273 'type' => 'title', 274 ), 275 276 // custom order statuses 343 'type' => 'title' 344 ), 277 345 'registered_status' => array( 278 346 'title' => __('Order registered', 'best2pay-payment_method'), 279 347 'type' => 'select', 280 'options' => $wc_statuses ,348 'options' => $wc_statuses 281 349 ), 282 350 'authorized_status' => array( 283 351 'title' => __('Order authorized', 'best2pay-payment_method'), 284 352 'type' => 'select', 285 'options' => $wc_statuses ,353 'options' => $wc_statuses 286 354 ), 287 355 'loan_status' => array( 288 356 'title' => __('Loan agreement approved but not signed', 'best2pay-payment_method'), 289 357 'type' => 'select', 290 'options' => $wc_statuses ,358 'options' => $wc_statuses 291 359 ), 292 360 'completed_status' => array( 293 361 'title' => __('Order successfully paid', 'best2pay-payment_method'), 294 362 'type' => 'select', 295 'options' => $wc_statuses ,363 'options' => $wc_statuses 296 364 ), 297 365 'canceled_status' => array( 298 366 'title' => __('Order canceled', 'best2pay-payment_method'), 299 367 'type' => 'select', 368 'options' => $wc_statuses 369 ), 370 'notify_customer_enabled' => array( 371 'title' => __('Issuing an invoice for payment', 'best2pay-payment_method'), 372 'type' => 'checkbox', 373 'label' => __('Enable issuing an invoice for payment by email of the payer', 'best2pay-payment_method'), 374 'default' => 'no' 375 ), 376 'agreement_status' => array( 377 'title' => __('Order agreement', 'best2pay-payment_method'), 378 'type' => 'select', 300 379 'options' => $wc_statuses, 301 ), 302 380 'default' => 'wc-on-hold' 381 ), 382 'payment_expected_status' => array( 383 'title' => __('Payment expected', 'best2pay-payment_method'), 384 'type' => 'select', 385 'options' => $wc_statuses, 386 'default' => 'wc-pending' 387 ) 303 388 ); 304 305 } 306 307 /** 308 * Overwritten WC function. 309 * Register order @ Best2Pay and redirect user to payment form 310 * 311 * @param $order_id 312 * @return string[] 313 **/ 314 public function process_payment($order_id) 315 { 316 $order = wc_get_order($order_id); 389 390 wp_enqueue_script('admin-best2pay-script', plugins_url('assets/js/admin.js', __FILE__)); 391 } 392 393 public function wc_best2pay_order_payment_change ($order_id, $status_from, $status_to, $order) { 394 if($order->payment_method === 'best2pay' && ($status_from === 'on-hold' && $status_to === 'pending')) { 395 $this->process_payment_registration($order); 396 } 397 } 398 399 public function process_payment_registration($order) { 317 400 $order_amount = $this->centify($order->get_total()); 318 401 319 402 $this->calc_fiscal_position_shop_cart($order, $order_amount); 320 403 321 404 $args = array( 322 405 'sector' => $this->sector, … … 332 415 'signature' => $this->generate_sign([$this->sector, $order_amount, $this->currency], true) 333 416 ); 334 417 418 if($this->notify_customer_enabled === 'yes') { 419 $args = array_merge($args, ['notify_customer' => 1]); 420 } 421 335 422 try { 336 423 $response = $this->send_request($this->url . '/webapi/Register', ['body' => $args]); 337 424 if (is_wp_error($response)) 338 425 throw new Exception($response->get_error_message()); 426 339 427 $response = $response['body'] ?? $response; 428 340 429 $b2p_order_id = (int) $response; 341 430 if ($b2p_order_id == 0) 342 431 throw new Exception(__('Failed to register order', 'best2pay-payment_method') . '<br>' . $response ); 432 343 433 } catch(Exception $e) { 344 434 $this->log($e->getMessage(), ['args' => $args, 'response' => $response]); 345 435 wc_add_notice($e->getMessage(), 'error' ); 436 346 437 return [ 347 438 'result' => 'failure', … … 349 440 ]; 350 441 } 351 442 352 443 update_post_meta($order->get_id(), 'best2pay_order_id', $b2p_order_id); 353 444 update_post_meta($order->get_id(), 'best2pay_order_state', self::ORDER_REGISTERED); 354 445 $order->add_order_note(__('Order registered successfully', 'best2pay-payment_method') . " (ID: $b2p_order_id)"); 355 446 447 return $b2p_order_id; 448 } 449 450 public function process_payment_payform($pay_order_id) : string { 356 451 $data = [ 357 452 'sector' => $this->sector, 358 'id' => $ b2p_order_id453 'id' => $pay_order_id 359 454 ]; 455 360 456 if(($this->payment_method === 'halva' || $this->payment_method === 'halva_two_steps') && $this->shop_cart) { 361 457 $shop_cart_encoded = base64_encode(json_encode($this->shop_cart, JSON_UNESCAPED_UNICODE)); 458 362 459 if(strlen($shop_cart_encoded) > self::SHOP_CART_MAX_LENGTH) 363 460 $shop_cart_encoded = ''; 461 364 462 $data['shop_cart'] = $shop_cart_encoded; 365 463 } 464 366 465 $this->sign_data($data, true); 367 466 $payment_path = self::PAYMENT_PATHS_BY_METHOD[$this->payment_method]; 368 $payment_url = $this->url . $payment_path . '?' . http_build_query($data); 467 468 return $this->url . $payment_path . '?' . http_build_query($data); 469 } 470 471 public function process_admin_options() { 472 if(!empty($_POST[$this->remove_logo_field]) && !empty($this->logo)){ 473 if(wp_delete_attachment($this->logo)) 474 $this->update_option('logo'); 475 } else if (!empty($_FILES[$this->logo_field]['name'])) { 476 require_once( ABSPATH . 'wp-admin/includes/image.php' ); 477 require_once( ABSPATH . 'wp-admin/includes/file.php' ); 478 require_once( ABSPATH . 'wp-admin/includes/media.php' ); 479 if(!file_is_valid_image($_FILES[$this->logo_field]['tmp_name'])) 480 return false; 481 482 $attachment_id = media_handle_upload($this->logo_field, 0 ); 483 if (is_wp_error($attachment_id)) 484 return $attachment_id->get_error_message(); 485 486 // remove old attachment 487 if(!empty($this->logo)) 488 wp_delete_attachment($this->logo); 489 490 $this->update_option('logo', $attachment_id); 491 } 492 493 $this->init_settings(); 494 495 $post_data = $this->get_post_data(); 496 497 foreach ( $this->get_form_fields() as $key => $field ) { 498 if(in_array($this->get_field_type( $field ), ['title', 'image'])) continue; 499 500 try { 501 $this->settings[ $key ] = $this->get_field_value( $key, $field, $post_data ); 502 } catch ( Exception $e ) { 503 $this->add_error( $e->getMessage() ); 504 } 505 } 506 507 return update_option( $this->get_option_key(), apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ) ); 508 } 509 510 /** 511 * Overwritten WC function. 512 * Register order @ Best2Pay and redirect user to payment form 513 * 514 * @param $order_id 515 * @return string[] 516 **/ 517 public function process_payment($order_id) { 518 $order = wc_get_order($order_id); 519 520 if($this->notify_customer_enabled === 'yes' && $order->get_status() !== $this->agreement_status && !get_post_meta($order_id, 'best2pay_order_moderated', true)) { 521 $order->add_order_note(__('Order successfully create', 'best2pay-payment_method')); 522 $order->update_status($this->agreement_status); 523 524 update_post_meta($order->get_id(), 'best2pay_order_moderated', 'yes'); 525 526 WC()->cart->empty_cart(); 527 528 return array( 529 'result' => 'success', 530 'redirect' => $this->get_return_url($order), 531 ); 532 } 533 534 $register_order_id = get_post_meta($order_id, 'best2pay_order_id', true); 535 536 if($register_order_id) { 537 $payment_url = $this->process_payment_payform(intval($register_order_id)); 538 } else { 539 $pay_order_id = intval($this->process_payment_registration($order)); 540 $payment_url = $this->process_payment_payform($pay_order_id); 541 } 542 369 543 return array( 370 544 'result' => 'success', … … 372 546 ); 373 547 } 374 548 375 549 /** 376 550 * Callback from payment gateway was received 377 551 **/ 378 public function callback_from_gateway() 379 { 552 public function callback_from_gateway() { 380 553 $response = ''; 381 554 $order = []; 382 555 $checkout_url = apply_filters('woocommerce_get_checkout_url', wc_get_checkout_url()); 556 383 557 try{ 384 // processing center order ID385 558 $pc_order_id = intval($_REQUEST['id']); 386 559 if(!$pc_order_id) 387 560 throw new Exception(__('Failed to get Best2pay order ID', 'best2pay-payment_method')); 561 388 562 $pc_operation_id = intval($_REQUEST['operation']); 389 563 if(!$pc_operation_id) 390 564 throw new Exception(__('Failed to get Best2pay operation ID', 'best2pay-payment_method')); 565 391 566 $order_id = intval($_REQUEST['reference']); 392 567 if(!$order_id) 393 568 throw new Exception(__('Undefined order ID', 'best2pay-payment_method')); 569 394 570 $order = wc_get_order($order_id); 395 571 if(!$order) 396 572 throw new Exception(__('Failed to get order information', 'best2pay-payment_method')); 573 574 $db_pc_order_id = (int) get_post_meta($order_id, 'best2pay_order_id', true); 575 if($db_pc_order_id !== $pc_order_id) 576 throw new Exception(__('Request data is not valid', 'best2pay-payment_method')); 397 577 398 578 // if order already paid … … 402 582 exit(); 403 583 } 404 584 405 585 $pc_order = $this->get_pc_order($pc_order_id); 406 586 $this->pc_order_validation($pc_order); … … 408 588 if(!$operation) 409 589 throw new Exception(__('Could not find operation', 'best2pay-payment_method') . " ( $pc_operation_id )"); 590 410 591 $this->pc_order_operation_validation($operation, true); 411 592 412 593 $pc_order_params = $this->get_pc_order_params($pc_order); 413 594 $is_loan = (!empty($pc_order_params['vda_application_id']) || !empty($pc_order_params['fb_application_id'])); 595 414 596 // There is no valid operation amount in case of LOAN (VsegdaDa\FinBox) 415 597 if(!$is_loan) … … 418 600 $message = __('Failed to pay for the order', 'best2pay-payment_method') . ":\n" . $e->getMessage(); 419 601 $this->log($message, ['data' => $data ?? '', 'response' => $response]); 602 420 603 if($order) 421 604 $order->add_order_note(nl2br($message)); 605 422 606 wc_add_notice(nl2br($message), 'error'); 423 607 wp_redirect($checkout_url); 608 424 609 exit(); 425 610 } 611 426 612 if($pc_order_state !== $pc_order['state']) { 427 // updating order status428 613 $order_status = $this->get_custom_order_status($operation['type'], $is_loan); 429 614 $order->update_status($order_status); 430 // updating order metadata431 615 update_post_meta($order_id, 'best2pay_order_state', $pc_order['state']); 432 433 // updating order real payment method434 616 $payment_method = get_post_meta($order_id, 'best2pay_payment_method', true); 617 435 618 if(!$payment_method){ 436 619 $is_halva = !empty($pc_order_params['buyIdSumAmount']); … … 438 621 update_post_meta($order_id, 'best2pay_payment_method', $payment_method); 439 622 } 623 440 624 $order->add_order_note(__('Payment completed successfully', 'best2pay-payment_method')); 441 625 } 626 442 627 wp_redirect($this->get_return_url($order)); 628 443 629 exit(); 444 630 } 445 631 446 632 /** 447 633 * Payment notify from gateway was received 448 634 **/ 449 public function notify_from_gateway() 450 { 635 public function notify_from_gateway() { 451 636 global $wp_filesystem; 452 637 $order = []; 453 638 $pc_operation = []; 639 454 640 if (empty($wp_filesystem)) 455 641 WP_Filesystem(); 642 456 643 try { 457 644 $response = $wp_filesystem->get_contents('php://input'); … … 460 647 if(!$order_id) 461 648 throw new Exception(__('Undefined order ID', 'best2pay-payment_method')); 649 462 650 $order = wc_get_order($order_id); 463 651 if(!$order) 464 652 throw new Exception(__('Failed to get order information', 'best2pay-payment_method')); 465 466 // if order already completed\refunded 653 467 654 $pc_order_state = get_post_meta($order_id, 'best2pay_order_state', true); 468 469 655 if ($pc_order_state === self::ORDER_CANCELED || $pc_order_state === self::ORDER_BLOCKED || $pc_order_state === self::ORDER_EXPIRED) 470 656 throw new Exception(sprintf(__('The order has already been %s', 'best2pay-payment_method'), $pc_order_state)); 657 471 658 $this->pc_operation_validation($pc_operation); 472 473 659 $pc_order = $this->get_pc_order((int) $pc_operation['order_id']); 474 660 $this->pc_order_validation($pc_order); 475 476 661 $pc_order_params = $this->get_pc_order_params($pc_order); 477 662 $is_loan = (!empty($pc_order_params['vda_application_id']) || !empty($pc_order_params['fb_application_id'])); 663 478 664 // There is no valid operation amount in case of LOAN (VsegdaDa\FinBox) 479 665 if(!$is_loan) 480 666 $this->operation_amount_validation($pc_operation, $this->centify($order->get_total())); 481 482 667 } catch(Exception $e) { 483 668 $message = sprintf(__('Failed to complete request for operation %s from the processing center', 'best2pay-payment_method'), $pc_operation['type']) . PHP_EOL . $e->getMessage(); 484 669 $this->log($message, $pc_operation); 670 485 671 if($order) 486 672 $order->add_order_note($message); 673 487 674 exit($message); 488 675 } 489 // updating order real payment method 676 490 677 $payment_method = get_post_meta($order_id, 'best2pay_payment_method', true); 678 491 679 if(!$payment_method){ 492 680 $is_halva = !empty($pc_order_params['buyIdSumAmount']); … … 494 682 update_post_meta($order_id, 'best2pay_payment_method', $payment_method); 495 683 } 496 497 // updating order status 684 498 685 $order_status = $this->get_custom_order_status($pc_operation['type']); 499 686 $order->update_status($order_status); 500 // updating order metadata501 687 update_post_meta($order_id, 'best2pay_order_state', $pc_order['state']); 502 688 $message = sprintf(__('Request for operation %s from the processing center was completed successfully', 'best2pay-payment_method'), $pc_operation['type']); 503 689 $order->add_order_note($message); 690 504 691 exit('ok'); 505 692 } 506 693 507 694 public function complete_payment(){ 508 695 echo $this->payment_action(self::OPERATION_COMPLETE); 696 509 697 exit(); 510 698 } 511 699 512 700 /** 513 701 * Inherited method Process refund. … … 521 709 * @return boolean True or false based on success, or a WP_Error object. 522 710 */ 523 public function process_refund($order_id, $amount = null, $reason = '') 524 { 711 public function process_refund($order_id, $amount = null, $reason = '') { 525 712 return $this->payment_action(self::OPERATION_REFUND, $order_id, $amount, $reason); 526 713 } 527 714 528 715 /** 529 716 * Check operation state for hold order and set complete state … … 531 718 * @return string void 532 719 */ 533 public function payment_action($type, $order_id = 0, $amount = null, $reason = '') 534 { 720 public function payment_action($type, $order_id = 0, $amount = null, $reason = '') { 535 721 try{ 536 722 $order = []; 537 723 $operation = []; 538 724 539 725 // get variables from request and checking token for custom 'complete' action 540 726 if($type === self::OPERATION_COMPLETE){ … … 544 730 throw new Exception(__('Operation failed. Please refresh the page', 'best2pay-payment_method')); 545 731 } 546 732 547 733 if(!$order_id) 548 734 throw new Exception(__('Undefined order ID', 'best2pay-payment_method')); 735 549 736 $order = wc_get_order($order_id); 550 737 if(!$order) 551 738 throw new Exception(__('Failed to get order information', 'best2pay-payment_method')); 739 552 740 $pc_order_id = get_post_meta($order_id, 'best2pay_order_id', true); 553 741 if(!$pc_order_id) 554 742 throw new Exception(__('Failed to get Best2pay order ID', 'best2pay-payment_method')); 555 743 556 744 $payment_method = get_post_meta($order_id, 'best2pay_payment_method', true); 557 // converting old method to new558 745 $payment_method = self::OLD_TO_NEW_PAYMENT_METHODS[$payment_method] ?? $payment_method; 559 746 $request_path = self::get_action_path($type, $payment_method); 560 747 if(!$request_path) 561 748 throw new Exception(__('Failed to get operation request path', 'best2pay-payment_method')); 562 // full refund for AUTHORIZED orders only 749 563 750 $pc_order_state = get_post_meta($order_id, 'best2pay_order_state', true); 564 751 if($amount && $amount !== $order->get_total() && $type === self::OPERATION_REFUND && $pc_order_state === self::ORDER_AUTHORIZED){ 565 752 throw new Exception(__('For orders with AUTHORIZED status, only full refunds are available', 'best2pay-payment_method')); 566 753 } 754 567 755 // hardcode loan amount = 0! we use loans only without prepayment! otherwise we need to save and use the prepayment amount!! 568 if($payment_method === 'loan') 756 if($payment_method === 'loan') { 569 757 $amount = 0; 570 elseif($amount)758 } elseif($amount) { 571 759 $amount = $this->centify($amount); 572 else760 } else { 573 761 $amount = $this->centify($order->get_total()); 574 762 } 763 575 764 $data = [ 576 765 'sector' => $this->sector, … … 579 768 'currency' => $this->currency 580 769 ]; 770 581 771 $this->sign_data($data, true); 582 772 $response = $this->send_request($this->url . $request_path, ['body' => $data]); … … 585 775 if($operation['type'] !== $type) 586 776 throw new Exception(__('Operation type and action type are not equal', 'best2pay-payment_method')); 587 // for COMPLETED orders the operation amount may not be equal to the order amount(partial refund/complete)588 777 } catch(Exception $e) { 589 778 $comment = $this->get_action_comment($type)['fail'] . PHP_EOL . $e->getMessage(); … … 591 780 if($order) 592 781 $order->add_order_note($comment); 782 593 783 return json_encode([ 594 784 'success' => false, … … 596 786 ]); 597 787 } 598 788 599 789 $order_status = $this->get_custom_order_status($operation['type']); 600 790 if($order_status) 601 791 $order->update_status($order_status); 792 602 793 update_post_meta($order_id, 'best2pay_order_state', $operation['order_state']); 794 603 795 $comment = $this->get_action_comment($type)['success']; 604 796 if($reason){ 605 797 $comment .= PHP_EOL . esc_html($reason); 606 798 } 607 799 608 800 $order->add_order_note($comment); 801 609 802 return json_encode([ 610 803 'success' => true, … … 612 805 ]); 613 806 } 614 807 615 808 /** 616 809 * Draw Complete button for authorized orders … … 618 811 * @return void 619 812 */ 620 function wc_order_item_add_complete_button($order) 621 { 813 function wc_order_item_add_complete_button($order) { 622 814 if($order->get_payment_method() == $this->id){ 623 815 $pc_order_state = get_post_meta($order->get_id(), 'best2pay_order_state', true); 816 624 817 if($pc_order_state === self::ORDER_AUTHORIZED){ 625 818 $label = __('Complete payment', 'best2pay-payment_method'); 626 $nonce_complete = wp_create_nonce('best2pay_complete' . $order->get_id()); 627 ?> 819 $nonce_complete = wp_create_nonce('best2pay_complete' . $order->get_id());?> 820 628 821 <script src="<?php echo plugins_url('assets/js/scripts.js', plugin_basename(__FILE__)); ?>"></script> 629 822 <input type="hidden" id="nonce_best2pay_complete" value="<?php echo $nonce_complete; ?>"> 630 <button type="button" id="button_best2pay_complete" 631 class="button custom-items"><?php echo $label; ?></button> 632 <?php 633 } 634 } 635 } 636 637 private function calc_fiscal_position_shop_cart($order, $order_amount) 638 { 823 <button type="button" id="button_best2pay_complete" class="button custom-items"><?php echo $label; ?></button> 824 <?php } 825 } 826 } 827 828 private function calc_fiscal_position_shop_cart($order, $order_amount) { 639 829 $fiscal_positions = ''; 640 830 $fiscal_amount = 0; … … 642 832 $shop_cart_key = 0; 643 833 $order_items = $order->get_items(); 644 834 645 835 foreach($order_items as $item) { 646 836 $item_data = $item->get_data(); … … 653 843 $fiscal_positions .= str_replace([';', '|'], '', $item_data['name']) . '|'; 654 844 $fiscal_amount += $item_data['quantity'] * $element_price; 655 656 845 $shop_cart[$shop_cart_key]['quantityGoods'] = (int)$item['quantity']; 657 846 $shop_cart[$shop_cart_key]['goodCost'] = $item_price - $item_discount; … … 659 848 $shop_cart_key++; 660 849 } 661 850 662 851 $shipping_amount = $order->get_shipping_total(); 852 663 853 if ($shipping_amount){ 664 854 $fiscal_positions .= '1;' . $this->centify($shipping_amount) . ';6;Доставка|'; 665 855 $fiscal_amount += $this->centify($shipping_amount); 666 667 856 $shop_cart[$shop_cart_key]['quantityGoods'] = 1; 668 857 $shop_cart[$shop_cart_key]['goodCost'] = $shipping_amount; 669 858 $shop_cart[$shop_cart_key]['name'] = 'Доставка'; 670 859 } 860 671 861 $fiscalDiff = abs($fiscal_amount - $order_amount); 862 672 863 if ($fiscalDiff){ 673 864 $fiscal_positions .= '1;' . $fiscalDiff . ';6;Скидка;14|'; 674 865 $shop_cart = []; 675 866 } 867 676 868 $this->fiscal_positions = substr($fiscal_positions, 0, -1); 677 869 $this->shop_cart = $shop_cart; 678 870 } 679 680 private function get_pc_order($pc_order_id) 681 { 871 872 private function get_pc_order($pc_order_id) { 682 873 if(!$pc_order_id) 683 874 throw new Exception(__('Missing PC order ID', 'best2pay-payment_method')); 875 684 876 $data = [ 685 877 'sector' => $this->sector, 686 878 'id' => $pc_order_id, 687 879 ]; 880 688 881 $this->sign_data($data, true); 689 882 $response = $this->send_request($this->url . '/webapi/Order', ['body' => $data]); 883 690 884 return $this->parse_xml($response['body']); 691 885 } 692 693 private function get_pc_order_operation($pc_order, $pc_operation_id) 694 { 886 887 private function get_pc_order_operation($pc_order, $pc_operation_id) { 695 888 if(empty($pc_order['operations']['operation'])) 696 889 throw new Exception(__('There are no operations in the order', 'best2pay-payment_method')); 697 // "operation" may contain one or few operations (array) 890 698 891 $operations = isset($pc_order['operations']['operation'][0]) ? $pc_order['operations']['operation'] : [$pc_order['operations']['operation']]; 892 699 893 foreach($operations as $operation) { 700 894 if(empty($operation['id'])) continue; … … 702 896 return $operation; 703 897 } 898 704 899 return []; 705 900 } 706 707 private function get_pc_order_params($pc_order) 708 { 901 902 private function get_pc_order_params($pc_order) { 709 903 $params = []; 904 710 905 if(empty($pc_order['parameters']['parameter'])) return $params; 711 906 foreach($pc_order['parameters']['parameter'] as $param) { … … 718 913 $params[$key] = $param['value'] ?? 'null'; 719 914 } 915 720 916 return $params; 721 917 } 722 723 public function pc_operation_validation($response): void 724 { 918 919 public function pc_operation_validation($response): void { 725 920 if(empty($response['reason_code']) && !empty($response['code']) && !empty($response['description'])) 726 921 throw new Exception("$response[description] (error code $response[code])"); 922 727 923 if(empty($response['signature'])) 728 924 throw new Exception(__('Signature is missing', 'best2pay-payment_method')); 925 729 926 $xml_string = self::xml_values_to_string($response); 730 927 $signature = $this->generate_sign($xml_string, true); 731 928 if ($signature !== $response['signature']) 732 929 throw new Exception(__('Invalid signature', 'best2pay-payment_method')); 930 733 931 if(!in_array($response['type'], self::OPERATION_TYPES)) 734 932 throw new Exception(__('Unknown operation type', 'best2pay-payment_method') . ' : ' . $response['type']); 933 735 934 if($response['state'] !== self::OPERATION_APPROVED) 736 935 throw new Exception(__('Operation not approved', 'best2pay-payment_method')); 737 936 } 738 739 public function pc_order_validation($order): void 740 { 937 938 public function pc_order_validation($order): void { 741 939 if(empty($order['reason_code']) && !empty($order['code']) && !empty($order['description'])) 742 940 throw new Exception("$order[description] (error code $order[code])"); 941 743 942 if(empty($order['signature'])) 744 943 throw new Exception(__('Signature is missing', 'best2pay-payment_method')); 944 745 945 $xml_string = self::xml_values_to_string($order); 746 946 $signature = $this->generate_sign($xml_string, true); … … 748 948 throw new Exception(__('Invalid signature', 'best2pay-payment_method')); 749 949 } 750 public function pc_order_operation_validation($operation, $is_payment = false): void 751 {950 951 public function pc_order_operation_validation($operation, $is_payment = false): void { 752 952 if(empty($operation['reason_code']) && !empty($operation['code']) && !empty($operation['description'])) 753 953 throw new Exception(__('An error occurred during the operation', 'best2pay-payment_method') . "($operation[code] : $operation[description])"); 954 754 955 if(!in_array($operation['type'], self::OPERATION_TYPES)) 755 956 throw new Exception(__('Unknown operation type', 'best2pay-payment_method') . ' : ' . $operation['type']); 957 756 958 if($operation['state'] !== self::OPERATION_APPROVED) 757 959 throw new Exception(__('Operation not approved', 'best2pay-payment_method')); 960 758 961 if($is_payment && !in_array($operation['type'], self::PAID_OPERATION_TYPES)) { 759 962 throw new Exception(__('Unknown payment operation type', 'best2pay-payment_method') . ' : ' . $operation['type']); 760 963 } 761 964 } 762 763 public static function xml_values_to_string($xml_array): string 764 { 965 966 public static function xml_values_to_string($xml_array): string { 765 967 if(!is_array($xml_array)) return ''; 968 766 969 $res = ''; 767 970 foreach($xml_array as $key => $value) { … … 769 972 $res .= is_string($value) ? $value : self::xml_values_to_string($value); 770 973 } 974 771 975 return $res; 772 976 } 773 774 public function get_operation_amount($operation): int 775 { 977 978 public function get_operation_amount($operation): int { 776 979 return !empty($operation['buyIdSumAmount']) ? (int) $operation['buyIdSumAmount'] : (int) $operation['amount']; 777 980 } 778 779 private function operation_amount_validation($operation, $order_amount): void 780 { 981 982 private function operation_amount_validation($operation, $order_amount): void { 781 983 $operation_amount = self::get_operation_amount($operation); 984 782 985 if (!$operation_amount || $operation_amount !== $order_amount) 783 986 throw new \Exception(__('Invalid operation amount', 'best2pay-payment_method')); 784 987 } 785 786 public function get_custom_order_status($operation_type, $is_loan = false) 787 { 988 989 public function get_custom_order_status($operation_type, $is_loan = false) { 788 990 switch($operation_type){ 789 991 case 'PURCHASE': … … 796 998 return $this->canceled_status ?? false; 797 999 } 1000 798 1001 return false; 799 1002 } 800 801 private function get_action_path($action_type, $payment_type) 802 { 1003 1004 private function get_action_path($action_type, $payment_type) { 803 1005 $prefix = ($payment_type == 'halva' || $payment_type == 'halva_two_steps') ? '/webapi/custom/svkb/' : '/webapi/'; 1006 804 1007 switch($action_type) { 805 1008 case self::OPERATION_COMPLETE: return $prefix . 'Complete'; 806 1009 case self::OPERATION_REFUND: return $prefix . 'Reverse'; 807 1010 } 1011 808 1012 return false; 809 1013 } 810 811 private function get_action_comment($action) 812 { 1014 1015 private function get_action_comment($action) { 813 1016 switch($action) { 814 1017 case self::OPERATION_COMPLETE: return [ … … 822 1025 } 823 1026 } 824 825 private function get_pc_payment_method($operation_type, $is_halva, $is_loan) 826 { 1027 1028 private function get_pc_payment_method($operation_type, $is_halva, $is_loan) { 827 1029 switch($operation_type) { 828 1030 case 'PURCHASE': … … 841 1043 return ''; 842 1044 } 843 844 private function send_request($url, $args, $method = 'post', int $repeat = 3) 845 { 1045 1046 private function send_request($url, $args, $method = 'post', int $repeat = 3) { 846 1047 $method = (strtolower($method) === 'get') ? 'get' : 'post'; 847 1048 $repeat = !$repeat ? 1 : $repeat; … … 853 1054 sleep(2); 854 1055 } 1056 855 1057 return $response; 856 1058 } 857 1059 858 1060 /** 859 1061 * Admin Panel Options 860 1062 **/ 861 public function admin_options() 862 { 863 ?> 1063 public function admin_options() {?> 864 1064 <h3><?php _e('Best2Pay', 'best2pay-payment_method'); ?></h3> 865 1065 <p><?php echo sprintf(__('Payments with bank cards via the <a href="%s" target="_blank">Best2Pay</a> payment system.', 'best2pay-payment_method'), self::PLUGIN_SITE); ?></p> 866 1066 <table class="form-table"> 867 <?php 868 // Generate the HTML For the settings form. 869 $this->generate_settings_html(); 870 ?> 871 </table><!--/.form-table--> 872 <?php 873 } 874 1067 <?php $this->generate_settings_html(); ?> 1068 </table> 1069 <?php } 1070 875 1071 /** 876 1072 * Get current currency code … … 878 1074 * @return string 879 1075 */ 880 public function get_currency($wc_currency): string 881 { 1076 public function get_currency($wc_currency): string { 882 1077 switch($wc_currency) { 883 1078 case 'EUR': return '978'; 884 1079 case 'USD': return '840'; 1080 885 1081 default: return '643'; 886 1082 } 887 1083 } 888 1084 889 1085 /** 890 1086 * @param array $data … … 892 1088 * @return void 893 1089 */ 894 public function sign_data(&$data, $password = false): void 895 { 1090 public function sign_data(&$data, $password = false): void { 896 1091 unset($data['signature']); 1092 897 1093 $sign = implode('', $data); 898 1094 if($password) 899 1095 $sign .= $this->password; 1096 900 1097 $data['signature'] = base64_encode($this->sign_hash($sign)); 901 1098 } 902 903 public function generate_sign($data, $password = false): string 904 { 1099 1100 public function generate_sign($data, $password = false): string { 905 1101 $string = is_array($data) ? implode('', $data) : (string) $data; 906 1102 if($password) 907 1103 $string .= $this->password; 1104 908 1105 return base64_encode($this->sign_hash($string)); 909 1106 } 910 911 private function sign_hash($data) 912 { 1107 1108 private function sign_hash($data) { 913 1109 return hash($this->hash_algo, $data); 914 1110 } 915 1111 916 1112 /** 917 1113 * Changes a currency unit to a derived equivalent currency unit … … 920 1116 * @return int 921 1117 */ 922 public function centify($value): int 923 { 1118 public function centify($value): int { 924 1119 return intval(strval($value * 100)); 925 1120 } 926 927 private function best2pay_get_url(): string 928 { 1121 1122 private function best2pay_get_url(): string { 929 1123 $best2pay_url = "https://test.best2pay.net"; 1124 930 1125 if ($this->testmode == "0"){ 931 1126 $best2pay_url = "https://pay.best2pay.net"; 932 1127 } 1128 933 1129 return $best2pay_url; 934 1130 } 935 1131 936 1132 /** 937 1133 * Parse $xml from PC with removing element with values = '' or null … … 939 1135 * @return false|mixed 940 1136 */ 941 public function parse_xml(string $string) 942 { 1137 public function parse_xml(string $string) { 943 1138 if (!$string) 944 1139 throw new Exception(__('Server response is empty', 'best2pay-payment_method')); 1140 945 1141 $xml = simplexml_load_string($string); 946 1142 if (!$xml) 947 1143 throw new Exception(__('Invalid XML from response', 'best2pay-payment_method')); 1144 948 1145 $valid_xml = json_decode(json_encode($xml), true); 949 1146 if (!$valid_xml) 950 1147 throw new Exception(__('Unable to decode xml', 'best2pay-payment_method')); 1148 951 1149 return $valid_xml; 952 1150 } 953 1151 954 1152 /** 955 1153 * Write log-messages in file when it accessible in FS on hosting … … 958 1156 * @param array $data 959 1157 */ 960 public function log(string $message, array $data = []) 961 { 1158 public function log(string $message, array $data = []) { 962 1159 $log = "\n[" . date("H:i:s d.m.Y") . '] ' . $message; 963 1160 if($data) 964 1161 $log .= "\n" . var_export($data, true); 1162 965 1163 file_put_contents(ABSPATH . $this->id . '.log', $log, FILE_APPEND); 966 1164 } 967 968 } // class 1165 } 1166 969 1167 /** 970 1168 * Add this gateway to the list of available payment gateways … … 973 1171 * @return mixed 974 1172 */ 975 function add_best2pay_gateway($methods) 976 { 1173 function add_best2pay_gateway($methods) { 977 1174 $methods[] = 'woocommerce_best2pay'; 1175 978 1176 return $methods; 979 1177 } 980 1178 981 1179 add_filter('woocommerce_payment_gateways', 'add_best2pay_gateway'); 982 1180 983 1181 add_filter( 984 1182 'plugin_action_links_' . plugin_basename( __FILE__ ), … … 992 1190 if (!class_exists('woocommerce')) 993 1191 return $links; 994 1192 995 1193 array_unshift( 996 1194 $links, … … 1001 1199 ) 1002 1200 ); 1003 1201 1004 1202 return $links; 1005 1203 } -
best2pay-payment-method-visamastercard/trunk/languages/best2pay-payment_method-ru_RU.po
r3011458 r3036865 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Best2Pay payment m ethod (Visa/MasterCard/MIR) 2.1.0\n"5 "Project-Id-Version: Best2Pay payment module 2.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/best2pay-payment-method-visamastercard\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 16 16 17 17 #. Plugin Name of the plugin 18 msgid "Best2Pay payment m ethod (Visa/MasterCard/MIR)"19 msgstr " Оплата с Best2Pay (Visa/MasterCard/МИР)"18 msgid "Best2Pay payment module" 19 msgstr "Модуль оплаты Best2Pay" 20 20 21 21 #. Plugin URI of the plugin … … 28 28 29 29 #. Author of the plugin 30 #: best2pay-payment_method.php:110 31 #: best2pay-payment_method.php:111 32 #: best2pay-payment_method.php:855 30 #: best2pay-payment_method.php:113 31 #: best2pay-payment_method.php:981 33 32 msgid "Best2Pay" 34 33 msgstr "Best2Pay" 35 34 35 #: best2pay-payment_method.php:115 36 36 msgid "To accept payments through the plugin, you need to apply to connect to Best2pay on the website <a href=\"%1$s\" target=\"_blank\">%1$s</a> and enter into an agreement with the company.<br/>Support email: <a href=\"mailto:%2$s\">%2$s</a>" 37 37 msgstr "" … … 39 39 "<a href=\"%1$s\" target=\"_blank\">%1$s</a> и заключить договор с компанией.<br/>Электронная почта службы поддержки: <a href=\"mailto:%2$s\">%2$s</a>" 40 40 41 #: best2pay-payment_method.php:1 1242 #: best2pay-payment_method.php: 85641 #: best2pay-payment_method.php:133 42 #: best2pay-payment_method.php:982 43 43 msgid "Payments with bank cards via the <a href=\"%s\" target=\"_blank\">Best2Pay</a> payment system." 44 44 msgstr "" … … 46 46 "href=\"%s\" target=\"_blank\">Best2Pay</a>." 47 47 48 #: best2pay-payment_method.php:1 4548 #: best2pay-payment_method.php:159 49 49 msgid "Pay for your order in installments" 50 50 msgstr "Оплатите заказ частями" 51 51 52 #: best2pay-payment_method.php: 15253 msgid " Pay by QR"54 msgstr " Оплата по QR"55 56 #: best2pay-payment_method.php: 17752 #: best2pay-payment_method.php:215 53 msgid "Remove logo" 54 msgstr "Удалить логотип" 55 56 #: best2pay-payment_method.php:241 57 57 msgid "Enable/Disable" 58 58 msgstr "Включить/Выключить" 59 59 60 #: best2pay-payment_method.php: 17960 #: best2pay-payment_method.php:243 61 61 msgid "Enable Best2Pay checkout method" 62 62 msgstr "Включить использование метода платежа Best2Pay" 63 63 64 #: best2pay-payment_method.php:184 64 #: best2pay-payment_method.php:248 65 msgid "Title" 66 msgstr "Название" 67 68 #: best2pay-payment_method.php:250 69 msgid "Custom title for payment type" 70 msgstr "Свое название для типа платежа" 71 72 #: best2pay-payment_method.php:257 73 msgid "Description" 74 msgstr "Описание" 75 76 #: best2pay-payment_method.php:259 77 msgid "Custom description for payment type" 78 msgstr "Свое описание для типа платежа" 79 80 #: best2pay-payment_method.php:266 81 msgid "Logo" 82 msgstr "Логотип" 83 84 #: best2pay-payment_method.php:268 85 msgid "Custom logo for payment type" 86 msgstr "Свой логотип для типа платежа" 87 88 #: best2pay-payment_method.php:274 65 89 msgid "Sector ID" 66 90 msgstr "Sector ID" 67 91 68 #: best2pay-payment_method.php: 18692 #: best2pay-payment_method.php:276 69 93 msgid "Your shop identifier at Best2Pay" 70 94 msgstr "Идентификатор вашего магазина в системе Best2Pay" 71 95 72 #: best2pay-payment_method.php: 19296 #: best2pay-payment_method.php:282 73 97 msgid "Password" 74 98 msgstr "Пароль" 75 99 76 #: best2pay-payment_method.php: 194100 #: best2pay-payment_method.php:284 77 101 msgid "Password to use for digital signature" 78 102 msgstr "Пароль для цифровой подписи" 79 103 80 #: best2pay-payment_method.php:2 00104 #: best2pay-payment_method.php:290 81 105 msgid "Test Mode" 82 106 msgstr "Тестовый режим" 83 107 84 #: best2pay-payment_method.php:2 03108 #: best2pay-payment_method.php:293 85 109 msgid "Test mode - real payments will not be processed" 86 110 msgstr "Тестовый режим - средства с карты не списываются" 87 111 88 #: best2pay-payment_method.php:2 04112 #: best2pay-payment_method.php:294 89 113 msgid "Production mode - payments will be processed" 90 114 msgstr "Рабочий режим - средства списываются с карты" 91 115 92 #: best2pay-payment_method.php:2 06116 #: best2pay-payment_method.php:296 93 117 msgid "Select test or live mode" 94 118 msgstr "Выберите тестовый или рабочий режим" 95 119 96 #: best2pay-payment_method.php: 211120 #: best2pay-payment_method.php:301 97 121 msgid "Payment method" 98 122 msgstr "Способ оплаты" 99 123 100 #: best2pay-payment_method.php: 214124 #: best2pay-payment_method.php:304 101 125 msgid "Standard acquiring (one-stage payment)" 102 126 msgstr "Стандартный эквайринг (одностадийная оплата)" 103 127 104 #: best2pay-payment_method.php: 215128 #: best2pay-payment_method.php:305 105 129 msgid "Standard acquiring (two-stage payment)" 106 130 msgstr "Стандартный эквайринг (двухстадийная оплата)" 107 131 108 #: best2pay-payment_method.php: 216109 msgid " Halva Chastyami(one-stage payment)"110 msgstr " Только Халва Частями(одностадийная оплата)"111 112 #: best2pay-payment_method.php: 217113 msgid " Halva Chastyami(two-stage payment)"114 msgstr " Только Халва Частями(двухстадийная оплата)"115 116 #: best2pay-payment_method.php: 218132 #: best2pay-payment_method.php:306 133 msgid "Plait (one-stage payment)" 134 msgstr "Плайт (одностадийная оплата)" 135 136 #: best2pay-payment_method.php:307 137 msgid "Plait (two-stage payment)" 138 msgstr "Плайт (двухстадийная оплата)" 139 140 #: best2pay-payment_method.php:308 117 141 msgid "Fast Payment System" 118 142 msgstr "Система Быстрых Платежей (СБП)" 119 143 120 #: best2pay-payment_method.php: 219144 #: best2pay-payment_method.php:309 121 145 msgid "Loan" 122 146 msgstr "Кредитование" 123 147 124 #: best2pay-payment_method.php: 221148 #: best2pay-payment_method.php:311 125 149 msgid "Payment occurs after confirmation by the manager in the personal account" 126 150 msgstr "Оплата происходит после подтверждения менеджером в ЛК" 127 151 128 #: best2pay-payment_method.php: 226152 #: best2pay-payment_method.php:316 129 153 msgid "TAX" 130 154 msgstr "Налог" 131 155 132 #: best2pay-payment_method.php: 229156 #: best2pay-payment_method.php:319 133 157 msgid "VAT rate 20%" 134 158 msgstr "ставка НДС 20%" 135 159 136 #: best2pay-payment_method.php: 230160 #: best2pay-payment_method.php:320 137 161 msgid "VAT rate 10%" 138 162 msgstr "ставка НДС 10%" 139 163 140 #: best2pay-payment_method.php: 231164 #: best2pay-payment_method.php:321 141 165 msgid "VAT rate calc. 20/120" 142 166 msgstr "ставка НДС расч. 20/120" 143 167 144 #: best2pay-payment_method.php: 232168 #: best2pay-payment_method.php:322 145 169 msgid "VAT rate calc. 10/110" 146 170 msgstr "ставка НДС расч. 10/110" 147 171 148 #: best2pay-payment_method.php: 233172 #: best2pay-payment_method.php:323 149 173 msgid "VAT rate 0%" 150 174 msgstr "ставка НДС 0%" 151 175 152 #: best2pay-payment_method.php: 234176 #: best2pay-payment_method.php:324 153 177 msgid "Not subject to VAT" 154 178 msgstr "НДС не облагается" 155 179 156 #: best2pay-payment_method.php: 240180 #: best2pay-payment_method.php:330 157 181 msgid "Notify URL" 158 182 msgstr "URL для уведомлений" 159 183 160 #: best2pay-payment_method.php: 242184 #: best2pay-payment_method.php:332 161 185 msgid "Report this URL to Best2Pay technical support to receive payment notifications" 162 186 msgstr "Сообщите в службу технической поддержки Best2Pay этот URL для получения уведомлений о платеже" 163 187 164 #: best2pay-payment_method.php: 251188 #: best2pay-payment_method.php:341 165 189 msgid "Data encryption algorithm" 166 190 msgstr "Алгоритм шифрования данных" 167 191 168 #: best2pay-payment_method.php: 257192 #: best2pay-payment_method.php:347 169 193 msgid "Must match your sector encryption settings in your personal account" 170 194 msgstr "Должен соответствовать настройкам шифрования вашего сектора в личном кабинете" 171 195 172 #: best2pay-payment_method.php: 263196 #: best2pay-payment_method.php:353 173 197 msgid "Custom statuses for orders" 174 198 msgstr "Настраиваемые статусы для заказов" 175 199 176 #: best2pay-payment_method.php: 269200 #: best2pay-payment_method.php:359 177 201 msgid "Order registered" 178 202 msgstr "Заказ зарегистрирован" 179 203 180 #: best2pay-payment_method.php: 274204 #: best2pay-payment_method.php:364 181 205 msgid "Order authorized" 182 206 msgstr "Средства захолдированы" 183 207 184 #: best2pay-payment_method.php: 279208 #: best2pay-payment_method.php:369 185 209 msgid "Loan agreement approved but not signed" 186 210 msgstr "Кредитный договор одобрен, но не подписан" 187 211 188 #: best2pay-payment_method.php: 284212 #: best2pay-payment_method.php:374 189 213 msgid "Order successfully paid" 190 214 msgstr "Заказ успешно оплачен" 191 215 192 #: best2pay-payment_method.php: 289216 #: best2pay-payment_method.php:379 193 217 msgid "Order canceled" 194 218 msgstr "Платеж отменен" 195 219 196 #: best2pay-payment_method.php:317 220 #: best2pay-payment_method.php:371 221 msgid "Issuing an invoice for payment" 222 msgstr "Выставление счёта на оплату" 223 224 #: best2pay-payment_method.php:373 225 msgid "Enable issuing an invoice for payment by email of the payer" 226 msgstr "Включить выставление счёта на оплату на email плательщика" 227 228 #: best2pay-payment_method.php:377 229 msgid "Order agreement" 230 msgstr "Заказ на согласовании" 231 232 #: best2pay-payment_method.php:383 233 msgid "Payment expected" 234 msgstr "Ожидается оплата" 235 236 #: best2pay-payment_method.php:443 197 237 msgid "Order #%s" 198 238 msgstr "Заказ №%s" 199 239 200 #: best2pay-payment_method.php: 333240 #: best2pay-payment_method.php:459 201 241 msgid "Failed to register order" 202 242 msgstr "Не удалось зарегистрировать заказ" 203 243 204 #: best2pay-payment_method.php: 345244 #: best2pay-payment_method.php:471 205 245 msgid "Order registered successfully" 206 246 msgstr "Заказ успешно зарегистрирован" 207 247 208 #: best2pay-payment_method.php: 378209 #: best2pay-payment_method.php: 545248 #: best2pay-payment_method.php:504 249 #: best2pay-payment_method.php:671 210 250 msgid "Failed to get Best2pay order ID" 211 251 msgstr "Не удалось получить ID заказа Best2pay" 212 252 213 #: best2pay-payment_method.php: 381253 #: best2pay-payment_method.php:507 214 254 msgid "Failed to get Best2pay operation ID" 215 255 msgstr "Не удалось получить ID операции Best2pay" 216 256 217 #: best2pay-payment_method.php: 384218 #: best2pay-payment_method.php: 452219 #: best2pay-payment_method.php: 539257 #: best2pay-payment_method.php:510 258 #: best2pay-payment_method.php:578 259 #: best2pay-payment_method.php:665 220 260 msgid "Undefined order ID" 221 261 msgstr "Неопределенный ID заказа" 222 262 223 #: best2pay-payment_method.php: 387224 #: best2pay-payment_method.php: 455225 #: best2pay-payment_method.php: 542263 #: best2pay-payment_method.php:513 264 #: best2pay-payment_method.php:581 265 #: best2pay-payment_method.php:668 226 266 msgid "Failed to get order information" 227 267 msgstr "Не удалось получить информацию о заказе" 228 268 229 #: best2pay-payment_method.php: 400269 #: best2pay-payment_method.php:526 230 270 msgid "Could not find operation" 231 271 msgstr "Не удалось найти операцию" 232 272 233 #: best2pay-payment_method.php: 409273 #: best2pay-payment_method.php:535 234 274 msgid "Failed to pay for the order" 235 275 msgstr "Не удалось оплатить заказ" 236 276 237 #: best2pay-payment_method.php: 431277 #: best2pay-payment_method.php:557 238 278 msgid "Payment completed successfully" 239 279 msgstr "Платеж успешно завершен" 240 280 241 #: best2pay-payment_method.php: 461281 #: best2pay-payment_method.php:587 242 282 msgid "The order has already been %s" 243 283 msgstr "Заказ уже %s" 244 284 245 #: best2pay-payment_method.php: 474285 #: best2pay-payment_method.php:600 246 286 msgid "Failed to complete request for operation %s from the processing center" 247 287 msgstr "Не удалось выполнить запрос операции %s от процессингового центра" 248 288 249 #: best2pay-payment_method.php: 493289 #: best2pay-payment_method.php:619 250 290 msgid "Request for operation %s from the processing center was completed successfully" 251 291 msgstr "Запрос операции %s от процессингового центра выполнен успешно" 252 292 253 #: best2pay-payment_method.php: 535293 #: best2pay-payment_method.php:661 254 294 msgid "Operation failed. Please refresh the page" 255 295 msgstr "Не удалось выполнить операцию. Обновите страницу" 256 296 257 #: best2pay-payment_method.php: 552297 #: best2pay-payment_method.php:678 258 298 msgid "Failed to get operation request path" 259 299 msgstr "Не удалось получить путь запроса операции" 260 300 261 #: best2pay-payment_method.php: 556301 #: best2pay-payment_method.php:682 262 302 msgid "For orders with AUTHORIZED status, only full refunds are available" 263 303 msgstr "Для заказов со статусом AUTHORIZED возможен только полный возврат средств" 264 304 265 #: best2pay-payment_method.php: 577305 #: best2pay-payment_method.php:703 266 306 msgid "Operation type and action type are not equal" 267 307 msgstr "Тип операции и тип действия не совпадают" 268 308 269 #: best2pay-payment_method.php: 616309 #: best2pay-payment_method.php:742 270 310 msgid "Complete payment" 271 311 msgstr "Списать средства" 272 312 273 #: best2pay-payment_method.php: 674313 #: best2pay-payment_method.php:800 274 314 msgid "Missing PC order ID" 275 315 msgstr "Отсутствует ID заказа Пц" 276 316 277 #: best2pay-payment_method.php: 687317 #: best2pay-payment_method.php:813 278 318 msgid "There are no operations in the order" 279 319 msgstr "Операции заказа не найдены" 280 320 281 #: best2pay-payment_method.php: 719282 #: best2pay-payment_method.php: 735321 #: best2pay-payment_method.php:845 322 #: best2pay-payment_method.php:861 283 323 msgid "Signature is missing" 284 324 msgstr "Отсутствует подпись" 285 325 286 #: best2pay-payment_method.php: 723287 #: best2pay-payment_method.php: 739326 #: best2pay-payment_method.php:849 327 #: best2pay-payment_method.php:865 288 328 msgid "Invalid signature" 289 329 msgstr "Неверная подпись" 290 330 291 #: best2pay-payment_method.php: 725292 #: best2pay-payment_method.php: 746331 #: best2pay-payment_method.php:851 332 #: best2pay-payment_method.php:872 293 333 msgid "Unknown operation type" 294 334 msgstr "Неизвестный тип операции" 295 335 296 #: best2pay-payment_method.php: 727297 #: best2pay-payment_method.php: 748336 #: best2pay-payment_method.php:853 337 #: best2pay-payment_method.php:874 298 338 msgid "Operation not approved" 299 339 msgstr "Операция не одобрена" 300 340 301 #: best2pay-payment_method.php: 744341 #: best2pay-payment_method.php:870 302 342 msgid "An error occurred during the operation" 303 343 msgstr "Во время операции произошла ошибка" 304 344 305 #: best2pay-payment_method.php: 750345 #: best2pay-payment_method.php:876 306 346 msgid "Unknown payment operation type" 307 347 msgstr "Неизвестный тип платежной операции" 308 348 309 #: best2pay-payment_method.php: 774349 #: best2pay-payment_method.php:900 310 350 msgid "Invalid operation amount" 311 351 msgstr "Неверная сумма операции" 312 352 313 #: best2pay-payment_method.php: 806353 #: best2pay-payment_method.php:932 314 354 msgid "Funds for the order have been successfully debited" 315 355 msgstr "Средства за заказ успешно списаны" 316 356 317 #: best2pay-payment_method.php: 807357 #: best2pay-payment_method.php:933 318 358 msgid "Failed to complete payment" 319 359 msgstr "Не удалось завершить платеж" 320 360 321 #: best2pay-payment_method.php: 810361 #: best2pay-payment_method.php:936 322 362 msgid "Payment refunded successfully" 323 363 msgstr "Платеж успешно возвращен" 324 364 325 #: best2pay-payment_method.php: 811365 #: best2pay-payment_method.php:937 326 366 msgid "Failed to refund payment" 327 367 msgstr "Не удалось вернуть платеж" 328 368 329 #: best2pay-payment_method.php: 935369 #: best2pay-payment_method.php:1061 330 370 msgid "Server response is empty" 331 371 msgstr "Ответ сервера пуст" 332 372 333 #: best2pay-payment_method.php: 938373 #: best2pay-payment_method.php:1064 334 374 msgid "Invalid XML from response" 335 375 msgstr "Неверный XML в ответе" 336 376 337 #: best2pay-payment_method.php: 941377 #: best2pay-payment_method.php:1067 338 378 msgid "Unable to decode xml" 339 379 msgstr "Невозможно декодировать XML" 340 380 341 #: best2pay-payment_method.php: 991381 #: best2pay-payment_method.php:1117 342 382 msgid "Settings" 343 383 msgstr "Настройки" -
best2pay-payment-method-visamastercard/trunk/languages/best2pay-payment_method.pot
r3011458 r3036865 1 # Copyright (C) 202 3Best2Pay1 # Copyright (C) 2024 Best2Pay 2 2 # This file is distributed under the GPL3. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Best2Pay payment m ethod (Visa/MasterCard/MIR) 2.1.5\n"6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ trunk\n"5 "Project-Id-Version: Best2Pay payment module 2.2\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/best2pay\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 8 8 "Language-Team: LANGUAGE <[email protected]>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 3-11-17T14:41:40+03:00\n"12 "POT-Creation-Date: 2024-02-06T18:05:18+03:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 8.1\n"14 "X-Generator: WP-CLI 2.9.0\n" 15 15 "X-Domain: best2pay-payment_method\n" 16 16 17 17 #. Plugin Name of the plugin 18 msgid "Best2Pay payment m ethod (Visa/MasterCard/MIR)"18 msgid "Best2Pay payment module" 19 19 msgstr "" 20 20 … … 28 28 29 29 #. Author of the plugin 30 #: best2pay-payment_method.php:110 31 #: best2pay-payment_method.php:111 32 #: best2pay-payment_method.php:855 30 #: best2pay-payment_method.php:117 31 #: best2pay-payment_method.php:1059 33 32 msgid "Best2Pay" 34 33 msgstr "" 35 34 36 #: best2pay-payment_method.php:112 37 #: best2pay-payment_method.php:856 35 #: best2pay-payment_method.php:119 36 msgid "To accept payments through the plugin, you need to apply to connect to Best2pay on the website <a href=\"%1$s\" target=\"_blank\">%1$s</a> and enter into an agreement with the company.<br/>Support email: <a href=\"mailto:%2$s\">%2$s</a>" 37 msgstr "" 38 39 #: best2pay-payment_method.php:137 40 #: best2pay-payment_method.php:1060 38 41 msgid "Payments with bank cards via the <a href=\"%s\" target=\"_blank\">Best2Pay</a> payment system." 39 42 msgstr "" 40 43 41 #: best2pay-payment_method.php:1 4544 #: best2pay-payment_method.php:166 42 45 msgid "Pay for your order in installments" 43 46 msgstr "" 44 47 45 #: best2pay-payment_method.php: 15246 msgid " Pay by QR"47 msgstr "" 48 49 #: best2pay-payment_method.php: 17748 #: best2pay-payment_method.php:221 49 msgid "Remove logo" 50 msgstr "" 51 52 #: best2pay-payment_method.php:241 50 53 msgid "Enable/Disable" 51 54 msgstr "" 52 55 53 #: best2pay-payment_method.php: 17956 #: best2pay-payment_method.php:243 54 57 msgid "Enable Best2Pay checkout method" 55 58 msgstr "" 56 59 57 #: best2pay-payment_method.php:184 60 #: best2pay-payment_method.php:247 61 msgid "Title" 62 msgstr "" 63 64 #: best2pay-payment_method.php:249 65 msgid "Custom title for payment type" 66 msgstr "" 67 68 #: best2pay-payment_method.php:255 69 msgid "Description" 70 msgstr "" 71 72 #: best2pay-payment_method.php:257 73 msgid "Custom description for payment type" 74 msgstr "" 75 76 #: best2pay-payment_method.php:263 77 msgid "Logo" 78 msgstr "" 79 80 #: best2pay-payment_method.php:265 81 msgid "Custom logo for payment type" 82 msgstr "" 83 84 #: best2pay-payment_method.php:270 58 85 msgid "Sector ID" 59 86 msgstr "" 60 87 61 #: best2pay-payment_method.php: 18688 #: best2pay-payment_method.php:272 62 89 msgid "Your shop identifier at Best2Pay" 63 90 msgstr "" 64 91 65 #: best2pay-payment_method.php: 19292 #: best2pay-payment_method.php:277 66 93 msgid "Password" 67 94 msgstr "" 68 95 69 #: best2pay-payment_method.php: 19496 #: best2pay-payment_method.php:279 70 97 msgid "Password to use for digital signature" 71 98 msgstr "" 72 99 73 #: best2pay-payment_method.php:2 00100 #: best2pay-payment_method.php:284 74 101 msgid "Test Mode" 75 102 msgstr "" 76 103 77 #: best2pay-payment_method.php:2 03104 #: best2pay-payment_method.php:287 78 105 msgid "Test mode - real payments will not be processed" 79 106 msgstr "" 80 107 81 #: best2pay-payment_method.php:2 04108 #: best2pay-payment_method.php:288 82 109 msgid "Production mode - payments will be processed" 83 110 msgstr "" 84 111 85 #: best2pay-payment_method.php:2 06112 #: best2pay-payment_method.php:290 86 113 msgid "Select test or live mode" 87 114 msgstr "" 88 115 89 #: best2pay-payment_method.php:2 11116 #: best2pay-payment_method.php:294 90 117 msgid "Payment method" 91 118 msgstr "" 92 119 93 #: best2pay-payment_method.php:2 14120 #: best2pay-payment_method.php:297 94 121 msgid "Standard acquiring (one-stage payment)" 95 122 msgstr "" 96 123 97 #: best2pay-payment_method.php:2 15124 #: best2pay-payment_method.php:298 98 125 msgid "Standard acquiring (two-stage payment)" 99 126 msgstr "" 100 127 101 #: best2pay-payment_method.php:2 16102 msgid " Halva Chastyami(one-stage payment)"103 msgstr "" 104 105 #: best2pay-payment_method.php: 217106 msgid " Halva Chastyami(two-stage payment)"107 msgstr "" 108 109 #: best2pay-payment_method.php: 218128 #: best2pay-payment_method.php:299 129 msgid "Plait (one-stage payment)" 130 msgstr "" 131 132 #: best2pay-payment_method.php:300 133 msgid "Plait (two-stage payment)" 134 msgstr "" 135 136 #: best2pay-payment_method.php:301 110 137 msgid "Fast Payment System" 111 138 msgstr "" 112 139 113 #: best2pay-payment_method.php: 219140 #: best2pay-payment_method.php:302 114 141 msgid "Loan" 115 142 msgstr "" 116 143 117 #: best2pay-payment_method.php: 221144 #: best2pay-payment_method.php:304 118 145 msgid "Payment occurs after confirmation by the manager in the personal account" 119 146 msgstr "" 120 147 121 #: best2pay-payment_method.php: 226148 #: best2pay-payment_method.php:308 122 149 msgid "TAX" 123 150 msgstr "" 124 151 125 #: best2pay-payment_method.php: 229152 #: best2pay-payment_method.php:311 126 153 msgid "VAT rate 20%" 127 154 msgstr "" 128 155 129 #: best2pay-payment_method.php: 230156 #: best2pay-payment_method.php:312 130 157 msgid "VAT rate 10%" 131 158 msgstr "" 132 159 133 #: best2pay-payment_method.php: 231160 #: best2pay-payment_method.php:313 134 161 msgid "VAT rate calc. 20/120" 135 162 msgstr "" 136 163 137 #: best2pay-payment_method.php: 232164 #: best2pay-payment_method.php:314 138 165 msgid "VAT rate calc. 10/110" 139 166 msgstr "" 140 167 141 #: best2pay-payment_method.php: 233168 #: best2pay-payment_method.php:315 142 169 msgid "VAT rate 0%" 143 170 msgstr "" 144 171 145 #: best2pay-payment_method.php: 234172 #: best2pay-payment_method.php:316 146 173 msgid "Not subject to VAT" 147 174 msgstr "" 148 175 149 #: best2pay-payment_method.php: 240176 #: best2pay-payment_method.php:321 150 177 msgid "Notify URL" 151 178 msgstr "" 152 179 153 #: best2pay-payment_method.php: 242180 #: best2pay-payment_method.php:323 154 181 msgid "Report this URL to Best2Pay technical support to receive payment notifications" 155 182 msgstr "" 156 183 157 #: best2pay-payment_method.php: 251184 #: best2pay-payment_method.php:331 158 185 msgid "Data encryption algorithm" 159 186 msgstr "" 160 187 161 #: best2pay-payment_method.php: 257188 #: best2pay-payment_method.php:337 162 189 msgid "Must match your sector encryption settings in your personal account" 163 190 msgstr "" 164 191 165 #: best2pay-payment_method.php: 263192 #: best2pay-payment_method.php:342 166 193 msgid "Custom statuses for orders" 167 194 msgstr "" 168 195 169 #: best2pay-payment_method.php: 269196 #: best2pay-payment_method.php:346 170 197 msgid "Order registered" 171 198 msgstr "" 172 199 173 #: best2pay-payment_method.php: 274200 #: best2pay-payment_method.php:351 174 201 msgid "Order authorized" 175 202 msgstr "" 176 203 177 #: best2pay-payment_method.php: 279204 #: best2pay-payment_method.php:356 178 205 msgid "Loan agreement approved but not signed" 179 206 msgstr "" 180 207 181 #: best2pay-payment_method.php: 284208 #: best2pay-payment_method.php:361 182 209 msgid "Order successfully paid" 183 210 msgstr "" 184 211 185 #: best2pay-payment_method.php: 289212 #: best2pay-payment_method.php:366 186 213 msgid "Order canceled" 187 214 msgstr "" 188 215 189 #: best2pay-payment_method.php:317 216 #: best2pay-payment_method.php:371 217 msgid "Issuing an invoice for payment" 218 msgstr "" 219 220 #: best2pay-payment_method.php:373 221 msgid "Enable issuing an invoice for payment by email of the payer" 222 msgstr "" 223 224 #: best2pay-payment_method.php:377 225 msgid "Order agreement" 226 msgstr "" 227 228 #: best2pay-payment_method.php:383 229 msgid "Payment expected" 230 msgstr "" 231 232 #: best2pay-payment_method.php:409 190 233 msgid "Order #%s" 191 234 msgstr "" 192 235 193 #: best2pay-payment_method.php: 333236 #: best2pay-payment_method.php:431 194 237 msgid "Failed to register order" 195 238 msgstr "" 196 239 197 #: best2pay-payment_method.php: 345240 #: best2pay-payment_method.php:445 198 241 msgid "Order registered successfully" 199 242 msgstr "" 200 243 201 #: best2pay-payment_method.php:378 202 #: best2pay-payment_method.php:545 244 #: best2pay-payment_method.php:521 245 msgid "Order successfully create" 246 msgstr "" 247 248 #: best2pay-payment_method.php:560 249 #: best2pay-payment_method.php:737 203 250 msgid "Failed to get Best2pay order ID" 204 251 msgstr "" 205 252 206 #: best2pay-payment_method.php: 381253 #: best2pay-payment_method.php:564 207 254 msgid "Failed to get Best2pay operation ID" 208 255 msgstr "" 209 256 210 #: best2pay-payment_method.php: 384211 #: best2pay-payment_method.php: 452212 #: best2pay-payment_method.php: 539257 #: best2pay-payment_method.php:568 258 #: best2pay-payment_method.php:643 259 #: best2pay-payment_method.php:729 213 260 msgid "Undefined order ID" 214 261 msgstr "" 215 262 216 #: best2pay-payment_method.php: 387217 #: best2pay-payment_method.php: 455218 #: best2pay-payment_method.php: 542263 #: best2pay-payment_method.php:572 264 #: best2pay-payment_method.php:647 265 #: best2pay-payment_method.php:733 219 266 msgid "Failed to get order information" 220 267 msgstr "" 221 268 222 #: best2pay-payment_method.php: 400269 #: best2pay-payment_method.php:584 223 270 msgid "Could not find operation" 224 271 msgstr "" 225 272 226 #: best2pay-payment_method.php: 409273 #: best2pay-payment_method.php:595 227 274 msgid "Failed to pay for the order" 228 275 msgstr "" 229 276 230 #: best2pay-payment_method.php: 431277 #: best2pay-payment_method.php:619 231 278 msgid "Payment completed successfully" 232 279 msgstr "" 233 280 234 #: best2pay-payment_method.php: 461281 #: best2pay-payment_method.php:651 235 282 msgid "The order has already been %s" 236 283 msgstr "" 237 284 238 #: best2pay-payment_method.php: 474285 #: best2pay-payment_method.php:663 239 286 msgid "Failed to complete request for operation %s from the processing center" 240 287 msgstr "" 241 288 242 #: best2pay-payment_method.php: 493289 #: best2pay-payment_method.php:683 243 290 msgid "Request for operation %s from the processing center was completed successfully" 244 291 msgstr "" 245 292 246 #: best2pay-payment_method.php: 535293 #: best2pay-payment_method.php:725 247 294 msgid "Operation failed. Please refresh the page" 248 295 msgstr "" 249 296 250 #: best2pay-payment_method.php: 552297 #: best2pay-payment_method.php:743 251 298 msgid "Failed to get operation request path" 252 299 msgstr "" 253 300 254 #: best2pay-payment_method.php: 556301 #: best2pay-payment_method.php:747 255 302 msgid "For orders with AUTHORIZED status, only full refunds are available" 256 303 msgstr "" 257 304 258 #: best2pay-payment_method.php: 577305 #: best2pay-payment_method.php:771 259 306 msgid "Operation type and action type are not equal" 260 307 msgstr "" 261 308 262 #: best2pay-payment_method.php: 616309 #: best2pay-payment_method.php:813 263 310 msgid "Complete payment" 264 311 msgstr "" 265 312 266 #: best2pay-payment_method.php: 674313 #: best2pay-payment_method.php:869 267 314 msgid "Missing PC order ID" 268 315 msgstr "" 269 316 270 #: best2pay-payment_method.php: 687317 #: best2pay-payment_method.php:884 271 318 msgid "There are no operations in the order" 272 319 msgstr "" 273 320 274 #: best2pay-payment_method.php: 719275 #: best2pay-payment_method.php: 735321 #: best2pay-payment_method.php:919 322 #: best2pay-payment_method.php:938 276 323 msgid "Signature is missing" 277 324 msgstr "" 278 325 279 #: best2pay-payment_method.php: 723280 #: best2pay-payment_method.php: 739326 #: best2pay-payment_method.php:924 327 #: best2pay-payment_method.php:943 281 328 msgid "Invalid signature" 282 329 msgstr "" 283 330 284 #: best2pay-payment_method.php: 725285 #: best2pay-payment_method.php: 746331 #: best2pay-payment_method.php:927 332 #: best2pay-payment_method.php:951 286 333 msgid "Unknown operation type" 287 334 msgstr "" 288 335 289 #: best2pay-payment_method.php: 727290 #: best2pay-payment_method.php: 748336 #: best2pay-payment_method.php:930 337 #: best2pay-payment_method.php:954 291 338 msgid "Operation not approved" 292 339 msgstr "" 293 340 294 #: best2pay-payment_method.php: 744341 #: best2pay-payment_method.php:948 295 342 msgid "An error occurred during the operation" 296 343 msgstr "" 297 344 298 #: best2pay-payment_method.php: 750345 #: best2pay-payment_method.php:957 299 346 msgid "Unknown payment operation type" 300 347 msgstr "" 301 348 302 #: best2pay-payment_method.php: 774349 #: best2pay-payment_method.php:981 303 350 msgid "Invalid operation amount" 304 351 msgstr "" 305 352 306 #: best2pay-payment_method.php: 806353 #: best2pay-payment_method.php:1013 307 354 msgid "Funds for the order have been successfully debited" 308 355 msgstr "" 309 356 310 #: best2pay-payment_method.php: 807357 #: best2pay-payment_method.php:1014 311 358 msgid "Failed to complete payment" 312 359 msgstr "" 313 360 314 #: best2pay-payment_method.php: 810361 #: best2pay-payment_method.php:1017 315 362 msgid "Payment refunded successfully" 316 363 msgstr "" 317 364 318 #: best2pay-payment_method.php: 811365 #: best2pay-payment_method.php:1018 319 366 msgid "Failed to refund payment" 320 367 msgstr "" 321 368 322 #: best2pay-payment_method.php: 935369 #: best2pay-payment_method.php:1134 323 370 msgid "Server response is empty" 324 371 msgstr "" 325 372 326 #: best2pay-payment_method.php: 938373 #: best2pay-payment_method.php:1138 327 374 msgid "Invalid XML from response" 328 375 msgstr "" 329 376 330 #: best2pay-payment_method.php: 941377 #: best2pay-payment_method.php:1142 331 378 msgid "Unable to decode xml" 332 379 msgstr "" 333 380 334 #: best2pay-payment_method.php: 991381 #: best2pay-payment_method.php:1193 335 382 msgid "Settings" 336 383 msgstr "" -
best2pay-payment-method-visamastercard/trunk/readme.txt
r3011458 r3036865 1 === best2pay payment method===1 === Модуль оплаты Best2Pay === 2 2 Contributors: best2pay 3 Tags: e-commerce, payments, best2pay, платежные системы 4 Tested up to: 6.3.2 3 Tags: woocommerce, payments, best2pay, платежные системы 5 4 Requires at least: 4.7 5 Tested up to: 6.4.3 6 6 Requires PHP: 7.4 7 Stable tag: 2.0.1 7 Stable tag: 2.2.0 8 WC requires at least: 6.0 9 WC tested up to: 8.5.1 8 10 License: GPLv3 9 11 License URI: https://www.gnu.org/licenses/gpl-3.0.html 10 12 11 13 == Description == 14 12 15 Плагин «Best2pay» – платежное решение для сайтов на WooCommerce: 13 * включает 7 cпособов приема платежей, 14 * подходит для юрлиц и ИП, 15 * деньги поступают на банковский счет компании. 16 *Соблюдение 54 ФЗ16 - Включает 7 cпособов приема платежей 17 - Подходит для юрлиц и ИП 18 - Деньги поступают на банковский счет компании 19 - Соблюдение 54 ФЗ 17 20 18 Настройка плагина 19 Чтобы принимать платежи через плагин, нужно подать заявку на подключение к Best2pay на сайте https://best2pay.net и заключить договор с компанией. 21 = Тарифы = 22 23 Подключение Bes2pay и настройка плагина – бесплатно. Комиссия за прием платежей – от 3,2%. 24 25 = Все возможности Best2pay = 26 27 После подключения Best2pay доступны: 28 - 12 способов приема платежей. Интернет-банки, СБП, виртуальные карты. Вы сами выбираете, какие способы нужны, и перечисляете их в договоре. Кнопки оплаты можно разместить на своем сайте или на сайте Best2pay: выберите подходящий вариант при настройке плагина. 29 - Личный кабинет на сайте Best2pay. В нем можно делать возвраты платежей, выставлять и отправлять счета, общаться с менеджерами. 30 31 == Installation == 32 33 Чтобы принимать платежи через плагин, нужно подать заявку на подключение к Best2pay на сайте https://best2pay.net и заключить договор с компанией. 20 34 После этого вы получите нужные настройки. 21 35 Поддержка передачи данных чека: 22 1. Через Bes2pay вы настраивали отправку чековв налоговую (по 54-ФЗ)36 1. Отправка чеков через Bes2pay в налоговую (по 54-ФЗ) 23 37 2. Через подключённых партнёров. 24 38 25 Тарифы 26 Подключение Bes2pay и настройка плагина – бесплатно. Комиссия за прием платежей – от 3,2%. 39 == Screenshots == 27 40 28 Все возможности Best2pay29 После подключения Best2pay доступны:30 * 12 способов приема платежей. Интернет-банки, СБП, виртуальные карты. Вы сами выбираете, какие способы нужны, и перечисляете их в договоре. Кнопки оплаты можно разместить на своем сайте или на сайте Best2pay: выберите подходящий вариант при настройке плагина.31 * Личный кабинет на сайте Best2pay. В нем можно делать возвраты платежей, выставлять и отправлять счета, общаться с менеджерами.32 33 == Screenshots ==34 41 1. Страница настроек плагина
Note: See TracChangeset
for help on using the changeset viewer.