Changeset 2879544
- Timestamp:
- 03/14/2023 05:57:36 AM (3 years ago)
- Location:
- payflex-payment-gateway
- Files:
-
- 1 added
- 2 edited
-
tags/2.4.2 (added)
-
trunk/partpay.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
payflex-payment-gateway/trunk/partpay.php
r2807854 r2879544 3 3 Plugin Name: Payflex Payment Gateway 4 4 Description: Use Payflex as a credit card processor for WooCommerce. 5 Version: 2.4. 15 Version: 2.4.2 6 6 Author: Payflex 7 7 */ 8 if(!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 } 8 31 9 32 /** … … 606 629 $OrderBodyObj->description = 'string'; 607 630 $OrderBodyObj->items = []; 608 $ itms = [];631 $objectItems = []; 609 632 foreach ($items as $item) 610 633 { 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; 614 637 $OrderBodyObj->merchant = new stdClass; 615 638 $OrderBodyObj->merchant->redirectConfirmUrl = (string)$this->get_return_url($order) . '&order_id=' . $order_id . '&status=confirmed&wc-api=WC_Gateway_PartPay'; … … 621 644 622 645 $APIURL = $this->orderurl . '/productSelect'; 623 646 624 647 $order_args = array( 625 648 'method' => 'POST', … … 958 981 } 959 982 } 960 983 961 984 /** 962 985 * Check the order status of all orders that didn't return to the thank you page or marked as Pending by PartPay … … 966 989 public function check_pending_abandoned_orders() 967 990 { 991 968 992 969 993 // $pending_orders = get_posts(array('post_type'=>'shop_order','post_status'=>'wc-pending', … … 1026 1050 if ($response_code == 200) 1027 1051 { 1052 $order_note = sprintf(__('Checked payment status with Payflex. Payment %s. Payflex Order ID: %s', 'woo_partpay') , strtolower($body->orderStatus) , $partpay_order_id); 1028 1053 // Check status of order 1029 1054 if($body->orderStatus == "Initiated"){ … … 1044 1069 elseif ($body->orderStatus == 'Abandoned') 1045 1070 { 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); 1047 1072 $order->update_status('cancelled'); 1048 1073 } 1049 1074 elseif ($body->orderStatus == 'Declined') 1050 1075 { 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); 1052 1077 $order->update_status('cancelled'); 1053 1078 } 1054 1079 else 1055 1080 { 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); 1057 1082 $order->update_status('failed'); 1058 1083 } -
payflex-payment-gateway/trunk/readme.txt
r2807854 r2879544 5 5 Tested up to: 6.1 6 6 Requires PHP: 7.0 7 Stable tag: 2.4. 17 Stable tag: 2.4.2 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 79 79 = 2.4.1 = 80 80 * 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.