Commit 2bbe42a0 authored by 夏彬's avatar 夏彬

添加order createAndPayment 接口

parent adb30c26
......@@ -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',
// '学院测试订单', '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);
\ No newline at end of file
......@@ -37,6 +37,29 @@ class Order extends Client
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'));
}
/**
* 发起指定订单的退款请求
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment