Changeset 2106864
- Timestamp:
- 06/16/2019 09:42:22 AM (7 years ago)
- Location:
- mango-ssl/trunk
- Files:
-
- 3 edited
-
mango-ssl.php (modified) (2 diffs)
-
mango-ssl_order.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mango-ssl/trunk/mango-ssl.php
r1859445 r2106864 3 3 /** 4 4 * @package mango-ssl 5 * @version 1. 05 * @version 1.1 6 6 */ 7 7 /* … … 11 11 Description: Mango ssl plugin sends all the order changes entered in WooCommerce to mango(www.mangossl.com) to avoid reentering those orders manually. 12 12 Author: Franck Janini 13 Version: 1. 013 Version: 1.1 14 14 Author URI: https://www.mangossl.com/ 15 15 */ -
mango-ssl/trunk/mango-ssl_order.php
r1859445 r2106864 13 13 add_action('woocommerce_order_status_changed', 'mango_ssl_update', 10, 1); 14 14 15 add_action( 'woocommerce_payment_complete', 'mango_ssl_payment_complete' ); 16 17 add_action( 'woocommerce_order_status_cancelled', 'mango_ssl_cancel', 10, 1 ); 18 15 19 // mango_ssl_update creates a mango order class from a woocommerce order change and sends it to mango 16 20 17 21 function mango_ssl_update($order_id) 18 22 { 19 20 23 error_log("Order has been updated $order_id"); 21 24 22 25 global $woocommerce; 23 26 $order = wc_get_order( $order_id ); 24 $obj = new mango_ssl_order($order); 27 $obj = new mango_ssl_order($order,'update'); 28 29 $mango = new mango_ssl_call(); 30 $mango->send('save','COMMAND',$obj); 31 } 32 33 function mango_ssl_cancel( $order_id ) 34 { 35 error_log("Order has been canceled $order_id"); 36 37 global $woocommerce; 38 $order = wc_get_order( $order_id ); 39 $obj = new mango_ssl_order($order,'cancel'); 40 41 $mango = new mango_ssl_call(); 42 $mango->send('save','COMMAND',$obj); 43 } 44 45 function mango_ssl_payment_complete( $order_id ) 46 { 47 error_log("Order has been payed $order_id"); 48 49 global $woocommerce; 50 $order = wc_get_order( $order_id ); 51 $obj = new mango_ssl_order($order,'paid'); 25 52 26 53 $mango = new mango_ssl_call(); … … 136 163 var $date; 137 164 var $type; 138 var $status; 165 var $status; 166 var $message; 167 var $system_status; 139 168 var $currency; 140 169 var $payment_method; … … 146 175 var $detail = array(); 147 176 148 public function __construct($woo_order )177 public function __construct($woo_order,$message) 149 178 { 150 179 $order_data = $woo_order->get_data(); … … 155 184 $this->po = $order_data['parent_id']; 156 185 157 if ($order_data['status']=='on-hold') 158 $this->status = 'HOLD'; 159 else if ($order_data['status']=='processing') 160 $this->status = 'COMMIT'; 161 else if ($order_data['status']=='completed') 162 $this->status = 'COMMIT'; 163 else 164 $this->status = 'HOLD'; 186 $this->message = $message; 187 $this->system_status = $order_data['status']; 188 189 if ($message=='update') 190 { 191 if ($order_data['status']=='on-hold') 192 $this->status = 'HOLD'; 193 else if ($order_data['status']=='processing') 194 $this->status = 'COMMIT'; 195 else if ($order_data['status']=='completed') 196 $this->status = 'COMMIT'; 197 else if ($order_data['status']=='cancelled') 198 $this->status = 'CANCELLED'; 199 else 200 $this->status = 'HOLD'; 201 } 202 else if ($message=='paid') 203 { 204 $this->status = 'PAID'; 205 } 206 else if ($message=='cancel') 207 { 208 $this->status = 'CANCELLED'; 209 } 165 210 166 211 $this->currency = $order_data['currency']; -
mango-ssl/trunk/readme.txt
r1859445 r2106864 8 8 Tags: accounting, inventory, payment 9 9 Requires at least: 4.6 10 Tested up to: 4.9.410 Tested up to: 5.2.1 11 11 Requires WooCommerce 3 or higher 12 12 Stable tag: trunk … … 69 69 * Fist release 70 70 71 = 1.1 = 72 * Updated to support paid and cancelled order status 73 71 74 == Upgrade Notice == 72 75 … … 74 77 First release 75 78 76 79 = 1.1 = 80 * Updated to support paid and cancelled order status
Note: See TracChangeset
for help on using the changeset viewer.