From 04662963c5d66033d97a8d237be89b39f899fad4 Mon Sep 17 00:00:00 2001 From: ying <1023927037@qq.com> Date: Sat, 6 Oct 2018 07:28:55 +0800 Subject: [PATCH] fix api.js --- src/document/cn/apis.js | 55 ++++++++++++++++++++++++++++++++++++++- src/document/en/apis.js | 57 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 110 insertions(+), 2 deletions(-) diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index 5642c6f87..c01faa190 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -106,7 +106,60 @@ * @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在 * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 */ - +/** + * @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} 创建H5支付单(仅支持支付宝) + * @apiName NewMobileH5Pay + * @apiGroup MobileH5 + * @apiVersion 1.0.0 + * @apiDescription + * + * H5支付适用场景为移动端App或者手机自带浏览器进行支付,用户下单后浏览器跳转至微信支付页面并自动拉起支付宝客户端完成支付。
+ * 返回值包括跳转支付地址,跳转支付页需要带上签名信息。 + * 货币类型如果是CNY,注意通过汇率转换后不得低于0.01AUD,否则订单可以创建成功,但支付时会报金额不合法错误
+ * + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code 必填,商户编码,由4位大写字母或数字构成 + * @apiParam (PathVariable) {String} order_id 必填,商户支付订单号,要求同一商户唯一 + * @apiUse Sign + * @apiParam (JSON) {String} description 必填,订单标题(最大长度128字符,超出自动截取) + * @apiParam (JSON) {int} price 必填,金额,单位为货币最小单位,例如使用100表示AUD1.00 + * @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码 + * @apiParam (JSON) {String=Alipay} channel 支付渠道,大小写敏感 + * @apiParam (JSON) {String} notify_url 支付通知url,详见支付通知api,不填则不会推送支付通知 + * @apiParam (JSON) {String} operator 操作人员标识 + * + * @apiSuccess {String} return_code 执行结果 + * @apiSuccess {String} result_code SUCCESS表示创建订单成功,EXISTS表示订单已存在 + * @apiSuccess {String} partner_code 商户编码 + * @apiSuccess {String} channel 支付渠道 + * @apiSuccess {String} full_name 商户注册全名 + * @apiSuccess {String} partner_name 商户名称 + * @apiSuccess {String} order_id RoyalPay订单ID,同时也是微信订单ID,最终支付成功的订单ID可能不同 + * @apiSuccess {String} partner_order_id 商户订单ID + * @apiSuccess {String} pay_url 跳转URL + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 + * @apiError (ERROR_CODE) ORDER_PAID 订单已支付 + * + */ +/** + * @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5支付跳转页 + * @apiName MobileH5Pay + * @apiDescription 必须先调用创建H5支付订单接口再进行跳转。 + * 建议在用户回调到对应页时通过后台查询订单状态接口确认订单的支付状态。 + * @apiVersion 1.0.0 + * @apiGroup MobileH5 + * @apiParam (PathVariable) {String} partner_code 必填,商户编码,由4位大写字母或数字构成 + * @apiParam (PathVariable) {String} order_id 必填,商户支付订单号,要求已预先创建 + * @apiUse Sign + * @apiParam (QueryParam) {String} redirect 必填,支付成功后跳转页面,回调时会带上签名参数用于校验 + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在 + * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 + */ /** * @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} 创建JSAPI订单 diff --git a/src/document/en/apis.js b/src/document/en/apis.js index 7abb83c7d..b70133991 100644 --- a/src/document/en/apis.js +++ b/src/document/en/apis.js @@ -109,7 +109,62 @@ * @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner */ - +/** + * @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} Create H5 Payment(Only support Alipay) + * @apiName NewMobileH5Pay + * @apiGroup MobileH5 + * @apiVersion 1.0.0 + * @apiDescription + * + * Alipay has no limit at the moment.
+ * H5 Payment is used for payment in Webpage or App on mobile outside WeChat or Alipay App. The browser would redirect to a webpage from WeChat or Alipay and call the App to finish the payment.
+ * Return value contains a payment page. Partners shall guide users to redirect to this page. Sign params are required. + * If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD, + * otherwise user will get Invalid Amount Error from WeChat when making the payment.
+ * + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code Required, Partner code + * @apiParam (PathVariable) {String} order_id Required, Partner order id + * @apiUse Sign + * @apiParam (JSON) {String} description Required, Order description + * @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency. + * @apiParam (JSON) {String=AUD,CNY} currency=AUD currency + * @apiParam (JSON) {String=Alipay} channel Payment channel, case sensitive + * @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds + * @apiParam (JSON) {String} operator Note for the operator who created this order. + * + * @apiSuccess {String} return_code Execution result + * @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed. + * @apiSuccess {String} partner_code Partner code + * @apiSuccess {String} channel Payment channel + * @apiSuccess {String} full_name Partner's full company name when registered + * @apiSuccess {String} partner_name Partner's name + * @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. + * @apiSuccess {String} partner_order_id Partner order id + * @apiSuccess {String} pay_url Payment page in RoyalPay. + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner + * @apiError (ERROR_CODE) ORDER_PAID Order has already been paid + * + */ +/** + * @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5 Payment Page + * @apiName MobileH5Pay + * @apiDescription This page mush be called after payment order has been created. + * When jumping back to redirection URL, it is recommended to call the order query API to make sure the payment has succeeded. + * @apiVersion 1.0.0 + * @apiGroup MobileH5 + * @apiParam (PathVariable) {String} partner_code Required, Partner code + * @apiParam (PathVariable) {String} order_id Required, Partner order id. It shall have already been created + * @apiUse Sign + * @apiParam (QueryParam) {String} redirect Required, Redirect url when payment succeeded. Contain sign parameters for validation. + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist + * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner + */ /** * @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order