Plugin Directory

Changeset 2576337


Ignore:
Timestamp:
08/02/2021 09:52:30 AM (4 years ago)
Author:
best2pay
Message:

log errors

Location:
best2pay-payment-method-visamastercard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • best2pay-payment-method-visamastercard/best2pay-payment_method.php

    r2534234 r2576337  
    11<?php
    22/* 
    3     This program is free software; you can redistribute it and/or modify
    4     it under the terms of the GNU General Public License, version 2, as
    5     published by the Free Software Foundation.
    6 
    7     This program is distributed in the hope that it will be useful,
    8     but WITHOUT ANY WARRANTY; without even the implied warranty of
    9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    10     GNU General Public License for more details.
    11 
    12     You should have received a copy of the GNU General Public License
    13     along with this program; if not, write to the Free Software
    14     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     3    This program is free software; you can redistribute it and/or modify
     4    it under the terms of the GNU General Public License, version 2, as
     5    published by the Free Software Foundation.
     6
     7    This program is distributed in the hope that it will be useful,
     8    but WITHOUT ANY WARRANTY; without even the implied warranty of
     9    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10    GNU General Public License for more details.
     11
     12    You should have received a copy of the GNU General Public License
     13    along with this program; if not, write to the Free Software
     14    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1515*/
    1616/**
     
    1818 * Plugin URI: http://best2pay.net/
    1919 * Description: Receive payments via Visa/Mastercard easily with Best2Pay bank cards processing
    20  * Version: 1.1.1
     20 * Version: 1.1.2
    2121 * Author: Best2Pay
    2222 * Tested up to: 5.7.1
     
    218218
    219219            if (intval($b2p_order_id) == 0) {
     220                $request_body = $args['body'];
     221                $request_body['email'] = ($request_body['email']) ? 'isset' : 'isnotset';
     222                $request_body['signature'] = ($request_body['signature']) ? 'isset' : 'isnotset';
     223                $this->logIt('Не удалось зарегистрировать заказ', array('b2p_order_id' => $b2p_order_id, 'request_body' => $request_body));
    220224                return false;
    221225            }
     
    396400        }
    397401
     402
     403        /**
     404         * @param string $message
     405         * @param array $details
     406         */
     407        public function logIt (string $message, array $details = []) {
     408            $log = fopen($this->getLogFileName(), 'a+') or die("logging trouble");
     409            $date = date("d.m.y H:i:s");
     410            $msg = "\n" . $date . "\t" . $message;
     411            if ($details) {
     412                $msg .= "\n" . print_r($details, true);
     413            }
     414            fwrite($log, $msg);
     415            fclose($log);
     416        }
     417
     418        public function getLogFileName () {
     419            $signature = base64_encode($this->sector . $this->password . $_SERVER['HTTP_HOST']);
     420            $signature = str_ireplace('=', '', $signature);
     421            return 'b2p_log_' . $signature . '.txt';
     422        }
     423
    398424    } // class
    399425
  • best2pay-payment-method-visamastercard/readme.txt

    r2534234 r2576337  
    55Requires at least: 4.7
    66Requires PHP: 7.0
    7 Stable tag: 1.1.1
     7Stable tag: 1.1.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
  • best2pay-payment-method-visamastercard/trunk/best2pay-payment_method.php

    r2534234 r2576337  
    1818 * Plugin URI: http://best2pay.net/
    1919 * Description: Receive payments via Visa/Mastercard easily with Best2Pay bank cards processing
    20  * Version: 1.1.1
     20 * Version: 1.1.2
    2121 * Author: Best2Pay
    2222 * Tested up to: 5.7.1
     
    218218
    219219            if (intval($b2p_order_id) == 0) {
     220                $request_body = $args['body'];
     221                $request_body['email'] = ($request_body['email']) ? 'isset' : 'isnotset';
     222                $request_body['signature'] = ($request_body['signature']) ? 'isset' : 'isnotset';
     223                $this->logIt('Не удалось зарегистрировать заказ', array('b2p_order_id' => $b2p_order_id, 'request_body' => $request_body));
    220224                return false;
    221225            }
     
    396400        }
    397401
     402
     403        /**
     404         * @param string $message
     405         * @param array $details
     406         */
     407        public function logIt (string $message, array $details = []) {
     408            $log = fopen($this->getLogFileName(), 'a+') or die("logging trouble");
     409            $date = date("d.m.y H:i:s");
     410            $msg = "\n" . $date . "\t" . $message;
     411            if ($details) {
     412                $msg .= "\n" . print_r($details, true);
     413            }
     414            fwrite($log, $msg);
     415            fclose($log);
     416        }
     417
     418        public function getLogFileName () {
     419            $signature = base64_encode($this->sector . $this->password . $_SERVER['HTTP_HOST']);
     420            $signature = str_ireplace('=', '', $signature);
     421            return 'b2p_log_' . $signature . '.txt';
     422        }
     423
    398424    } // class
    399425
Note: See TracChangeset for help on using the changeset viewer.