HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/centrum8a.komma.pro/app/KommaApp/Shop/Orders/OrderStatus.php
<?php
namespace App\KommaApp\Shop\Orders;

abstract class OrderStatus
{
    const pending                   = 'pending';               //Customer started the checkout process but did not complete it
    const awaiting_payment          = 'awaiting_payment';      //customer has completed the checkout process, but payment has yet to be confirmed
    const awaiting_fulfillment      = 'awaiting_fulfillment';  //customer has completed the checkout process and payment has been confirmed
    const awaiting_shipment         = 'awaiting_shipment';     //Order has been picked and packaged and is awaiting collection from a shipping provider
    const awaiting_pickup           = 'awaiting_pickup';       //Order has been packaged and is awaiting customer pickup from a seller-specified location
    const partially_shipped         = 'partially_shipped';     //Only some items in the order have been shipped, due to some products being pre-order only or other reasons
    const completed                 = 'completed';             //The order has been shipped/picked up. And receipt is confirmed. An Authorize only transaction has been captured. client has paid for their digital product, and their file(s) are available for download.
    const shipped                   = 'shipped';               //Order has been shipped, but receipt has not been confirmed
    const canceled                  = 'canceled';              //Seller has canceled an order, due to a stock inconsistency or other reasons
    const declined                  = 'declined';              //Seller has marked the order as declined for lack of manual payment, or other reasons
    const refunded                  = 'refunded';              //Seller refunded the payment
    const partially_refunded        = 'partially_refunded';    //Seller has partially refunded the order.
    const Disputed                  = 'Disputed';              //Customer has initiated a dispute resolution process for the PayPal transaction that paid for the order
    const Verification              = 'Verification';          //Order on hold while some aspect (e.g. tax-exempt documentation) needs to be manually confirmed

    /**
     * @return int[] All OrderStatus as an array of integers
     */
    static function getAsArray() {
        return self::getAllOrderStatus();
    }

    /**
     * Check if the passed role is really a role that is defined as a constant in this class.
     *
     * @param int $role
     * @param bool $strict If true it will only consider a role as valid if it is an int. If it for example is a numeric string it won't consider it valid
     * @return bool Returns true if the role is a valid one, false otherwise
     */
    static function isValidRole(int $role, $strict = false) {
        return in_array($role, self::getAllOrderStatus(), $strict);
    }

    /**
     * Returns an array containing integers representing the defined OrderStatus.
     *
     * @return int[]
     */
    private static function getAllOrderStatus()
    {
        $thisClassAsReflectionClass = new \ReflectionClass(__CLASS__);
        return $thisClassAsReflectionClass->getConstants();
    }
}