Plugin Directory

Changeset 2346759


Ignore:
Timestamp:
07/26/2020 03:45:57 PM (6 years ago)
Author:
alonezcount
Message:

improve error email
extend session

Location:
ezcount/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ezcount/trunk/EZcount.php

    r2338153 r2346759  
    44 * Plugin URI:
    55 * Description: invoicing, clearing and paypal integration plugin.
    6  * Version: 1.8.2
     6 * Version: 1.8.3
    77 * Author: EZcount
    88 * Author URI:
     
    333333
    334334            $secretTransactionId = WC()->session->get( 'transaction_id:' . $_GET['tab_id'] );
    335             if ( ! $secretTransactionId ) {
    336                 $msg = "בעיה באישור הזמנה $order_id, לא הצלחנו לבצע אישור מול חברת האשראי לסליקה, ההזמנה נכנסה לhold אנא בדקו מול חברת האשראי האם הכסף נכנס. \n<br/>
    337                 Order ($order_id) transaction Id is empty, can't validate payment\n<br/>" .
     335            if ( ! $secretTransactionId) {
     336                $msg = "בעיה באישור הזמנה $order_id, לא הצלחנו לבצע אישור מול חברת האשראי לסליקה, ההזמנה נכנסה לhold אנא בדקו מול חברת האשראי האם הכסף נכנס. \n<br/>\n
     337                נראה שהמשתמשים שלכם מאבדים את הsession אנא בדקו את אורך הsession ועקבו אחרי המאמר הבא כדי לטפל בבעיות נפוצות של איבוד session.
     338                it's seems the user lost the session, please check your session settings using the next article\n<br/>\n
     339                https://en.blogpascher.com/wordpress-tutorial/How-correct-the-loss-of-session-on-wordpress\n<br/>\n
     340                \n
     341                Order ($order_id) transaction Id is empty, can't validate payment \n<br/>\n" .
    338342                       json_encode( [
    339                                         'order_id'             => $_GET['order_id'],
    340                                         'tab_id'                => $_GET['tab_id'],
     343                                        'order_id'            => $_GET['order_id'],
     344                                        'tab_id'              => $_GET['tab_id'],
     345                                        'timezone'            => date_default_timezone_get(),
     346                                        'server_date'         => date(DATE_ATOM),
    341347                                        'secretTransactionId' => $secretTransactionId,
    342348                                        '$_SERVER'            => $_SERVER
     
    543549    }
    544550
     551    /**
     552     * We need longer sessions so we add this filters
     553     */
     554    //https://stackoverflow.com/a/39707517/2992810
     555    // https://github.com/ericmann/wp-session-manager/issues/25#issuecomment-299819341
     556    add_action( 'plugins_loaded',
     557        function () {
     558            add_filter( 'wp_session_expiration',
     559                function () {
     560                    return 48 * 60 * 60;
     561                } );
     562            add_filter( 'wp_session_expiration_variant',
     563                function () {
     564                    return 46 * 60 * 60;
     565                } );
     566        },
     567                1 );
     568    // not sure which of them will do the job..
     569    // https://stackoverflow.com/a/62241135/2992810
     570    add_filter( 'wc_session_expiring', 'wc_custom_session_expiring' );
     571    add_filter( 'wc_session_expiration', 'wc_custom_session_expiring' );
     572    function wc_custom_session_expiring( $expiry ) {
     573        return 60 * 60 * 48;
     574    }
     575
     576    // load the ezcount gateway
    545577    add_filter( 'woocommerce_payment_gateways', 'add_ezcount_gateway' );
    546578}
  • ezcount/trunk/readme.txt

    r2338153 r2346759  
    44Tags        : Invoicing and clearing for Woocommerce, by EasyCount.
    55Tested up to: 4.9.8
    6 Version     : 1.8.2
     6Version     : 1.8.3
    77Stable tag: trunk
    88Requires PHP: 5.4
Note: See TracChangeset for help on using the changeset viewer.