WC_Gateway_Paypal_Response::payment_complete() protected WC 1.0
Complete order, add transaction ID and note.
{} Это метод класса: WC_Gateway_Paypal_Response{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->payment_complete( $order, $txn_id, $note );
- $order(WC_Order) (обязательный)
- Order object.
- $txn_id(строка)
- Transaction ID.
- $note(строка)
- Payment note.
Код WC_Gateway_Paypal_Response::payment_complete() WC Gateway Paypal Response::payment complete WC 5.0.0
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();
}
}
}