WC_Gateway_Paypal_Response::payment_on_hold()protectedWC 1.0

Hold order and add note.

Method of the class: WC_Gateway_Paypal_Response{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->payment_on_hold( $order, $reason );
$order(WC_Order) (required)
Order object.
$reason(string)
Reason why the payment is on hold.
Default: ''

WC_Gateway_Paypal_Response::payment_on_hold() code WC 8.7.0

protected function payment_on_hold( $order, $reason = '' ) {
	$order->update_status( 'on-hold', $reason );

	if ( isset( WC()->cart ) ) {
		WC()->cart->empty_cart();
	}
}