62 lines
1.8 KiB
PHP
62 lines
1.8 KiB
PHP
<?php
|
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
# source: payment/v1/payment.proto
|
|
|
|
namespace Payment\V1;
|
|
|
|
use UnexpectedValueException;
|
|
|
|
/**
|
|
* PaymentProvider represents the supported set
|
|
* of payment providers.
|
|
*
|
|
* Protobuf type <code>payment.v1.PaymentProvider</code>
|
|
*/
|
|
class PaymentProvider
|
|
{
|
|
/**
|
|
* Generated from protobuf enum <code>PAYMENT_PROVIDER_UNSPECIFIED = 0;</code>
|
|
*/
|
|
const PAYMENT_PROVIDER_UNSPECIFIED = 0;
|
|
/**
|
|
* Generated from protobuf enum <code>PAYMENT_PROVIDER_STRIPE = 1;</code>
|
|
*/
|
|
const PAYMENT_PROVIDER_STRIPE = 1;
|
|
/**
|
|
* Generated from protobuf enum <code>PAYMENT_PROVIDER_PAYPAL = 2;</code>
|
|
*/
|
|
const PAYMENT_PROVIDER_PAYPAL = 2;
|
|
/**
|
|
* Generated from protobuf enum <code>PAYMENT_PROVIDER_APPLE = 3;</code>
|
|
*/
|
|
const PAYMENT_PROVIDER_APPLE = 3;
|
|
|
|
private static $valueToName = [
|
|
self::PAYMENT_PROVIDER_UNSPECIFIED => 'PAYMENT_PROVIDER_UNSPECIFIED',
|
|
self::PAYMENT_PROVIDER_STRIPE => 'PAYMENT_PROVIDER_STRIPE',
|
|
self::PAYMENT_PROVIDER_PAYPAL => 'PAYMENT_PROVIDER_PAYPAL',
|
|
self::PAYMENT_PROVIDER_APPLE => 'PAYMENT_PROVIDER_APPLE',
|
|
];
|
|
|
|
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);
|
|
}
|
|
}
|
|
|