Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-Server
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
李帅
2022-11-13 00:00:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b73a3033fe60807be462e2ef145abdd95e382036
b73a3033
1 parent
b0d5fb41
1.使用谷歌服务账号进行验证
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
14 deletions
app/Console/Commands/DevGoogle.php
app/Http/Controllers/Controller.php
app/Payment/GooglePayment.php
app/Console/Commands/DevGoogle.php
View file @
b73a303
...
...
@@ -3,6 +3,7 @@
namespace
App\Console\Commands
;
use
App\Payment\GooglePayment
;
use
Carbon\Carbon
;
use
Illuminate\Console\Command
;
class
DevGoogle
extends
Command
...
...
@@ -38,21 +39,27 @@ class DevGoogle extends Command
*/
public
function
handle
()
{
//
// $credentials_file = public_path().'/pc-api-7482901338487549764-603-566eccf76b91.json';
// $client = new \Google_Client();
// $client->setAuthConfig($credentials_file);
// $client->setApplicationName("Client_Library_Examples");
// $client->setScopes(
// [
// \Google_Service_AndroidPublisher::ANDROIDPUBLISHER,
// ]
// );
//
// $validator =new \Google_Service_AndroidPublisher($client);
// $resp = $validator->purchases_subscriptions->get('pub.yiyan.parlando.Parlando', 'monthly_yiyan_vip', 'aa');
// dd($resp);
$credentials_file
=
public_path
()
.
'/pc-api-7482901338487549764-603-566eccf76b91.json'
;
$client
=
new
\Google_Client
();
$client
->
setAuthConfig
(
$credentials_file
);
$client
->
setApplicationName
(
"Client_Library_Examples"
);
$client
->
setScopes
(
[
\Google_Service_AndroidPublisher
::
ANDROIDPUBLISHER
,
]
);
$validator
=
new
\Google_Service_AndroidPublisher
(
$client
);
$resp
=
$validator
->
purchases_subscriptions
->
get
(
'pub.yiyan.parlando.Parlando'
,
'monthly_yiyan_vip'
,
'aa'
);
dd
(
$resp
);
$time
=
1668186646527
;
$startTime
=
1668184557316
;
echo
date
(
'Y-m-d H:i:s'
,
$startTime
/
1000
)
.
PHP_EOL
;
echo
date
(
'Y-m-d H:i:s'
,
$time
/
1000
)
.
PHP_EOL
;
echo
Carbon
::
createFromTimestampMs
(
$time
)
->
toDateTimeString
();
return
0
;
}
}
...
...
app/Http/Controllers/Controller.php
View file @
b73a303
...
...
@@ -25,6 +25,12 @@ class Controller extends BaseController
{
$ua
=
request
()
->
header
(
'user-agent'
);
return
'ios'
;
if
(
strpos
(
$ua
,
'iPhone'
)
||
strpos
(
$ua
,
'iPad'
)
||
strpos
(
$ua
,
'Mac OS X'
))
{
return
'ios'
;
}
else
if
(
strpos
(
$ua
,
'Android'
)
||
strpos
(
$ua
,
'android'
)){
return
'android'
;
}
else
{
return
'unkown'
;
}
}
}
...
...
app/Payment/GooglePayment.php
View file @
b73a303
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment