PayEnum.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_COD = 'cod';
  14. const METHOD_BANK_CARD = 'bank_card';
  15. const METHOD_SCORE = 'score';
  16. // 支付类型枚举
  17. const METHOD_TEXT_MAP = [
  18. self::METHOD_WECHAT => '微信支付',
  19. self::METHOD_ALIPAY => '支付宝',
  20. self::METHOD_DOUYIN => '抖音支付',
  21. // self::METHOD_BALANCE => '余额支付',
  22. // self::METHOD_OFFLINE => '线下支付',
  23. //self::METHOD_COD => '货到付款',
  24. // self::METHOD_BANK_CARD => '银行卡支付',
  25. //self::METHOD_SCORE => '积分支付',
  26. ];
  27. // 商户类型
  28. const MERCHANT_TYPE_NORMAL = 0;
  29. // 服务商商户
  30. const MERCHANT_TYPE_SERVICE = 2;
  31. const MERCHANT_TYPE_MAP = [
  32. self::MERCHANT_TYPE_NORMAL => '普通商户',
  33. self::MERCHANT_TYPE_SERVICE => '服务商',
  34. ];
  35. public static function getMerchantTypeList()
  36. {
  37. return self::MERCHANT_TYPE_MAP;
  38. }
  39. public static function getMerchantTypeText($type){
  40. return self::MERCHANT_TYPE_MAP[$type] ?? '未知';
  41. }
  42. public static function getPayMethodList()
  43. {
  44. return self::METHOD_TEXT_MAP;
  45. }
  46. public static function getPayMethodText($method)
  47. {
  48. return self::METHOD_TEXT_MAP[$method] ?? '未知';
  49. }
  50. const PAY_STATUS_UNPAID = 'unpaid';
  51. const PAY_STATUS_PAID = 'paid';
  52. const PAY_STATUS_REFUND = 'refund';
  53. public function statusList()
  54. {
  55. return [
  56. self::PAY_STATUS_UNPAID => '未支付',
  57. self::PAY_STATUS_PAID => '已支付',
  58. self::PAY_STATUS_REFUND => '已退款'
  59. ];
  60. }
  61. }