WC_Gateway_Cheque::process_payment()
Process the payment and return the result.
Метод класса: WC_Gateway_Cheque{}
Хуки из метода
Возвращает
Массив
.
Использование
$WC_Gateway_Cheque = new WC_Gateway_Cheque(); $WC_Gateway_Cheque->process_payment( $order_id );
- $order_id(int) (обязательный)
- Order ID.
Код WC_Gateway_Cheque::process_payment() WC Gateway Cheque::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 cheque). $order->update_status( apply_filters( 'woocommerce_cheque_process_payment_order_status', 'on-hold', $order ), _x( 'Awaiting check payment', 'Check payment method', 'woocommerce' ) ); } else { $order->payment_complete(); } // Remove cart. WC()->cart->empty_cart(); // Return thankyou redirect. return array( 'result' => 'success', 'redirect' => $this->get_return_url( $order ), ); }