Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
22a2117c
Commit
22a2117c
authored
Jan 08, 2018
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加用户中心创建订单的接口
parent
4ac931ea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
ucenter_order.php
example/ucenter_order.php
+18
-0
Order.php
src/ucenter/Order.php
+40
-0
No files found.
example/ucenter_order.php
0 → 100644
View file @
22a2117c
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2018/1/8
* Time: 18:52
*/
use
internalApi\ucenter\Order
;
require
__DIR__
.
'/_init.php'
;
Order
::
setDebug
();
$order
=
Order
::
create
(
12
,
'0.01'
,
'http://xue.yunya.com/api/pay-notify'
,
'xue_test'
,
'xue_test_123'
,
'学院测试订单'
,
'http://xue.yunya.com/home/course-info?courseId=123'
);
print_r
(
$order
);
\ No newline at end of file
src/ucenter/Order.php
0 → 100644
View file @
22a2117c
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2018/1/8
* Time: 18:35
*/
namespace
internalApi\ucenter
;
use
internalApi\base\Client
;
/**
* 用户中心订单服务
* @package internalApi\ucenter
*/
class
Order
extends
Client
{
/**
* 创建订单
*
* @param int $uid 用户ID
* @param float $amount 订单金额,以元为单位,最多精确到小数点两位
* @param string $callbackUrl 支付回调地址
* @param string $prefix 商品类型前缀,每个平台不同商品如果需要细分需要明确类别前缀,比如学院的课程,则前缀标为 xue_course,依此类推
* @param string $key 商品唯一索引,每个商品唯一的索引值,建议使用 prefix_ID,如 xue_course_112345
* @param string $name 商品名称
* @param string $url 商品URL地址
* @param string $image 商品图片
* @param string $description 商品介绍
* @return array 订单信息
* @throws \internalApi\base\ApiException
*/
public
static
function
create
(
$uid
,
$amount
,
$callbackUrl
,
$prefix
,
$key
,
$name
,
$url
,
$image
=
''
,
$description
=
''
)
{
return
self
::
call
(
'order.create'
,
compact
(
'uid'
,
'amount'
,
'callbackUrl'
,
'prefix'
,
'key'
,
'name'
,
'url'
,
'image'
,
'description'
));
}
}
\ 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