| 1 |
<?php |
| 2 |
/** |
| 3 |
* Order interface |
| 4 |
* |
| 5 |
* @package SeQura/WC |
| 6 |
* @subpackage SeQura/WC/Controllers |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace SeQura\WC\Controllers\Hooks\Order; |
| 10 |
|
| 11 |
use WC_Order; |
| 12 |
use WC_Order_Data_Store_CPT; |
| 13 |
|
| 14 |
/** |
| 15 |
* Handle hooks related to order management |
| 16 |
*/ |
| 17 |
interface Interface_Order_Controller { |
| 18 |
|
| 19 |
/** |
| 20 |
* Add support to custom meta query vars for the order query |
| 21 |
* |
| 22 |
* @param array $wp_query_args Args for WP_Query. |
| 23 |
* @param array $query_vars Query vars from WC_Order_Query. |
| 24 |
* @param WC_Order_Data_Store_CPT $order_data_store WC_Order_Data_Store instance. |
| 25 |
* @return array modified $query |
| 26 |
*/ |
| 27 |
public function handle_custom_query_vars( $wp_query_args, $query_vars, $order_data_store ); |
| 28 |
|
| 29 |
/** |
| 30 |
* Trigger the sync of the order status with SeQura |
| 31 |
* |
| 32 |
* @param int $order_id Order ID. |
| 33 |
* @param string $old_status Old status. |
| 34 |
* @param string $new_status New status. |
| 35 |
* @param WC_Order $order Order object. |
| 36 |
* |
| 37 |
* @return void |
| 38 |
*/ |
| 39 |
public function handle_order_status_changed( $order_id, $old_status, $new_status, $order ); |
| 40 |
|
| 41 |
/** |
| 42 |
* Display notices related to an order |
| 43 |
* |
| 44 |
* @return void |
| 45 |
*/ |
| 46 |
public function display_notices(); |
| 47 |
|
| 48 |
/** |
| 49 |
* Show a link to the seQura back office in the order details page |
| 50 |
* |
| 51 |
* @param WC_Order $order Order object. |
| 52 |
* @return void |
| 53 |
*/ |
| 54 |
public function show_link_to_sequra_back_office( $order ); |
| 55 |
|
| 56 |
/** |
| 57 |
* Cleanup orders |
| 58 |
* |
| 59 |
* @return void |
| 60 |
*/ |
| 61 |
public function cleanup_orders(); |
| 62 |
|
| 63 |
/** |
| 64 |
* Respond to the sequra_order_migration_add_indexes hook |
| 65 |
* |
| 66 |
* @param string $hook Hook name that triggered the action. |
| 67 |
*/ |
| 68 |
public function migrate_orders_to_use_indexes( $hook ); |
| 69 |
} |
| 70 |
|