Automattic\WooCommerce\Internal\Orders

PointOfSaleOrderUtil::is_order_paid_at_pos │ public static │ WC 10.6.0

Check if the order was paid at POS, regardless of where it was created.

An order is considered paid at POS if:

  • It was created via the POS REST API, OR
  • It was paid via card terminal, OR
  • It was paid via cash at POS.

Метод класса: PointOfSaleOrderUtil{}

Хуков нет.

Возвращает

bool.

Использование

$result = PointOfSaleOrderUtil::is_order_paid_at_pos( $order ): bool;
$order(WC_Abstract_Order) (обязательный)
Order instance.

Список изменений

С версии 10.6.0 Введена.

Код PointOfSaleOrderUtil::is_order_paid_at_pos() WC 11.2.2

public static function is_order_paid_at_pos( WC_Abstract_Order $order ): bool {
	if ( self::is_pos_order( $order ) ) {
		return true;
	}

	if ( 'mobile_pos' === $order->get_meta( '_wcpay_ipp_channel' ) ) {
		return true;
	}

	if ( 'mobile_pos' === $order->get_meta( '_stripe_ipp_channel' ) ) {
		return true;
	}

	if ( '' !== $order->get_meta( '_cash_change_amount' ) ) {
		return true;
	}

	return false;
}