Changeset 2837763
- Timestamp:
- 12/22/2022 04:51:18 AM (3 years ago)
- Location:
- best2pay-payment-method-visamastercard
- Files:
-
- 2 added
- 4 edited
-
best2pay-payment_method.php (modified) (13 diffs)
-
best2pay.png (modified) (previous)
-
halva.svg (added)
-
languages/best2pay-payment_method-ru_RU.po (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
-
trunk/halva.svg (added)
Legend:
- Unmodified
- Added
- Removed
-
best2pay-payment-method-visamastercard/best2pay-payment_method.php
r2818298 r2837763 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 $this->halvaparts = $this->settings['halvaparts']; 70 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 } 71 82 // actions 72 83 add_action('init', array($this, 'successful_request')); … … 131 142 'description' => __('Select test or live mode', 'best2pay-payment_method') 132 143 ), 133 'halvaparts' => array(134 'title' => __(' Only Halva parts', 'best2pay-payment_method'),144 /*'mode' => array( 145 'title' => __('Payment mode', 'best2pay-payment_method'), 135 146 'type' => 'select', 136 147 'options' => array( 137 '1' => __('No', 'best2pay-payment_method'), 138 '0' => __('Yes', 'best2pay-payment_method') 148 '0' => __('Standard acquiring', 'best2pay-payment_method'), 149 '1' => __('Just installment', 'best2pay-payment_method'), 150 '2' => __('Just purchase by QR', 'best2pay-payment_method') 139 151 ), 140 'description' => __('The module works only for paying for Halva Parts, other payment methods are disabled', 'best2pay-payment_method'), 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'), 141 163 ), 142 164 'twostepsmode' => array( … … 148 170 ), 149 171 'description' => __('Turn on 2 steps mode', 'best2pay-payment_method') 150 //),151 //'deferred' => array(152 //'title' => __('Deferred payment', 'best2pay-payment_method'),153 //'type' => 'select',154 //'options' => array(155 //'1' => __('On', 'best2pay-payment_method'),156 //'0' => __('Off', 'best2pay-payment_method')157 //),158 //'description' => __('Making of an email message with a link to payment (payment is not carried out)', 'best2pay-payment_method')159 ) 172 ), 173 /*'deferred' => array( 174 'title' => __('Deferred payment', 'best2pay-payment_method'), 175 'type' => 'select', 176 'options' => array( 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 )*/ 160 182 ); 161 183 … … 183 205 if ($this->testmode == "0") 184 206 $best2pay_url = "https://pay.best2pay.net"; 185 $best2pay_operation = "Purchase"; 186 if ($this->twostepsmode == "1") 187 $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 } 188 220 189 221 $signature = base64_encode(md5($this->sector . intval($order->get_total() * 100) . $currency . $this->password)); … … 193 225 $fiscalPositions = ''; 194 226 $fiscalAmount = 0; 195 $KKT = true; 196 197 if ($KKT) { 198 foreach ($items as $item_id => $item) { 199 $item_data = $item->get_data(); 200 $fiscalPositions .= $item_data['quantity'] . ';'; 201 $elementPrice = $item->get_product()->get_price() * 100; 202 $fiscalPositions .= $elementPrice . ';'; 203 $fiscalPositions .= ($item_data['total_tax']) ?: 6 . ';'; // tax 204 $fiscalPositions .= str_ireplace([';', '|'], '', $item_data['name']) . '|'; 205 206 $fiscalAmount += $item_data['quantity'] * $elementPrice; 207 } 208 if ($wc_order->get_shipping_total()) { 209 $fiscalPositions .= '1;' . $wc_order->get_shipping_total() * 100 . ';6;Доставка|'; 210 $fiscalAmount += $wc_order->get_shipping_total() * 100; 211 } 212 $fiscalDiff = abs($fiscalAmount - intval($order->get_total() * 100)); 213 if ($fiscalDiff) { 214 $fiscalPositions .= '1;' . $fiscalDiff . ';6;Скидка;14|'; 215 } 216 $fiscalPositions = substr($fiscalPositions, 0, -1); 217 } 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); 218 247 219 248 $args = array( … … 225 254 'description' => sprintf(__('Order #%s', 'best2pay-payment_method'), ltrim($order->get_order_number(), '#')), 226 255 'email' => $order->get_billing_email(), 227 //'notify_customer' => ($this->deferred) ? 1 : 0,256 // 'notify_customer' => ($this->deferred) ? 1 : 0, 228 257 'currency' => $currency, 229 258 'mode' => 1, … … 233 262 ); 234 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 235 278 $remote_post = wp_remote_post($best2pay_url . '/webapi/Register', $args); 236 279 $remote_post = (isset($remote_post['body'])) ? $remote_post['body'] : $remote_post; … … 247 290 $signature = base64_encode(md5($this->sector . $b2p_order_id . $this->password)); 248 291 249 // $order->update_status('on-hold'); 250 251 // if ($this->deferred) { 252 // wp_redirect($this->get_return_url($wc_order)); 253 // exit(); 254 // } 255 256 if(intval($this->halvaparts) == 0){ 257 $best2pay_operation = 'custom/svkb/PurchaseWithInstallment'; 258 } 292 $order->update_status('on-hold'); 293 294 /*if ($this->deferred) { 295 wp_redirect($this->get_return_url($wc_order)); 296 exit(); 297 }*/ 259 298 260 299 return array( … … 402 441 return false; 403 442 404 if ($order->get_date_paid())443 if ($order->get_date_paid()) 405 444 exit(); 406 445 … … 438 477 * @param array $details 439 478 */ 440 public function logIt (string $message, array $details = []) { 479 public function logIt(string $message, array $details = []) 480 { 441 481 $log = fopen($this->getLogFileName(), 'a+') or die("logging trouble"); 442 482 $date = date("d.m.y H:i:s"); … … 446 486 } 447 487 $msg .= "\n\n\n"; 448 fprintf($log, chr(0xEF) .chr(0xBB).chr(0xBF));488 fprintf($log, chr(0xEF) . chr(0xBB) . chr(0xBF)); 449 489 fwrite($log, $msg); 450 490 fclose($log); 451 491 } 452 492 453 public function getLogFileName () { 493 public function getLogFileName() 494 { 454 495 $signature = base64_encode($this->sector . $this->password . $_SERVER['HTTP_HOST']); 455 496 $signature = str_ireplace('=', '', $signature); -
best2pay-payment-method-visamastercard/languages/best2pay-payment_method-ru_RU.po
r2818298 r2837763 8 8 "Report-Msgid-Bugs-To: \n" 9 9 "POT-Creation-Date: 2015-12-15 04:38+0300\n" 10 "PO-Revision-Date: 2022-1 1-07 14:20+0000\n"10 "PO-Revision-Date: 2022-10-25 06:15+0000\n" 11 11 "Last-Translator: \n" 12 12 "Language-Team: Русский\n" … … 21 21 "X-Loco-Version: 2.6.2; wp-6.0.3" 22 22 23 #: best2pay-payment_method.php:3 5123 #: best2pay-payment_method.php:346 24 24 msgid "." 25 25 msgstr "" 26 26 27 #: best2pay-payment_method.php:14 627 #: best2pay-payment_method.php:143 28 28 msgid "2 steps payment mode" 29 29 msgstr "Двухстадийная оплата" … … 31 31 #. Author of the plugin 32 32 #: best2pay-payment_method.php:53 best2pay-payment_method.php:54 33 #: best2pay-payment_method.php:8 533 #: best2pay-payment_method.php:84 34 34 msgid "Best2Pay" 35 35 msgstr "Best2Pay" … … 39 39 msgstr "Оплата с Best2Pay (Виза/МастерКард)" 40 40 41 #: best2pay-payment_method.php:107 41 #: best2pay-payment_method.php:152 42 msgid "Deferred payment" 43 msgstr "Отсроченный платёж" 44 45 #: best2pay-payment_method.php:106 42 46 msgid "Enable Best2Pay checkout method" 43 47 msgstr "Включить использование метода платежа Best2Pay" 44 48 45 #: best2pay-payment_method.php:10 549 #: best2pay-payment_method.php:104 46 50 msgid "Enable/Disable" 47 51 msgstr "Включить/Выключить" 48 49 #: best2pay-payment_method.php:14150 #, fuzzy51 #| msgid "fast payment system"52 msgid "Fast payment system"53 msgstr "Система быстрых платежей"54 55 #: best2pay-payment_method.php:14056 #, fuzzy57 #| msgid "halva-parts"58 msgid "Halva Chastyami"59 msgstr "Халва Частями"60 52 61 53 #. URI of the plugin … … 63 55 msgstr "http://best2pay.net/" 64 56 65 #: best2pay-payment_method.php:139 66 #, fuzzy 67 #| msgid "internet-acquiring" 68 msgid "Internet-acquiring" 69 msgstr "Интернет-эквайринг" 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 "проводится)" 70 64 71 #: best2pay-payment_method.php:150 65 #: best2pay-payment_method.php:137 66 msgid "No" 67 msgstr "Нет" 68 69 #: best2pay-payment_method.php:147 best2pay-payment_method.php:156 72 70 msgid "Off" 73 71 msgstr "Выкл" 74 72 75 #: best2pay-payment_method.php:14 973 #: best2pay-payment_method.php:146 best2pay-payment_method.php:155 76 74 msgid "On" 77 75 msgstr "Вкл" 78 76 79 #: best2pay-payment_method.php:228 77 #: best2pay-payment_method.php:134 78 msgid "Only Halva parts" 79 msgstr "Только Халва Частями" 80 81 #: best2pay-payment_method.php:225 80 82 #, php-format 81 83 msgid "Order #%s" 82 84 msgstr "Заказ #%s" 83 85 84 #: best2pay-payment_method.php:11 986 #: best2pay-payment_method.php:118 85 87 msgid "Password" 86 88 msgstr "Пароль" 87 89 88 #: best2pay-payment_method.php:12 190 #: best2pay-payment_method.php:120 89 91 msgid "Password to use for digital signature" 90 92 msgstr "Пароль для цифровой подписи" 91 93 92 #: best2pay-payment_method.php:4 2594 #: best2pay-payment_method.php:417 93 95 msgid "Payment completed." 94 96 msgstr "Платеж завершен." 95 97 96 #: best2pay-payment_method.php:136 97 msgid "Payment method" 98 msgstr "Метод оплаты" 99 100 #: best2pay-payment_method.php:55 best2pay-payment_method.php:86 98 #: best2pay-payment_method.php:55 best2pay-payment_method.php:85 101 99 msgid "" 102 100 "Payments with bank cards via the <a href=\"http://www.best2pay.net\" " … … 106 104 "href=\"http://www.best2pay.net\" target=\"_blank\">Best2Pay</a>." 107 105 108 #: best2pay-payment_method.php:1 30106 #: best2pay-payment_method.php:129 109 107 msgid "Production mode - payments will be processed" 110 108 msgstr "Рабочий режим - средства списываются с карты" … … 118 116 "помощью системы Best2Pay" 119 117 120 #: best2pay-payment_method.php:11 2118 #: best2pay-payment_method.php:111 121 119 msgid "Sector ID" 122 120 msgstr "ID сектора" 123 121 124 #: best2pay-payment_method.php:13 2122 #: best2pay-payment_method.php:131 125 123 msgid "Select test or live mode" 126 124 msgstr "Выберите тестовый или рабочий режим" 127 125 128 #: best2pay-payment_method.php:12 6126 #: best2pay-payment_method.php:125 129 127 msgid "Test Mode" 130 128 msgstr "Тестовый режим" 131 129 132 #: best2pay-payment_method.php:12 9130 #: best2pay-payment_method.php:128 133 131 msgid "Test mode - real payments will not be processed" 134 132 msgstr "Тестовый режим - средства не списываются с карты" 135 133 136 #: best2pay-payment_method.php:14 3134 #: best2pay-payment_method.php:140 137 135 msgid "" 138 "The module works only for paying for Halva Chastyami or only SPB(QR) or"139 " Payform(cards and other avaible methods)"136 "The module works only for paying for Halva Parts, other payment methods are " 137 "disabled" 140 138 msgstr "" 141 "Модуль работает только для оплаты Халва Частями или СБП(QR) или форма"142 "о платы(интернет-эквайринг и другие доступные способы)"139 "Модуль работает только на оплату Халвой Частями, иные способы оплаты " 140 "отключены" 143 141 144 #: best2pay-payment_method.php:3 53142 #: best2pay-payment_method.php:348 145 143 msgid "The order wasn't paid [1]: " 146 144 msgstr "Заказ не был оплачен: " 147 145 148 #: best2pay-payment_method.php:38 6146 #: best2pay-payment_method.php:381 149 147 msgid "The order wasn't paid [2]: " 150 148 msgstr "Заказ не был оплачен: " 151 149 152 #: best2pay-payment_method.php:28 6 best2pay-payment_method.php:288150 #: best2pay-payment_method.php:281 best2pay-payment_method.php:283 153 151 msgid "The order wasn't paid." 154 152 msgstr "Заказ не был оплачен." 155 153 156 #: best2pay-payment_method.php:1 52154 #: best2pay-payment_method.php:149 157 155 msgid "Turn on 2 steps mode" 158 156 msgstr "Включён режим двухстадийной оплаты" 159 157 160 #: best2pay-payment_method.php:114 158 #: best2pay-payment_method.php:138 159 msgid "Yes" 160 msgstr "Да" 161 162 #: best2pay-payment_method.php:113 161 163 msgid "Your shop identifier at Best2Pay" 162 164 msgstr "Идентификатор вашего магазина в системе Best2Pay" 165 166 #: best2pay-payment_method.php:144 167 msgid "Payment mode" 168 msgstr "Идентификатор вашего магазина в системе Best2Pay" 169 -
best2pay-payment-method-visamastercard/readme.txt
r2811190 r2837763 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.