ThirdApi.php 884 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * 第三方接口
  4. * User: solu
  5. * Date: 2018/12/10
  6. * Time: 4:40 PM
  7. */
  8. class ThirdApi {
  9. /**
  10. * 上报游戏结果
  11. * @author solu
  12. * @param $gameId
  13. * @param $betAmount
  14. * @param $winAmount
  15. * @param string $appid
  16. * @return mixed
  17. */
  18. public static function reportGameResult($gameId, $betAmount, $winAmount, $appid = 'baccarat') {
  19. $api = URL_SICBO . 'eos/gameResult';
  20. $data = [
  21. 'gameid' => $gameId,
  22. 'game_name' => $appid,
  23. 'bet_amount' => $betAmount,
  24. 'win_amount' => $winAmount,
  25. ];
  26. $objEosAES = new EosAES($GLOBALS['codeGtAdmin']);
  27. $objHttp = new dwHttp();
  28. $seed = "{$appid}|{$gameId}";
  29. $data['sign'] = $objEosAES->encode($seed);
  30. $resp = $objHttp->post2($api, $data);
  31. return json_decode($resp, true);
  32. }
  33. }