Fuyou123.php 3.9 KB

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