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
2bbe42a0
Commit
2bbe42a0
authored
May 07, 2018
by
夏彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加order createAndPayment 接口
parent
adb30c26
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
ucenter_order.php
example/ucenter_order.php
+4
-0
Order.php
src/ucenter/Order.php
+23
-0
No files found.
example/ucenter_order.php
View file @
2bbe42a0
...
@@ -18,4 +18,8 @@ $order = Order::getByOid('2018010818030671446574');
...
@@ -18,4 +18,8 @@ $order = Order::getByOid('2018010818030671446574');
//$order = Order::create(12, '0.01', 'http://xue.yunya.com/api/pay-notify', 'xue_test', 'xue_test_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');
// '学院测试订单', 'http://xue.yunya.com/home/course-info?courseId=123');
$order
=
Order
::
createAndPayment
(
'wx_lite'
,
12
,
'0.01'
,
'http://xue.yunya.com/api/pay-notify'
,
'xue_test'
,
'xue_test_123'
,
'学院测试订单'
,
'http://xue.yunya.com/home/course-info?courseId=123'
,
array
(
'open_id'
=>
'1111111111'
));
print_r
(
$order
);
print_r
(
$order
);
\ No newline at end of file
src/ucenter/Order.php
View file @
2bbe42a0
...
@@ -37,6 +37,29 @@ class Order extends Client
...
@@ -37,6 +37,29 @@ 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'
));
}
}
/**
* 创建订单并发起支付返回charge对象
*
* @param string $type 付款类型
* @param int $uid 用户ID
* @param float $amount 订单金额
* @param string $callbackUrl 支付回调地址
* @param string $prefix 商品类型前缀
* @param string $key 商品在该平台唯一索引,如商品ID
* @param string $name 商品名称
* @param string $url 商品URL地址
* @param array $extra 扩展信息,详见 https://www.pingxx.com/api#%E6%94%AF%E4%BB%98%E6%B8%A0%E9%81%93-extra-%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E
* @param string $image 商品图片
* @param string $description 商品介绍
* @return array 对象信息
*/
public
static
function
createAndPayment
(
$type
,
$uid
,
$amount
,
$callbackUrl
,
$prefix
,
$key
,
$name
,
$url
,
$extra
,
$image
=
''
,
$description
=
''
)
{
return
self
::
call
(
'order.createAndPayment'
,
compact
(
'type'
,
'uid'
,
'amount'
,
'callbackUrl'
,
'prefix'
,
'key'
,
'name'
,
'url'
,
'extra'
,
'image'
,
'description'
));
}
/**
/**
* 发起指定订单的退款请求
* 发起指定订单的退款请求
*
*
...
...
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