Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #293 from bangbangda/add-shop-doc
Browse files Browse the repository at this point in the history
增加自定义版交易组件开放接口文档1.2
  • Loading branch information
overtrue authored Jul 19, 2021
2 parents de9c2f0 + 00a859f commit 2592bc5
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
- [自定义版交易组件 - 接入商品前接口](/docs/{{version}}/mini-program/shop/basic)
- [自定义版交易组件 - 商家入驻接口](/docs/{{version}}/mini-program/shop/account)
- [自定义版交易组件 - SPU接口](/docs/{{version}}/mini-program/shop/spu)
- [自定义版交易组件 - 订单接口](/docs/{{version}}/mini-program/shop/order)
- ## 开放平台
- ## 开放平台
- [入门](/docs/{{version}}/open-platform/index)
- [服务端](/docs/{{version}}/open-platform/server)
Expand Down
59 changes: 59 additions & 0 deletions mini-program/shop/order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 自定义版交易组件及开放接口 - 订单接口


## 生成订单

API:

```
$order = [
'create_time' => '2020-03-25 13:05:25'
'type' => 0,
......
];
$app->shop_order->add($productId);
```

> 注意:该接口可重入,如果order_id或out_order_id已存在,会直接更新整个订单数据

## 同步订单支付结果

API:

```
$pay = [
'out_order_id' => 'abc123'
'action_type' => 1,
......
];
$app->shop_order->add($productId);
```


## 获取订单

API:

```
// 商家自定义订单ID 微信侧订单id (二选一)
$orderId = [
'out_order_id' => 'abc123'
'order_id' => 122221,
];
$openid = 'abcdefg12112';
$app->shop_order->get($openid, $orderId);
```


## 检查场景值是否在支付校验范围内

API:

```
$app->shop_order->sceneCheck(1175);
```

0 comments on commit 2592bc5

Please sign in to comment.