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-22 01:12:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
535459c5aeaf7fb357ccdea5726997161717b208
535459c5
1 parent
2997a99f
1.打印苹果日志
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletions
app/Http/Controllers/V1/PayController.php
app/Models/UserProfile.php
app/Payment/ApplePayment.php
app/Http/Controllers/V1/PayController.php
View file @
535459c
...
...
@@ -43,12 +43,15 @@ class PayController extends Controller
$order_sn
=
$request
->
post
(
'order_sn'
);
$pay_type
=
$request
->
post
(
'pay_type'
);
$token
=
$request
->
post
(
'token'
);
$others
=
$request
->
post
(
'others'
,[]);
$transactionId
=
$others
[
'apple'
][
'transactionIdentifier'
];
$originalTransactionId
=
$others
[
'apple'
][
'originalTransactionIdentifier'
];
$order
=
Order
::
query
()
->
where
(
'order_sn'
,
$order_sn
)
->
first
();
if
(
$order
->
status
!=
Order
::
UNPAID
)
return
Response
::
fail
(
'订单错误!'
);
$payment
=
$factory
->
init
(
$pay_type
)
->
verify
(
$order
,
$token
);
$payment
=
$factory
->
init
(
$pay_type
)
->
verify
(
$order
,
$token
,
$transactionId
,
$originalTransactionId
);
if
(
$payment
)
return
Response
::
success
([
'order_sn'
=>
$order_sn
],
'支付成功'
);
else
return
Response
::
fail
(
'订单错误!'
);
...
...
app/Models/UserProfile.php
View file @
535459c
...
...
@@ -14,6 +14,12 @@ class UserProfile extends Model
protected
$fillable
=
[
'user_id'
,
'unionid'
];
const
IS_VIP
=
1
;
const
NO_VIP
=
0
;
const
WAIT_VIP
=
2
;
// 已付款,等待处理(回调不及时,需要等待)
public
function
user
()
{
return
$this
->
belongsTo
(
'App\Models\User'
,
'id'
,
'user_id'
);
...
...
app/Payment/ApplePayment.php
View file @
535459c
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment