Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rpc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lambda
rpc
Commits
5203a576
Commit
5203a576
authored
May 12, 2017
by
TingSong-Syu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Product add method present
parent
d9b2ef92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
Product.php
src/pay_center/Product.php
+17
-0
No files found.
src/pay_center/Product.php
View file @
5203a576
...
...
@@ -53,4 +53,20 @@ class Product implements IAssignable {
public
static
function
hasBought
(
string
$name
,
int
$userId
)
:
bool
{
return
array_key_exists
(
$name
,
self
::
userBought
(
$userId
));
}
/**
* @param int $userId
* @param string $comment
*
* @return Order
*/
public
function
present
(
int
$userId
,
string
$comment
=
''
)
{
$purpose
=
new
Purpose
();
$purpose
->
productName
=
$this
->
name
;
$purpose
->
payMethod
=
Order
::
PAY_PRESENT
;
$purpose
->
userId
=
$userId
;
$purpose
->
comment
=
$comment
;
$purpose
->
money
=
0
;
return
RPCWrapper
::
rpc
(
'pay_center'
)
->
call
(
'buy'
,
$purpose
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment