6
0
Fork 0

优化支付方式枚举

release
李静 2022-02-25 13:45:12 +08:00
parent c23be217f4
commit f5cbf6a638
3 changed files with 8 additions and 8 deletions

View File

@ -9,8 +9,8 @@ enum PayWay: string {
// 微信支付
case WxpayApp = 'wxpay_app';
case WxpayH5 = 'wxpay_h5';
case WxpayJs = 'wxpay_jsapi';
case WxpayMp = 'wxpay_mp';
case WxpayJsApi = 'wxpay_jsapi';
case WxpayMiniProgram = 'wxpay_mp';
// 阿里支付
case AlipayApp = 'alipay_app';
@ -20,7 +20,7 @@ enum PayWay: string {
static::Offline => '#5b69bc',
static::Balance => '#dda451',
static::Wallet => '#ff8acc',
static::WxpayApp, static::WxpayH5, static::WxpayJs, static::WxpayMp => '#21b978',
static::WxpayApp, static::WxpayH5, static::WxpayJsApi, static::WxpayMiniProgram => '#21b978',
static::AlipayApp => '#3085d6',
default => '#ea5455',
};
@ -32,7 +32,7 @@ enum PayWay: string {
static::Offline => 'offline',
static::Balance => 'balance',
static::Wallet => 'wallet',
static::WxpayApp, static::WxpayH5, static::WxpayJs, static::WxpayMp => 'wxpay',
static::WxpayApp, static::WxpayH5, static::WxpayJsApi, static::WxpayMiniProgram => 'wxpay',
static::AlipayApp => 'alipay',
};
}
@ -43,7 +43,7 @@ enum PayWay: string {
static::Offline => '线下',
static::Balance => '余额',
static::Wallet => '可提',
static::WxpayApp, static::WxpayH5, static::WxpayJs, static::WxpayMp => '微信支付',
static::WxpayApp, static::WxpayH5, static::WxpayJsApi, static::WxpayMiniProgram => '微信支付',
static::AlipayApp => '支付宝',
default => 'Unknown',
};

View File

@ -18,7 +18,7 @@ enum WxpayTradeType: string {
return match ($payWay) {
PayWay::WxpayApp => static::App,
PayWay::WxpayH5 => static::H5,
PayWay::WxpayJs, PayWay::WxpayMp => static::JSAPI,
PayWay::WxpayJsApi, PayWay::WxpayMiniProgram => static::JSAPI,
default => null,
};
}

View File

@ -66,9 +66,9 @@ class PayLog extends Model
{
return in_array($this->pay_way, [
PayWay::WxpayApp,
PayWay::WxpayJs,
PayWay::WxpayJsApi,
PayWay::WxpayH5,
PayWay::WxpayMp,
PayWay::WxpayMiniProgram,
]);
}