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
af48c34d
Commit
af48c34d
authored
Jan 09, 2018
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户中心订单服务增加获取订单信息和验证订单回调CODE方法
parent
073e08b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
ucenter_order.php
example/ucenter_order.php
+4
-2
Order.php
src/ucenter/Order.php
+24
-1
No files found.
example/ucenter_order.php
View file @
af48c34d
...
@@ -12,7 +12,9 @@ require __DIR__.'/_init.php';
...
@@ -12,7 +12,9 @@ require __DIR__.'/_init.php';
Order
::
setDebug
();
Order
::
setDebug
();
$order
=
Order
::
create
(
12
,
'0.01'
,
'http://xue.yunya.com/api/pay-notify'
,
'xue_test'
,
'xue_test_123'
,
$order
=
Order
::
getByOid
(
'2018010818030671446574'
);
'学院测试订单'
,
'http://xue.yunya.com/home/course-info?courseId=123'
);
//$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
);
print_r
(
$order
);
\ No newline at end of file
src/ucenter/Order.php
View file @
af48c34d
...
@@ -24,7 +24,7 @@ class Order extends Client
...
@@ -24,7 +24,7 @@ class Order extends Client
* @param float $amount 订单金额,以元为单位,最多精确到小数点两位
* @param float $amount 订单金额,以元为单位,最多精确到小数点两位
* @param string $callbackUrl 支付回调地址
* @param string $callbackUrl 支付回调地址
* @param string $prefix 商品类型前缀,每个平台不同商品如果需要细分需要明确类别前缀,比如学院的课程,则前缀标为 xue_course,依此类推
* @param string $prefix 商品类型前缀,每个平台不同商品如果需要细分需要明确类别前缀,比如学院的课程,则前缀标为 xue_course,依此类推
* @param string $key 商品唯一索引,每个商品
唯一的索引值,建议使用 prefix_ID,如 xue_course_112345
* @param string $key 商品唯一索引,每个商品
在该平台的唯一的索引值,建议使用商品 ID
* @param string $name 商品名称
* @param string $name 商品名称
* @param string $url 商品URL地址
* @param string $url 商品URL地址
* @param string $image 商品图片
* @param string $image 商品图片
...
@@ -37,4 +37,27 @@ class Order extends Client
...
@@ -37,4 +37,27 @@ class Order extends Client
return
self
::
call
(
'order.create'
,
compact
(
'uid'
,
'amount'
,
'callbackUrl'
,
'prefix'
,
'key'
,
'name'
,
'url'
,
'image'
,
'description'
));
return
self
::
call
(
'order.create'
,
compact
(
'uid'
,
'amount'
,
'callbackUrl'
,
'prefix'
,
'key'
,
'name'
,
'url'
,
'image'
,
'description'
));
}
}
/**
* 根据OID获取订单信息
*
* @param string $oid
* @return array|null
*/
public
static
function
getByOid
(
$oid
)
{
return
self
::
call
(
'order.getByOid'
,
compact
(
'oid'
));
}
/**
* 验证支付回调码
*
* @param string $oid
* @param string $code
* @return bool 返回true代表验证通过,返回false验证失败
*/
public
static
function
verifyNotifyCode
(
$oid
,
$code
)
{
return
self
::
call
(
'order.verifyNotifyCode'
,
compact
(
'oid'
,
'code'
));
}
}
}
\ 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