1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace app\common\Enum;
- class PayEnum
- {
- /**
- * 支付方式 枚举
- */
- const METHOD_ALIPAY = 'alipay';
- const METHOD_WECHAT = 'wechat';
- const METHOD_DOUYIN = 'douyin';
- const METHOD_BALANCE = 'balance';
- const METHOD_OFFLINE = 'offline';
- const METHOD_COD = 'cod';
- const METHOD_BANK_CARD = 'bank_card';
- const METHOD_SCORE = 'score';
- // 支付类型枚举
- const METHOD_TEXT_MAP = [
- self::METHOD_WECHAT => '微信支付',
- self::METHOD_ALIPAY => '支付宝',
- self::METHOD_DOUYIN => '抖音支付',
- // self::METHOD_BALANCE => '余额支付',
- // self::METHOD_OFFLINE => '线下支付',
- //self::METHOD_COD => '货到付款',
- // self::METHOD_BANK_CARD => '银行卡支付',
- //self::METHOD_SCORE => '积分支付',
- ];
- // 商户类型
- const MERCHANT_TYPE_NORMAL = 0;
- // 服务商商户
- const MERCHANT_TYPE_SERVICE = 2;
- const MERCHANT_TYPE_MAP = [
- self::MERCHANT_TYPE_NORMAL => '普通商户',
- self::MERCHANT_TYPE_SERVICE => '服务商',
- ];
- public static function getMerchantTypeList()
- {
- return self::MERCHANT_TYPE_MAP;
- }
- public static function getMerchantTypeText($type){
- return self::MERCHANT_TYPE_MAP[$type] ?? '未知';
- }
-
- public static function getPayMethodList()
- {
- return self::METHOD_TEXT_MAP;
- }
- public static function getPayMethodText($method)
- {
- return self::METHOD_TEXT_MAP[$method] ?? '未知';
- }
- const PAY_STATUS_UNPAID = 'unpaid';
- const PAY_STATUS_PAID = 'paid';
- const PAY_STATUS_REFUND = 'refund';
- public function statusList()
- {
- return [
- self::PAY_STATUS_UNPAID => '未支付',
- self::PAY_STATUS_PAID => '已支付',
- self::PAY_STATUS_REFUND => '已退款'
- ];
- }
- }
|