PayEnum.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\common\Enum;
  3. class PayEnum
  4. {
  5. /**
  6. * 支付方式 枚举
  7. */
  8. const METHOD_ALIPAY = 'alipay';
  9. const METHOD_WECHAT = 'wechat';
  10. const METHOD_DOUYIN = 'douyin';
  11. const METHOD_BALANCE = 'balance';
  12. const METHOD_OFFLINE = 'offline';
  13. const METHOD_CASH = 'cash';
  14. const METHOD_BANK_CARD = 'bank_card';
  15. // 支付类型枚举
  16. const METHOD_TEXT_MAP = [
  17. // self::METHOD_WECHAT => '微信支付',
  18. // self::METHOD_ALIPAY => '支付宝',
  19. self::METHOD_DOUYIN => '抖音支付',
  20. // self::METHOD_BALANCE => '余额支付',
  21. // self::METHOD_OFFLINE => '线下支付',
  22. // self::METHOD_CASH => '现金支付',
  23. // self::METHOD_BANK_CARD => '银行卡支付',
  24. ];
  25. // 商户类型
  26. const MERCHANT_TYPE_NORMAL = 0;
  27. // 服务商商户
  28. const MERCHANT_TYPE_SERVICE = 1;
  29. const MERCHANT_TYPE_MAP = [
  30. self::MERCHANT_TYPE_NORMAL => '普通商户',
  31. self::MERCHANT_TYPE_SERVICE => '服务商商户',
  32. ];
  33. public static function getMerchantTypeList()
  34. {
  35. return self::MERCHANT_TYPE_MAP;
  36. }
  37. public static function getMerchantTypeText($type){
  38. return self::MERCHANT_TYPE_MAP[$type] ?? '未知';
  39. }
  40. public static function getPayMethodList()
  41. {
  42. return self::METHOD_TEXT_MAP;
  43. }
  44. public static function getPayMethodText($method)
  45. {
  46. return self::METHOD_TEXT_MAP[$method] ?? '未知';
  47. }
  48. }