李帅

1.使用谷歌服务账号进行验证

...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
3 namespace App\Console\Commands; 3 namespace App\Console\Commands;
4 4
5 use App\Payment\GooglePayment; 5 use App\Payment\GooglePayment;
6 +use Carbon\Carbon;
6 use Illuminate\Console\Command; 7 use Illuminate\Console\Command;
7 8
8 class DevGoogle extends Command 9 class DevGoogle extends Command
...@@ -38,21 +39,27 @@ class DevGoogle extends Command ...@@ -38,21 +39,27 @@ class DevGoogle extends Command
38 */ 39 */
39 public function handle() 40 public function handle()
40 { 41 {
42 +//
43 +// $credentials_file = public_path().'/pc-api-7482901338487549764-603-566eccf76b91.json';
44 +// $client = new \Google_Client();
45 +// $client->setAuthConfig($credentials_file);
46 +// $client->setApplicationName("Client_Library_Examples");
47 +// $client->setScopes(
48 +// [
49 +// \Google_Service_AndroidPublisher::ANDROIDPUBLISHER,
50 +// ]
51 +// );
52 +//
53 +// $validator =new \Google_Service_AndroidPublisher($client);
54 +// $resp = $validator->purchases_subscriptions->get('pub.yiyan.parlando.Parlando', 'monthly_yiyan_vip', 'aa');
55 +// dd($resp);
41 56
42 - $credentials_file = public_path().'/pc-api-7482901338487549764-603-566eccf76b91.json'; 57 + $time = 1668186646527;
43 - $client = new \Google_Client(); 58 + $startTime = 1668184557316;
44 - $client->setAuthConfig($credentials_file); 59 + echo date('Y-m-d H:i:s',$startTime/1000) . PHP_EOL;
45 - $client->setApplicationName("Client_Library_Examples"); 60 + echo date('Y-m-d H:i:s',$time/1000) . PHP_EOL;
46 - $client->setScopes(
47 - [
48 - \Google_Service_AndroidPublisher::ANDROIDPUBLISHER,
49 - ]
50 - );
51 -
52 - $validator =new \Google_Service_AndroidPublisher($client);
53 - $resp = $validator->purchases_subscriptions->get('pub.yiyan.parlando.Parlando', 'monthly_yiyan_vip', 'aa');
54 - dd($resp);
55 61
62 + echo Carbon::createFromTimestampMs($time)->toDateTimeString();
56 return 0; 63 return 0;
57 } 64 }
58 } 65 }
......
...@@ -25,6 +25,12 @@ class Controller extends BaseController ...@@ -25,6 +25,12 @@ class Controller extends BaseController
25 { 25 {
26 $ua = request()->header('user-agent'); 26 $ua = request()->header('user-agent');
27 27
28 - return 'ios'; 28 + if (strpos($ua, 'iPhone') || strpos($ua, 'iPad') || strpos($ua,'Mac OS X')) {
29 + return 'ios';
30 + }else if (strpos($ua, 'Android') || strpos($ua, 'android')){
31 + return 'android';
32 + }else{
33 + return 'unkown';
34 + }
29 } 35 }
30 } 36 }
......
This diff is collapsed. Click to expand it.