Plugin Directory


Ignore:
Location:
woo-wallet/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • woo-wallet/trunk/includes/class-woo-wallet-ajax.php

    r2816610 r2817824  
    11<?php
    22/**
    33 * Plugin ajax file
    44 *
    55 * @package WooWallet
    66 */
    77
    88if ( ! defined( 'ABSPATH' ) ) {
    99    exit; // Exit if accessed directly.
    1010}
    1111if ( ! class_exists( 'Woo_Wallet_Ajax' ) ) {
    1212    /**
    1313     * Plugin Ajax class
    1414     */
    1515    class Woo_Wallet_Ajax {
    1616
    1717        /**
    1818         * The single instance of the class.
    1919         *
    2020         * @var Woo_Wallet_Ajax
    2121         * @since 1.1.10
    2222         */
    2323        protected static $_instance = null;
    2424
    2525        /**
    2626         * Main instance
    2727         *
    2828         * @return class object
    2929         */
    3030        public static function instance() {
    3131            if ( is_null( self::$_instance ) ) {
    3232                self::$_instance = new self();
    3333            }
    3434            return self::$_instance;
    3535        }
    3636
    3737        /**
    3838         * Class constructor
    3939         */
    4040        public function __construct() {
    4141            add_action( 'wp_ajax_woo_wallet_order_refund', array( $this, 'woo_wallet_order_refund' ) );
    4242            add_action( 'wp_ajax_woocommerce_wallet_rated', array( $this, 'woocommerce_wallet_rated' ) );
    4343            add_action( 'wp_ajax_woo-wallet-user-search', array( $this, 'woo_wallet_user_search' ) );
    4444            add_action( 'wp_ajax_woo_wallet_partial_payment_update_session', array( $this, 'woo_wallet_partial_payment_update_session' ) );
    4545            add_action( 'wp_ajax_woo_wallet_refund_partial_payment', array( $this, 'woo_wallet_refund_partial_payment' ) );
    4646            add_action( 'wp_ajax_woo-wallet-dismiss-promotional-notice', array( $this, 'woo_wallet_dismiss_promotional_notice' ) );
    4747            add_action( 'wp_ajax_draw_wallet_transaction_details_table', array( $this, 'draw_wallet_transaction_details_table' ) );
    4848
    4949            add_action( 'woocommerce_order_after_calculate_totals', array( $this, 'recalculate_order_cashback_after_calculate_totals' ), 10, 2 );
    5050
    5151            add_action( 'wp_ajax_terawallet_export_user_search', array( $this, 'terawallet_export_user_search' ) );
    5252
    5353            add_action( 'wp_ajax_terawallet_do_ajax_transaction_export', array( $this, 'terawallet_do_ajax_transaction_export' ) );
    5454
    5555            add_action( 'wp_ajax_lock_unlock_terawallet', array( $this, 'lock_unlock_terawallet' ) );
    5656        }
    5757        /**
    5858         * Lock / Unlock user wallet
    5959         *
    6060         * @return void
    6161         */
    6262        public function lock_unlock_terawallet() {
    6363            check_ajax_referer( 'lock-unlock-nonce', 'security' );
    6464            $user_id = isset( $_POST['user_id'] ) ? sanitize_text_field( wp_unslash( $_POST['user_id'] ) ) : 0;
    6565            $type    = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';
     66            if ( ! current_user_can( 'edit_user', $user_id ) ) {
     67                wp_die( -1 );
     68            }
    6669            if ( 'lock' === $type ) {
    6770                update_user_meta( $user_id, '_is_wallet_locked', true );
    6871                wp_send_json_success(
    6972                    array(
    7073                        'type' => 'unlock',
    7174                        'text' => __(
    7275                            'Unlock',
    7376                            'woo-wallet'
    7477                        ),
    7578                    )
    7679                );
    7780            } else {
    7881                delete_user_meta( $user_id, '_is_wallet_locked' );
    7982                wp_send_json_success(
    8083                    array(
    8184                        'type' => 'lock',
    8285                        'text' => __(
    8386                            'Lock',
    8487                            'woo-wallet'
    8588                        ),
    8689                    )
    8790                );
    8891            }
    8992        }
    9093        /**
    9194         * Generate export CSV file.
    9295         */
    9396        public function terawallet_do_ajax_transaction_export() {
    9497            check_ajax_referer( 'terawallet-exporter-script', 'security' );
    9598            include_once WOO_WALLET_ABSPATH . 'includes/export/class-terawallet-csv-exporter.php';
    9699            $step = isset( $_POST['step'] ) ? absint( $_POST['step'] ) : 1;
    97100
    98101            $exporter = new TeraWallet_CSV_Exporter();
    99102
    100103            $exporter->set_step( $step );
    101104
    102105            if ( ! empty( $_POST['selected_columns'] ) ) {
    103106                $exporter->set_columns_to_export( wp_unslash( $_POST['selected_columns'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    104107            }
    105108
    106109            if ( ! empty( $_POST['selected_users'] ) ) {
    107110                $exporter->set_users_to_export( wp_unslash( $_POST['selected_users'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    108111            }
    109112
    110113            if ( ! empty( $_POST['start_date'] ) ) {
    111114                $exporter->set_start_date( sanitize_text_field( wp_unslash( $_POST['start_date'] ) ) );
    112115            }
    113116
    114117            if ( ! empty( $_POST['end_date'] ) ) {
    115118                $exporter->set_end_date( sanitize_text_field( wp_unslash( $_POST['end_date'] ) ) );
    116119            }
    117120
    118121            if ( ! empty( $_POST['filename'] ) ) {
    119122                $exporter->set_filename( sanitize_text_field( wp_unslash( $_POST['filename'] ) ) );
    120123            }
    121124            $exporter->write_to_csv();
    122125            $query_args = array(
    123126                'nonce'    => wp_create_nonce( 'terawallet-transaction-csv' ),
    124127                'action'   => 'download_export_csv',
    125128                'filename' => $exporter->get_filename(),
    126129            );
    127130            if ( $exporter->get_percent_complete() >= 100 ) {
    128131                wp_send_json_success(
    129132                    array(
    130133                        'step'       => 'done',
    131134                        'percentage' => 100,
    132135                        'url'        => add_query_arg( $query_args, admin_url( 'admin.php?page=terawallet-exporter' ) ),
    133136                    )
    134137                );
    135138            } else {
    136139                wp_send_json_success(
    137140                    array(
    138141                        'step'       => ++$step,
    139142                        'percentage' => $exporter->get_percent_complete(),
    140143                        'columns'    => '',
    141144                    )
    142145                );
    143146            }
    144147        }
    145148
    146149        /**
    147150         * Search users for export transactions.
    148151         */
    149152        public function terawallet_export_user_search() {
    150153            check_ajax_referer( 'search-user', 'security' );
    151154            $term    = isset( $_POST['term'] ) ? sanitize_text_field( wp_unslash( $_POST['term'] ) ) : '';
    152155            $return  = array();
    153156            $blog_id = isset( $_POST['site_id'] ) ? sanitize_text_field( wp_unslash( $_POST['site_id'] ) ) : get_current_blog_id();
    154157
    155158            $users = get_users(
    156159                array(
    157160                    'blog_id'        => $blog_id,
    158161                    'search'         => '*' . $term . '*',
    159162                    'search_columns' => array( 'user_login', 'user_nicename', 'user_email' ),
    160163                )
    161164            );
    162165
    163166            foreach ( $users as $user ) {
    164167                $return[] = array(
    165168                    /* translators: 1: user_login, 2: user_email */
    166169                    'label' => sprintf( _x( '%1$s (%2$s)', 'user autocomplete result', 'woo-wallet' ), $user->user_login, $user->user_email ),
    167170                    'value' => $user->ID,
    168171                );
    169172            }
    170173            wp_send_json( $return );
    171174        }
    172175
    173176        /**
    174177         * Recalculate and send order cashback.
    175178         *
    176179         * @param Bool     $and_taxes Description.
    177180         * @param WC_Order $order order.
    178181         */
    179182        public function recalculate_order_cashback_after_calculate_totals( $and_taxes, $order ) {
    180183            $cashback_amount = woo_wallet()->cashback->calculate_cashback( false, $order->get_id(), true );
    181184            $transaction_id  = get_post_meta( $order->get_id(), '_general_cashback_transaction_id', true );
    182185            if ( $transaction_id ) {
    183186                update_wallet_transaction( $transaction_id, $order->get_customer_id(), array( 'amount' => $cashback_amount ), array( '%f' ) );
    184187            }
    185188        }
    186189
    187190        /**
    188191         * Wallet partial payment refund.
    189192         */
    190193        public function woo_wallet_refund_partial_payment() {
    191194            if ( ! current_user_can( 'edit_shop_orders' ) ) {
    192195                wp_die( -1 );
    193196            }
    194197            $response               = array( 'success' => false );
    195198            $order_id               = absint( filter_input( INPUT_POST, 'order_id' ) );
    196199            $order                  = wc_get_order( $order_id );
    197200            $partial_payment_amount = get_order_partial_payment_amount( $order_id );
    198201            $transaction_id         = woo_wallet()->wallet->credit( $order->get_customer_id(), $partial_payment_amount, __( 'Wallet refund #', 'woo-wallet' ) . $order->get_order_number() );
    199202            if ( $transaction_id ) {
    200203                $response['success'] = true;
    201204                /* translators: wallet amount */
    202205                $order->add_order_note( sprintf( __( '%s refunded to customer wallet', 'woo-wallet' ), wc_price( $partial_payment_amount, woo_wallet_wc_price_args( $order->get_customer_id() ) ) ) );
    203206                update_post_meta( $order_id, '_woo_wallet_partial_payment_refunded', true );
    204207                update_post_meta( $order_id, '_partial_payment_refund_id', $transaction_id );
    205208                do_action( 'woo_wallet_partial_order_refunded', $order_id, $transaction_id );
    206209            }
    207210            wp_send_json( $response );
    208211        }
    209212
    210213        /**
    211214         * Process refund through wallet
    212215         *
    213216         * @throws Exception To return errors.
    214217         */
    215218        public function woo_wallet_order_refund() {
    216219            ob_start();
    217220            check_ajax_referer( 'order-item', 'security' );
    218221            if ( ! current_user_can( 'edit_shop_orders' ) ) {
    219222                wp_die( -1 );
    220223            }
    221224            $order_id               = isset( $_POST['order_id'] ) ? absint( $_POST['order_id'] ) : 0;
    222225            $refund_amount          = isset( $_POST['refund_amount'] ) ? wc_format_decimal( sanitize_text_field( wp_unslash( $_POST['refund_amount'] ) ), wc_get_price_decimals() ) : 0;
    223226            $refunded_amount        = isset( $_POST['refunded_amount'] ) ? wc_format_decimal( sanitize_text_field( wp_unslash( $_POST['refunded_amount'] ) ), wc_get_price_decimals() ) : 0;
    224227            $refund_reason          = isset( $_POST['refund_reason'] ) ? sanitize_text_field( wp_unslash( $_POST['refund_reason'] ) ) : '';
    225228            $line_item_qtys         = isset( $_POST['line_item_qtys'] ) ? array_map( 'intval', json_decode( sanitize_text_field( wp_unslash( $_POST['line_item_qtys'] ) ), true ) ) : array();
    226229            $line_item_totals       = isset( $_POST['line_item_totals'] ) ? array_map( 'floatval', json_decode( sanitize_text_field( wp_unslash( $_POST['line_item_totals'] ) ), true ) ) : array();
    227230            $line_item_tax_totals   = isset( $_POST['line_item_tax_totals'] ) ? array_map( 'floatval', json_decode( sanitize_text_field( wp_unslash( $_POST['line_item_tax_totals'] ) ), true ) ) : array();
    228231            $api_refund             = isset( $_POST['api_refund'] ) && 'true' === $_POST['api_refund'];
    229232            $restock_refunded_items = isset( $_POST['restock_refunded_items'] ) && 'true' === $_POST['restock_refunded_items'];
    230233            $refund                 = false;
    231234            $response               = array();
    232235            try {
    233236                $order      = wc_get_order( $order_id );
    234237                $max_refund = wc_format_decimal( $order->get_total() - $order->get_total_refunded(), wc_get_price_decimals() );
    235238
    236239                if ( ( ! $refund_amount && ( wc_format_decimal( 0, wc_get_price_decimals() ) !== $refund_amount ) ) || $max_refund < $refund_amount || 0 > $refund_amount ) {
    237240                    throw new Exception( __( 'Invalid refund amount', 'woocommerce' ) );
    238241                }
    239242
    240243                if ( wc_format_decimal( $order->get_total_refunded(), wc_get_price_decimals() ) !== $refunded_amount ) {
    241244                    throw new Exception( __( 'Error processing refund. Please try again.', 'woocommerce' ) );
    242245                }
    243246
    244247                // Prepare line items which we are refunding.
    245248                $line_items = array();
    246249                $item_ids   = array_unique( array_merge( array_keys( $line_item_qtys ), array_keys( $line_item_totals ) ) );
    247250
    248251                foreach ( $item_ids as $item_id ) {
    249252                    $line_items[ $item_id ] = array(
    250253                        'qty'          => 0,
    251254                        'refund_total' => 0,
    252255                        'refund_tax'   => array(),
    253256                    );
    254257                }
    255258                foreach ( $line_item_qtys as $item_id => $qty ) {
    256259                    $line_items[ $item_id ]['qty'] = max( $qty, 0 );
    257260                }
    258261                foreach ( $line_item_totals as $item_id => $total ) {
    259262                    $line_items[ $item_id ]['refund_total'] = wc_format_decimal( $total );
    260263                }
    261264                foreach ( $line_item_tax_totals as $item_id => $tax_totals ) {
    262265                    $line_items[ $item_id ]['refund_tax'] = array_filter( array_map( 'wc_format_decimal', $tax_totals ) );
    263266                }
    264267
    265268                // Create the refund object.
    266269                $refund = wc_create_refund(
    267270                    array(
    268271                        'amount'         => $refund_amount,
    269272                        'reason'         => $refund_reason,
    270273                        'order_id'       => $order_id,
    271274                        'line_items'     => $line_items,
    272275                        'refund_payment' => $api_refund,
    273276                        'restock_items'  => $restock_refunded_items,
    274277                    )
    275278                );
    276279                if ( ! is_wp_error( $refund ) ) {
    277280                    $transaction_id = woo_wallet()->wallet->credit( $order->get_customer_id(), $refund_amount, $refund_reason );
    278281                    if ( ! $transaction_id ) {
    279282                        throw new Exception( __( 'Refund not credited to customer', 'woo-wallet' ) );
    280283                    } else {
    281284                        do_action( 'woo_wallet_order_refunded', $order, $refund, $transaction_id );
    282285                    }
    283286                }
    284287
    285288                if ( is_wp_error( $refund ) ) {
    286289                    throw new Exception( $refund->get_error_message() );
    287290                }
    288291
    289292                if ( did_action( 'woocommerce_order_fully_refunded' ) ) {
    290293                    $response['status'] = 'fully_refunded';
    291294                }
    292295            } catch ( Exception $e ) {
    293296                wp_send_json_error( array( 'error' => $e->getMessage() ) );
    294297            }
    295298            // wp_send_json_success must be outside the try block not to break phpunit tests.
    296299            wp_send_json_success( $response );
    297300        }
    298301
    299302        /**
    300303         * Mark wallet rated.
    301304         */
    302305        public function woocommerce_wallet_rated() {
    303306            if ( current_user_can( 'manage_options' ) ) {
    304307                update_option( 'woocommerce_wallet_admin_footer_text_rated', true );
    305308            }
    306309            die;
    307310        }
    308311
    309312        /**
    310313         * Search users
    311314         */
    312315        public function woo_wallet_user_search() {
    313316            check_ajax_referer( 'search-user', 'security' );
    314317            $return = array();
    315318            $term   = isset( $_POST['term'] ) ? sanitize_text_field( wp_unslash( $_POST['term'] ) ) : '';
    316319            if ( apply_filters( 'woo_wallet_user_search_exact_match', true ) ) {
    317320                $user = get_user_by( apply_filters( 'woo_wallet_user_search_by', 'email' ), $term );
    318321                if ( $user && wp_get_current_user()->user_email !== $user->user_email ) {
    319322                    $return[] = array(
    320323                        /* translators: 1: user_login, 2: user_email */
    321324                        'label' => sprintf( _x( '%1$s (%2$s)', 'user autocomplete result', 'woo-wallet' ), $user->user_login, $user->user_email ),
    322325                        'value' => $user->ID,
    323326                    );
    324327                }
    325328            } else {
    326329                $blog_id = isset( $_POST['site_id'] ) ? sanitize_text_field( wp_unslash( $_POST['site_id'] ) ) : get_current_blog_id();
    327330
    328331                $users = get_users(
    329332                    array(
    330333                        'blog_id'        => $blog_id,
    331334                        'search'         => '*' . $term . '*',
    332335                        'exclude'        => array( get_current_user_id() ),
    333336                        'search_columns' => array( 'user_login', 'user_nicename', 'user_email' ),
    334337                    )
    335338                );
    336339
    337340                foreach ( $users as $user ) {
    338341                    $return[] = array(
    339342                        /* translators: 1: user_login, 2: user_email */
    340343                        'label' => sprintf( _x( '%1$s (%2$s)', 'user autocomplete result', 'woo-wallet' ), $user->user_login, $user->user_email ),
    341344                        'value' => $user->ID,
    342345                    );
    343346                }
    344347            }
    345348            wp_send_json( $return );
    346349        }
    347350        /**
    348351         * Update partial payment session.
    349352         *
    350353         * @return void
    351354         */
    352355        public function woo_wallet_partial_payment_update_session() {
    353356            if ( isset( $_POST['checked'] ) && 'true' === $_POST['checked'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
    354357                update_wallet_partial_payment_session( true );
    355358            } else {
    356359                update_wallet_partial_payment_session();
    357360            }
    358361            wp_die();
    359362        }
    360363        /**
    361364         * Dismiss wallet promotonal message.
    362365         *
    363366         * @return void
    364367         */
    365368        public function woo_wallet_dismiss_promotional_notice() {
    366369            if ( ! current_user_can( 'manage_options' ) ) {
    367370                wp_send_json_error( __( 'You have no permission to do that', 'woo-wallet' ) );
    368371            }
    369372
    370373            if ( isset( $_POST['nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'woo_wallet_admin' ) ) {
    371374                wp_send_json_error( __( 'Invalid nonce', 'woo-wallet' ) );
    372375            }
    373376            update_option( '_woo_wallet_promotion_dismissed', true );
    374377            wp_send_json_success();
    375378        }
    376379
    377380        /**
    378381         * Send wallet transaction AJAX response.
    379382         */
    380383        public function draw_wallet_transaction_details_table() {
    381384            check_ajax_referer( 'woo-wallet-transactions', 'security' );
    382385            $start  = isset( $_POST['start'] ) ? sanitize_text_field( wp_unslash( $_POST['start'] ) ) : 0;
    383386            $length = isset( $_POST['length'] ) ? sanitize_text_field( wp_unslash( $_POST['length'] ) ) : 10;
    384387            $search = isset( $_POST['search'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['search'] ) ) : '';
    385388            $args   = array(
    386389                'limit' => "$start, $length",
    387390            );
    388391            if ( isset( $search['value'] ) && ! empty( $search['value'] ) ) {
    389392                $args['where'] = array(
    390393                    array(
    391394                        'key'      => 'date',
    392395                        'value'    => $search['value'] . '%',
    393396                        'operator' => 'LIKE',
    394397                    ),
    395398                );
    396399            }
    397400            $transactions = get_wallet_transactions( $args );
    398401            unset( $args['limit'] );
    399402            $records_total = get_wallet_transactions_count( get_current_user_id() );
    400403
    401404            $response = array(
    402405                'draw'            => isset( $_POST['draw'] ) ? sanitize_text_field( wp_unslash( $_POST['draw'] ) ) : 1,
    403406                'recordsTotal'    => $records_total,
    404407                'recordsFiltered' => count( get_wallet_transactions( $args ) ),
    405408                'data'            => array(),
    406409            );
    407410            if ( $transactions ) {
    408411                foreach ( $transactions as $transaction ) {
    409412                    $response['data'][] = apply_filters(
    410413                        'woo_wallet_transactons_datatable_row_data',
    411414                        array(
    412415                            'id'      => $transaction->transaction_id,
    413416                            'credit'  => 'credit' === $transaction->type ? wc_price( apply_filters( 'woo_wallet_amount', $transaction->amount, $transaction->currency, $transaction->user_id ), woo_wallet_wc_price_args( $transaction->user_id ) ) : ' - ',
    414417                            'debit'   => 'debit' === $transaction->type ? wc_price( apply_filters( 'woo_wallet_amount', $transaction->amount, $transaction->currency, $transaction->user_id ), woo_wallet_wc_price_args( $transaction->user_id ) ) : ' - ',
    415418                            'details' => $transaction->details,
    416419                            'date'    => wc_string_to_datetime( $transaction->date )->date_i18n( wc_date_format() ),
    417420                        ),
    418421                        $transaction
    419422                    );
    420423                }
    421424            }
    422425            wp_send_json( $response );
    423426        }
    424427
    425428    }
    426429
    427430}
    428431Woo_Wallet_Ajax::instance();
  • woo-wallet/trunk/includes/class-woo-wallet-payment-method.php

    r2816610 r2817824  
    11<?php
    22
    33if ( ! defined( 'ABSPATH' ) ) {
    44    exit; // Exit if accessed directly.
    55}
    66if ( class_exists( 'WC_Payment_Gateway' ) ) {
    77
    88    class Woo_Gateway_Wallet_payment extends WC_Payment_Gateway {
    99
    1010        /**
    1111         * Class constructor
    1212         */
    1313        public function __construct() {
    1414            $this->setup_properties();
    1515            $this->supports = array(
    1616                'products',
    1717                'refunds',
    1818                'subscriptions',
    1919                'multiple_subscriptions',
    2020                'subscription_cancellation',
    2121                'subscription_suspension',
    2222                'subscription_reactivation',
    2323                'subscription_amount_changes',
    2424                'subscription_date_changes',
    2525                'subscription_payment_method_change',
    2626                'subscription_payment_method_change_customer',
    2727                'subscription_payment_method_change_admin',
    2828            );
    2929            // Load the settings.
    3030            $this->init_form_fields();
    3131            $this->init_settings();
    3232            // Get settings.
    3333            $this->title        = $this->get_option( 'title' );
    3434            $this->description  = $this->get_option( 'description' );
    3535            $this->instructions = $this->get_option( 'instructions' );
    3636
    3737            add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
    3838            /* support for woocommerce subscription plugin */
    3939            add_action( 'woocommerce_scheduled_subscription_payment_' . $this->id, array( $this, 'scheduled_subscription_payment' ), 10, 2 );
    4040
    4141            add_action( 'woocommerce_pre_payment_complete', array( $this, 'woocommerce_pre_payment_complete' ) );
    4242        }
    4343
    4444        /**
    4545         * Setup general properties for the gateway.
    4646         */
    4747        protected function setup_properties() {
    4848            $this->id                 = 'wallet';
    4949            $this->method_title       = __( 'Wallet', 'woo-wallet' );
    5050            $this->method_description = __( 'Have your customers pay with wallet.', 'woo-wallet' );
    5151            $this->has_fields         = false;
    5252        }
    5353
    5454        /**
    5555         * Initialise Gateway Settings Form Fields.
    5656         */
    5757        public function init_form_fields() {
    5858            $this->form_fields = array(
    5959                'enabled'      => array(
    6060                    'title'       => __( 'Enable/Disable', 'woo-wallet' ),
    6161                    'label'       => __( 'Enable wallet payments', 'woo-wallet' ),
    6262                    'type'        => 'checkbox',
    6363                    'description' => '',
    6464                    'default'     => 'yes',
    6565                ),
    6666                'title'        => array(
    6767                    'title'       => __( 'Title', 'woo-wallet' ),
    6868                    'type'        => 'text',
    6969                    'description' => __( 'This controls the title which the user sees during checkout.', 'woo-wallet' ),
    7070                    'default'     => __( 'Wallet payment', 'woo-wallet' ),
    7171                    'desc_tip'    => true,
    7272                ),
    7373                'description'  => array(
    7474                    'title'       => __( 'Description', 'woo-wallet' ),
    7575                    'type'        => 'textarea',
    7676                    'description' => __( 'Payment method description that the customer will see on your checkout.', 'woo-wallet' ),
    7777                    'default'     => __( 'Pay with wallet.', 'woo-wallet' ),
    7878                    'desc_tip'    => true,
    7979                ),
    8080                'instructions' => array(
    8181                    'title'       => __( 'Instructions', 'woo-wallet' ),
    8282                    'type'        => 'textarea',
    8383                    'description' => __( 'Instructions that will be added to the thank you page.', 'woo-wallet' ),
    8484                    'default'     => __( 'Pay with wallet.', 'woo-wallet' ),
    8585                    'desc_tip'    => true,
    8686                ),
    8787            );
    8888        }
    8989
    9090        /**
    9191         * Is gateway available
    9292         *
    9393         * @return boolean
    9494         */
    9595        public function is_available() {
    9696            if ( is_checkout() ) {
    9797                return apply_filters( 'woo_wallet_payment_is_available', ( parent::is_available() && is_full_payment_through_wallet() && is_user_logged_in() && ! is_enable_wallet_partial_payment() && ! is_wallet_account_locked() ) );
    9898            }
    9999            return parent::is_available();
    100100        }
    101101        /**
    102102         * Display wallet balance as Icon.
    103103         *
    104104         * @return string
    105105         */
    106106        public function get_icon() {
    107107            $current_balance = woo_wallet()->wallet->get_wallet_balance( get_current_user_id() );
    108108            return apply_filters( 'woo_wallet_gateway_icon', sprintf( __( ' | Current Balance: <strong>%s</strong>', 'woo-wallet' ), $current_balance ), $this->id );
    109109        }
    110110
    111111        /**
    112112         * Is $order_id a subscription?
    113113         *
    114114         * @param  int $order_id order_id.
    115115         * @return boolean
    116116         */
    117117        protected function is_subscription( $order_id ) {
    118118            return ( function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_is_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) ) );
    119119        }
    120120
    121121        /**
    122122         * Process wallet payment
    123123         *
    124124         * @param int $order_id order_id.
    125125         * @return array
    126126         */
    127127        public function process_payment( $order_id ) {
    128128            $order = wc_get_order( $order_id );
    129129            if ( ( $order->get_total( 'edit' ) > woo_wallet()->wallet->get_wallet_balance( get_current_user_id(), 'edit' ) ) && apply_filters( 'woo_wallet_disallow_negative_transaction', ( woo_wallet()->wallet->get_wallet_balance( get_current_user_id(), 'edit' ) <= 0 || $order->get_total( 'edit' ) > woo_wallet()->wallet->get_wallet_balance( get_current_user_id(), 'edit' ) ), $order->get_total( 'edit' ), woo_wallet()->wallet->get_wallet_balance( get_current_user_id(), 'edit' ) ) ) {
    130130                wc_add_notice( __( 'Payment error: ', 'woo-wallet' ) . sprintf( __( 'Your wallet balance is low. Please add %s to proceed with this transaction.', 'woo-wallet' ), wc_price( $order->get_total( 'edit' ) - woo_wallet()->wallet->get_wallet_balance( get_current_user_id(), 'edit' ), woo_wallet_wc_price_args( $order->get_customer_id() ) ) ), 'error' );
    131131                return;
    132132            }
    133133
    134134            // Reduce stock levels.
    135135            wc_reduce_stock_levels( $order_id );
    136136
    137137            // Remove cart.
    138138            WC()->cart->empty_cart();
    139139
    140140            // Complete order payment.
    141141            $order->payment_complete();
    142142
    143143            // Return thankyou redirect.
    144144            return array(
    145145                'result'   => 'success',
    146146                'redirect' => $this->get_return_url( $order ),
    147147            );
    148148        }
    149149        /**
    150150         * Debit user wallet on WooCommerce payment complete.
    151151         *
    152152         * @param WC_Order $order_id order_id.
    153153         * @throws Exception WooCommerce expeptions.
    154154         */
    155155        public function woocommerce_pre_payment_complete( $order_id ) {
    156156            $order = wc_get_order( $order_id );
    157157            if ( 'wallet' === $order->get_payment_method( 'edit' ) && ! $order->get_transaction_id( 'edit' ) && $order->has_status( apply_filters( 'woocommerce_valid_order_statuses_for_payment_complete', array( 'on-hold', 'pending', 'failed', 'cancelled' ), $order ) ) ) {
    158158                if ( woo_wallet()->wallet->get_wallet_balance( $order->get_customer_id( 'edit' ), 'edit' ) >= $order->get_total( 'edit' ) ) {
    159159                    $wallet_response = woo_wallet()->wallet->debit( $order->get_customer_id( 'edit' ), $order->get_total( 'edit' ), apply_filters( 'woo_wallet_order_payment_description', __( 'For order payment #', 'woo-wallet' ) . $order->get_order_number(), $order ) );
    160160                    if ( $wallet_response ) {
    161161                        $order->set_transaction_id( $wallet_response );
    162162                        do_action( 'woo_wallet_payment_processed', $order_id, $wallet_response );
    163163                        $order->save();
    164164                    } else {
    165165                        throw new Exception( __( 'Something went wrong with processing payment please try again.', 'woo-wallet' ) );
    166166                    }
    167167                } else {
    168168                    throw new Exception( __( 'Insufficient wallet balance', 'woo-wallet' ) );
    169169                }
    170170            }
    171171        }
    172172
    173173        /**
    174174         * Process a refund if supported.
    175175         *
    176176         * @param  int    $order_id Order ID.
    177177         * @param  float  $amount Refund amount.
    178178         * @param  string $reason Refund reason.
    179179         * @return bool|WP_Error
     180         * @throws Exception WP_Error Exceptions.
    180181         */
    181182        public function process_refund( $order_id, $amount = null, $reason = '' ) {
    182183            $order          = wc_get_order( $order_id );
    183184            $refund_reason  = $reason ? $reason : __( 'Wallet refund #', 'woo-wallet' ) . $order->get_order_number();
    184185            $transaction_id = woo_wallet()->wallet->credit( $order->get_customer_id(), $amount, $refund_reason );
    185186            if ( ! $transaction_id ) {
    186187                throw new Exception( __( 'Refund not credited to customer', 'woo-wallet' ) );
    187188            }
    188189            do_action( 'woo_wallet_order_refunded', $order, $amount, $transaction_id );
    189190            return true;
    190191        }
    191192
    192193        /**
    193194         * Process renewal payment for subscription order
    194195         *
    195196         * @param int      $amount_to_charge amount_to_charge.
    196197         * @param WC_Order $order order.
    197198         * @return void
    198199         */
    199200        public function scheduled_subscription_payment( $amount_to_charge, $order ) {
    200201            if ( get_post_meta( $order->get_id(), '_wallet_scheduled_subscription_payment_processed', true ) ) {
    201202                return;
    202203            }
    203204            $order->payment_complete();
    204205            update_post_meta( $order->get_id(), '_wallet_scheduled_subscription_payment_processed', true );
    205206        }
    206207    }
    207208}
  • woo-wallet/trunk/readme.txt

    r2816610 r2817824  
    11=== TeraWallet - For WooCommerce ===
    22Contributors: standalonetech, subratamal, moumitaadak
    33Tags: woo wallet, woocommerce wallet, wp wallet, user wallet, refund, cashback, partial payment, wallet, wc wallet, woocommerce credits
    4 Requires PHP: 5.6
    5 Requires at least: 4.4
     4Requires PHP: 7.2
     5Requires at least: 5.8
    66Tested up to: 6.1
    7 Stable tag: 1.4.3
     7Stable tag: 1.4.4
    88Donate link: https://paypal.me/standalonetech
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1111
    1212A powerful, extendable WooCommerce wallet system which support payment, partial payment, cashback reward program as well as refund for your WooCommerce store.
    1313
    1414== Description ==
    1515
    1616TeraWallet allows customers to store their money in a digital wallet. The customers can use the wallet money for purchasing products from the store. The customers can add money to their wallet using various payment methods set by the admin. The admin can set cashback rules according to cart price or product. The customers will receive their cashback amount in their wallet account. The admin can process refund to customer wallet.
    1717
    1818[youtube https://www.youtube.com/watch?v=Fnpp8qxAWBw]
    1919
    2020= Use case of TeraWallet =
    2121With this extension, the customers won't have to fill in the payment details every time. They can simply log in and pay for products using the wallet money. The customers will also get the advantage for earning cashback using the wallet money. The admin can process refund to the customer wallet.
    2222
    2323= Features of TeraWallet =
    2424- Wallet system works just like any other payment method.
    2525- Set wallet system payment method title for the front-end.
    2626- The customers can use various payment methods to add money.
    2727- The admin can process refund using the wallet money.
    2828- Customers will earn cashback according to cart price, product or product category wise.
    2929- Customers can made partial payment.
    3030- Set cashback amount calculation using fixed or percent method.
    3131- Admin can export users wallet transactions.
    3232- Admin can setup low wallet balance notification email.
    3333- Admin can lock / unlock any user wallet.
    3434- From the backend, the admin can view the transaction history.
    3535- Customers receive notification emails for every wallet transaction.
    3636- The admin can adjust the wallet amount of any customer from the backend.
    3737- Users can transfer wallet amount to other user.
    3838- Shortcode `woo-wallet` which will display user wallet page.
    3939- Built with a REST API
    4040- Convert WooCommerce coupon into cashback.
    4141- Support WordPress Multisite Network
    4242- Supports multiple languages translations.
    4343- Supports WooCommerce Subscriptions.
    4444- Supports WooCommerce Multivendor Marketplace by WC Lovers.
    4545- Supports WC Marketplace.
    4646- Supports Dokan Multivendor Marketplace.
    4747
    4848> Take a step forward and try our [demo](https://standalonetech.com/).
    4949
    5050= Workflow of TeraWallet =
    5151After the plugin installation, the admin needs to do the payment method configuration. Set the title and select allowed payments for adding money.
    5252Now for enable cashback rules, navigate to WooWallet > Settings >  Credit. Now setup cashback rule according to your requirement. If cashback rule set to product wise then admin will have an option to add cashback rule for each product.
    5353On the front-end, the customers can log in to the store and go to wallet page from My Account. Enter the amount to add and then complete the checkout process just like any other product purchase.
    5454
    5555= Translator Contributors =
    5656- [#fa_IR](https://translate.wordpress.org/locale/fa/default/wp-plugins/woo-wallet) - [@rahimvaziri](https://wordpress.org/support/users/rahimvaziri/)
    5757- [#es_ES](https://translate.wordpress.org/locale/es/default/wp-plugins/woo-wallet) - [@chipweb](https://wordpress.org/support/users/chipweb/)
    5858
    5959== Installation ==
    6060
    6161= Minimum Requirements =
    6262
    6363* PHP version 5.2.4 or greater (PHP 5.6 or greater is recommended)
    6464* MySQL version 5.0 or greater (MySQL 5.6 or greater is recommended)
    6565* WordPress 4.4+
    6666* WooCommerce 3.0+
    6767
    6868= Automatic installation =
    6969
    7070Automatic installation is the easiest option as WordPress handles the file transfers itself and you don’t need to leave your web browser. To do an automatic install of WooCommerce Wallet Payment, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
    7171
    7272In the search field type “WooCommerce Wallet Payment” and click Search Plugins. Once you’ve found our WooCommerce Wallet Payment plugin you can view details about it such as the point release, rating and description. Most importantly of course, you can install it by simply clicking “Install Now”.
    7373
    7474= Manual installation =
    7575
    7676The manual installation method involves downloading our plugin and uploading it to your webserver via your favourite FTP application. The WordPress codex contains [instructions on how to do this here](https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).
    7777
    7878= Updating =
    7979
    8080Automatic updates should work like a charm; as always though, ensure you backup your site just in case.
    8181
    8282If on the off-chance you do encounter issues with the wallet endpoints pages after an update you simply need to flush the permalinks by going to WordPress > Settings > Permalinks and hitting 'save'. That should return things to normal.
    8383
    8484== Frequently Asked Questions ==
    8585
    8686= Does this plugin work with newest WP version and also older versions? =
    8787
    8888Yes, this plugin works fine with WordPress 4.9, It is also compatible for older WordPress versions upto 4.4.
    8989
    9090= Up to which version of WooCommerce this plugin compatible with? =
    9191
    9292This plugin is compatible with the latest version of WooCommerce.
    9393
    9494= Will WooCommerce Wallet work with WordPress multisite network? =
    9595
    9696Yes, WooCommerce Wallet plugin is fully compatible with Wordpress multisite.
    9797
    9898= Where can I get support or talk to other users? =
    9999
    100100If you get stuck, you can ask for help in the [WordPress Plugin Forum](https://wordpress.org/support/plugin/woo-wallet) or just email us at support@standalonetech.com.
    101101
    102102= Where can I report bugs or contribute to the project? =
    103103
    104104Bugs can be reported either in our support forum or preferably on the [GitHub repository](https://github.com/malsubrata/woo-wallet/issues).
    105105
    106106= Where can I find the REST API documentation? =
    107107
    108108You can find the documentation of our [Wallet REST API Docs](https://github.com/malsubrata/woo-wallet/wiki/API-V3).
    109109
    110110= This plugin is awesome! Can I contribute? =
    111111
    112112Yes you can! Join in on our [GitHub repository](https://github.com/malsubrata/woo-wallet) :)
    113113
    114114== Screenshots ==
    115115
    1161161. User wallet page.
    1171172. Transfer wallet balance.
    1181183. View transaction details.
    1191194. All user balance details.
    1201205. Admin view transaction details.
    1211216. Admin adjust wallet balance.
    1221227. WooCommerce wallet payment gateway.
    1231238. WooCommerce refund.
    1241249. Wallet actions.
    125125
    126126== Changelog ==
     127= 1.4.4 - 2022-11-14 =
     128* Fix - Security issue on the function lock_unlock_terawallet.
     129
    127130= 1.4.3 - 2022-11-11 =
    128131* Fix - Datatable ajax issue.
    129132
    130133= 1.4.2 - 2022-11-11 =
    131134* Fix - Mini wallet nav menu location.
    132135
    133136= 1.4.1 - 2022-11-11 =
    134137* Fix - Fix Cannot uncheck checkbox issue in plugin settings page.
    135138
    136139= 1.4.0 - 2022-11-4 =
    137140* Fix - Plugin CSRF issue ( Thanks Muhammad Daffa ).
    138141* Add - Compatibility with WP 6.1
    139142
    140143= 1.3.24 - 2022-03-18 =
    141144* Fix - Wallet payment process.
    142145* Fix - Referral signup action.
    143146* Tweak - Wallet pages will be removed from account page if user is bolocked.
    144147* Add - REST API V3 [API Docs](https://github.com/malsubrata/woo-wallet/wiki/API-V3).
    145148
    146149= 1.3.23 - 2022-02-17 =
    147150* Fix - Compatibility with WooCommerce Subscription plugin.
    148151* Fix - Referral order amount
    149152* Fix - Cashback issue for guest user.
    150153* Add - Support for order created via rest API.
    151154
    152155= 1.3.22 - 2021-12-23 =
    153156* Fix - Plugin title translation issue.
    154157 
    155158= 1.3.21 -2021-12-22 =
    156159* Fix - Exporter column header.
    157160* Fix - Incorrect wallet top-up this month widget.
    158161* Tweak - Delete Transaction history without effecting User balance.
    159162* Fix - Cashback coupon for Guest User.
    160163* Fix - Referring signup bug.
    161164* Add - Compatibility with Dokan > 3.3.
    162165
    163166= 1.3.20 - 2021-11-26 =
    164167* Fix - Wallet top-up issue.
    165168* Fix - Extension page CSS issue.
    166169
    167170= 1.3.19 - 2021-07-02 =
    168171* Add - Now admin can setup low wallet balance notification email.
    169172* Add - Admin can export wallet transactions.
    170173* Add - Admin can lock / unlock user wallet.
    171174
    172175= 1.3.18 - 2021-3-18 =
    173176* Add - Now admin can see which user make credit / debit transaction.
    174177* Fix - Cashback recalculation issue.
    175178* Fix - Debit Round up issue for bulk action.
    176179* Fix - Removed order again button from wallet rechargeable order details page.
    177180* Tweak - Now referral bonus will be credited after user purchase something from the store.
    178181* Dev - Added new filter `woo_wallet_calculate_cashback_on_total` to set cashback on order total or subtotal.
    179182
    180183= 1.3.17 - 2020-12-29 =
    181184* Fix - Fix URL while searching users in balance details page.
    182185* Fix - Redirect issue in adjust balance page.
    183186* Fix - Decimal point issue in bulk credit, debit wallet balance.
    184187* Fix - WooCommerce Analytics report.
    185188
    186189= 1.3.16 - 2020-08-26 =
    187190* Add - New wallet recharge state in dashboard widget.
    188191* Tweak - Now cashback will be calculated on order total instead of order subtotal.
    189192* Tweak - Excluded wallet rechargable orders from WooCommerce analytics page.
    190193* Tweak - Database query result performance optimization.
    191194* Fix - Translation issue and wp list table display issue for mobile.
    192195* Fix - Redirection issue in wallet dashboard for wallet shortcode.
    193196* Dev - Added hooks into WooCommerce product review action.
    194197
    195198= 1.3.15 - 2020-04-22 =
    196199* Add - AJAX datatable on wallet transaction details page.
    197200* Add - Custom field in WP nav menu setting to display wallet icon and amount instead of menu title.
    198201* Notice - Mini wallet display location settings will be removed on next update use WooCommerce endpoint menu item instead.
    199202
    200203= 1.3.14 - 2020-03-07 =
    201204* Add - Bulk credit debit option for admin #46.
    202205* Fix - Current link attributes in wallet details page #45.
    203206
    204207= 1.3.13 - 2020-02-08 =
    205208* Fix - Wallet top-up issue.
    206209
    207210= 1.3.12 - 2020-02-07 =
    208211* Add - Mini wallet RTL support.
    209212* Add - Support for WooCommerce subscription payment method change.
    210213* Add - Copy to clipboard function in referral URL.
    211214* Fix - Cashback recalculation function.
    212215* Fix - Loading issue in wallet transfer searchbox.
    213216* Tweak - `is_full_payment_through_wallet` function.
    214217* Dev - Added `woo_wallet_cashback_rules` filter.
    215218* Dev - Added `created_by` database column to `woo_wallet_transactions` table.
    216219
    217220= 1.3.11 - 2019-11-13 =
    218221* Add - Mini wallet shortcode.
    219222* Fix - Cashback amount for product cart rule.
    220223* Fix - Wallet endpoint issue for shortcode.
    221224
    222225= 1.3.10 - 2019-09-11 =
    223226* Add - Submit button at Wallet Top-Up widget.
    224227* Fix - Cashback calculation issue for product category.
    225228* Fix - Partial payment template.
    226229* Fix - WooCommerce endpoint save issue.
    227230* Tweak - Alter database column amount and balance.
    228231
    229232= 1.3.9 - 2019-06-18 =
    230233* New - Now admin can configure cashback for variable products.
    231234
    232235= 1.3.8 - 2019-06-07 =
    233236* Add - Role wise filter in wallet transaction page.
    234237* Add - Hooks and Filters.
    235238
    236239= 1.3.7 - 2019-05-05 =
    237240* Add - Minimum transfer limit.
    238241* Fix - Dokan withdrawal issue.
    239242
    240243= 1.3.6 - 2019-04-19 =
    241244* Updated - Plugin name change.
    242245
    243246= 1.3.5 - 2019-04-18 =
    244247* Add - Support for WC version 3.6.
    245248* Add - Referral action.
    246249* Fix - `wc_format_decimal` function use in partial payment.
    247250* Remove - Deprecated WC functions.
    248251
    249252= 1.3.4 - 2019-03-23 =
    250253* Added - Compatibility with WooCommerce Germanized plugin.
    251254* Add - Empty datatable info translation string
    252255* Add - Fee amount in woowallet cart total function.
    253256* Fix - Wallet transfer menu issue.
    254257
    255258= 1.3.3 - 2019-03-04 =
    256259* Fix - Plugin dependencies file.
    257260
    258261= 1.3.2 - 2019-02-27 =
    259262* Add - Now cart items will be restored after successful wallet top-up.
    260263* Fix - Partial payment issues.
    261264* Fix - Cashback calculation for variable product.
    262265* Fix - Transaction date issue.
    263266* Fix - Order by balance column in WooWallet balance details table.
    264267* Tweak - Cashback logic.
    265268* Tweak - Wallet funds transfer description.
    266269
    267270= 1.3.1 - 2019-02-04 =
    268271* Fix - Cashback issue.
    269272
    270273= 1.3.0 - 2019-02-02 =
    271274* Add - Now cashback will be credited if admin create order for customer.
    272275* Add - Added wallet top-up widget.
    273276* Fix - Disable partial payment if user balance is zero.
    274277* Fix - Multiple ajax call for partial payment.
    275278* Fix - Delete transaction records upon deletion of user.
    276279* Tweak - Daily visit.
    277280
    278281[See changelog for all versions](https://raw.githubusercontent.com/malsubrata/woo-wallet/master/changelog.txt).
    279282
    280283== Upgrade Notice ==
    281284
    282285= 1.3 =
  • woo-wallet/trunk/woo-wallet.php

    r2816610 r2817824  
    11<?php
    22/**
    33 * Plugin Name: TeraWallet
    44 * Plugin URI: https://wordpress.org/plugins/woo-wallet/
    55 * Description: The leading wallet plugin for WooCommerce with partial payment, refunds, cashbacks and what not!
    66 * Author: StandaloneTech
    77 * Author URI: https://standalonetech.com/
    8  * Version: 1.4.3
     8 * Version: 1.4.4
    99 * Requires at least: 4.4
    1010 * Tested up to: 6.1
    1111 * WC requires at least: 3.0
    12  * WC tested up to: 7.0
     12 * WC tested up to: 7.1
    1313 *
    1414 * Text Domain: woo-wallet
    1515 * Domain Path: /languages/
    1616 *
    1717 *
    1818 * This program is free software: you can redistribute it and/or modify
    1919 * it under the terms of the GNU General Public License as published by
    2020 * the Free Software Foundation, either version 3 of the License, or
    2121 * (at your option) any later version.
    2222 *
    2323 * This program is distributed in the hope that it will be useful,
    2424 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2525 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    2626 * GNU General Public License for more details.
    2727 *
    2828 * You should have received a copy of the GNU General Public License
    2929 * along with this program. If not, see <http://www.gnu.org/licenses/>.
    3030 *
    3131 * @package WooWallet
    3232 */
    3333
    3434if ( ! defined( 'ABSPATH' ) ) {
    3535    exit;
    3636}
    3737
    3838// Define WOO_WALLET_PLUGIN_FILE.
    3939if ( ! defined( 'WOO_WALLET_PLUGIN_FILE' ) ) {
    4040    define( 'WOO_WALLET_PLUGIN_FILE', __FILE__ );
    4141}
    4242
    4343// Define WOO_WALLET_ABSPATH.
    4444if ( ! defined( 'WOO_WALLET_ABSPATH' ) ) {
    4545    define( 'WOO_WALLET_ABSPATH', dirname( WOO_WALLET_PLUGIN_FILE ) . '/' );
    4646}
    4747
    4848// Define WOO_WALLET_PLUGIN_VERSION.
    4949if ( ! defined( 'WOO_WALLET_PLUGIN_VERSION' ) ) {
    50     define( 'WOO_WALLET_PLUGIN_VERSION', '1.4.3' );
     50    define( 'WOO_WALLET_PLUGIN_VERSION', '1.4.4' );
    5151}
    5252
    5353// include dependencies file.
    5454if ( ! class_exists( 'Woo_Wallet_Dependencies' ) ) {
    5555    include_once dirname( __FILE__ ) . '/includes/class-woo-wallet-dependencies.php';
    5656}
    5757
    5858// Include the main class.
    5959if ( ! class_exists( 'WooWallet' ) ) {
    6060    include_once dirname( __FILE__ ) . '/includes/class-woo-wallet.php';
    6161}
    6262/**
    6363 * Returns the main instance of WooWallet.
    6464 *
    6565 * @since  1.1.0
    6666 * @return WooWallet
    6767 */
    6868function woo_wallet() {
    6969    return WooWallet::instance();
    7070}
    7171
    7272$GLOBALS['woo_wallet'] = woo_wallet();
Note: See TracChangeset for help on using the changeset viewer.