config.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. namespace refill\feimingyu_fs;
  3. use mtopcard;
  4. class config
  5. {
  6. const ORDER_URL = 'http://119.91.194.222:9999/api/v1/order/submit';
  7. const QUERY_URL = 'http://119.91.194.222:9999/api/v1/order/query';
  8. const BALANCE_URL = 'http://119.91.194.222:9999/api/v1/agent/balance';
  9. const APP_ID = 'VIP0001';
  10. const APP_SECRET = 'jKfgf9veDlUCuTeUqhTV/A==';
  11. const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_feimingyu_fs.php";
  12. const PRODUCT = [
  13. mtopcard\ChinaMobileCard => [
  14. //贵州
  15. 24 => [
  16. 30 => 309,
  17. 50 => 310,
  18. 100 => 311,
  19. 200 => 312,
  20. ],
  21. //云南
  22. 25 => [
  23. 30 => 313,
  24. 50 => 314,
  25. 100 => 315,
  26. 200 => 316,
  27. ],
  28. //江苏
  29. 10 => [
  30. 30 => 317,
  31. 50 => 318,
  32. 100 => 319,
  33. 200 => 320,
  34. ],
  35. //福建
  36. 13 => [
  37. 30 => 321,
  38. 50 => 322,
  39. 100 => 323,
  40. 200 => 324,
  41. ],
  42. ],
  43. mtopcard\ChinaTelecomCard => [
  44. //江苏
  45. 10 => [
  46. 30 => 297,
  47. 50 => 298,
  48. 100 => 299,
  49. 200 => 300,
  50. ],
  51. //广东
  52. 19 => [
  53. 30 => 301,
  54. 50 => 302,
  55. 100 => 303,
  56. 200 => 304,
  57. ],
  58. //四川
  59. 23 => [
  60. 30 => 305,
  61. 50 => 306,
  62. 100 => 307,
  63. 200 => 308,
  64. ],
  65. //新疆
  66. 31 => [
  67. 30 => 325,
  68. 50 => 326,
  69. 100 => 327,
  70. 200 => 328,
  71. ],
  72. //福建
  73. 13 => [
  74. 30 => 363,
  75. 50 => 364,
  76. 100 => 365,
  77. 200 => 366,
  78. ],
  79. ]
  80. ];
  81. const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
  82. public static function sign($params)
  83. {
  84. $params['appSecret'] = config::APP_SECRET;
  85. ksort($params);
  86. $content = '';
  87. foreach ($params as $key => $value) {
  88. if(self::check_empty($value) === false) {
  89. $content .= "{$key}={$value}&";
  90. }
  91. }
  92. $content = rtrim($content, '&');
  93. return md5($content);
  94. }
  95. public static function check_empty($value)
  96. {
  97. if (!isset($value))
  98. return true;
  99. if ($value === null)
  100. return true;
  101. if (trim($value) === "")
  102. return true;
  103. return false;
  104. }
  105. //key格式 卡类型-面值-regin_no
  106. const Price = [
  107. //移动
  108. "4-30-24" => 27.6, "4-50-24" => 46, "4-100-24" => 92, "4-200-24" => 184,//贵州 24
  109. "4-30-25" => 28.2, "4-50-25" => 47, "4-100-25" => 94, "4-200-25" => 188,//云南 25
  110. "4-30-10" => 28.35, "4-50-10" => 47.25, "4-100-10" => 94.5, "4-200-10" => 189,//江苏 10
  111. "4-30-13" => 28.2, "4-50-13" => 47, "4-100-13" => 94, "4-200-13" => 188,//福建 13
  112. //电信
  113. "6-30-10" => 28.05, "6-50-10" => 46.75, "6-100-10" => 93.5, "6-200-10" => 187,//江苏 10
  114. "6-30-19" => 28.05, "6-50-19" => 46.75, "6-100-19" => 93.5, "6-200-19" => 187,//广东 19
  115. "6-30-23" => 27.6, "6-50-23" => 46, "6-100-23" => 92, "6-200-23" => 184,//四川 23
  116. "6-30-31" => 27.9, "6-50-31" => 46.5, "6-100-31" => 93, "6-200-31" => 186,//新疆 31
  117. "6-30-13" => 27.45, "6-50-13" => 45.75, "6-100-13" => 91.5, "6-200-13" => 183,//福建 13
  118. ];
  119. }