<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: WAProto.proto

namespace PhpWA\Protocol\Proto\PaymentInfo;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.PaymentInfo.TxnStatus</code>
 */
class TxnStatus
{
    /**
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>PENDING_SETUP = 1;</code>
     */
    const PENDING_SETUP = 1;
    /**
     * Generated from protobuf enum <code>PENDING_RECEIVER_SETUP = 2;</code>
     */
    const PENDING_RECEIVER_SETUP = 2;
    /**
     * Generated from protobuf enum <code>INIT = 3;</code>
     */
    const INIT = 3;
    /**
     * Generated from protobuf enum <code>SUCCESS = 4;</code>
     */
    const SUCCESS = 4;
    /**
     * Generated from protobuf enum <code>COMPLETED = 5;</code>
     */
    const COMPLETED = 5;
    /**
     * Generated from protobuf enum <code>FAILED = 6;</code>
     */
    const FAILED = 6;
    /**
     * Generated from protobuf enum <code>FAILED_RISK = 7;</code>
     */
    const FAILED_RISK = 7;
    /**
     * Generated from protobuf enum <code>FAILED_PROCESSING = 8;</code>
     */
    const FAILED_PROCESSING = 8;
    /**
     * Generated from protobuf enum <code>FAILED_RECEIVER_PROCESSING = 9;</code>
     */
    const FAILED_RECEIVER_PROCESSING = 9;
    /**
     * Generated from protobuf enum <code>FAILED_DA = 10;</code>
     */
    const FAILED_DA = 10;
    /**
     * Generated from protobuf enum <code>FAILED_DA_FINAL = 11;</code>
     */
    const FAILED_DA_FINAL = 11;
    /**
     * Generated from protobuf enum <code>REFUNDED_TXN = 12;</code>
     */
    const REFUNDED_TXN = 12;
    /**
     * Generated from protobuf enum <code>REFUND_FAILED = 13;</code>
     */
    const REFUND_FAILED = 13;
    /**
     * Generated from protobuf enum <code>REFUND_FAILED_PROCESSING = 14;</code>
     */
    const REFUND_FAILED_PROCESSING = 14;
    /**
     * Generated from protobuf enum <code>REFUND_FAILED_DA = 15;</code>
     */
    const REFUND_FAILED_DA = 15;
    /**
     * Generated from protobuf enum <code>EXPIRED_TXN = 16;</code>
     */
    const EXPIRED_TXN = 16;
    /**
     * Generated from protobuf enum <code>AUTH_CANCELED = 17;</code>
     */
    const AUTH_CANCELED = 17;
    /**
     * Generated from protobuf enum <code>AUTH_CANCEL_FAILED_PROCESSING = 18;</code>
     */
    const AUTH_CANCEL_FAILED_PROCESSING = 18;
    /**
     * Generated from protobuf enum <code>AUTH_CANCEL_FAILED = 19;</code>
     */
    const AUTH_CANCEL_FAILED = 19;
    /**
     * Generated from protobuf enum <code>COLLECT_INIT = 20;</code>
     */
    const COLLECT_INIT = 20;
    /**
     * Generated from protobuf enum <code>COLLECT_SUCCESS = 21;</code>
     */
    const COLLECT_SUCCESS = 21;
    /**
     * Generated from protobuf enum <code>COLLECT_FAILED = 22;</code>
     */
    const COLLECT_FAILED = 22;
    /**
     * Generated from protobuf enum <code>COLLECT_FAILED_RISK = 23;</code>
     */
    const COLLECT_FAILED_RISK = 23;
    /**
     * Generated from protobuf enum <code>COLLECT_REJECTED = 24;</code>
     */
    const COLLECT_REJECTED = 24;
    /**
     * Generated from protobuf enum <code>COLLECT_EXPIRED = 25;</code>
     */
    const COLLECT_EXPIRED = 25;
    /**
     * Generated from protobuf enum <code>COLLECT_CANCELED = 26;</code>
     */
    const COLLECT_CANCELED = 26;
    /**
     * Generated from protobuf enum <code>COLLECT_CANCELLING = 27;</code>
     */
    const COLLECT_CANCELLING = 27;
    /**
     * Generated from protobuf enum <code>IN_REVIEW = 28;</code>
     */
    const IN_REVIEW = 28;
    /**
     * Generated from protobuf enum <code>REVERSAL_SUCCESS = 29;</code>
     */
    const REVERSAL_SUCCESS = 29;
    /**
     * Generated from protobuf enum <code>REVERSAL_PENDING = 30;</code>
     */
    const REVERSAL_PENDING = 30;
    /**
     * Generated from protobuf enum <code>REFUND_PENDING = 31;</code>
     */
    const REFUND_PENDING = 31;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::PENDING_SETUP => 'PENDING_SETUP',
        self::PENDING_RECEIVER_SETUP => 'PENDING_RECEIVER_SETUP',
        self::INIT => 'INIT',
        self::SUCCESS => 'SUCCESS',
        self::COMPLETED => 'COMPLETED',
        self::FAILED => 'FAILED',
        self::FAILED_RISK => 'FAILED_RISK',
        self::FAILED_PROCESSING => 'FAILED_PROCESSING',
        self::FAILED_RECEIVER_PROCESSING => 'FAILED_RECEIVER_PROCESSING',
        self::FAILED_DA => 'FAILED_DA',
        self::FAILED_DA_FINAL => 'FAILED_DA_FINAL',
        self::REFUNDED_TXN => 'REFUNDED_TXN',
        self::REFUND_FAILED => 'REFUND_FAILED',
        self::REFUND_FAILED_PROCESSING => 'REFUND_FAILED_PROCESSING',
        self::REFUND_FAILED_DA => 'REFUND_FAILED_DA',
        self::EXPIRED_TXN => 'EXPIRED_TXN',
        self::AUTH_CANCELED => 'AUTH_CANCELED',
        self::AUTH_CANCEL_FAILED_PROCESSING => 'AUTH_CANCEL_FAILED_PROCESSING',
        self::AUTH_CANCEL_FAILED => 'AUTH_CANCEL_FAILED',
        self::COLLECT_INIT => 'COLLECT_INIT',
        self::COLLECT_SUCCESS => 'COLLECT_SUCCESS',
        self::COLLECT_FAILED => 'COLLECT_FAILED',
        self::COLLECT_FAILED_RISK => 'COLLECT_FAILED_RISK',
        self::COLLECT_REJECTED => 'COLLECT_REJECTED',
        self::COLLECT_EXPIRED => 'COLLECT_EXPIRED',
        self::COLLECT_CANCELED => 'COLLECT_CANCELED',
        self::COLLECT_CANCELLING => 'COLLECT_CANCELLING',
        self::IN_REVIEW => 'IN_REVIEW',
        self::REVERSAL_SUCCESS => 'REVERSAL_SUCCESS',
        self::REVERSAL_PENDING => 'REVERSAL_PENDING',
        self::REFUND_PENDING => 'REFUND_PENDING',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

