WC_Gateway_BACS::process_payment()publicWC 1.0

Process the payment and return the result.

Метод класса: WC_Gateway_BACS{}

Возвращает

Массив.

Использование

$WC_Gateway_BACS = new WC_Gateway_BACS();
$WC_Gateway_BACS->process_payment( $order_id );
$order_id(int) (обязательный)
Order ID.

Код WC_Gateway_BACS::process_payment() WC 8.7.0

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 ),
	);

}