1public function process_payment( $order_id ) {
2
3 $order = wc_get_order( $order_id );
4
5 // Mark as on-hold (we're awaiting the payment)
6 $order->update_status( 'on-hold', __( 'Awaiting offline payment', 'wc-gateway-offline' ) );
7
8 // Reduce stock levels
9 $order->reduce_order_stock();
10
11 // Remove cart
12 WC()->cart->empty_cart();
13
14 // Return thankyou redirect
15 return array(
16 'result' => 'success',
17 'redirect' => $this->get_return_url( $order )
18 );
19}
20