Plugin Directory

Changeset 2879544


Ignore:
Timestamp:
03/14/2023 05:57:36 AM (3 years ago)
Author:
tomlister
Message:

Added wp_get_active_network_plugins function if not found

Location:
payflex-payment-gateway
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • payflex-payment-gateway/trunk/partpay.php

    r2807854 r2879544  
    33Plugin Name: Payflex Payment Gateway
    44Description: Use Payflex as a credit card processor for WooCommerce.
    5 Version: 2.4.1
     5Version: 2.4.2
    66Author: Payflex
    77*/
     8if(!function_exists('wp_get_active_network_plugins')){
     9    function wp_get_active_network_plugins() {
     10        $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
     11        if ( empty( $active_plugins ) ) {
     12            return array();
     13        }
     14   
     15        $plugins        = array();
     16        $active_plugins = array_keys( $active_plugins );
     17        sort( $active_plugins );
     18   
     19        foreach ( $active_plugins as $plugin ) {
     20            if ( ! validate_file( $plugin ) // $plugin must validate as file
     21                && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php'
     22                && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist
     23                ) {
     24                $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
     25            }
     26        }
     27   
     28        return $plugins;
     29    }
     30}
    831
    932/**
     
    606629                $OrderBodyObj->description = 'string';
    607630                $OrderBodyObj->items = [];
    608                 $itms = [];
     631                $objectItems = [];
    609632                foreach ($items as $item)
    610633                {
    611                     array_push($itms,json_decode($item[0]));
    612                 }
    613                 $OrderBodyObj->items = $itms;
     634                    array_push($objectItems,json_decode($item[0]));
     635                }
     636                $OrderBodyObj->items = $objectItems;
    614637                $OrderBodyObj->merchant = new stdClass;
    615638                $OrderBodyObj->merchant->redirectConfirmUrl = (string)$this->get_return_url($order) . '&order_id=' . $order_id . '&status=confirmed&wc-api=WC_Gateway_PartPay';
     
    621644
    622645                $APIURL = $this->orderurl . '/productSelect';
    623 
     646               
    624647                $order_args = array(
    625648                    'method' => 'POST',
     
    958981                }
    959982            }
    960 
     983           
    961984            /**
    962985             * Check the order status of all orders that didn't return to the thank you page or marked as Pending by PartPay
     
    966989            public function check_pending_abandoned_orders()
    967990            {
     991               
    968992
    969993                // $pending_orders = get_posts(array('post_type'=>'shop_order','post_status'=>'wc-pending',
     
    10261050                    if ($response_code == 200)
    10271051                    {
     1052                        $order_note = sprintf(__('Checked payment status with Payflex. Payment %s. Payflex Order ID: %s', 'woo_partpay') , strtolower($body->orderStatus) , $partpay_order_id);
    10281053                        // Check status of order
    10291054                        if($body->orderStatus == "Initiated"){
     
    10441069                        elseif ($body->orderStatus == 'Abandoned')
    10451070                        {
    1046                             $order->add_order_note(sprintf(__('Checked payment status with Payflex. Payment %s. Payflex Order ID: %s', 'woo_partpay') , strtolower($body->orderStatus) , $partpay_order_id));
     1071                            $order->add_order_note($order_note);
    10471072                            $order->update_status('cancelled');
    10481073                        }
    10491074                        elseif ($body->orderStatus == 'Declined')
    10501075                        {
    1051                             $order->add_order_note(sprintf(__('Checked payment status with Payflex. Payment %s. Payflex Order ID: %s', 'woo_partpay') , strtolower($body->orderStatus) , $partpay_order_id));
     1076                            $order->add_order_note($order_note);
    10521077                            $order->update_status('cancelled');
    10531078                        }
    10541079                        else
    10551080                        {
    1056                             $order->add_order_note(sprintf(__('Checked payment status with Payflex. Payment %s. Payflex Order ID: %s', 'woo_partpay') , strtolower($body->orderStatus) , $partpay_order_id));
     1081                            $order->add_order_note($order_note);
    10571082                            $order->update_status('failed');
    10581083                        }
  • payflex-payment-gateway/trunk/readme.txt

    r2807854 r2879544  
    55Tested up to: 6.1
    66Requires PHP: 7.0
    7 Stable tag: 2.4.1
     7Stable tag: 2.4.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7979= 2.4.1 =
    8080     * minor bug fix
     81= 2.4.2 =
     82     * Added wp_get_active_network_plugins function if not found
Note: See TracChangeset for help on using the changeset viewer.