PayTypeEnum.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. namespace common\enums;
  3. /**
  4. * 支付类型
  5. *
  6. * Class PayTypeEnum
  7. * @package common\enums
  8. * @author jianyan74 <751393839@qq.com>
  9. */
  10. class PayTypeEnum extends BaseEnum
  11. {
  12. const ON_LINE = 0;
  13. const USER_MONEY = 1;
  14. const CASH = 2;
  15. const PAY_ON_DELIVERY = 3;
  16. // 第三方支付
  17. const WECHAT = 100;
  18. const ALI = 101;
  19. const UNION = 102;
  20. const BYTE_DANCE = 103;
  21. // 信用卡
  22. const STRIPE = 200;
  23. // 其他
  24. const OFFLINE = 300;
  25. const INTEGRAL = 301;
  26. const BARGAIN = 302;
  27. /**
  28. * @return array
  29. */
  30. public static function getMap(): array
  31. {
  32. return [
  33. self::ON_LINE => '', // 在线支付
  34. self::WECHAT => '微信',
  35. self::ALI => '支付宝',
  36. self::UNION => '银联卡',
  37. self::PAY_ON_DELIVERY => '货到付款',
  38. self::USER_MONEY => '余额支付',
  39. self::CASH => '现金',
  40. self::BYTE_DANCE => '字节跳动',
  41. // 其他
  42. self::OFFLINE => '线下支付',
  43. self::INTEGRAL => '积分兑换',
  44. self::BARGAIN => '砍价',
  45. // 海外
  46. self::STRIPE => '信用卡支付(By Stripe)',
  47. ];
  48. }
  49. /**
  50. * 调用方法
  51. *
  52. * @param $type
  53. * @return mixed|string
  54. */
  55. public static function action($type)
  56. {
  57. $ations = [
  58. self::WECHAT => 'wechat',
  59. self::ALI => 'alipay',
  60. self::UNION => 'union',
  61. self::STRIPE => 'stripe',
  62. ];
  63. return $ations[$type] ?? '';
  64. }
  65. /**
  66. * @return array
  67. */
  68. public static function thirdParty()
  69. {
  70. return [
  71. self::USER_MONEY => '余额',
  72. self::WECHAT => '微信',
  73. self::ALI => '支付宝',
  74. self::UNION => '银联卡',
  75. self::STRIPE => '信用卡支付(By Stripe)',
  76. ];
  77. }
  78. }
粤ICP备19079148号