Changeset 2883170
- Timestamp:
- 03/20/2023 03:18:40 AM (3 years ago)
- Location:
- app360/trunk
- Files:
-
- 3 edited
-
app360.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
transaction.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
app360/trunk/app360.php
r2859516 r2883170 11 11 * Plugin URI: https://www.app360.my/ 12 12 * Description: App360 CRM allows the integration between WooCommerce and App360 13 * Version: 1. 3.1513 * Version: 1.4.0 14 14 * Author: App360 15 15 * License: GPLv2 or later -
app360/trunk/readme.txt
r2859516 r2883170 4 4 Requires at least: 5.6 5 5 Tested up to: 5.8 6 Stable tag: 1. 3.96 Stable tag: 1.4.0 7 7 License: GPLv2 or later 8 8 … … 38 38 39 39 == Changelog == 40 = 1.4.0 = 41 *Release Date - 28 February 2023* 42 43 * feature | New hook to update App360 side order status upon status changes 40 44 41 45 = 1.3.15 = -
app360/trunk/transaction.php
r2859500 r2883170 344 344 add_action( 'woocommerce_order_status_changed', 'app360_order_status_changed', 99, 3 ); 345 345 function app360_order_status_changed( $order_id, $old_status, $new_status ){ 346 $status_app360 = ''; 347 switch (strtolower($new_status)) { 348 case 'completed': 349 $status_app360 = 'completed'; 350 break; 351 case 'refunded': 352 case 'failed': 353 case 'cancelled': 354 $status_app360 = 'rejected'; 355 break; 356 default: 357 $status_app360 = 'pending'; 358 } 359 360 if ($status_app360 != '') { 361 $app360_api_domain = get_option('app360_api_domain'); 362 $app360_api = get_option('app360_api'); 363 if($app360_api_domain && $app360_api){ 364 $url = $app360_api_domain.'/order/status'; 365 366 $param = array(); 367 $param['order_id'] = $order->id; 368 $param['source'] = 'w'; 369 $param['status'] = $status_app360; 370 371 $headers = array(); 372 $headers['Content-type'] = 'application/json'; 373 $headers['apikey'] = $app360_api; 374 wp_remote_request($url, [ 375 'method' => 'PUT', 376 'headers'=> $headers, 377 'body' => $param 378 ]); 379 } 380 } 381 382 346 383 if (strtolower($new_status) === 'completed') { 347 384 $order = wc_get_order( $order_id );
Note: See TracChangeset
for help on using the changeset viewer.