WC_Gateway_Cheque::process_payment() public WC 1.0
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(число) (обязательный)
- Order ID.
Код WC_Gateway_Cheque::process_payment() WC Gateway Cheque::process payment WC 5.0.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 ),
);
}