截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PayEnum.php 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\common\enum;
  20. /**
  21. * 支付
  22. * Class PayEnum
  23. * @package app\common\enum
  24. */
  25. class PayEnum
  26. {
  27. /**
  28. * 支付方式
  29. */
  30. const WECHAT_PAY = 1; //微信支付
  31. const ALI_PAY = 2; //支付宝支付
  32. const BALANCE_PAY = 3; //余额支付
  33. const OFFLINE_PAY = 4; //线下支付
  34. // 汇付斗拱微信
  35. const HFDG_WECHAT = 55;
  36. // 汇付斗拱支付宝
  37. const HFDG_ALIPAY = 66;
  38. const UNPAID = 0;//待支付
  39. const ISPAID = 1;//已支付
  40. const REFUNDED = 2;//已退款
  41. const REFUSED_REFUND = 3;//拒绝退款
  42. /**
  43. * Notes: 支付方式
  44. * @param bool $type
  45. * @author 段誉(2021/5/7 15:01)
  46. * @return array|string
  47. */
  48. public static function getPayWay($type = true)
  49. {
  50. $data = [
  51. self::WECHAT_PAY => '微信支付',
  52. self::ALI_PAY => '支付宝支付',
  53. self::BALANCE_PAY => '余额支付',
  54. self::OFFLINE_PAY => '线下支付',
  55. self::HFDG_WECHAT => '汇付斗拱(微信)',
  56. self::HFDG_ALIPAY => '汇付斗拱(支付宝)',
  57. ];
  58. if (true === $type) {
  59. return $data;
  60. }
  61. return $data[$type] ?? '-';
  62. }
  63. //支付状态
  64. public static function getPayStatus($type)
  65. {
  66. $data = [
  67. PayEnum::UNPAID => '待支付',
  68. PayEnum::ISPAID => '已支付',
  69. PayEnum::REFUNDED => '已退款',
  70. PayEnum::REFUSED_REFUND => '拒绝退款',
  71. ];
  72. if ($type === true) {
  73. return $data;
  74. }
  75. return $data[$type] ?? '未知';
  76. }
  77. }