WC_Gateway_BACS::process_payment( int $order_id )
Process the payment and return the result.
Description Description
Parameters Parameters
- $order_id
-
(Required) Order ID.
Return Return
(array)
Source Source
File: includes/gateways/bacs/class-wc-gateway-bacs.php
public function process_payment( $order_id ) { $order = wc_get_order( $order_id ); if ( $order->get_total() > 0 ) { // Mark as on-hold (we're awaiting the payment). $order->update_status( apply_filters( 'woocommerce_bacs_process_payment_order_status', 'on-hold', $order ), __( 'Awaiting BACS payment', 'woocommerce' ) ); } else { $order->payment_complete(); } // Remove cart. WC()->cart->empty_cart(); // Return thankyou redirect. return array( 'result' => 'success', 'redirect' => $this->get_return_url( $order ), ); }