Notify.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. namespace app\mobile\controller;
  3. use app\core\model\User;
  4. use app\core\model\UserAccount;
  5. use app\core\model\UserDrawcash;
  6. use app\core\model\UserRecharge;
  7. use app\core\service\Pay;
  8. use think\Log;
  9. use think\Request;
  10. class Notify
  11. {
  12. //充值回调page
  13. public function Page_recharge() {
  14. $param = Request::instance()->param();
  15. Log::write('notify begin', 'pay');
  16. Log::write($param, 'pay');
  17. Log::write('end', 'pay');
  18. vendor('fuyou.Gold');
  19. $gold = new \Gold();
  20. $check = $gold->rsaVerify($param['amt'].'|'.$param['login_id'].'|'.$param['mchnt_cd'].'|'.$param['mchnt_txn_ssn'].'|'.$param['resp_code'], $param['signature']);
  21. if(!$check) {
  22. echo '验证失败';exit;
  23. }
  24. $userRecharge = UserRecharge::get([
  25. 'outerNumber'=>$param['mchnt_txn_ssn']
  26. ]);
  27. if(!$userRecharge) {
  28. echo '不存在该充值记录';exit;
  29. }
  30. $user = User::get($userRecharge['userID']);
  31. if(!$user) {
  32. echo '该充值用户已经丢失';exit;
  33. }
  34. $userAccount = new UserAccount();
  35. //到账时间有点问题
  36. $userAccount->MODE_recharge_addMoney($userRecharge, $user, THINK_START_TIME);
  37. echo '验证通过';exit;
  38. }
  39. //充值回调Notify
  40. public function Notify_recharge() {
  41. $param = Request::instance()->param();
  42. Log::write($param, 'pay');
  43. $gold = new \Gold();
  44. $check = $gold->rsaVerify($param['amt'].'|'.$param['mchnt_cd'].'|'.$param['mchnt_txn_dt'].'|'.$param['mchnt_txn_ssn'].'|'.$param['mobile_no'].'|'.$param['remark'], $param['signature']);
  45. if(!$check) {
  46. return;
  47. }
  48. return view(__FUNCTION__, [
  49. 'money'=>''
  50. ]);
  51. }
  52. //提现
  53. public function Page_drawcash() {
  54. $param = Request::instance()->param();
  55. Log::write('notify begin', 'pay');
  56. Log::write($param, 'pay');
  57. Log::write('end', 'pay');
  58. vendor('fuyou.Gold');
  59. $gold = new \Gold();
  60. $check = $gold->rsaVerify($param['amt'].'|'.$param['login_id'].'|'.$param['mchnt_cd'].'|'.$param['mchnt_txn_ssn'].'|'.$param['resp_code'], $param['signature']);
  61. if(!$check) {
  62. echo '验证失败';exit;
  63. }
  64. $userDrawcash = UserDrawcash::get([
  65. 'outerNumber'=>$param['mchnt_txn_ssn'],
  66. 'userDrawcashID'=>$param['userDrawcashID']
  67. ]);
  68. if(!$userDrawcash) {
  69. echo '不存在该充值记录';exit;
  70. }
  71. $user = User::get($userDrawcash['userID']);
  72. if(!$user) {
  73. echo '该充值用户已经丢失';exit;
  74. }
  75. $userAccount = new UserAccount();
  76. //到账时间有点问题
  77. $userAccount->MODE_drawcash_decMoney_submit($msg, $userDrawcash, $user, THINK_START_TIME);
  78. echo $msg;exit;
  79. }
  80. //提现回调Notify
  81. public function Notify_drawcash() {
  82. $param = Request::instance()->param();
  83. Log::write($param, 'pay');
  84. $gold = new \Gold();
  85. $check = $gold->rsaVerify($param['amt'].'|'.$param['mchnt_cd'].'|'.$param['mchnt_txn_dt'].'|'.$param['mchnt_txn_ssn'].'|'.$param['mobile_no'].'|'.$param['remark'], $param['signature']);
  86. if(!$check) {
  87. return;
  88. }
  89. return view(__FUNCTION__, [
  90. 'money'=>''
  91. ]);
  92. }
  93. //提现到账notify
  94. public function Notify_drawcash_reach() {
  95. $param = Request::instance()->param();
  96. Log::write($param, 'pay');
  97. $gold = new \Gold();
  98. $check = $gold->rsaVerify($param['amt'].'|'.$param['mchnt_cd'].'|'.$param['mchnt_txn_dt'].'|'.$param['mchnt_txn_ssn'].'|'.$param['mobile_no'].'|'.$param['remark'], $param['signature']);
  99. if(!$check) {
  100. return;
  101. }
  102. return view(__FUNCTION__, [
  103. 'money'=>''
  104. ]);
  105. }
  106. }