6
0
Fork 0
jiqu-library-server/app/Enums/PayWay.php

47 lines
1.1 KiB
PHP

<?php
namespace App\Enums;
enum PayWay: string {
case Offline = 'offline';
case Balance = 'balance';
case Wallet = 'wallet';
// 微信支付
case WxpayApp = 'wxpay_app';
case WxpayH5 = 'wxpay_h5';
case WxpayJs = 'wxpay_jsapi';
case WxpayMp = 'wxpay_mp';
// 阿里支付
case AlipayApp = 'alipay_app';
public function color()
{
return match ($this) {
static::Offline => '#5b69bc',
static::Wallet => '#ff8acc',
static::WxpayApp, static::WxpayH5, static::WxpayJs, static::WxpayMp => '#21b978',
default => '#ea5455',
};
}
public function getDealerOrderLabel()
{
return match ($this) {
static::Offline => 'offline',
static::Wallet => 'wallet',
static::WxpayH5 => 'wxpay',
default => 'unknown',
};
}
public function getDealerOrderText()
{
return match ($this) {
static::Offline => '线下打款',
static::Wallet => '余额支付',
static::WxpayH5 => '微信支付',
default => 'Unknown',
};
}
}