Changeset 2837766
- Timestamp:
- 12/22/2022 04:53:40 AM (3 years ago)
- Location:
- best2pay-payment-method-visamastercard/trunk
- Files:
-
- 4 edited
-
best2pay-payment_method.php (modified) (13 diffs)
-
best2pay.png (modified) (previous)
-
languages/best2pay-payment_method-ru_RU.po (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
best2pay-payment-method-visamastercard/trunk/best2pay-payment_method.php
r2755152 r2837766 18 18 * Plugin URI: http://best2pay.net/ 19 19 * Description: Receive payments via Visa/Mastercard easily with Best2Pay bank cards processing 20 * Version: 1. 1.620 * Version: 1.2.0 21 21 * Author: Best2Pay 22 22 * Tested up to: 5.7.1 … … 52 52 $this->id = 'best2pay'; 53 53 $this->method_title = __('Best2Pay', 'best2pay-payment_method'); 54 $this->title = __(' Best2Pay', 'best2pay-payment_method');55 $this->description = __(" Payments with bank cards via the <a href=\"http://www.best2pay.net\" target=\"_blank\">Best2Pay</a> payment system.", 'best2pay-payment_method');54 $this->title = __('Оплата банковской картой', 'best2pay-payment_method'); 55 $this->description = __("через платежную систему <a href=\"http://www.best2pay.net\" target=\"_blank\">Best2Pay</a>", 'best2pay-payment_method'); 56 56 $this->icon = plugins_url('best2pay.png', __FILE__); 57 57 $this->has_fields = true; … … 67 67 $this->testmode = $this->settings['testmode']; 68 68 $this->twostepsmode = $this->settings['twostepsmode']; 69 69 // $this->halvaparts = $this->settings['halvaparts']; 70 $this->mode = $this->settings['mode']; 71 switch ($this->mode) { 72 case 1: 73 $this->title = 'Оплатить заказ Частями'; 74 $this->icon = plugins_url('halva.svg', __FILE__); 75 $this->description = ''; 76 break; 77 case 2: 78 $this->title = 'Оплатить по QR'; 79 $this->icon = null; 80 break; 81 } 70 82 // actions 71 83 add_action('init', array($this, 'successful_request')); … … 125 137 'type' => 'select', 126 138 'options' => array( 127 '1' => 'Test mode - real payments will not be processed',128 '0' => 'Production mode - payments will be processed'139 '1' => __('Test mode - real payments will not be processed', 'best2pay-payment_method'), 140 '0' => __('Production mode - payments will be processed', 'best2pay-payment_method') 129 141 ), 130 142 'description' => __('Select test or live mode', 'best2pay-payment_method') 143 ), 144 /*'mode' => array( 145 'title' => __('Payment mode', 'best2pay-payment_method'), 146 'type' => 'select', 147 'options' => array( 148 '0' => __('Standard acquiring', 'best2pay-payment_method'), 149 '1' => __('Just installment', 'best2pay-payment_method'), 150 '2' => __('Just purchase by QR', 'best2pay-payment_method') 151 ), 152 'description' => __('Select payment mode', 'best2pay-payment_method'), 153 ),*/ 154 'mode' => array( 155 'title' => __('Режим оплаты', 'best2pay-payment_method'), 156 'type' => 'select', 157 'options' => array( 158 '0' => __('Стандартный эквайринг', 'best2pay-payment_method'), 159 '1' => __('Только Халва.Частями', 'best2pay-payment_method'), 160 '2' => __('Только СБП', 'best2pay-payment_method') 161 ), 162 'description' => __('Выберите режим оплаты', 'best2pay-payment_method'), 131 163 ), 132 164 'twostepsmode' => array( … … 134 166 'type' => 'select', 135 167 'options' => array( 136 '1' => 'On',137 '0' => 'Off'168 '1' => __('On', 'best2pay-payment_method'), 169 '0' => __('Off', 'best2pay-payment_method') 138 170 ), 139 171 'description' => __('Turn on 2 steps mode', 'best2pay-payment_method') 140 172 ), 141 'deferred' => array(173 /*'deferred' => array( 142 174 'title' => __('Deferred payment', 'best2pay-payment_method'), 143 175 'type' => 'select', 144 176 'options' => array( 145 '1' => 'On', 146 '0' => 'Off' 147 ) 148 ) 177 '1' => __('On', 'best2pay-payment_method'), 178 '0' => __('Off', 'best2pay-payment_method') 179 ), 180 'description' => __('Making of an email message with a link to payment (payment is not carried out)', 'best2pay-payment_method') 181 )*/ 149 182 ); 150 183 … … 172 205 if ($this->testmode == "0") 173 206 $best2pay_url = "https://pay.best2pay.net"; 174 $best2pay_operation = "Purchase"; 175 if ($this->twostepsmode == "1") 176 $best2pay_operation = "Authorize"; 207 208 switch (intval($this->mode)) { 209 case 1: 210 $best2pay_operation = 'custom/svkb/PurchaseWithInstallment'; 211 break; 212 case 2: 213 $best2pay_operation = 'PurchaseSBP'; 214 break; 215 default: 216 $best2pay_operation = "Purchase"; 217 if ($this->twostepsmode == "1") 218 $best2pay_operation = "Authorize"; 219 } 177 220 178 221 $signature = base64_encode(md5($this->sector . intval($order->get_total() * 100) . $currency . $this->password)); … … 182 225 $fiscalPositions = ''; 183 226 $fiscalAmount = 0; 184 $KKT = true; 185 186 if ($KKT) { 187 foreach ($items as $item_id => $item) { 188 $item_data = $item->get_data(); 189 $fiscalPositions .= $item_data['quantity'] . ';'; 190 $elementPrice = $item->get_product()->get_price() * 100; 191 $fiscalPositions .= $elementPrice . ';'; 192 $fiscalPositions .= ($item_data['total_tax']) ?: 6 . ';'; // tax 193 $fiscalPositions .= str_ireplace([';', '|'], '', $item_data['name']) . '|'; 194 195 $fiscalAmount += $item_data['quantity'] * $elementPrice; 196 } 197 if ($wc_order->get_shipping_total()) { 198 $fiscalPositions .= '1;' . $wc_order->get_shipping_total() * 100 . ';6;Доставка|'; 199 $fiscalAmount += $wc_order->get_shipping_total() * 100; 200 } 201 $fiscalDiff = abs($fiscalAmount - intval($order->get_total() * 100)); 202 if ($fiscalDiff) { 203 $fiscalPositions .= '1;' . $fiscalDiff . ';6;Скидка;14|'; 204 } 205 $fiscalPositions = substr($fiscalPositions, 0, -1); 206 } 227 228 foreach ($items as $item_id => $item) { 229 $item_data = $item->get_data(); 230 $fiscalPositions .= $item_data['quantity'] . ';'; 231 $elementPrice = $item->get_product()->get_price() * 100; 232 $fiscalPositions .= $elementPrice . ';'; 233 $fiscalPositions .= ($item_data['total_tax']) ?: 6 . ';'; // tax 234 $fiscalPositions .= str_ireplace([';', '|'], '', $item_data['name']) . '|'; 235 236 $fiscalAmount += $item_data['quantity'] * $elementPrice; 237 } 238 if ($wc_order->get_shipping_total()) { 239 $fiscalPositions .= '1;' . $wc_order->get_shipping_total() * 100 . ';6;Доставка|'; 240 $fiscalAmount += $wc_order->get_shipping_total() * 100; 241 } 242 $fiscalDiff = abs($fiscalAmount - intval($order->get_total() * 100)); 243 if ($fiscalDiff) { 244 $fiscalPositions .= '1;' . $fiscalDiff . ';6;Скидка;14|'; 245 } 246 $fiscalPositions = substr($fiscalPositions, 0, -1); 207 247 208 248 $args = array( … … 214 254 'description' => sprintf(__('Order #%s', 'best2pay-payment_method'), ltrim($order->get_order_number(), '#')), 215 255 'email' => $order->get_billing_email(), 216 'notify_customer' => ($this->deferred) ? 1 : 0,256 // 'notify_customer' => ($this->deferred) ? 1 : 0, 217 257 'currency' => $currency, 218 258 'mode' => 1, … … 221 261 ) 222 262 ); 263 264 die('<pre>' . print_r(array( 265 'sector' => $this->sector, 266 'reference' => $order->get_id(), 267 'amount' => intval($order->get_total() * 100), 268 'fiscal_positions' => $fiscalPositions, 269 'description' => sprintf(__('Order #%s', 'best2pay-payment_method'), ltrim($order->get_order_number(), '#')), 270 'email' => $order->get_billing_email(), 271 // 'notify_customer' => ($this->deferred) ? 1 : 0, 272 'currency' => $currency, 273 'mode' => 1, 274 'url' => $this->callback_url, 275 'signature' => $signature 276 ), true)); 277 223 278 $remote_post = wp_remote_post($best2pay_url . '/webapi/Register', $args); 224 279 $remote_post = (isset($remote_post['body'])) ? $remote_post['body'] : $remote_post; … … 235 290 $signature = base64_encode(md5($this->sector . $b2p_order_id . $this->password)); 236 291 237 //$order->update_status('on-hold');238 239 if ($this->deferred) {292 $order->update_status('on-hold'); 293 294 /*if ($this->deferred) { 240 295 wp_redirect($this->get_return_url($wc_order)); 241 296 exit(); 242 } 297 }*/ 243 298 244 299 return array( … … 386 441 return false; 387 442 443 if ($order->get_date_paid()) 444 exit(); 445 388 446 // check server signature 389 447 $tmp_response = json_decode(json_encode($response), true); … … 419 477 * @param array $details 420 478 */ 421 public function logIt (string $message, array $details = []) { 479 public function logIt(string $message, array $details = []) 480 { 422 481 $log = fopen($this->getLogFileName(), 'a+') or die("logging trouble"); 423 482 $date = date("d.m.y H:i:s"); … … 427 486 } 428 487 $msg .= "\n\n\n"; 429 fprintf($log, chr(0xEF) .chr(0xBB).chr(0xBF));488 fprintf($log, chr(0xEF) . chr(0xBB) . chr(0xBF)); 430 489 fwrite($log, $msg); 431 490 fclose($log); 432 491 } 433 492 434 public function getLogFileName () { 493 public function getLogFileName() 494 { 435 495 $signature = base64_encode($this->sector . $this->password . $_SERVER['HTTP_HOST']); 436 496 $signature = str_ireplace('=', '', $signature); -
best2pay-payment-method-visamastercard/trunk/languages/best2pay-payment_method-ru_RU.po
r2531312 r2837766 3 3 # This file is distributed under the same license as the PACKAGE package. 4 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 5 #6 5 msgid "" 7 6 msgstr "" … … 9 8 "Report-Msgid-Bugs-To: \n" 10 9 "POT-Creation-Date: 2015-12-15 04:38+0300\n" 11 "PO-Revision-Date: 20 15-12-15 04:41+0300\n"12 "Last-Translator: Dennis Prochko <[email protected]>\n"13 "Language-Team: ru_RU <[email protected]>\n"10 "PO-Revision-Date: 2022-10-25 06:15+0000\n" 11 "Last-Translator: \n" 12 "Language-Team: Русский\n" 14 13 "Language: ru_RU\n" 15 14 "MIME-Version: 1.0\n" 16 15 "Content-Type: text/plain; charset=UTF-8\n" 17 16 "Content-Transfer-Encoding: 8bit\n" 18 "X-Generator: Poedit 1.5.4\n"17 "X-Generator: Loco https://localise.biz/\n" 19 18 "X-Poedit-SourceCharset: UTF-8\n" 19 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && " 20 "n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);\n" 21 "X-Loco-Version: 2.6.2; wp-6.0.3" 20 22 21 #: ../best2pay-woocommerce.php:3622 msgid " Best2Pay For WooCommerce (Visa/MasterCard)"23 msgstr " Best2Pay для WooCommerce (Виза/Мастеркард)"23 #: best2pay-payment_method.php:346 24 msgid "." 25 msgstr "" 24 26 25 #: ../best2pay-woocommerce.php:37 27 #: best2pay-payment_method.php:143 28 msgid "2 steps payment mode" 29 msgstr "Двухстадийная оплата" 30 31 #. Author of the plugin 32 #: best2pay-payment_method.php:53 best2pay-payment_method.php:54 33 #: best2pay-payment_method.php:84 34 msgid "Best2Pay" 35 msgstr "Best2Pay" 36 37 #. Name of the plugin 38 msgid "Best2Pay payment method (Visa/MasterCard)" 39 msgstr "Оплата с Best2Pay (Виза/МастерКард)" 40 41 #: best2pay-payment_method.php:152 42 msgid "Deferred payment" 43 msgstr "Отсроченный платёж" 44 45 #: best2pay-payment_method.php:106 46 msgid "Enable Best2Pay checkout method" 47 msgstr "Включить использование метода платежа Best2Pay" 48 49 #: best2pay-payment_method.php:104 50 msgid "Enable/Disable" 51 msgstr "Включить/Выключить" 52 53 #. URI of the plugin 54 msgid "http://best2pay.net/" 55 msgstr "http://best2pay.net/" 56 57 #: best2pay-payment_method.php:158 58 msgid "" 59 "Making of an email message with a link to payment (payment is not carried " 60 "out)" 61 msgstr "" 62 "Формирование электронного письма со ссылкой на оплату (сама оплата не " 63 "проводится)" 64 65 #: best2pay-payment_method.php:137 66 msgid "No" 67 msgstr "Нет" 68 69 #: best2pay-payment_method.php:147 best2pay-payment_method.php:156 70 msgid "Off" 71 msgstr "Выкл" 72 73 #: best2pay-payment_method.php:146 best2pay-payment_method.php:155 74 msgid "On" 75 msgstr "Вкл" 76 77 #: best2pay-payment_method.php:134 78 msgid "Only Halva parts" 79 msgstr "Только Халва Частями" 80 81 #: best2pay-payment_method.php:225 82 #, php-format 83 msgid "Order #%s" 84 msgstr "Заказ #%s" 85 86 #: best2pay-payment_method.php:118 87 msgid "Password" 88 msgstr "Пароль" 89 90 #: best2pay-payment_method.php:120 91 msgid "Password to use for digital signature" 92 msgstr "Пароль для цифровой подписи" 93 94 #: best2pay-payment_method.php:417 95 msgid "Payment completed." 96 msgstr "Платеж завершен." 97 98 #: best2pay-payment_method.php:55 best2pay-payment_method.php:85 99 msgid "" 100 "Payments with bank cards via the <a href=\"http://www.best2pay.net\" " 101 "target=\"_blank\">Best2Pay</a> payment system." 102 msgstr "" 103 "Платежи по банковским картам (Visa, Mastercard) через платёжную систему <a " 104 "href=\"http://www.best2pay.net\" target=\"_blank\">Best2Pay</a>." 105 106 #: best2pay-payment_method.php:129 107 msgid "Production mode - payments will be processed" 108 msgstr "Рабочий режим - средства списываются с карты" 109 110 #. Description of the plugin 26 111 msgid "" 27 112 "Receive payments via Visa/Mastercard easily with Best2Pay bank cards " … … 31 116 "помощью системы Best2Pay" 32 117 33 #: ../best2pay-woocommerce.php:3834 msgid " Dennis Prochko"35 msgstr " Прочко Денис"118 #: best2pay-payment_method.php:111 119 msgid "Sector ID" 120 msgstr "ID сектора" 36 121 37 #: ../best2pay-woocommerce.php:52 ../best2pay-woocommerce.php:5338 msgid " Best2Pay"39 msgstr " Best2Pay"122 #: best2pay-payment_method.php:131 123 msgid "Select test or live mode" 124 msgstr "Выберите тестовый или рабочий режим" 40 125 41 #: ../best2pay-woocommerce.php:54 126 #: best2pay-payment_method.php:125 127 msgid "Test Mode" 128 msgstr "Тестовый режим" 129 130 #: best2pay-payment_method.php:128 131 msgid "Test mode - real payments will not be processed" 132 msgstr "Тестовый режим - средства не списываются с карты" 133 134 #: best2pay-payment_method.php:140 42 135 msgid "" 43 " Payments with bank cards via the <a href=\"http://www.best2pay.net\" target="44 " \"_blank\">Best2Pay</a> payment system."136 "The module works only for paying for Halva Parts, other payment methods are " 137 "disabled" 45 138 msgstr "" 46 " Платежи по банковским картам (Visa, Mastercard) через платёжную систему <a"47 " href=\"http://www.best2pay.net\" target=\"_blank\">Best2Pay</a>."139 "Модуль работает только на оплату Халвой Частями, иные способы оплаты " 140 "отключены" 48 141 49 #: ../best2pay-woocommerce.php:9950 msgid " Enable/Disable"51 msgstr " Включить/Выключить"142 #: best2pay-payment_method.php:348 143 msgid "The order wasn't paid [1]: " 144 msgstr "Заказ не был оплачен: " 52 145 53 #: ../best2pay-woocommerce.php:10154 msgid " Enable Best2Pay checkout method"55 msgstr " Включить использование метода платежа Best2Pay"146 #: best2pay-payment_method.php:381 147 msgid "The order wasn't paid [2]: " 148 msgstr "Заказ не был оплачен: " 56 149 57 #: ../best2pay-woocommerce.php:10658 msgid " Sector ID"59 msgstr " Sector ID"150 #: best2pay-payment_method.php:281 best2pay-payment_method.php:283 151 msgid "The order wasn't paid." 152 msgstr "Заказ не был оплачен." 60 153 61 #: ../best2pay-woocommerce.php:108 154 #: best2pay-payment_method.php:149 155 msgid "Turn on 2 steps mode" 156 msgstr "Включён режим двухстадийной оплаты" 157 158 #: best2pay-payment_method.php:138 159 msgid "Yes" 160 msgstr "Да" 161 162 #: best2pay-payment_method.php:113 62 163 msgid "Your shop identifier at Best2Pay" 63 164 msgstr "Идентификатор вашего магазина в системе Best2Pay" 64 165 65 #: ../best2pay-woocommerce.php:11366 msgid "Pa ssword"67 msgstr " Пароль"166 #: best2pay-payment_method.php:144 167 msgid "Payment mode" 168 msgstr "Идентификатор вашего магазина в системе Best2Pay" 68 169 69 #: ../best2pay-woocommerce.php:11570 msgid "Password to use for digital signature"71 msgstr "Пароль для цифровой подписи"72 73 #: ../best2pay-woocommerce.php:12074 msgid "Test Mode"75 msgstr "Тестовый режим"76 77 #: ../best2pay-woocommerce.php:12678 msgid "Select test or live mode"79 msgstr "Выберите тестовый или рабочий режим"80 81 #: ../best2pay-woocommerce.php:16382 #, php-format83 msgid "Order #%s"84 msgstr "Заказ #%s"85 86 #: ../best2pay-woocommerce.php:201 ../best2pay-woocommerce.php:20387 msgid "The order wasn't paid."88 msgstr "Заказ не был оплачен."89 90 #: ../best2pay-woocommerce.php:258 ../best2pay-woocommerce.php:26091 #: ../best2pay-woocommerce.php:28492 msgid "The order wasn't paid: "93 msgstr "Заказ не был оплачен: "94 95 #: ../best2pay-woocommerce.php:31796 msgid "Payment completed."97 msgstr "Платеж завершен." -
best2pay-payment-method-visamastercard/trunk/readme.txt
r2811190 r2837766 2 2 Contributors: best2pay 3 3 Tags: e-commerce, payments, best2pay, платежные системы 4 Tested up to: 6.0.14 Tested up to: 5.7.1 5 5 Requires at least: 4.7 6 Requires PHP: 7. 07 Stable tag: 1. 1.66 Requires PHP: 7.4 7 Stable tag: 1.2.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html 10 10 11 11 == Description == 12 Плагин «Best2Pay» — платежное решение для сайтов на Wordpress: 13 • 4 встроенных способа приема платежей. 14 • Для юридических лиц и ИП. 15 • Быстрое поступление денег на счет компании. 16 • Полное соответствие 54-ФЗ. 17 • Бесплатное подключение. 18 == Настройка плагина == 19 Чтобы принимать платежи через плагин, подайте заявку на подключение к Best2Pay на сайте best2pay.net. С вами свяжется сотрудник компании и выдаст доступ на подключение. 20 == Поддержка передачи чека == 21 1. Настройте быструю передачу чеков в налоговую из Best2Pay согласно 54-ФЗ. 22 2. Передавайте чеки через партнеров (облачные кассы «АТОЛ Онлайн», Orange Data, «Бизнес.ру», Kit online). 23 == Тарифы == 24 • Комиссия за прием платежей — от 1%. Комиссия рассчитывается индивидуально для каждого бизнеса. Для корректной оценки тарифа необходимо предоставить информацию по виду деятельности компании, среднему чеку и оборотам в месяц. 25 После подключения Best2Pay доступны 26 == 4 способа приема платежей: == 27 • СБП 28 • Банковские карты 29 • Яндекс Pay 30 • Халва Частями 12 Плагин «Best2pay» – платежное решение для сайтов на WooCommerce: 13 * включает 7 cпособов приема платежей, 14 * подходит для юрлиц и ИП, 15 * деньги поступают на банковский счет компании. 16 * Соблюдение 54 ФЗ 31 17 18 Настройка плагина 19 Чтобы принимать платежи через плагин, нужно подать заявку на подключение к Best2pay на сайте https://best2pay.net и заключить договор с компанией. 20 После этого вы получите нужные настройки. 21 Поддержка передачи данных чека: 22 1. Через Bes2pay вы настраивали отправку чеков в налоговую (по 54-ФЗ) 23 2. Через подключённых партнёров. 32 24 33 • Личный кабинет, в котором вы сможете видеть все операции, возвращать платежи, выставлять и отправлять счета и обратиться в службу поддержки Best2Pay (служба поддержки Best2Pay работает 24/7). 25 Тарифы 26 Подключение Bes2pay и настройка плагина – бесплатно. Комиссия за прием платежей – от 3,2%. 34 27 28 Все возможности Best2pay 29 После подключения Best2pay доступны: 30 * 12 способов приема платежей. Интернет-банки, СБП, виртуальные карты. Вы сами выбираете, какие способы нужны, и перечисляете их в договоре. Кнопки оплаты можно разместить на своем сайте или на сайте Best2pay: выберите подходящий вариант при настройке плагина. 31 * Личный кабинет на сайте Best2pay. В нем можно делать возвраты платежей, выставлять и отправлять счета, общаться с менеджерами. 35 32 36 33 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.