GRAYBYTE WORDPRESS FILE MANAGER1078

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/chahida.co.in/wp-content/plugins/woocommerce/src/Internal/Orders/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/chahida.co.in/wp-content/plugins/woocommerce/src/Internal/Orders//IppFunctions.php
<?php

namespace Automattic\WooCommerce\Internal\Orders;

use WC_Order;
use WC_Gateway_COD;

/**
 * Class with methods for handling order In-Person Payments.
 */
class IppFunctions {

	/**
	 * Returns if order is eligible to accept In-Person Payments.
	 *
	 * @param WC_Order $order order that the conditions are checked for.
	 *
	 * @return bool true if order is eligible, false otherwise
	 */
	public static function is_order_in_person_payment_eligible( WC_Order $order ): bool {
		$has_status            = in_array( $order->get_status(), array( 'pending', 'on-hold', 'processing' ), true );
		$has_payment_method    = in_array( $order->get_payment_method(), array( WC_Gateway_COD::ID, 'woocommerce_payments', 'none' ), true );
		$order_is_not_paid     = null === $order->get_date_paid();
		$order_is_not_refunded = empty( $order->get_refunds() );

		$order_has_no_subscription_products = true;
		foreach ( $order->get_items() as $item ) {
			$product = $item->get_product();

			if ( is_object( $product ) && $product->is_type( 'subscription' ) ) {
				$order_has_no_subscription_products = false;
				break;
			}
		}

		return $has_status && $has_payment_method && $order_is_not_paid && $order_is_not_refunded && $order_has_no_subscription_products;
	}

	/**
	 * Returns if store is eligible to accept In-Person Payments.
	 *
	 * @return bool true if store is eligible, false otherwise
	 */
	public static function is_store_in_person_payment_eligible(): bool {
		$is_store_usa_based    = self::has_store_specified_country_currency( 'US', 'USD' );
		$is_store_canada_based = self::has_store_specified_country_currency( 'CA', 'CAD' );

		return $is_store_usa_based || $is_store_canada_based;
	}

	/**
	 * Checks if the store has specified country location and currency used.
	 *
	 * @param string $country country to compare store's country with.
	 * @param string $currency currency to compare store's currency with.
	 *
	 * @return bool true if specified country and currency match the store's ones. false otherwise
	 */
	public static function has_store_specified_country_currency( string $country, string $currency ): bool {
		return ( WC()->countries->get_base_country() === $country && get_woocommerce_currency() === $currency );
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
CardIcons
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:19
giriqfky / giriqfky
0644
CouponsController.php
3.518 KB
March 21 2023 20:45:06
giriqfky / giriqfky
0644
IppFunctions.php
2.19 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
MobileMessagingHandler.php
5.502 KB
April 10 2024 16:54:10
giriqfky / giriqfky
0644
OrderActionsRestController.php
20.819 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
OrderAttributionBlocksController.php
4.367 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
OrderAttributionController.php
15.318 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
OrderStatusRestController.php
2.62 KB
December 18 2024 22:19:16
giriqfky / giriqfky
0644
PaymentInfo.php
4.706 KB
December 16 2024 15:24:32
giriqfky / giriqfky
0644
PointOfSaleOrderUtil.php
0.723 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
TaxesController.php
1.799 KB
August 24 2022 02:07:06
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF