WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal_Response::payment_complete() protected WC 1.0

Complete order, add transaction ID and note.

{} It's a method of the class: WC_Gateway_Paypal_Response{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->payment_complete( $order, $txn_id, $note );
$order(WC_Order) (required)
Order object.
$txn_id(string)
Transaction ID.
Default: ''
$note(string)
Payment note.
Default: ''

Code of WC_Gateway_Paypal_Response::payment_complete() WC 5.7.1

protected function payment_complete( $order, $txn_id = '', $note = '' ) {
	if ( ! $order->has_status( array( 'processing', 'completed' ) ) ) {
		$order->add_order_note( $note );
		$order->payment_complete( $txn_id );

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