WC_Gateway_Paypal_Response::payment_complete( WC_Order $order, string $txn_id = '', string $note = '' )

Complete order, add transaction ID and note.


Description Description


Parameters Parameters

$order

(Required) Order object.

$txn_id

(Optional) Transaction ID.

Default value: ''

$note

(Optional) Payment note.

Default value: ''


Top ↑

Source Source

File: includes/gateways/paypal/includes/class-wc-gateway-paypal-response.php

	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 );
			WC()->cart->empty_cart();
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.