Automattic\WooCommerce\Admin\API
LaunchYourStore::get_woopay_test_orders_count()
Count the test orders created during Woo Payments test mode.
Method of the class: LaunchYourStore{}
No Hooks.
Return
\WP_REST_Response
.
Usage
$LaunchYourStore = new LaunchYourStore(); $LaunchYourStore->get_woopay_test_orders_count();
LaunchYourStore::get_woopay_test_orders_count() LaunchYourStore::get woopay test orders count code WC 9.6.0
public function get_woopay_test_orders_count() { $return = function ( $count ) { return new \WP_REST_Response( array( 'count' => $count ) ); }; $orders = wc_get_orders( array( // phpcs:ignore 'meta_key' => '_wcpay_mode', // phpcs:ignore 'meta_value' => 'test', 'return' => 'ids', ) ); return $return( count( $orders ) ); }