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-12-17 22:56:06 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2a78f868a6c4bba7f340083650759f44a5003185
2a78f868
1 parent
5cb75643
1.打印苹果日志
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
4 deletions
app/Http/Controllers/V1/PayController.php
app/Payment/ApplePayment.php
app/Payment/PaymentFactory.php
app/Providers/AppServiceProvider.php
config/horizon.php
routes/api.php
app/Http/Controllers/V1/PayController.php
View file @
2a78f86
...
...
@@ -110,7 +110,14 @@ class PayController extends Controller
{
$all
=
$request
->
all
();
if
(
$service
==
'apple'
)
{
$factory
->
init
(
$service
)
->
notify
(
''
);
}
elseif
(
$service
==
'apple-sandbox'
){
$factory
->
init
(
$service
)
->
notifySandbox
(
$all
);
}
else
{
$factory
->
init
(
$service
)
->
notify
(
$all
[
'message'
][
'data'
]);
}
return
Response
::
ok
();
}
...
...
app/Payment/ApplePayment.php
View file @
2a78f86
...
...
@@ -35,4 +35,25 @@ class ApplePayment implements PaymentInterface
{
// 查询订单对应的产品id
}
public
function
notify
(
$all
)
{
Log
::
debug
(
print_r
(
$all
,
true
));
Log
::
debug
(
'apple返回的数据:===================='
);
$data
=
json_decode
(
base64_decode
(
$all
[
'signedPayload'
]),
true
);
Log
::
debug
(
print_r
(
$data
,
true
));
}
public
function
notifySandbox
(
$all
)
{
Log
::
debug
(
print_r
(
$all
,
true
));
Log
::
debug
(
'sandbox返回的数据:===================='
);
$data
=
json_decode
(
base64_decode
(
$all
[
'signedPayload'
]),
true
);
Log
::
debug
(
print_r
(
$data
,
true
));
}
}
\ No newline at end of file
...
...
app/Payment/PaymentFactory.php
View file @
2a78f86
...
...
@@ -23,6 +23,8 @@ class PaymentFactory
return
new
GooglePayment
();
case
'apple'
:
return
new
ApplePayment
();
case
'apple-sandbox'
:
return
new
ApplePayment
();
default
:
return
new
\Exception
(
'未知的支付方式'
);
}
...
...
app/Providers/AppServiceProvider.php
View file @
2a78f86
...
...
@@ -2,7 +2,9 @@
namespace
App\Providers
;
use
Illuminate\Support\Facades\Log
;
use
Illuminate\Support\ServiceProvider
;
use
Laravel\Horizon\Horizon
;
class
AppServiceProvider
extends
ServiceProvider
{
...
...
@@ -24,5 +26,8 @@ class AppServiceProvider extends ServiceProvider
public
function
boot
()
{
//
Horizon
::
auth
(
function
()
{
return
true
;
});
}
}
...
...
config/horizon.php
View file @
2a78f86
...
...
@@ -84,7 +84,7 @@ return [
*/
'waits'
=>
[
'redis:default'
=>
60
,
'redis:default'
=>
60
*
3
,
],
/*
...
...
@@ -151,7 +151,7 @@ return [
|
*/
'memory_limit'
=>
64
,
'memory_limit'
=>
256
,
/*
|--------------------------------------------------------------------------
...
...
routes/api.php
View file @
2a78f86
...
...
@@ -28,7 +28,7 @@ Route::prefix('v1')->namespace('App\Http\Controllers\V1')->group(function (Route
$api
->
any
(
'auth/{service}/callback'
,
'AuthController@apiHandleProviderCallback'
);
/** 社会化用户登录*/
$api
->
post
(
'socialite/{service}'
,
'AuthController@socialite'
);
$api
->
post
(
'
/
socialite/{service}'
,
'AuthController@socialite'
);
/** 增加观看次数 */
$api
->
get
(
'/addview/{id}'
,
'ImmerseController@addview'
);
...
...
@@ -52,7 +52,7 @@ Route::prefix('v1')->namespace('App\Http\Controllers\V1')->group(function (Route
$api
->
post
(
'/upload/audio'
,
'SettingController@uploadAudio'
);
/** 调起支付 */
$api
->
any
(
'pay/{service}/callback'
,
'PayController@iapCallback'
);
$api
->
any
(
'
/
pay/{service}/callback'
,
'PayController@iapCallback'
);
});
...
...
Please
register
or
login
to post a comment