benson vor 6 Jahren
Ursprung
Commit
844974a1cf
88 geänderte Dateien mit 2807 neuen und 1953 gelöschten Zeilen
  1. 27 22
      docs/.vuepress/config.js
  2. 3 0
      docs/.vuepress/public/tongyong.md
  3. 0 146
      docs/android/3.md
  4. 0 111
      docs/android/4.md
  5. 3 2
      docs/zh/android/6.md
  6. 3 3
      docs/android/README.md
  7. 0 0
      docs/android/channel.md
  8. 188 0
      docs/android/common.md
  9. 0 0
      docs/android/flow.md
  10. 2 1
      docs/android/1.md
  11. 125 0
      docs/android/purc.md
  12. 13 0
      docs/android/sign.md
  13. 0 194
      docs/h5/3.md
  14. 0 11
      docs/h5/4.md
  15. 4 3
      docs/h5/README.md
  16. 8 0
      docs/h5/channel.md
  17. 188 0
      docs/h5/common.md
  18. 18 0
      docs/h5/error.md
  19. 4 0
      docs/h5/flow.md
  20. 0 0
      docs/h5/overview.md
  21. 34 0
      docs/h5/purc.md
  22. 12 0
      docs/h5/sign.md
  23. 22 0
      docs/h5/test.md
  24. 0 144
      docs/ios/3.md
  25. 0 119
      docs/ios/4.md
  26. 1 1
      docs/zh/ios/6.md
  27. 3 3
      docs/ios/README.md
  28. 0 0
      docs/ios/channel.md
  29. 188 0
      docs/ios/common.md
  30. 0 0
      docs/ios/flow.md
  31. 0 0
      docs/ios/overview.md
  32. 134 0
      docs/ios/purc.md
  33. 13 0
      docs/ios/sign.md
  34. 0 3
      docs/pc/2.md
  35. 0 159
      docs/pc/3.md
  36. 0 17
      docs/pc/6.md
  37. 4 3
      docs/pc/README.md
  38. 203 92
      docs/pc/4.md
  39. 188 0
      docs/pc/common.md
  40. 18 0
      docs/pc/error.md
  41. 4 0
      docs/pc/flow.md
  42. 0 0
      docs/pc/overview.md
  43. 35 0
      docs/pc/purc.md
  44. 1 13
      docs/h5/2.md
  45. 3 3
      docs/pc/5.md
  46. 3 3
      docs/wx/README.md
  47. 0 146
      docs/zh/android/3.md
  48. 0 111
      docs/zh/android/4.md
  49. 3 2
      docs/android/6.md
  50. 3 3
      docs/zh/android/README.md
  51. 1 1
      docs/zh/android/5.md
  52. 188 0
      docs/zh/android/common.md
  53. 0 0
      docs/zh/android/flow.md
  54. 2 1
      docs/zh/android/1.md
  55. 125 0
      docs/zh/android/purc.md
  56. 13 0
      docs/zh/android/sign.md
  57. 0 23
      docs/zh/h5/2.md
  58. 0 136
      docs/zh/h5/3.md
  59. 3 3
      docs/zh/h5/README.md
  60. 15 0
      docs/zh/h5/channel.md
  61. 188 0
      docs/zh/h5/common.md
  62. 1 1
      docs/zh/pc/6.md
  63. 0 0
      docs/zh/h5/flow.md
  64. 0 0
      docs/zh/h5/overview.md
  65. 31 0
      docs/zh/h5/purc.md
  66. 13 0
      docs/zh/h5/sign.md
  67. 3 2
      docs/zh/pc/5.md
  68. 0 144
      docs/zh/ios/3.md
  69. 0 119
      docs/zh/ios/4.md
  70. 1 1
      docs/ios/6.md
  71. 3 3
      docs/zh/ios/README.md
  72. 3 1
      docs/zh/ios/5.md
  73. 188 0
      docs/zh/ios/common.md
  74. 0 0
      docs/zh/ios/flow.md
  75. 0 0
      docs/zh/ios/overview.md
  76. 134 0
      docs/zh/ios/purc.md
  77. 13 0
      docs/zh/ios/sign.md
  78. 0 164
      docs/zh/pc/3.md
  79. 3 3
      docs/zh/pc/README.md
  80. 154 34
      docs/zh/pc/4.md
  81. 188 0
      docs/zh/pc/common.md
  82. 1 1
      docs/zh/h5/4.md
  83. 3 0
      docs/zh/pc/flow.md
  84. 0 0
      docs/zh/pc/overview.md
  85. 39 0
      docs/zh/pc/purc.md
  86. 13 0
      docs/zh/pc/sign.md
  87. 22 0
      docs/zh/pc/test.md
  88. 1 1
      npm-debug.log

+ 27 - 22
docs/.vuepress/config.js

@@ -107,37 +107,42 @@ function genSidebar(name, title) {
   var child = {
     pc: [
       '',
-      '1',
-      '2',
-      '3',
-      '4',
-      '5',
-      '6',
+      'overview',
+      'flow',
+      'sign',
+      'purc',
+      'channel',
+      'common',
+      'test'
     ],
     android: [
       '',
-      '1',
-      '2',
-      '3',
-      '4',
-      '5',
-      '6',
+      'overview',
+      'flow',
+      'sign',
+      'purc',
+      'channel',
+      'common',
+      '7'
     ],
     ios: [
       '',
-      '1',
-      '2',
-      '3',
-      '4',
-      '5',
-      '6',
+      'overview',
+      'flow',
+      'sign',
+      'purc',
+      'channel',
+      'common',
+      '7'
     ],
     h5: [
       '',
-      '1',
-      '2',
-      '3',
-      '4',
+      'overview',
+      'flow',
+      'sign',
+      'purc',
+      'channel',
+      'common'
     ],
     wx: [
       '',

+ 3 - 0
docs/.vuepress/public/tongyong.md

@@ -0,0 +1,3 @@
+# 4.通用接口
+
+

+ 0 - 146
docs/android/3.md

@@ -1,146 +0,0 @@
-# 3.通用API说明
-
-商户服务器和 AllPay 网关对接的通用接口,每个渠道都具有的功能,包括:消费,退款,查询接口。
-
-## 3.1. 验签说明 
-
-1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
-
-3.示例签名串
-
-```java
-acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
-```
-
-## 3.2. 通用API 接入地址 
-
- 交易名称  |开发调试地址|生产交易地址  
- ------- |-----------|-------
- 消费接口 |<https://testapi.allpayx.com/app/pay> |<https://api.allpayx.com/app/pay>
- 查询接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
- 退款接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
-
-## 3.3. 消费交易接口
-
-1.接口说明
-
-商户网关将订单信息发送给 ALLPAY 网关,由 ALLPAY 网关进行处理后将交易流水 号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。
-
-2.请求报文格式
-
-下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|前端 URL 地址 |400|文本|frontURL  |app 模式默认填"nil" 
- 8|后端 URL 地址 |400|文本|backURL   |支付结果异步通知到该地址 
- 9|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 10|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 11|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 12|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 13|商品信息    |60  |文本|goodsInfo       | 商品信息
- 14|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 15|签名类型     |3  |文本|signType        |MD5 
- 16|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3. 响应报文格式
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
-  1|交易流水号 |32|文本|tn |tn 作为调起 sdk 支付的参数
-
-## 3.4. 查询交易接口 
-
-
-
-1. 接口说明
-
- 该接口为接入商家提供交易查询的功能。
-
-2. 请求报文格式 
-
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询填写“INQY”  
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|商户预留字段  |1024 |文本|merReserve    |商户保留 
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 9|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 10|签名类型     |3  |文本|signType        |MD5 
- 11|签名      |32  |文本|signature         |采用 MD5 签名 
-
-
-3. 响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询交易填写为“INQY 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-## 3.5. 退款交易接口
-
-1.接口功能说明 
-
-该接口为接入商家提供交易退款的功能。 
-
-2.请求报文格式 
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|退款金额  |12|文本|returnAmount    |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 8|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 9|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 10|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 11|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3.响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 

+ 0 - 111
docs/android/4.md

@@ -1,111 +0,0 @@
-# 4.Android 客户端接入步骤 
-
-## 4.1. 接入说明 
-
-启动支付控件的接口,接口定义如下:
-
-```java
-public static void pay(Activity activity,String tn,boolean mode)
-```
-
-::: tip 参数说明
-activity —— 用于启动支付控件的活动对象
-
-tn —— 订单信息为交易流水号,即 TN,为商户后台从 AllPay 后台获取
-
-mode —— AllPay 后台环境标识,true 将在 AllPay 正式环境发起交易,false 将在 AllPay 测试环 境发起交易
-:::
-
-## 4.2. 添加 SDK 包
-
-1. 把allpaysdk当做Module导入到自己的工程
-2. 在Application Module的build.gradle文件的dependencies下添加compile project(':allpaysdk') 
-3. 在Application Module的build.gradle文件中添加
-
-```java
-repositories {
-    flatDir {
-        dirs project(':allpaysdk').file('libs')
-    }
-}
-```
-
-## 4.3. 调用支付控件
-
-接着可以通过以下方式调用支付控件:
-
-```java
-/**
- * tn——交易流水号,即 TN,为商户后台从 AllPay 后台获取,获取方式参见 AllPay 网关对接文档
- * false 测试环境
- */
-AllPayEngine.Pay(ShopCartActivity.this, tn, false);
-```
-
-## 4.4. 同步结果通知
-
-支付完成后,获取支付控件支付结果,并添加相应处理逻辑,只需实现调用 Activity 
-中的 onActivityResult()方法即可,实例代码如下:
-
- ```java
-@Override
-protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-    if (data == null) {
-        return;
-    }
-
-    if (requestCode == AllPayConst.VTPAY_PAY_REQUESR_CODE&& resultCode == AllPayConst.VTPAY_PAY_RESULT_CODE) {
-        String result = data.getExtras().getString("pay_result");
-    }
-}
-```
-
-pay_result,为 json 字符串,格式如下:
-
-```text
-{
-    "state": "cancel",
-    "paymentSchema": "UP",
-    "orderNum": "604337497032",
-    "errorDetail": "user cancel operation "
-}
-```
-
-报文说明:
-
-* state: "success"代表成功, "cancel"代表用户取消操作,"fail"代表失败,"query"代表 app 需要调用查询接口来确认订单状态
-* paymentSchema: 支付渠道, "APMP"代表支付宝, "WX"代表微信 
-* orderNum: 订单号
-* errorDetail: 错误详情
-
-
-## 4.5. 异步结果通知
-
-商户需要提供一个 http 协议的接口,包含在参数里传递给 SDK,即 backURL。AllPay 
-服务器在支付完成后,会以 Get 方式调用 backURL,通知支付结果。 
-
-参数如下表:
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|清算金额  |12 |文本|settAmount   |如 100 元,表示为 100 或 100.00  
- 8|清算币种  |3|文本|settCurrency    |符合 ISO 标准,填写数字类型 
- 9|清算汇率   |7|文本|rate     |实际汇率,7 位有效数字  
- 10|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 11|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一
- 12|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 13|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 14|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 15|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 16|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 17|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 18|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间
- 19|签名类型     |3  |文本|signType        |MD5 
- 20|签名      |32  |文本|signature         |采用 MD5 签名 
- 

+ 3 - 2
docs/zh/android/6.md

@@ -1,5 +1,6 @@
-# 6.安卓SDK下载
+# 7.安卓SDK下载
 
 
 
-[Android Demo及SDK下载地址](https://git.allpayx.com/OpenAPI/b2c_android_sdk)
+[Android Demo及SDK下载地址](https://git.allpayx.com/OpenAPI/b2c_android_sdk)
+

+ 3 - 3
docs/android/README.md

@@ -1,8 +1,8 @@
-# Android端控件支付产品接口规范文档4.0.2
+# Android端控件支付产品接口规范文档4.3.0
 
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
-* 版本信息:中文 V4.0.2
-* 更新时间:2018 年7
+* 版本信息:中文 V4.3.0
+* 更新时间:2018 年11
 
 # 

docs/android/5.md → docs/android/channel.md


+ 188 - 0
docs/android/common.md

@@ -0,0 +1,188 @@
+# 6. 通用接口
+
+## 6.1. 接口地址
+
+
+
+通用接口包括 交易异步通知,交易查询,退款,退款查询接口
+
+
+
+接口名称   |测试地址 |生产地址
+ ------- |-----------|-------
+ 交易查询接口 |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
+ 退款接口 |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
+ 退款查询接口 |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>
+
+## 6.2. 异步通知报文
+
+AllPay服务器通过get方式,异步发送到消费接口中上送的backURL地址,商户根据收到的报文来确定交易的支付结果
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| settAmount    | String(12)   | M    | 清算金额:如 100 元,表示为 100 或 100.00                    |
+| settCurrency  | String(3)    | M    | 清算币种:符合 ISO 标准                                      |
+| rate          | String(7)    | M    | 实际汇率,7 位有效数字                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| transID       | String(32)   | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)    | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20)   | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14)   | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | signature                                                    |
+
+
+
+
+
+
+## 6.3. 查询交易接口 
+
+
+
+1. 接口说明
+
+ 该接口为接入商家提供交易查询的功能。
+
+2. 请求报文格式 
+
+  
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+3. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60) | M    | 订单号                                                       |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |
+
+
+
+## 6.4. 退款交易接口
+
+1.接口功能说明 
+
+该接口为接入商家提供交易退款的功能。 
+
+2.请求报文格式 
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 退款填写“REFD”                                               |
+| orderNum      | String(60)   | M    | 原交易订单号                                                 |
+| refundNum     | String(60)   | M    | 退款订单号:商户自行定义,需保证同一商户号下退款订单号不能重复 |
+| returnAmount  | String(12)   | M    | 退款金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3.响应报文格式
+
+| 参数      | 类型       | 属性 | 描述                                           |
+| --------- | ---------- | ---- | ---------------------------------------------- |
+| version   | String(12) | M    | 统一填写为“VER000000002”                       |
+| charSet   | String(6)  | M    | 统一填写为“UTF-8”                              |
+| transType | String(4)  | M    | 退款填写“REFD”                                 |
+| refundNum | String(60) | M    | 退款订单号                                     |
+| transID   | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一         |
+| merID     | String(15) | M    | 商户 ID,由AllPay 分配                         |
+| acqID     | String(11) | M    | 收单行 ID "99020344"                           |
+| RespCode  | String(2)  | M    | 应答码 00-成功                                 |
+| RespMsg   | String(20) | M    | 应答消息,全部为英文字符                       |
+| transTime | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                 |
+| GWTime    | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 |
+| signType  | String(3)  | M    | MD5                                            |
+| signature | String(32) | M    | signature                                      |
+
+
+
+## 6.5. 退款查询接口
+
+1. 1. 接口说明
+
+    该接口为接入商家提供退款查询的功能。
+
+   1. 请求报文格式 
+
+     
+
+   | 参数          | 类型         | 属性 | 描述                                                         |
+   | ------------- | ------------ | ---- | ------------------------------------------------------------ |
+   | version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+   | charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+   | transType     | String(4)    | M    | 查询填写“RFQY”                                               |
+   | refundNum     | String(60)   | M    | 退款订单号                                                   |
+   | merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+   | merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+   | acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+   | paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+   | transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+   | signType      | String(3)    | M    | MD5                                                          |
+   | signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+   1. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“REFD”                                               |
+| refundNum     | String(60) | M    | 退款订单号                                                   |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |

docs/android/2.md → docs/android/flow.md


+ 2 - 1
docs/android/1.md

@@ -1,2 +1,3 @@
 #### 1.概述
-AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“SDK”),以帮助客户实 现快速、安全、集中式的接入支付渠道。
+AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“SDK”),以帮助客户实 现快速、安全、集中式的接入支付渠道。
+

+ 125 - 0
docs/android/purc.md

@@ -0,0 +1,125 @@
+# 4.消费交易
+
+## 4.1. 消费交易地址 
+
+ 交易名称  |测试地址|生产地址  
+ ------- |-----------|-------
+ 消费接口 |<https://testapi.allpayx.com/app/pay> |<https://api.allpayx.com/app/pay>
+
+## 4.2. 消费交易接口
+
+1.接口说明
+
+商户网关将订单信息发送给 ALLPAY 网关,由 ALLPAY 网关进行处理后将交易流水 号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。
+
+2.请求报文格式
+
+下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号:商户自行定义,需保证同一商户号下订单号不能重复       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| frontURL      | String(400)  | M    | app 模式默认填"nil"                                          |
+| backURL       | String(400)  | M    | 支付结果异步通知到该地址                                     |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| goodsInfo     | String(60)   | M    | 商品信息                                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3. 响应报文格式
+
+   | 参数 | 类型       | 属性 | 描述                               |
+   | ---- | ---------- | ---- | ---------------------------------- |
+   | tn   | String(32) | M    | 交易流水号,作为调起 sdk 支付的参数 |
+
+
+## 4.3. Android 客户端接入步骤 
+
+## 4.3.1. 接入说明 
+
+启动支付控件的接口,接口定义如下:
+
+```java
+public static void pay(Activity activity,String tn,boolean mode)
+```
+
+::: tip 参数说明
+activity —— 用于启动支付控件的活动对象
+
+tn —— 订单信息为交易流水号,即 TN,为商户后台从 AllPay 后台获取
+
+mode —— AllPay 后台环境标识,true 将在 AllPay 正式环境发起交易,false 将在 AllPay 测试环 境发起交易
+:::
+
+## 4.3.2. 添加 SDK 包
+
+1. 把allpaysdk当做Module导入到自己的工程
+2. 在Application Module的build.gradle文件的dependencies下添加compile project(':allpaysdk') 
+3. 在Application Module的build.gradle文件中添加
+
+```java
+repositories {
+    flatDir {
+        dirs project(':allpaysdk').file('libs')
+    }
+}
+```
+
+## 4.3.3. 调用支付控件
+
+接着可以通过以下方式调用支付控件:
+
+```java
+/**
+ * tn——交易流水号,即 TN,为商户后台从 AllPay 后台获取,获取方式参见 AllPay 网关对接文档
+ * false 测试环境
+ */
+AllPayEngine.Pay(ShopCartActivity.this, tn, false);
+```
+
+## 4.3.4. 同步结果通知
+
+支付完成后,获取支付控件支付结果,并添加相应处理逻辑,只需实现调用 Activity 
+中的 onActivityResult()方法即可,实例代码如下:
+
+```java
+@Override
+protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+    if (data == null) {
+        return;
+    }
+
+    if (requestCode == AllPayConst.VTPAY_PAY_REQUESR_CODE&& resultCode == AllPayConst.VTPAY_PAY_RESULT_CODE) {
+        String result = data.getExtras().getString("pay_result");
+    }
+}
+```
+
+pay_result,为 json 字符串,格式如下:
+
+```text
+{
+    "state": "cancel",
+    "paymentSchema": "UP",
+    "orderNum": "604337497032",
+    "errorDetail": "user cancel operation "
+}
+```
+
+报文说明:
+
+- state: "success"代表成功, "cancel"代表用户取消操作,"fail"代表失败,"query"代表 app 需要调用查询接口来确认订单状态
+- paymentSchema: 支付渠道, "APMP"代表支付宝, "WX"代表微信 
+- orderNum: 订单号
+- errorDetail: 错误详情

+ 13 - 0
docs/android/sign.md

@@ -0,0 +1,13 @@
+# 3.签名
+
+1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
+
+3.示例签名串
+
+```js
+acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
+```
+
+## 

+ 0 - 194
docs/h5/3.md

@@ -1,194 +0,0 @@
-# 3. API Interface
-
-## 3.1. Purchase interface
-
-Merchant could use purchase interface to initiate a transaction, send transaction information to payment channels through AllPay gateway. 
-
- No. |Field Name  |Max.Length|Type|Parameter Name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"PURC" 
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Order Amount |12|Text|orderAmount   |100 is displayed as 100 or 100.00 
- 6|Order Currency   |3|Text|orderCurrency |Fill in "CNY" in RMB and "USD" in USD 
- 7|Frontend URL Address |400|Text|frontURL  |Payment results are notified to this address front 
- 8|Backend URL Address |400|Text|backURL   |Payment results are notified to this address asynchronously 
- 9|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. 
- 10|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 11|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 12|Payment Channel Code    |10  |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
- 13|Goods Information    |60  |Text|goodsInfo       |Goods Information
- 14|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 15|Signature Type     |3  |Text|signType        |MD5 
- 16|Signature Data      |32  |Text|signature         |MD5 signature 
-
-## 3.2. Purchase Response from AllPay 
-
- No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"PURC" 
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Order Amount |12|Text|orderAmount   |100 is displayed as 100 or 100.00 
- 6|Order Currency   |3|Text|orderCurrency |Fill in "CNY" in RMB and "USD" in USD 
- 7|Settlement Amount  |12 |Text|settAmount   |100 is displayed as 100 or 100.00  
- 8|Settlement Currency  |3|Text|settCurrency    |Comply with ISO standards and fill in the number type 
- 9|Settlement FX Rate   |7|Text|rate     |Real exchange rate, 7 digits  
- 10|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. 
- 11|Gateway Transaction ID  |32|Text|transID    |The unique transaction id generated by the gateway.
- 12|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 13|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 14|Payment Channel Code    |10  |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
- 15|Response Code   |2  |Text|RespCode       |00 stands for success; 01 stands for fail.  
- 16|Response Message    |20  |Text|RespMsg        |Response message, all English characters 
- 17|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 18|Gateway process time |14  |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time
- 19|Signature Type     |3  |Text|signType        |MD5 
- 20|Signature Data      |32  |Text|signature         |MD5 signature 
-
-
-## 3.3. Inqiury interface 
-
-
-
-1. Interface specification
-
- This interface provides the function of inqiury transaction for access merchants.
-
-2. Request message format 
-
-
- No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"INQY"  
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content 
- 6|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 7|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 8|Payment Channel Code    |10  |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
- 9|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 10|Signature Type     |3  |Text|signType        |MD5 
- 11|Signature Data      |32  |Text|signature         |MD5 signature 
-
-
-3. Response message format
-
-
-  No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"INQY" 
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Gateway Transaction ID  |32|Text|transID    |The unique transaction id generated by the gateway.  
- 6|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 7|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 8|Response Code   |2  |Text|RespCode       |00 stands for success; 01 stands for fail.  
- 9|Response Message    |20  |Text|RespMsg        |Response message, all English characters 
- 10|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 11|Gateway process time |14  |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time 
- 12|Signature Type     |3  |Text|signType        |MD5 
- 13|Signature Data      |32  |Text|signature         |MD5 signature 
-
-
-
-
-## 3.4. Refund interface
-
-1.Interface specification 
-
-This interface provides the function of refund transaction for access merchants. 
-
-2.Request message format 
-
-  No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"REFD" 
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, The order number is the same as the original transaction order.
- 5|Refund Number   |60|Text|refundNum  |The merchant shall define it by itself, and the refund number of the same merchant number shall not be repeated 
- 6|Return Amount  |12|Text|returnAmount    |100 is displayed as 100 or 100.00 
- 7|Order Currency   |3|Text|orderCurrency |Fill in "CNY" in RMB and "USD" in USD 
- 8|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. 
- 9|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 10|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 11|Payment Channel Code    |10  |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
- 12|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 13|Signature Type     |3  |Text|signType        |MD5 
- 14|Signature Data      |32  |Text|signature         |MD5 signature 
-
-3.Response message format
-
-
-  No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"REFD" 
- 4|Order Number   |60|Text|orderNum  |The order number is the same as the original transaction order.
- 5|Refund Number   |60|Text|refundNum  |The merchant shall define it by itself, and the refund number of the same merchant number shall not be repeated 
- 6|Gateway Transaction ID  |32|Text|transID    |The unique transaction id generated by the gateway.  
- 7|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 8|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 9|Response Code   |2  |Text|RespCode       |00 stands for success; 01 stands for fail.  
- 10|Response Message    |20  |Text|RespMsg        |Response message, all English characters 
- 11|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 12|Gateway process time |14  |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time 
- 13|Signature Type     |3  |Text|signType        |MD5 
- 14|Signature Data      |32  |Text|signature         |MD5 signature
-
- 
-
-## 3.5. Refund Inqiury interface 
-
-
-
-1. Interface specification
-
- This interface provides the function of refund inqiury transaction for access merchants.
-
-2. Request message format 
-
-
- No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"RFQY"  
- 4|Refund Number   |60|Text|refundNum  |The merchant shall define it by itself, and the refund number of the same merchant number shall not be repeated 
- 5|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content 
- 6|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 7|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 8|Payment Channel Code    |10  |Text|paymentSchema|UnionPay:"UP",Wechat:"WX,Alipay:"APMP"
- 9|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 10|Signature Type     |3  |Text|signType        |MD5 
- 11|Signature Data      |32  |Text|signature         |MD5 signature 
-
-
-3. Response message format
-
-
-  No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"REFD" 
- 4|Refund Number   |60|Text|refundNum  |The merchant shall define it by itself, and the refund number of the same merchant number shall not be repeated 
- 5|Gateway Transaction ID  |32|Text|transID    |The unique transaction id generated by the gateway.  
- 6|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 7|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 8|Response Code   |2  |Text|RespCode       |00 stands for success; 01 stands for fail.  
- 9|Response Message    |20  |Text|RespMsg        |Response message, all English characters 
- 10|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 11|Gateway process time |14  |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time 
- 12|Signature Type     |3  |Text|signType        |MD5 
- 13|Signature Data      |32  |Text|signature         |MD5 signature 
-
-
-
- 

+ 0 - 11
docs/h5/4.md

@@ -1,11 +0,0 @@
-# 4. error code 
-
-| code | msg                            |
-| -------------- | ------------------------------------------ |
-| U1             | merid not found                         |
-| U2             | Signature error                            |
-| U4             | missing  Parameter                            |
-| U5             | invalid  Parameter                            |
-| U6             | Orderno repeat                            |
-| U7             | Orderno  not exist                            |
-

+ 4 - 3
docs/h5/README.md

@@ -1,6 +1,7 @@
-# HTML5 Integration Specification V4.2.1
+# HTML5 Integration Specification V4.3.0
 
 [Shanghai AllPay Technology Co., Ltd.](https://www.allpayx.com)
 
-* Version:English V4.2.0
-* Update Time:April 2018
+* Version:English V4.3.0
+* Update Time: 2018 11
+

+ 8 - 0
docs/h5/channel.md

@@ -0,0 +1,8 @@
+# 5.Channel exclusive allocation
+## 5.1 AP
+
+| Parameter | Type       | Required | Description                                                  | Sample                                 |
+| --------- | ---------- | -------- | ------------------------------------------------------------ | -------------------------------------- |
+| timeout   | String(10) | O        | The default is 12h. Please contact Alipay Technical Support if you need to use other values. Max value is 15d. This parameter controls the valid time from login to completion. | 5m 10m 15m 30m 1h 2h 3h 5h 10h 12h 1d. |
+
+

+ 188 - 0
docs/h5/common.md

@@ -0,0 +1,188 @@
+# 6.Common interface
+
+## 6.1. Interface URL
+
+Common interface includes asynchronous notification of transactions, transaction inquiry, refund, refund inquiry interface
+
+
+
+Interface Name  |Test URL |Production URL 
+ ------- |-----------|-------
+ inquiry |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
+ refund |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
+ refund inquiry |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>
+
+## 6.2. Purchase Response from AllPay 
+
+AllPay server sends the backURL address to the consumer interface asynchronously through get, and the merchant determines the payment result of the transaction based on the received messag
+
+
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | "VER000000002"                                               |
+| charSet       | String(6)    | M        | “UTF-8”                                                      |
+| transType     | String(4)    | M        | “PURC”                                                       |
+| orderNum      | String(60)   | M        | 订单号                                                       |
+| orderAmount   | String(12)   | M        | Order amount: if 100 yuan, it will be 100 or 100.00          |
+| orderCurrency | String(3)    | M        | Currency of the order: ISO standard, such as RMB filling in "CNY", us dollar filling in "USD" |
+| settAmount    | String(12)   | M        | 100 is displayed as 100 or 100.00                            |
+| settCurrency  | String(3)    | M        | Comply with ISO standards                                    |
+| rate          | String(7)    | M        | Real exchange rate, 7 digits                                 |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| transID       | String(32)   | M        | The unique transaction id generated by the gateway.          |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)    | M        | 00 stands for success; 01 stands for fail.                   |
+| RespMsg       | String(20)   | M        | Response message, all English characters                     |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| GWTime        | String(14)   | M        | YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time |
+| signType      | String(3)    | M        | MD5                                                          |
+| signature     | String(32)   | M        | MD5 signature                                                |
+
+
+
+
+
+
+## 6.3. Inqiury interface 
+
+
+
+1. Interface specification
+
+ This interface provides the function of inqiury transaction for access merchants.
+
+2. Request message format 
+
+  
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | "VER000000002"                                               |
+| charSet       | String(6)    | M        | "UTF-8"                                                      |
+| transType     | String(4)    | M        | "INQY"                                                       |
+| orderNum      | String(60)   | M        | Original trade order number                                  |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| signType      | String(3)    | M        | "MD5"                                                        |
+| signature     | String(32)   | M        | MD5 signature                                                |
+
+
+
+3. Response message format
+
+| Parameter     | Type       | Required | Description                                                  |
+| ------------- | ---------- | -------- | ------------------------------------------------------------ |
+| version       | String(12) | M        | "VER000000002"                                               |
+| charSet       | String(6)  | M        | “UTF-8”                                                      |
+| transType     | String(4)  | M        | “INQY”                                                       |
+| orderNum      | String(60) | M        | Original trade order number                                  |
+| transID       | String(32) | M        | The unique transaction id generated by the gateway.          |
+| merID         | String(15) | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11) | M        | "99020344"                                                   |
+| paymentSchema | String(10) | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M        | 00 stands for success; 01 stands for fail.                   |
+| RespMsg       | String(20) | M        | Response message, all English characters                     |
+| transTime     | String(14) | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| GWTime        | String(14) | M        | YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time |
+| signType      | String(3)  | M        | MD5                                                          |
+| signature     | String(32) | M        | signature                                                    |
+
+
+
+## 6.4. Refund interface
+
+1.Interface specification 
+
+This interface provides the function of refund transaction for access merchants. 
+
+2.Request message format 
+
+
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | “VER000000002”                                               |
+| charSet       | String(6)    | M        | “UTF-8”                                                      |
+| transType     | String(4)    | M        | “REFD”                                                       |
+| orderNum      | String(60)   | M        | Original trade order number                                  |
+| refundNum     | String(60)   | M        | Refund order number: it is defined by the merchant, and the refund order number under the same merchant number cannot be repeated |
+| returnAmount  | String(12)   | M        | Refund amount: if 100 yuan, it is 100 or 100.00              |
+| orderCurrency | String(3)    | M        | Currency of the order: ISO standard, such as RMB filling in "CNY", us dollar filling in "USD" |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| signType      | String(3)    | M        | MD5                                                          |
+| signature     | String(32)   | M        | signature                                                    |
+
+3.Response message format
+
+| Parameter | Type       | Required | Description                                                  |
+| --------- | ---------- | -------- | ------------------------------------------------------------ |
+| version   | String(12) | M        | “VER000000002”                                               |
+| charSet   | String(6)  | M        | “UTF-8”                                                      |
+| transType | String(4)  | M        | “REFD”                                                       |
+| refundNum | String(60) | M        | The merchant shall define it by itself, and the refund number of the same merchant number shall not be repeated |
+| transID   | String(32) | M        | The unique transaction id generated by the gateway.          |
+| merID     | String(15) | M        | Merchant ID, assigned by AllPay                              |
+| acqID     | String(11) | M        | "99020344"                                                   |
+| RespCode  | String(2)  | M        | 00 stands for success; 01 stands for fail.                   |
+| RespMsg   | String(20) | M        | Response message, all English characters                     |
+| transTime | String(14) | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| GWTime    | String(14) | M        | YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time |
+| signType  | String(3)  | M        | MD5                                                          |
+| signature | String(32) | M        | signature                                                    |
+
+
+
+## 6.5. Refund Inqiury interface
+
+1.Interface specification
+
+ This interface provides the function of Refund inqiury transaction for access merchants.
+
+2. Request message format 
+
+  
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | “VER000000002”                                               |
+| charSet       | String(6)    | M        | “UTF-8”                                                      |
+| transType     | String(4)    | M        | “RFQY”                                                       |
+| refundNum     | String(60)   | M        | Refund order number                                          |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| signType      | String(3)    | M        | MD5                                                          |
+| signature     | String(32)   | M        | signature                                                    |
+
+
+
+3. Response message format
+
+| Parameter     | Type       | Required | Description                                                  |
+| ------------- | ---------- | -------- | ------------------------------------------------------------ |
+| version       | String(12) | M        | “VER000000002”                                               |
+| charSet       | String(6)  | M        | “UTF-8”                                                      |
+| transType     | String(4)  | M        | “REFD”                                                       |
+| refundNum     | String(60) | M        | Refund order number                                          |
+| transID       | String(32) | M        | The unique transaction id generated by the gateway.          |
+| merID         | String(15) | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11) | M        | "99020344"                                                   |
+| paymentSchema | String(10) |          | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M        | Response message, all English characters                     |
+| RespMsg       | String(20) | M        | Response message, all English characters                     |
+| transTime     | String(14) | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| GWTime        | String(14) | M        | YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time |
+| signType      | String(3)  | M        | MD5                                                          |
+| signature     | String(32) | M        | signature                                                    |

+ 18 - 0
docs/h5/error.md

@@ -0,0 +1,18 @@
+# 8.  error code 
+
+| code | msg                                        |
+| ---- | ------------------------------------------ |
+| U1   | Clientid not found                         |
+| U2   | Signature error                            |
+| V1   | Parameter missing                          |
+| E1   | Exceed the limit                           |
+| R1   | Orderno repeat                             |
+| C1   | Order currency is not set                  |
+| P1   | paychannel error                           |
+| I1   | Illegal request address                    |
+| T1   | Parameter missing(version或tranType)     |
+| T2   | Txntype error                              |
+| T3   | transaction is not exist or fail           |
+| T4   | The maximum amount exceeds the upper limit |
+
+| 99             | System error  

+ 4 - 0
docs/h5/flow.md

@@ -0,0 +1,4 @@
+# 2.Transaction process
+
+![image](/b2c/pc_flowsheet.png)
+

docs/h5/1.md → docs/h5/overview.md


+ 34 - 0
docs/h5/purc.md

@@ -0,0 +1,34 @@
+# 4. Purchase interface
+
+## 
+
+| Interface Name | Test URL                               | Production URL                     |
+| -------------- | -------------------------------------- | ---------------------------------- |
+| Purchase       | <https://mchapi.allpayx.com/testjspay> | <https://mchapi.allpayx.com/jspay> |
+
+Merchant could use purchase interface to initiate a transaction, send transaction information to payment channels through AllPay gateway. 
+
+
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | "VER000000002"                                               |
+| charSet       | String(6)    | M        | “UTF-8”                                                      |
+| transType     | String(4)    | M        | “PURC”                                                       |
+| orderNum      | String(60)   | M        | Order number: it is defined by the merchant itself, and the order number must not be repeated for the same merchant number |
+| orderAmount   | String(12)   | M        | Order amount: if 100 yuan, it will be 100 or 100.00          |
+| orderCurrency | String(3)    | M        | Currency of the order: ISO standard, such as RMB filling in "CNY", us dollar filling in "USD" |
+| frontURL      | String(400)  | M        | When the payment is complete, jump to the address            |
+| backURL       | String(400)  | M        | Payment results are asynchronously notified to this address                                    |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas.   |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | UnionPay:"UP",Wechat:"WX,Alipay:"APMP"                       |
+| goodsInfo     | String(60)   | M        | Goods Information                                            |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| signType      | String(3)    | M        | MD5                                                          |
+| signature     | String(32)   | M        | MD5 signature                                                |
+
+
+
+

+ 12 - 0
docs/h5/sign.md

@@ -0,0 +1,12 @@
+# 3. Signature
+
+1.For a POST request message sent to the ALLPAY system, in which all incoming parameters (except signature parameters) according to the field name of ASCII smallest sequence (dictionary), using the format of the URL key/value pair (key1 = value1 & key2 = value2... ) spliced into a string String1.
+
+2.At the end of String1, the signature key K1(assigned at ALLPAY upon access) agreed by both parties is spliced directly (no need to connect with "&"), resulting in a stringSignTemp string, and an md5 operation on stringSignTemp to get the value of signature.
+
+3.Sample signature string
+
+```js
+acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26
+```
+

+ 22 - 0
docs/h5/test.md

@@ -0,0 +1,22 @@
+# 7.Test account
+
+ Please note that AliPay and TenPay transactions need to be tested with Chinese real-name certified accounts. All test transactions do not provide liquidation services. Please use a small amount of test.
+
+The following are the UnionPay channel test cards for testing only: 
+
+```
+Credit Card:5200831111111113 
+Mobile:13552535506
+CVN2:123
+Exp Date:month 11 year 19
+SMS Code on PC:111111 
+SMS Code on Mobile:123456
+
+Credit Card:6226388000000095 
+Mobile:18100000000 
+CVN2:248
+Exp Date:month 12 year 19
+SMS Code on PC:111111 
+SMS Code on Mobile:123456 
+ 
+```

+ 0 - 144
docs/ios/3.md

@@ -1,144 +0,0 @@
-# 3.通用API说明
-
-商户服务器和 AllPay 网关对接的通用接口,每个渠道都具有的功能,包括:消费,退款,查询接口。
-
-## 3.1. 验签说明 
-
-1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
-
-3.示例签名串
-
-```js
-acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
-```
-
-## 3.2. 通用API 接入地址 
-
- 交易名称  |开发调试地址|生产交易地址  
- ------- |-----------|-------
- 消费接口 |<https://testapi.allpayx.com/app/pay> |<https://api.allpayx.com/app/pay>
- 查询接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
- 退款接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
-
-## 3.3. 消费交易接口
-
-1.接口说明
-
-商户网关将订单信息发送给 ALLPAY 网关,由 ALLPAY 网关进行处理后将交易流水 号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。
-
-2.请求报文格式
-
-下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|前端 URL 地址 |400|文本|frontURL  |app 模式默认填"nil" 
- 8|后端 URL 地址 |400|文本|backURL   |支付结果异步通知到该地址 
- 9|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 10|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 11|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 12|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 13|商品信息    |60  |文本|goodsInfo       | 商品信息
- 14|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 15|签名类型     |3  |文本|signType        |MD5 
- 16|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3. 响应报文格式
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
-  1|交易流水号 |32|文本|tn |tn 作为调起 sdk 支付的参数,code等于"00"时返回该字段
-
-## 3.4. 查询交易接口
-
-1. 接口说明
-
- 该接口为接入商家提供交易查询的功能。
-
-2. 请求报文格式 
-
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询填写“INQY”  
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|商户预留字段  |1024 |文本|merReserve    |商户保留 
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 9|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 10|签名类型     |3  |文本|signType        |MD5 
- 11|签名      |32  |文本|signature         |采用 MD5 签名 
-
-
-3. 响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询交易填写为“INQY 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-## 3.5. 退款交易接口
-
-1.接口功能说明 
-
-该接口为接入商家提供交易退款的功能。 
-
-2.请求报文格式 
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|退款金额  |12|文本|returnAmount    |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 8|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 9|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 10|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 11|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3.响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 

+ 0 - 119
docs/ios/4.md

@@ -1,119 +0,0 @@
-# 4.iOS 客户端接入步骤 
-
-## 4.1. 接入说明 
-
-启动支付控件的接口,接口定义如下:
-
-```c
-[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
-
-//此处处理同步支付结果
-
-}];
-
-
-参数说明
-tn: 是从服务器端获取的流水号; mode:测试环境:NO; 生产环境:YES。
-
-Scheme: 可以为任意值推荐填写成"com.xxx.xxx" 等形式, 有特殊配置的渠道会在渠道专属配置里面说明
-
-ViewController: 调用 SDK 时的 ViewController;
-
-onResult: 接收同步结果通知
-```
-
-
-
-
-## 4.2. 添加 SDK 包
-
-1. 将  allpaysdk 下的 AllPaySDK.h,libAllPaySDK.a文件add到项目中
-2. 在 APPDelegate.m 类中导入头文件: #import "allpaysdk/AllPaySDK.h" 并添加如下方法
-
-```c
--(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ 
-
-[AllPaySDK openURL:url]; return YES; 
-
-}
-
--(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ 
-
-[AllPaySDK openURL:url]; return YES; 
-
-} 
-
--(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options{ 
-
-[AllPaySDK openURL:url]; return YES; 
-
-}
-```
-
-3. 根据要使用的渠道的专属配置,对项目进行配置
-
-## 4.3 同步结果通知 
-
-```c
-[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) { 
-
-  //此处处理同步支付结果
-
- }];
- 
-```
-
-resultDic,转为 json 字符串,格式如下:
-
-{
-  "state": "cancel",
-  "paymentSchema": "YL",
-  "orderNum": "604337497032",
-  "errorDetail": "user cancel operation"
-}
-
-报文说明
-
-- state: "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败
-- paymentSchema: 支付渠道, 印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay
-- orderNum: 订单号
-- errorDetail: 错误详情
-
-
-| 参数        | 说明           |
-| ------------- |:-------------:|
-| state      | "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败 |
-| paymentSchema |印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay      |
-| orderNum | 订单号      |
-| errorDetail | 错误详情      |
-
-
-## 4.5. 异步结果通知
-
-商户需要提供一个 http 协议的接口,包含在参数里传递给 SDK,即 backURL。AllPay 
-服务器在支付完成后,会以 Get 方式调用 backURL,通知支付结果。 
-
-参数如下表: 
-
- 序号 |名称  |长度|类型|参数名称|备注
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|清算金额  |12 |文本|settAmount   |如 100 元,表示为 100 或 100.00  
- 8|清算币种  |3|文本|settCurrency    |符合 ISO 标准,填写数字类型 
- 9|清算汇率   |7|文本|rate     |实际汇率,7 位有效数字  
- 10|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 11|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一
- 12|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 13|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 14|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 15|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 16|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 17|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 18|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间
- 19|签名类型     |3  |文本|signType        |MD5 
- 20|签名      |32  |文本|signature         |采用 MD5 签名 

+ 1 - 1
docs/zh/ios/6.md

@@ -1,4 +1,4 @@
-# 6.iOS SDK下载
+# 7.iOS SDK下载
 
 
 

+ 3 - 3
docs/ios/README.md

@@ -1,6 +1,6 @@
-# IOS端控件支付产品接口规范文档4.0.0
+# IOS端控件支付产品接口规范文档4.3.0
 
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
-* 版本信息:中文 V4.0.0
-* 更新时间:2018 年4
+* 版本信息:中文 V4.3.0
+* 更新时间:2018 年11

docs/ios/5.md → docs/ios/channel.md


+ 188 - 0
docs/ios/common.md

@@ -0,0 +1,188 @@
+# 6. 通用接口
+
+## 6.1. 接口地址
+
+
+
+通用接口包括 交易异步通知,交易查询,退款,退款查询接口
+
+
+
+接口名称   |测试地址 |生产地址
+ ------- |-----------|-------
+ 交易查询接口 |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
+ 退款接口 |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
+ 退款查询接口 |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>
+
+## 6.2. 异步通知报文
+
+AllPay服务器通过get方式,异步发送到消费接口中上送的backURL地址,商户根据收到的报文来确定交易的支付结果
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| settAmount    | String(12)   | M    | 清算金额:如 100 元,表示为 100 或 100.00                    |
+| settCurrency  | String(3)    | M    | 清算币种:符合 ISO 标准                                      |
+| rate          | String(7)    | M    | 实际汇率,7 位有效数字                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| transID       | String(32)   | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)    | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20)   | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14)   | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | signature                                                    |
+
+
+
+
+
+
+## 6.3. 查询交易接口 
+
+
+
+1. 接口说明
+
+ 该接口为接入商家提供交易查询的功能。
+
+2. 请求报文格式 
+
+  
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+3. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60) | M    | 订单号                                                       |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |
+
+
+
+## 6.4. 退款交易接口
+
+1.接口功能说明 
+
+该接口为接入商家提供交易退款的功能。 
+
+2.请求报文格式 
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 退款填写“REFD”                                               |
+| orderNum      | String(60)   | M    | 原交易订单号                                                 |
+| refundNum     | String(60)   | M    | 退款订单号:商户自行定义,需保证同一商户号下退款订单号不能重复 |
+| returnAmount  | String(12)   | M    | 退款金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3.响应报文格式
+
+| 参数      | 类型       | 属性 | 描述                                           |
+| --------- | ---------- | ---- | ---------------------------------------------- |
+| version   | String(12) | M    | 统一填写为“VER000000002”                       |
+| charSet   | String(6)  | M    | 统一填写为“UTF-8”                              |
+| transType | String(4)  | M    | 退款填写“REFD”                                 |
+| refundNum | String(60) | M    | 退款订单号                                     |
+| transID   | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一         |
+| merID     | String(15) | M    | 商户 ID,由AllPay 分配                         |
+| acqID     | String(11) | M    | 收单行 ID "99020344"                           |
+| RespCode  | String(2)  | M    | 应答码 00-成功                                 |
+| RespMsg   | String(20) | M    | 应答消息,全部为英文字符                       |
+| transTime | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                 |
+| GWTime    | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 |
+| signType  | String(3)  | M    | MD5                                            |
+| signature | String(32) | M    | signature                                      |
+
+
+
+## 6.5. 退款查询接口
+
+1. 1. 接口说明
+
+    该接口为接入商家提供退款查询的功能。
+
+   1. 请求报文格式 
+
+     
+
+   | 参数          | 类型         | 属性 | 描述                                                         |
+   | ------------- | ------------ | ---- | ------------------------------------------------------------ |
+   | version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+   | charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+   | transType     | String(4)    | M    | 查询填写“RFQY”                                               |
+   | refundNum     | String(60)   | M    | 退款订单号                                                   |
+   | merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+   | merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+   | acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+   | paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+   | transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+   | signType      | String(3)    | M    | MD5                                                          |
+   | signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+   1. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“REFD”                                               |
+| refundNum     | String(60) | M    | 退款订单号                                                   |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |

docs/ios/2.md → docs/ios/flow.md


docs/ios/1.md → docs/ios/overview.md


+ 134 - 0
docs/ios/purc.md

@@ -0,0 +1,134 @@
+# 4.消费交易
+
+## 4.1. 消费交易地址 
+
+ 交易名称  |测试地址|生产地址  
+ ------- |-----------|-------
+ 消费接口 |<https://testapi.allpayx.com/app/pay> |<https://api.allpayx.com/app/pay>
+
+## 4.2. 消费交易接口
+
+1.接口说明
+
+商户网关将订单信息发送给 ALLPAY 网关,由 ALLPAY 网关进行处理后将交易流水 号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。
+
+2.请求报文格式
+
+下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号:商户自行定义,需保证同一商户号下订单号不能重复       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| frontURL      | String(400)  | M    | app 模式默认填"nil"                                          |
+| backURL       | String(400)  | M    | 支付结果异步通知到该地址                                     |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| goodsInfo     | String(60)   | M    | 商品信息                                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3. 响应报文格式
+
+   | 参数 | 类型       | 属性 | 描述                               |
+   | ---- | ---------- | ---- | ---------------------------------- |
+   | tn   | String(32) | M    | 交易流水号,作为调起 sdk 支付的参数 |
+
+
+## 4.4. iOS 客户端接入步骤
+
+## 4.4.1. 接入说明 
+
+启动支付控件的接口,接口定义如下:
+
+```c
+[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
+
+//此处处理同步支付结果
+
+}];
+
+
+参数说明
+tn: 是从服务器端获取的流水号; mode:测试环境:NO; 生产环境:YES。
+
+Scheme: 可以为任意值推荐填写成"com.xxx.xxx" 等形式, 有特殊配置的渠道会在渠道专属配置里面说明
+
+ViewController: 调用 SDK 时的 ViewController;
+
+onResult: 接收同步结果通知
+```
+
+
+
+## 4.4.2. 添加 SDK 包
+
+1. 将  allpaysdk 下的 AllPaySDK.h,libAllPaySDK.a文件add到项目中
+2. 在 APPDelegate.m 类中导入头文件: #import "allpaysdk/AllPaySDK.h" 并添加如下方法
+
+```c
+-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ 
+
+[AllPaySDK openURL:url]; return YES; 
+
+}
+
+-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ 
+
+[AllPaySDK openURL:url]; return YES; 
+
+} 
+
+-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options{ 
+
+[AllPaySDK openURL:url]; return YES; 
+
+}
+```
+
+1. 根据要使用的渠道的专属配置,对项目进行配置
+
+## 4.4.3 同步结果通知 
+
+```c
+[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) { 
+
+  //此处处理同步支付结果
+
+ }];
+ 
+```
+
+resultDic,转为 json 字符串,格式如下:
+
+{
+  "state": "cancel",
+  "paymentSchema": "YL",
+  "orderNum": "604337497032",
+  "errorDetail": "user cancel operation"
+}
+
+报文说明
+
+- state: "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败
+- paymentSchema: 支付渠道, 印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay
+- orderNum: 订单号
+- errorDetail: 错误详情
+
+| 参数          |                             说明                             |
+| ------------- | :----------------------------------------------------------: |
+| state         | "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败  |
+| paymentSchema | 印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay |
+| orderNum      |                            订单号                            |
+| errorDetail   |                           错误详情                           |
+
+## 

+ 13 - 0
docs/ios/sign.md

@@ -0,0 +1,13 @@
+# 3.签名
+
+1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
+
+3.示例签名串
+
+```js
+acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
+```
+
+## 

+ 0 - 3
docs/pc/2.md

@@ -1,3 +0,0 @@
-# 2.Transaction process
-
-![image](/b2c/pc_flowsheet.png)

+ 0 - 159
docs/pc/3.md

@@ -1,159 +0,0 @@
-# 3.General API specification
-
-Common interface between merchant server and AllPay gateway, each channel has functions including: Purchase, Refund, Inqiury interface.
-
-## 3.1. Description of verifying the signature  
-
-1.For a POST request message sent to the ALLPAY system, in which all incoming parameters (except signature parameters) according to the field name of ASCII smallest sequence (dictionary), using the format of the URL key/value pair (key1 = value1 & key2 = value2... ) spliced into a string String1.
-
-2.At the end of String1, the signature key K1(assigned at ALLPAY upon access) agreed by both parties is spliced directly (no need to connect with "&"), resulting in a stringSignTemp string, and an md5 operation on stringSignTemp to get the value of signature.
-
-3.Sample signature string:
-
-```js
-acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26
-```
-
-## 3.2. General API access address
-
- Transaction Type  |Test Address|Production Address  
- ------- |-----------|-------
- Purchase |<https://testapi.allpayx.com/pay/v1> |<https://api.allpayx.com/pay/v1>
- Inqiury |<https://testapi.allpayx.com/pay/v1> |<https://api.allpayx.com/pay/v1>
- Refund |<https://testapi.allpayx.com/pay/v1> |<https://api.allpayx.com/pay/v1>
-
-## 3.3. Purchase interface
-
-1. Request message format
-
-This field is a list of common fields, sending, every channel needs some channel channel exclusive field, specific fields please go to the channel's exclusive canal to the fields that view. Consumer interface is divided into jump transformation and parameters return type, default to jump transformation, parameters return type will be explained in chapter 4 channels (exclusive) inside.
-
- No. |Field Name  |Max.Length|Type|Parameter Name|Comment
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002"
- 2|Character set coding |6|Text|charSet  |"UTF-8"
- 3|Transaction type  |4|Text|transType |"PURC"
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated
- 5|Order Amount |12|Text|orderAmount   |100 is displayed as 100 or 100.00
- 6|Order Currency   |3|Text|orderCurrency |Fill in "CNY" in RMB and "USD" in USD
- 7|Frontend URL Address |400|Text|frontURL  |Payment results are notified to this address front
- 8|Backend URL Address |400|Text|backURL   |Payment results are notified to this address asynchronously
- 9|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas.
- 10|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 11|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 12|Payment Channel Code    |10  |Text|paymentSchema|Payment Channel Code:[Click here for details](https://git.allpayx.com/OpenAPI/b2c/src/master/pc_api/paymentSchema.md)
- 13|Goods Information    |60  |Text|goodsInfo       |Goods Information
- 14|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 15|Signature Type     |3  |Text|signType        |MD5 
- 16|Signature Data      |32  |Text|signature         |MD5 signature 
- 
-2. Jump transformation Purchase interface response message
-
-	The merchant needs to provide an HTTP/HTTPS protocol interface that is included in the parameters passed to the SDK, the backURL. After the payment is complete, the AllPay server will call the backURL as a Get, informing the payment result. 
-
-The parameters are as follows: 
-
- No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"PURC" 
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Order Amount |12|Text|orderAmount   |100 is displayed as 100 or 100.00 
- 6|Order Currency   |3|Text|orderCurrency |Fill in "CNY" in RMB and "USD" in USD 
- 7|Settlement Amount  |12 |Text|settAmount   |100 is displayed as 100 or 100.00  
- 8|Settlement Currency  |3|Text|settCurrency    |Comply with ISO standards and fill in the number type 
- 9|Settlement FX Rate   |7|Text|rate     |Real exchange rate, 7 digits  
- 10|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. 
- 11|Gateway Transaction ID  |32|Text|transID    |The unique transaction id generated by the gateway.
- 12|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 13|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 14|Payment Channel Code    |10  |Text|paymentSchema|Payment Channel Code:[Click here for details](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
- 15|Response Code   |2  |Text|RespCode       |00 stands for success; 01 stands for fail.  
- 16|Response Message    |20  |Text|RespMsg        |Response message, all English characters 
- 17|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 18|Gateway process time |14  |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time
- 19|Signature Type     |3  |Text|signType        |MD5 
- 20|Signature Data      |32  |Text|signature         |MD5 signature 
-
-## 3.4. Inqiury interface 
- 
-1. Interface specification
- 
- This interface provides the function of inqiury transaction for access merchants.
-
-2. Request message format 
-
- No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"INQY"  
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content 
- 6|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 7|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 8|Payment Channel Code    |10  |Text|paymentSchema|Payment Channel Code:[Click here for details](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
- 9|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 10|Signature Type     |3  |Text|signType        |MD5 
- 11|Signature Data      |32  |Text|signature         |MD5 signature 
-
-3. Response message format
-
-  No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"INQY" 
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Gateway Transaction ID  |32|Text|transID    |The unique transaction id generated by the gateway.  
- 6|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 7|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 8|Response Code   |2  |Text|RespCode       |00 stands for success; 01 stands for fail.  
- 9|Response Message    |20  |Text|RespMsg        |Response message, all English characters 
- 10|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 11|Gateway process time |14  |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time 
- 12|Signature Type     |3  |Text|signType        |MD5 
- 13|Signature Data      |32  |Text|signature         |MD5 signature 
-
-## 3.5. Refund interface
-
-1.Interface specification 
-
-This interface provides the function of refund transaction for access merchants. 
-
-2.Request message format 
-
-  No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"REFD" 
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Return Amount  |12|Text|returnAmount    |100 is displayed as 100 or 100.00 
- 6|Order Currency   |3|Text|orderCurrency |Fill in "CNY" in RMB and "USD" in USD 
- 7|Merchant Reserved  |1024 |Text|merReserve    |Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. 
- 8|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 9|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 10|Payment Channel Code    |10  |Text|paymentSchema|Payment Channel Code:[Click here for details](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
- 11|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 12|Signature Type     |3  |Text|signType        |MD5 
- 13|Signature Data      |32  |Text|signature         |MD5 signature 
- 
-3.Response message format
-  
-  No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
- 1|Message Version|12|Text|version |"VER000000002" 
- 2|Character set coding |6|Text|charSet  |"UTF-8" 
- 3|Transaction type  |4|Text|transType |"REFD" 
- 4|Order Number   |60|Text|orderNum  |The merchant shall define it by itself, and the order number of the same merchant number shall not be repeated 
- 5|Gateway Transaction ID  |32|Text|transID    |The unique transaction id generated by the gateway.  
- 6|Merchant ID   |15 |Text|merID     |Merchant ID, assigned by AllPay 
- 7|Acquirer ID    |11  |Text|acqID      |"99020344" 
- 8|Response Code   |2  |Text|RespCode       |00 stands for success; 01 stands for fail.  
- 9|Response Message    |20  |Text|RespMsg        |Response message, all English characters 
- 10|Transaction Time    |14  |Text|transTime       |Transaction time, format :" yyymmddhhmmss" 
- 11|Gateway process time |14  |Text|GWTime |YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time 
- 12|Signature Type     |3  |Text|signType        |MD5 
- 13|Signature Data      |32  |Text|signature         |MD5 signature 

+ 0 - 17
docs/pc/6.md

@@ -1,17 +0,0 @@
-# 6. error code 
-
-| code | msg                            |
-| -------------- | ------------------------------------------ |
-| U1             | Clientid not found                         |
-| U2             | Signature error                            |
-| V1             | Parameter missing                          |
-| E1             | Exceed the limit                           |
-| R1             | Orderno repeat                             |
-| C1             | Order currency is not set                  |
-| P1             | paychannel error                           |
-| I1             | Illegal request address                    |
-| T1             | Parameter missing(version或tranType)     |
-| T2             | Txntype error                              |
-| T3             | transaction is not exist or fail           |
-| T4             | The maximum amount exceeds the upper limit |
-| 99             | System error  

+ 4 - 3
docs/pc/README.md

@@ -1,5 +1,6 @@
-# PC Web Integration Specification V4.2.1
+# PC Web Integration Specification V4.3.0
+
 [Shanghai AllPay Technology Co., Ltd.](https://www.allpayx.com)
 
-* Version:English V4.2.1
-* Update Time:April 2018
+- Version:English V4.3.0
+- Update Time: 2018 11

+ 203 - 92
docs/pc/4.md

@@ -1,28 +1,27 @@
-# 4.Channel exclusive allocation
-## 4.1 EB(Transition)
+# 5.Channel exclusive allocation
+## 5.1 EB(Transition)
 
+| No.  | Field Name | Max.Length | Type | Parameter name | Comment                                                    |
+| ---- | ---------- | ---------- | ---- | -------------- | ---------------------------------------------------------- |
+| 1    | Name       | 32         | Text | trxn_firstname | This is name of the customer who is doing the transaction. |
+| 2    | Email      | 40         | Text | trxn_email_id  | this is email id of the customer who is doing transaction. |
+| 3    | Phone      | 20         | Text | trxn_phone     | Phone number of the customer.                              |
 
-No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
-  1| Name     |32  |Text|trxn_firstname         |This is name of the customer who is doing the transaction. 
-  2| Email     |40  |Text|trxn_email_id         |this is email id of the customer who is doing transaction.
-  3|Phone |20  |Text|trxn_phone|Phone number of the customer.
+## 5.2 UP(Transition)
 
-## 4.2 UP(Transition)
+| No.  | Field Name           | Max.Length | Type | Parameter name | Comment                                                      |
+| ---- | -------------------- | ---------- | ---- | -------------- | ------------------------------------------------------------ |
+| 1    | UnionPay card number | 19         | Text | uCardNumber    | The overseas UnionPay channel is applicable to the UnionPay excellent plan. Can not upload, if you need to fill in the bank card number in advance, then send this field. |
 
-No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
-  1| UnionPay card number |19  | Text|uCardNumber |The overseas UnionPay channel is applicable to the UnionPay excellent plan. Can not upload, if you need to fill in the bank card number in advance, then send this field.
+## 5.3 WX(Includes transition and parameter return)
 
-## 4.3 WX(Includes transition and parameter return)
+| No.  | Field Name                | Max.Length | Type | Parameter name | Comment                                                      |
+| ---- | ------------------------- | ---------- | ---- | -------------- | ------------------------------------------------------------ |
+| 1    | Transaction scenario code | 16         | Text | code           | 1.“NATIVE“:Return the URL value of WeChat payment collection for parameter return, ask the merchant to convert it into QR code, generate the front interface of payment, and prompt the user to scan the code to pay; 2.“QUICK”:It's jump mode, open the front-end page provided by AllPay, which contains WeChat QR code. |
 
- No. |Field Name  |Max.Length|Type|Parameter name|Comment 
- -----|-----|----|----|------|------
-  1| Transaction scenario code|16  | Text|code |1.“NATIVE“:Return the URL value of WeChat payment collection for parameter return, ask the merchant to convert it into QR code, generate the front interface of payment, and prompt the user to scan the code to pay; 2.“QUICK”:It's jump mode, open the front-end page provided by AllPay, which contains WeChat QR code.
-
-## 4.4 PPRO(Transition)
-## 4.4.1 PPRO_AC
+## 5.4 PPRO(Transition)
 
+## 5.4.1 PPRO_AC
 
  Field name  |M/O   |Type |Description  
  -----|-----|----|----
@@ -31,8 +30,8 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 
 Note: AstroPay Card is available for currency USD and country codes BO, BR, CL, CN, CO, CR, MX, PE, UY, VE. 
-     
-###### 4.4.2 PPRO_AD
+     
+## 5.4.2 PPRO_AD
 
 
  Field name  |M/O   |Type |Description  
@@ -41,10 +40,10 @@ Note: AstroPay Card is available for currency USD and country codes BO, BR, CL,
 accountholdername|M   |Text |The account holder - minimum of 3 characters, up to 100 charac- ters. 
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 
-Note: AstroPay Direct is available for currency USD and country codes AR, BR, CL, CN, CO, MX, PE, UY. 
+Note: AstroPay Direct is available for currency USD and country codes AR, BR, CL, CN, CO, MX, PE, UY, CN 
 
 
-###### 4.4.3 PPRO_AR
+## 5.4.3 PPRO_AR
 
 
  Field name  |M/O   |Type |Description  
@@ -54,12 +53,16 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 nationalid  |M   |Text |Consumer’s national id (up to 30 characters) 
 email   |M   |Text |RFC compliant email address of the account holder 
+address   |M   |Text |Consumer's address
+zipcode   |M   |Text |Consumer's zip/postal code
 dob    |O   |Text |Date of birth, format YYYYMMDD 
 
+
+
 Note: Aura (Brazil) is available for currency USD and country code BR. 
 
 
-###### 4.4.4 PPRO_BA
+## 5.4.4 PPRO_BA
 
 
  Field name  |M/O   |Type |Description  
@@ -69,12 +72,14 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 nationalid  |M   |Text |Consumer’s national id (up to 30 characters) 
 email   |M   |Text |RFC compliant email address of the account holder 
+address   |M   |Text |Consumer's address
+zipcode   |M   |Text |Consumer's zip/postal code
 dob    |O   |Text |Date of birth, format YYYYMMDD 
 
 Note: Baloto Cash (Colombia) is available for currency USD and country code CO. 
 
 
-###### 4.4.5 PPRO_BB
+## 5.4.5 PPRO_BB
 
 
  Field name  |M/O   |Type |Description  
@@ -84,12 +89,14 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 nationalid  |M   |Text |Consumer’s national id (up to 30 characters) 
 email   |M   |Text |RFC compliant email address of the account holder 
+address   |M   |Text |Consumer's address
+zipcode   |M   |Text |Consumer's zip/postal code
 dob    |O   |Text |Date of birth, format YYYYMMDD 
 
 Note: Banco do Brasil (Brazil) is available for currency USD and country code BR. 
 
 
-###### 4.4.6 PPRO_BO
+## 5.4.6 PPRO_BO
 
 
  Field name  |M/O   |Type |Description  
@@ -99,27 +106,13 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 nationalid  |M   |Text |Consumer’s national id (up to 30 characters) 
 email   |M   |Text |RFC compliant email address of the account holder 
+address   |M   |Text |Consumer's address
+zipcode   |M   |Text |Consumer's zip/postal code
 dob    |O   |Text |Date of birth, format YYYYMMDD 
 
 Note: Boleto Bancario is available for currency USD and country code BR. 
 
-
-
-###### 4.4.7 PPRO_CC
-
-
- Field name  |M/O   |Type |Description  
- -----|-----|----|----
- countrycode|M   |Text |The 2-letter ISO country code of the country in which the payment instrument is issued/operated (e.g. DE). For details see payment method specific documentation. 
-accountholdername|M   |Text |The account holder - minimum of 3 characters, up to 100 charac- ters. 
-consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
-nationalid  |M   |Text |Consumer’s national id (up to 30 characters) 
-email   |M   |Text |RFC compliant email address of the account holder 
-dob    |O   |Text |Date of birth, format YYYYMMDD 
-
-Note: Cartao MercadoLivre (Brazil) is available for currency USD and country code BR. 
-
-###### 4.4.8 PPRO_DR
+## 5.4.7 PPRO_DR
 
 
  Field name  |M/O   |Type |Description  
@@ -133,7 +126,7 @@ Note: Dragonpay is only available for currency PHP and country code PH.
 
 
 
-###### 4.4.9 PPRO_EN
+## 5.4.8 PPRO_EN
 
 
  Field name  |M/O   |Type |Description  
@@ -145,7 +138,7 @@ phone  |M  |Text |Valid international phone number of the account holder
 
 Note: eNETS is only available for currency SGD and country code SG. 
 
-###### 4.4.10 PPRO_EP
+## 5.4.9 PPRO_EP
 
 
  Field name  |M/O   |Type |Description  
@@ -155,7 +148,7 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 
 Note: eps only works for the countrycode “AT” and currency “EUR”. 
 
-###### 4.4.11 PPRO_GP
+## 5.4.10 PPRO_GP
 
 
  Field name  |M/O   |Type |Description  
@@ -164,8 +157,9 @@ Note: eps only works for the countrycode “AT” and currency “EUR”.
 accountholdername|M   |Text |The account holder - minimum of 3 characters, up to 100 charac- ters. 
 bic |O  |Text |Valid BIC (8 or 11 alphanumeric letters) of consumer’s bank 
 
+the countrycode “DE” and currency “EUR”. 
 
-###### 4.4.12 PPRO_HC
+## 5.4.11 PPRO_HC
 
 
  Field name  |M/O   |Type |Description  
@@ -175,11 +169,13 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 nationalid  |M   |Text |Consumer’s national id (up to 30 characters) 
 email   |M   |Text |RFC compliant email address of the account holder 
+address   |M   |Text |Consumer's address
+zipcode   |M   |Text |Consumer's zip/postal code
 dob    |O   |Text |Date of birth, format YYYYMMDD 
 
 Note: Hipercard (Brazil) is available for currency USD and country code BR. 
 
-###### 4.4.13 PPRO_ID
+## 5.4.12 PPRO_ID
 
 
  Field name  |M/O   |Type |Description  
@@ -189,7 +185,12 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 
 Note: iDEAL only works for the countrycode “NL” and currency “EUR”. 
 
-###### 4.4.14 PPRO_IT
+
+Here is the list of currently available issuers and their associated BIC:
+
+![image](/b2c/bic_list.jpg)
+
+## 5.4.13 PPRO_IT
 
 
  Field name  |M/O   |Type |Description  
@@ -199,11 +200,13 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 nationalid  |M   |Text |Consumer’s national id (up to 30 characters) 
 email   |M   |Text |RFC compliant email address of the account holder 
+address   |M   |Text |Consumer's address
+zipcode   |M   |Text |Consumer's zip/postal code
 dob    |O   |Text |Date of birth, format YYYYMMDD 
 
 Note: Itaú (Brazil) is available for currency USD and country code BR.
 
-###### 4.4.15 PPRO_MB
+## 5.4.14 PPRO_MB
 
 
 
@@ -215,7 +218,7 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 Note: MyBank only works for the country code IT and currency EUR. 
 
 
-###### 4.4.16 PPRO_PC
+## 5.4.15 PPRO_PC
 
 
 
@@ -227,22 +230,7 @@ consumerref |M   |Text |Unique reference identifying the consumer, has to satisf
 
 
 
-###### 4.4.17 PPRO_PB
-
-
-
- Field name  |M/O   |Type |Description  
- -----|-----|----|----
- countrycode|M   |Text |The 2-letter ISO country code of the country in which the payment instrument is issued/operated (e.g. DE). For details see payment method specific documentation. 
-accountholdername|M   |Text |The account holder - minimum of 3 characters, up to 100 charac- ters. 
-email   |M   |Text |RFC compliant email address of the account holder 
-phone  |M  |Text |Valid international phone number of the account holder 
-
-Note: PAYSBUY Cash is only available for currency THB and country code TH. 
-
-
-
-###### 4.4.18 PPRO_PU
+## 5.4.16 PPRO_PU
 
 
 
@@ -254,7 +242,7 @@ email   |M   |Text |RFC compliant email address of the account holder
 
 Note: PayU works only for country code/currency combinations CZ/CZK and PL/PLN. 
 
-###### 4.4.19 PPRO_PL
+## 5.4.17 PPRO_PL
 
 
  Field name  |M/O   |Type |Description  
@@ -264,7 +252,7 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 
 Note: POLi only works for the countrycode/currency combinations “NZ”/”NZD” and “AU/AUD”. 
 
-###### 4.4.20 PPRO_P24
+## 5.4.18 PPRO_P24
 
 
  Field name  |M/O   |Type |Description  
@@ -276,7 +264,7 @@ email   |M   |Text |RFC compliant email address of the account holder
 Note: Przelewy24 only works for the countrycode “PL” and currencies “PLN” and “EUR”. 
 
 
-###### 4.4.21 PPRO_QW
+## 5.4.19 PPRO_QW
 
 
  Field name  |M/O   |Type |Description  
@@ -284,20 +272,22 @@ Note: Przelewy24 only works for the countrycode “PL” and currencies “PLN
  countrycode|M   |Text |The 2-letter ISO country code of the country in which the payment instrument is issued/operated (e.g. DE). For details see payment method specific documentation. 
 accountholdername|M   |Text |The account holder - minimum of 3 characters, up to 100 charac- ters. 
 mobilephone|M   |Text |Valid international Russian mobile phone number identifying the QIWI destination account to pay out to (excluding plus sign or any other international prefixes, including a leading 7 for Russia, 11 digits in total, e.g. 71234567890). 
+siteid|M/O   |Text |Unique site identifier, forwarded to qiwi. Required for clients serving multiple points of sale.
 
 
 Note:	QIWI Payout only works for the countrycodes “RU”, “KZ” and UA, and - depending on your contract - currency 
“RUB” , “EUR” ,”KZT” and “USD”. 

-###### 4.4.22 PPRO_SP
+## 5.4.20 PPRO_SP
 
 
  Field name  |M/O   |Type |Description  
  -----|-----|----|----
  countrycode|M   |Text |The 2-letter ISO country code of the country in which the payment instrument is issued/operated (e.g. DE). For details see payment method specific documentation. 
 accountholdername|M   |Text |The account holder - minimum of 3 characters, up to 100 charac- ters. 
+email   |M   |Text |RFC compliant email address of the account holder 
 
-Note: SafetyPay only works for country codes “AT”, “BR”, “CO”, “CR”, “DE”, “ES”, “MX”, “NI”, “NL”, “PA”, “PE” and currencies “EUR”, “USD”. 
+Note:SafetyPay only works for country codes “AT”, “BE”, “BR”, “CL”, “CR”, “DE”, “EC”, “ES”, “MX”, “NL”, “PE” and currencies “EUR”, “USD”.
 
-###### 4.4.23 PPRO_SD
+## 5.4.21 PPRO_SD
 
 
  Field name  |M/O   |Type |Description  
@@ -309,7 +299,7 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 Note: SEPA Direct Debit works for all SEPA countries and currency EUR. 
 
 
-###### 4.4.24 PPRO_SG
+## 5.4.22 PPRO_SG
 
 
  Field name  |M/O   |Type |Description  
@@ -321,7 +311,7 @@ phone  |M  |Text |Valid international phone number of the account holder
 
 Note: SingPost (Singapore) is only available for currency SGD and country code SG. 
 
-###### 4.4.25 PPRO_SK
+## 5.4.23 PPRO_SK
 
 
  Field name  |M/O   |Type |Description  
@@ -333,7 +323,15 @@ address   |O  |Text |Consumer’s address (e.g. street)
 zipcode    |O  |Text |Consumer’s postal code 
 city     |O  |Text |Consumer’s city 
 
-###### 4.4.26 PPRO_DP
+```xml
+The account holder name passed in the request has to be in the format <firstname><space><lastname>, with
+lastname having a minimum length of two characters and the total string a minimum length of five. Multiple
+first names are ok, valid examples are “John Dorian”, “William Charles Dickinson”. If these conditions are not
+met, the system will not accept the request 
+
+```
+
+## 5.4.24 PPRO_SB
 
 
  Field name  |M/O   |Type |Description  
@@ -342,30 +340,21 @@ city     |O  |Text |Consumer’s city
 accountholdername|M   |Text |The account holder - minimum of 3 characters, up to 100 charac- ters. 
 bic |O  |Text |Valid BIC (8 or 11 alphanumeric letters) of consumer’s bank 
 
+OFORT Banking (also known as SOFORT überweisung, formally DirectPay24) is available in Austria, Belgium,
+Germany, Spain, Italy and Netherlands (country codes AT, BE, DE, ES, IT, NL). EUR is supported in all countries.
 
-###### 4.4.27 PPRO_TP
 
+## 5.4.25 PPRO_TP
 
  Field name  |M/O   |Type |Description  
  -----|-----|----|----
  countrycode|M   |Text |The 2-letter ISO country code of the country in which the payment instrument is issued/operated (e.g. DE). For details see payment method specific documentation. 
 accountholdername|M   |Text |The account holder - minimum of 3 characters, up to 100 charac- ters. 
 
-TrustPay works for the following country code/currency combinations: 
-
-
-CZ 
-CZK, EUR 
-
-
-SK 
-EUR 
+Note: TrustPat   is only available for currency EUR and country code CZ, SK 
 
 
-The currencies available to you may depend on your contract. 
-
-
-###### 4.4.28 PPRO_WP
+## 5.4.26 PPRO_WP
 
 
  Field name  |M/O   |Type |Description  
@@ -375,14 +364,136 @@ accountholdername|M   |Text |The account holder - minimum of 3 characters, up to
 consumerref |M   |Text |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 nationalid  |M   |Text |Consumer’s national id (up to 30 characters) 
 email   |M   |Text |RFC compliant email address of the account holder 
+address   |M   |Text |Consumer's address
+zipcode   |M   |Text |Consumer's zip/postal code
 dob    |O   |Text |Date of birth, format YYYYMMDD 
 
-Note: WebPay is available for currency USD and country code CL.
+Note: WebPay is available for currency USD and country code CL. 
 
 
 
-## 4.5 AP(Transition)
+## 5.5 AP
 
 | Parameter | Type       | Required | Description                                                  | Sample                                 |
 | --------- | ---------- | -------- | ------------------------------------------------------------ | -------------------------------------- |
-| timeout   | String(10) | O        | The default is 12h. Please contact Alipay Technical Support if you need to use other values. Max value is 15d. This parameter controls the valid time from login to completion. | 5m 10m 15m 30m 1h 2h 3h 5h 10h 12h 1d. |
+| timeout   | String(10) | O        | The default is 12h. Please contact Alipay Technical Support if you need to use other values. Max value is 15d. This parameter controls the valid time from login to completion. | 5m 10m 15m 30m 1h 2h 3h 5h 10h 12h 1d. |
+
+
+
+## 5.6 MIPAY(Transition)
+
+| 序号 | 名称   | 长度 | 类型 | 参数名称   | 备注                                                         |
+| ---- | ------ | ---- | ---- | ---------- | ------------------------------------------------------------ |
+| 1    | 姓名   | 32   | Text | firstname  | This is name of the customer who is doing the transaction.   |
+| 2    | 邮箱   | 40   | Text | email      | this is email id of the customer who is doing transaction.   |
+| 3    | 电话   | 20   | Text | phone      | Phone number of the customer.                                |
+| 4    | 客户ID | 30   | Text | customerId | Customer ID, when client register on merchant, merchant distribute it to client. |
+
+测试环境配置:
+
+修改测试机器hosts,添加如下两条信息
+
+114.80.87.249 account.preview.n.xiaomi.net
+
+114.80.87.249 api.account.preview.n.xiaomi.net
+
+测试参数
+
+测试小米ID:100019995/test123456
+
+卡号:5123456789012346
+
+有效期:0520
+
+cvv:123
+
+## 5.7 IPL(Transition)
+
+| Parameter    | Type       | Required | Description                                                  | Sample |
+| ------------ | ---------- | -------- | ------------------------------------------------------------ | ------ |
+| language     | string(2)  | O        | 显示语言Chinese:zh,English:en,Korean:ko                      | zh     |
+| terminalType | string(16) | M        | 终端类型:web/h5/android/ios                                  | h5     |
+| transTimeout | string(6)  | M        | 订单有效时长,整数格式,单位分钟(min)                        | 10     |
+| country      | string(2)  | O        | 国家二字代码,需要大写。页面将展示这个国家的支付方式。如果不传,根据系统判定的国家展示支付方式 | CN     |
+
+测试卡号:
+
+```javascript
+Visa:
+cardNo: 4000020951595032
+expirationMonth: 06
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+
+Mastercard:
+cardNo: 5333300989521936
+expirationMonth: 06 
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+
+JCB:
+cardNo: 3567860000000000
+expirationMonth: 06 
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+
+American Express:
+cardNo: 375532604034750 
+expirationMonth: 06 
+expirationYear: 28
+cvv: 6688
+firstName: Ken 
+lastName: Swift
+
+Diners Club:
+cardNo: 36259600590707 
+expirationMonth: 06 
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+
+Discover:
+cardNo: 6011492100005191 
+expirationMonth: 06 
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+```
+
+## 5.8 RP(Transition)
+
+| Parameter | Type   | Required | Description                                                | Sample         |
+| --------- | ------ | -------- | ---------------------------------------------------------- | -------------- |
+| firstname | string | M        | This is name of the customer who is doing the transaction. | jim            |
+| email     | string | M        | this is email id of the customer who is doing transaction. | 123456@163.com |
+
+```javascript
+测试卡号
+Domestic
+
+Mastercard:   
+5104_0155_5555_5558, 
+5104_0600_0000_0008
+
+Visa:
+4111_1111_1111_1111
+
+International
+
+Mastercard:
+
+5555_5555_5555_4444
+5105_1051_0510_5100
+
+Visa:
+012_8888_8888_1881
+4000_1841_8621_8826
+```

+ 188 - 0
docs/pc/common.md

@@ -0,0 +1,188 @@
+# 6.Common interface
+
+## 6.1. Interface URL
+
+Common interface includes asynchronous notification of transactions, transaction inquiry, refund, refund inquiry interface
+
+
+
+Interface Name  |Test URL |Production URL 
+ ------- |-----------|-------
+ inquiry |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
+ refund |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
+ refund inquiry |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>
+
+## 6.2. Purchase Response from AllPay 
+
+AllPay server sends the backURL address to the consumer interface asynchronously through get, and the merchant determines the payment result of the transaction based on the received messag
+
+
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | "VER000000002"                                               |
+| charSet       | String(6)    | M        | “UTF-8”                                                      |
+| transType     | String(4)    | M        | “PURC”                                                       |
+| orderNum      | String(60)   | M        | 订单号                                                       |
+| orderAmount   | String(12)   | M        | Order amount: if 100 yuan, it will be 100 or 100.00          |
+| orderCurrency | String(3)    | M        | Currency of the order: ISO standard, such as RMB filling in "CNY", us dollar filling in "USD" |
+| settAmount    | String(12)   | M        | 100 is displayed as 100 or 100.00                            |
+| settCurrency  | String(3)    | M        | Comply with ISO standards                                    |
+| rate          | String(7)    | M        | Real exchange rate, 7 digits                                 |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| transID       | String(32)   | M        | The unique transaction id generated by the gateway.          |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)    | M        | 00 stands for success; 01 stands for fail.                   |
+| RespMsg       | String(20)   | M        | Response message, all English characters                     |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| GWTime        | String(14)   | M        | YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time |
+| signType      | String(3)    | M        | MD5                                                          |
+| signature     | String(32)   | M        | MD5 signature                                                |
+
+
+
+
+
+
+## 6.3. Inqiury interface 
+
+
+
+1. Interface specification
+
+ This interface provides the function of inqiury transaction for access merchants.
+
+2. Request message format 
+
+  
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | "VER000000002"                                               |
+| charSet       | String(6)    | M        | "UTF-8"                                                      |
+| transType     | String(4)    | M        | "INQY"                                                       |
+| orderNum      | String(60)   | M        | Original trade order number                                  |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| signType      | String(3)    | M        | "MD5"                                                        |
+| signature     | String(32)   | M        | MD5 signature                                                |
+
+
+
+3. Response message format
+
+| Parameter     | Type       | Required | Description                                                  |
+| ------------- | ---------- | -------- | ------------------------------------------------------------ |
+| version       | String(12) | M        | "VER000000002"                                               |
+| charSet       | String(6)  | M        | “UTF-8”                                                      |
+| transType     | String(4)  | M        | “INQY”                                                       |
+| orderNum      | String(60) | M        | Original trade order number                                  |
+| transID       | String(32) | M        | The unique transaction id generated by the gateway.          |
+| merID         | String(15) | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11) | M        | "99020344"                                                   |
+| paymentSchema | String(10) | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M        | 00 stands for success; 01 stands for fail.                   |
+| RespMsg       | String(20) | M        | Response message, all English characters                     |
+| transTime     | String(14) | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| GWTime        | String(14) | M        | YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time |
+| signType      | String(3)  | M        | MD5                                                          |
+| signature     | String(32) | M        | signature                                                    |
+
+
+
+## 6.4. Refund interface
+
+1.Interface specification 
+
+This interface provides the function of refund transaction for access merchants. 
+
+2.Request message format 
+
+
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | “VER000000002”                                               |
+| charSet       | String(6)    | M        | “UTF-8”                                                      |
+| transType     | String(4)    | M        | “REFD”                                                       |
+| orderNum      | String(60)   | M        | Original trade order number                                  |
+| refundNum     | String(60)   | M        | Refund order number: it is defined by the merchant, and the refund order number under the same merchant number cannot be repeated |
+| returnAmount  | String(12)   | M        | Refund amount: if 100 yuan, it is 100 or 100.00              |
+| orderCurrency | String(3)    | M        | Currency of the order: ISO standard, such as RMB filling in "CNY", us dollar filling in "USD" |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| signType      | String(3)    | M        | MD5                                                          |
+| signature     | String(32)   | M        | signature                                                    |
+
+3.Response message format
+
+| Parameter | Type       | Required | Description                                                  |
+| --------- | ---------- | -------- | ------------------------------------------------------------ |
+| version   | String(12) | M        | “VER000000002”                                               |
+| charSet   | String(6)  | M        | “UTF-8”                                                      |
+| transType | String(4)  | M        | “REFD”                                                       |
+| refundNum | String(60) | M        | The merchant shall define it by itself, and the refund number of the same merchant number shall not be repeated |
+| transID   | String(32) | M        | The unique transaction id generated by the gateway.          |
+| merID     | String(15) | M        | Merchant ID, assigned by AllPay                              |
+| acqID     | String(11) | M        | "99020344"                                                   |
+| RespCode  | String(2)  | M        | 00 stands for success; 01 stands for fail.                   |
+| RespMsg   | String(20) | M        | Response message, all English characters                     |
+| transTime | String(14) | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| GWTime    | String(14) | M        | YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time |
+| signType  | String(3)  | M        | MD5                                                          |
+| signature | String(32) | M        | signature                                                    |
+
+
+
+## 6.5. Refund Inqiury interface
+
+1.Interface specification
+
+ This interface provides the function of Refund inqiury transaction for access merchants.
+
+2. Request message format 
+
+  
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | “VER000000002”                                               |
+| charSet       | String(6)    | M        | “UTF-8”                                                      |
+| transType     | String(4)    | M        | “RFQY”                                                       |
+| refundNum     | String(60)   | M        | Refund order number                                          |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| signType      | String(3)    | M        | MD5                                                          |
+| signature     | String(32)   | M        | signature                                                    |
+
+
+
+3. Response message format
+
+| Parameter     | Type       | Required | Description                                                  |
+| ------------- | ---------- | -------- | ------------------------------------------------------------ |
+| version       | String(12) | M        | “VER000000002”                                               |
+| charSet       | String(6)  | M        | “UTF-8”                                                      |
+| transType     | String(4)  | M        | “REFD”                                                       |
+| refundNum     | String(60) | M        | Refund order number                                          |
+| transID       | String(32) | M        | The unique transaction id generated by the gateway.          |
+| merID         | String(15) | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11) | M        | "99020344"                                                   |
+| paymentSchema | String(10) |          | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M        | Response message, all English characters                     |
+| RespMsg       | String(20) | M        | Response message, all English characters                     |
+| transTime     | String(14) | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| GWTime        | String(14) | M        | YYYYMMDDHHMMSS this should be a GWtime, currently is local transaction time |
+| signType      | String(3)  | M        | MD5                                                          |
+| signature     | String(32) | M        | signature                                                    |

+ 18 - 0
docs/pc/error.md

@@ -0,0 +1,18 @@
+# 6.  error code 
+
+| code | msg                                        |
+| ---- | ------------------------------------------ |
+| U1   | Clientid not found                         |
+| U2   | Signature error                            |
+| V1   | Parameter missing                          |
+| E1   | Exceed the limit                           |
+| R1   | Orderno repeat                             |
+| C1   | Order currency is not set                  |
+| P1   | paychannel error                           |
+| I1   | Illegal request address                    |
+| T1   | Parameter missing(version或tranType)     |
+| T2   | Txntype error                              |
+| T3   | transaction is not exist or fail           |
+| T4   | The maximum amount exceeds the upper limit |
+
+| 99             | System error  

+ 4 - 0
docs/pc/flow.md

@@ -0,0 +1,4 @@
+# 2.Transaction process
+
+![image](/b2c/pc_flowsheet.png)
+

docs/pc/1.md → docs/pc/overview.md


+ 35 - 0
docs/pc/purc.md

@@ -0,0 +1,35 @@
+# 4. Purchase interface
+
+## 4.1. Interface URL
+
+ Interface Name |Test URL|Production URL  
+ ------- |-----------|-------
+ Purchase |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
+
+## 4.2. Purchase interface
+
+1. Request message format
+
+This field is a list of common fields, sending, every channel needs some channel channel exclusive field, specific fields please go to the channel's exclusive canal to the fields that view. Consumer interface is divided into jump transformation and parameters return type, default to jump transformation, parameters return type will be explained in chapter 4 channels (exclusive) inside.
+
+
+
+| Parameter     | Type         | Required | Description                                                  |
+| ------------- | ------------ | -------- | ------------------------------------------------------------ |
+| version       | String(12)   | M        | "VER000000002"                                               |
+| charSet       | String(6)    | M        | “UTF-8”                                                      |
+| transType     | String(4)    | M        | “PURC”                                                       |
+| orderNum      | String(60)   | M        | Order number: it is defined by the merchant itself, and the order number must not be repeated for the same merchant number |
+| orderAmount   | String(12)   | M        | Order amount: if 100 yuan, it will be 100 or 100.00          |
+| orderCurrency | String(3)    | M        | Currency of the order: ISO standard, such as RMB filling in "CNY", us dollar filling in "USD" |
+| frontURL      | String(400)  | M        | When the payment is complete, jump to the address            |
+| backURL       | String(400)  | M        | Payment results are asynchronously notified to this address  |
+| merReserve    | String(1024) | M        | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
+| merID         | String(15)   | M        | Merchant ID, assigned by AllPay                              |
+| acqID         | String(11)   | M        | "99020344"                                                   |
+| paymentSchema | String(10)   | M        | Channel code:[Click Here](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| goodsInfo     | String(60)   | M        | Goods Information                                            |
+| transTime     | String(14)   | M        | Transaction time, format :" yyymmddhhmmss"                   |
+| signType      | String(3)    | M        | MD5                                                          |
+| signature     | String(32)   | M        | MD5 signature                                                |
+

+ 1 - 13
docs/h5/2.md

@@ -1,8 +1,4 @@
-# 2.General API specification
-
-Common interface between merchant server and AllPay gateway, each channel has functions including: Purchase, Refund, Inqiury interface.
-
-## 2.1. Signature String and Calculated the Signature 
+# 2.Signature
 
 1.For a POST request message sent to the ALLPAY system, in which all incoming parameters (except signature parameters) according to the field name of ASCII smallest sequence (dictionary), using the format of the URL key/value pair (key1 = value1 & key2 = value2... ) spliced into a string String1.
 
@@ -14,11 +10,3 @@ Common interface between merchant server and AllPay gateway, each channel has fu
 acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26
 ```
 
-## 2.2. General API access address
-
- Transaction Type   |Test URL |Production URL
- ------- |-----------|-------
- Purchase |<https://mchapi.allpayx.com/testjspay> |<https://mchapi.allpayx.com/jspay>
- Inquiry |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
- Refund |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
- Refund Inquiry |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>

+ 3 - 3
docs/pc/5.md

@@ -1,9 +1,9 @@
-# 5.Test account
- 
+# 7.Test account
+
  Please note that AliPay and TenPay transactions need to be tested with Chinese real-name certified accounts. All test transactions do not provide liquidation services. Please use a small amount of test.
 
 The following are the UnionPay channel test cards for testing only: 
- 
+
 ```
 Credit Card:5200831111111113 
 Mobile:13552535506

+ 3 - 3
docs/wx/README.md

@@ -1,6 +1,6 @@
-# 微信小程序支付接入规范文档4.2.1
+# 微信小程序支付接入规范文档4.3.0
 
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
-* 版本信息:中文 V4.2.1
-* 更新时间:2018 年6
+* 版本信息:中文 V4.3.0
+* 更新时间:2018 年11

+ 0 - 146
docs/zh/android/3.md

@@ -1,146 +0,0 @@
-# 3.通用API说明
-
-商户服务器和 AllPay 网关对接的通用接口,每个渠道都具有的功能,包括:消费,退款,查询接口。
-
-## 3.1. 验签说明 
-
-1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
-
-3.示例签名串
-
-```java
-acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
-```
-
-## 3.2. 通用API 接入地址 
-
- 交易名称  |开发调试地址|生产交易地址  
- ------- |-----------|-------
- 消费接口 |<https://testapi.allpayx.com/app/pay> |<https://api.allpayx.com/app/pay>
- 查询接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
- 退款接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
-
-## 3.3. 消费交易接口
-
-1.接口说明
-
-商户网关将订单信息发送给 ALLPAY 网关,由 ALLPAY 网关进行处理后将交易流水 号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。
-
-2.请求报文格式
-
-下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|前端 URL 地址 |400|文本|frontURL  |app 模式默认填"nil" 
- 8|后端 URL 地址 |400|文本|backURL   |支付结果异步通知到该地址 
- 9|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 10|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 11|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 12|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 13|商品信息    |60  |文本|goodsInfo       | 商品信息
- 14|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 15|签名类型     |3  |文本|signType        |MD5 
- 16|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3. 响应报文格式
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
-  1|交易流水号 |32|文本|tn |tn 作为调起 sdk 支付的参数
-
-## 3.4. 查询交易接口 
-
-
-
-1. 接口说明
-
- 该接口为接入商家提供交易查询的功能。
-
-2. 请求报文格式 
-
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询填写“INQY”  
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|商户预留字段  |1024 |文本|merReserve    |商户保留 
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 9|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 10|签名类型     |3  |文本|signType        |MD5 
- 11|签名      |32  |文本|signature         |采用 MD5 签名 
-
-
-3. 响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询交易填写为“INQY 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-## 3.5. 退款交易接口
-
-1.接口功能说明 
-
-该接口为接入商家提供交易退款的功能。 
-
-2.请求报文格式 
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|退款金额  |12|文本|returnAmount    |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 8|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 9|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 10|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 11|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3.响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 

+ 0 - 111
docs/zh/android/4.md

@@ -1,111 +0,0 @@
-# 4.Android 客户端接入步骤 
-
-## 4.1. 接入说明 
-
-启动支付控件的接口,接口定义如下:
-
-```java
-public static void pay(Activity activity,String tn,boolean mode)
-```
-
-::: tip 参数说明
-activity —— 用于启动支付控件的活动对象
-
-tn —— 订单信息为交易流水号,即 TN,为商户后台从 AllPay 后台获取
-
-mode —— AllPay 后台环境标识,true 将在 AllPay 正式环境发起交易,false 将在 AllPay 测试环 境发起交易
-:::
-
-## 4.2. 添加 SDK 包
-
-1. 把allpaysdk当做Module导入到自己的工程
-2. 在Application Module的build.gradle文件的dependencies下添加compile project(':allpaysdk') 
-3. 在Application Module的build.gradle文件中添加
-
-```java
-repositories {
-    flatDir {
-        dirs project(':allpaysdk').file('libs')
-    }
-}
-```
-
-## 4.3. 调用支付控件
-
-接着可以通过以下方式调用支付控件:
-
-```java
-/**
- * tn——交易流水号,即 TN,为商户后台从 AllPay 后台获取,获取方式参见 AllPay 网关对接文档
- * false 测试环境
- */
-AllPayEngine.Pay(ShopCartActivity.this, tn, false);
-```
-
-## 4.4. 同步结果通知
-
-支付完成后,获取支付控件支付结果,并添加相应处理逻辑,只需实现调用 Activity 
-中的 onActivityResult()方法即可,实例代码如下:
-
- ```java
-@Override
-protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-    if (data == null) {
-        return;
-    }
-
-    if (requestCode == AllPayConst.VTPAY_PAY_REQUESR_CODE&& resultCode == AllPayConst.VTPAY_PAY_RESULT_CODE) {
-        String result = data.getExtras().getString("pay_result");
-    }
-}
-```
-
-pay_result,为 json 字符串,格式如下:
-
-```text
-{
-    "state": "cancel",
-    "paymentSchema": "UP",
-    "orderNum": "604337497032",
-    "errorDetail": "user cancel operation "
-}
-```
-
-报文说明:
-
-* state: "success"代表成功, "cancel"代表用户取消操作,"fail"代表失败,"query"代表 app 需要调用查询接口来确认订单状态
-* paymentSchema: 支付渠道, "APMP"代表支付宝, "WX"代表微信 
-* orderNum: 订单号
-* errorDetail: 错误详情
-
-
-## 4.5. 异步结果通知
-
-商户需要提供一个 http 协议的接口,包含在参数里传递给 SDK,即 backURL。AllPay 
-服务器在支付完成后,会以 Get 方式调用 backURL,通知支付结果。 
-
-参数如下表:
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|清算金额  |12 |文本|settAmount   |如 100 元,表示为 100 或 100.00  
- 8|清算币种  |3|文本|settCurrency    |符合 ISO 标准,填写数字类型 
- 9|清算汇率   |7|文本|rate     |实际汇率,7 位有效数字  
- 10|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 11|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一
- 12|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 13|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 14|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 15|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 16|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 17|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 18|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间
- 19|签名类型     |3  |文本|signType        |MD5 
- 20|签名      |32  |文本|signature         |采用 MD5 签名 
- 

+ 3 - 2
docs/android/6.md

@@ -1,5 +1,6 @@
-# 6.安卓SDK下载
+# 7.安卓SDK下载
 
 
 
-[Android Demo及SDK下载地址](https://git.allpayx.com/OpenAPI/b2c_android_sdk)
+[Android Demo及SDK下载地址](https://git.allpayx.com/OpenAPI/b2c_android_sdk)
+

+ 3 - 3
docs/zh/android/README.md

@@ -1,8 +1,8 @@
-# Android端控件支付产品接口规范文档4.0.2
+# Android端控件支付产品接口规范文档4.3.0
 
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
-* 版本信息:中文 V4.0.2
-* 更新时间:2018 年7
+* 版本信息:中文 V4.3.0
+* 更新时间:2018 年11
 
 # 

+ 1 - 1
docs/zh/android/5.md

@@ -8,7 +8,7 @@
 
 序号 |名称  |长度|类型|参数名称|备注 
  -----|-----|----|----|------|------
- 1 |姓名| 32   |文本  |trxn_firstname|trxn_firstname
+  |1| 姓名     |32  |文本|trxn_firstname|This is name of the customer who is doing the transaction. 
   2| 邮箱     |40  |文本|trxn_email_id|this is email id of the customer who is doing transaction.
   3|电话 |20  |文本|trxn_phone|Phone number of the customer.
   4|优惠券选项 |1  |文本|trxn_is_coupon_enabled| If the value is 0 then customer will not be able to see the coupons. If the value is 1 then customer will be able see the coupons and able to select the coupons

+ 188 - 0
docs/zh/android/common.md

@@ -0,0 +1,188 @@
+# 6. 通用接口
+
+## 6.1. 接口地址
+
+
+
+通用接口包括 交易异步通知,交易查询,退款,退款查询接口
+
+
+
+接口名称   |测试地址 |生产地址
+ ------- |-----------|-------
+ 交易查询接口 |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
+ 退款接口 |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
+ 退款查询接口 |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>
+
+## 6.2. 异步通知报文
+
+AllPay服务器通过get方式,异步发送到消费接口中上送的backURL地址,商户根据收到的报文来确定交易的支付结果
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| settAmount    | String(12)   | M    | 清算金额:如 100 元,表示为 100 或 100.00                    |
+| settCurrency  | String(3)    | M    | 清算币种:符合 ISO 标准                                      |
+| rate          | String(7)    | M    | 实际汇率,7 位有效数字                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| transID       | String(32)   | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)    | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20)   | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14)   | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | signature                                                    |
+
+
+
+
+
+
+## 6.3. 查询交易接口 
+
+
+
+1. 接口说明
+
+ 该接口为接入商家提供交易查询的功能。
+
+2. 请求报文格式 
+
+  
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+3. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60) | M    | 订单号                                                       |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |
+
+
+
+## 6.4. 退款交易接口
+
+1.接口功能说明 
+
+该接口为接入商家提供交易退款的功能。 
+
+2.请求报文格式 
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 退款填写“REFD”                                               |
+| orderNum      | String(60)   | M    | 原交易订单号                                                 |
+| refundNum     | String(60)   | M    | 退款订单号:商户自行定义,需保证同一商户号下退款订单号不能重复 |
+| returnAmount  | String(12)   | M    | 退款金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3.响应报文格式
+
+| 参数      | 类型       | 属性 | 描述                                           |
+| --------- | ---------- | ---- | ---------------------------------------------- |
+| version   | String(12) | M    | 统一填写为“VER000000002”                       |
+| charSet   | String(6)  | M    | 统一填写为“UTF-8”                              |
+| transType | String(4)  | M    | 退款填写“REFD”                                 |
+| refundNum | String(60) | M    | 退款订单号                                     |
+| transID   | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一         |
+| merID     | String(15) | M    | 商户 ID,由AllPay 分配                         |
+| acqID     | String(11) | M    | 收单行 ID "99020344"                           |
+| RespCode  | String(2)  | M    | 应答码 00-成功                                 |
+| RespMsg   | String(20) | M    | 应答消息,全部为英文字符                       |
+| transTime | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                 |
+| GWTime    | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 |
+| signType  | String(3)  | M    | MD5                                            |
+| signature | String(32) | M    | signature                                      |
+
+
+
+## 6.5. 退款查询接口
+
+1. 1. 接口说明
+
+    该接口为接入商家提供退款查询的功能。
+
+   1. 请求报文格式 
+
+     
+
+   | 参数          | 类型         | 属性 | 描述                                                         |
+   | ------------- | ------------ | ---- | ------------------------------------------------------------ |
+   | version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+   | charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+   | transType     | String(4)    | M    | 查询填写“RFQY”                                               |
+   | refundNum     | String(60)   | M    | 退款订单号                                                   |
+   | merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+   | merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+   | acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+   | paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+   | transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+   | signType      | String(3)    | M    | MD5                                                          |
+   | signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+   1. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“REFD”                                               |
+| refundNum     | String(60) | M    | 退款订单号                                                   |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |

docs/zh/android/2.md → docs/zh/android/flow.md


+ 2 - 1
docs/zh/android/1.md

@@ -1,2 +1,3 @@
 #### 1.概述
-AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“SDK”),以帮助客户实 现快速、安全、集中式的接入支付渠道。
+AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“SDK”),以帮助客户实 现快速、安全、集中式的接入支付渠道。
+

+ 125 - 0
docs/zh/android/purc.md

@@ -0,0 +1,125 @@
+# 4.消费交易
+
+## 4.1. 消费交易地址 
+
+ 交易名称  |测试地址|生产地址  
+ ------- |-----------|-------
+ 消费接口 |<https://testapi.allpayx.com/app/pay> |<https://api.allpayx.com/app/pay>
+
+## 4.2. 消费交易接口
+
+1.接口说明
+
+商户网关将订单信息发送给 ALLPAY 网关,由 ALLPAY 网关进行处理后将交易流水 号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。
+
+2.请求报文格式
+
+下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号:商户自行定义,需保证同一商户号下订单号不能重复       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| frontURL      | String(400)  | M    | app 模式默认填"nil"                                          |
+| backURL       | String(400)  | M    | 支付结果异步通知到该地址                                     |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| goodsInfo     | String(60)   | M    | 商品信息                                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3. 响应报文格式
+
+   | 参数 | 类型       | 属性 | 描述                               |
+   | ---- | ---------- | ---- | ---------------------------------- |
+   | tn   | String(32) | M    | 交易流水号,作为调起 sdk 支付的参数 |
+
+
+## 4.3. Android 客户端接入步骤 
+
+## 4.3.1. 接入说明 
+
+启动支付控件的接口,接口定义如下:
+
+```java
+public static void pay(Activity activity,String tn,boolean mode)
+```
+
+::: tip 参数说明
+activity —— 用于启动支付控件的活动对象
+
+tn —— 订单信息为交易流水号,即 TN,为商户后台从 AllPay 后台获取
+
+mode —— AllPay 后台环境标识,true 将在 AllPay 正式环境发起交易,false 将在 AllPay 测试环 境发起交易
+:::
+
+## 4.3.2. 添加 SDK 包
+
+1. 把allpaysdk当做Module导入到自己的工程
+2. 在Application Module的build.gradle文件的dependencies下添加compile project(':allpaysdk') 
+3. 在Application Module的build.gradle文件中添加
+
+```java
+repositories {
+    flatDir {
+        dirs project(':allpaysdk').file('libs')
+    }
+}
+```
+
+## 4.3.3. 调用支付控件
+
+接着可以通过以下方式调用支付控件:
+
+```java
+/**
+ * tn——交易流水号,即 TN,为商户后台从 AllPay 后台获取,获取方式参见 AllPay 网关对接文档
+ * false 测试环境
+ */
+AllPayEngine.Pay(ShopCartActivity.this, tn, false);
+```
+
+## 4.3.4. 同步结果通知
+
+支付完成后,获取支付控件支付结果,并添加相应处理逻辑,只需实现调用 Activity 
+中的 onActivityResult()方法即可,实例代码如下:
+
+```java
+@Override
+protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+    if (data == null) {
+        return;
+    }
+
+    if (requestCode == AllPayConst.VTPAY_PAY_REQUESR_CODE&& resultCode == AllPayConst.VTPAY_PAY_RESULT_CODE) {
+        String result = data.getExtras().getString("pay_result");
+    }
+}
+```
+
+pay_result,为 json 字符串,格式如下:
+
+```text
+{
+    "state": "cancel",
+    "paymentSchema": "UP",
+    "orderNum": "604337497032",
+    "errorDetail": "user cancel operation "
+}
+```
+
+报文说明:
+
+- state: "success"代表成功, "cancel"代表用户取消操作,"fail"代表失败,"query"代表 app 需要调用查询接口来确认订单状态
+- paymentSchema: 支付渠道, "APMP"代表支付宝, "WX"代表微信 
+- orderNum: 订单号
+- errorDetail: 错误详情

+ 13 - 0
docs/zh/android/sign.md

@@ -0,0 +1,13 @@
+# 3.签名
+
+1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
+
+3.示例签名串
+
+```js
+acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
+```
+
+## 

+ 0 - 23
docs/zh/h5/2.md

@@ -1,23 +0,0 @@
-# 2.通用API说明
-
-商户服务器和 AllPay 网关对接的通用接口,每个渠道都具有的功能,包括:消费,退款,查询接口。 
-
-## 2.1. 验签说明
-
-1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
-
-3.示例签名串
-
-```js
-acqID=99020344&backURL=http://example.com/example&charSet=UTF- 8&frontURL=nil&merID=000000000000015&merReserve=nil&orderAmount=0.01&orderCurre ncy=CNY&orderNum=869873851812&paymentSchema=APMP&signType=MD5&transTime= 20151112151356&transType=PURC&version=VER0000000022f2c77e3718c47cfb47a89a6fbc9d361
-```
-
-## 2.2. 通用API 接入地址
-
- 交易名称  |开发调试地址|生产交易地址  
- ------- |-----------|-------
- 消费接口 |<https://mchapi.allpayx.com/testjspay> |<https://mchapi.allpayx.com/jspay>
- 查询接口 |<https://testapi.allpayx.com/pay/v1> |<https://api.allpayx.com/pay/v1>
- 退款接口 |<https://testapi.allpayx.com/pay/v1> |<https://api.allpayx.com/pay/v1>

+ 0 - 136
docs/zh/h5/3.md

@@ -1,136 +0,0 @@
-# 3. API接口
-
-## 3.1. 消费交易接口
-
-将相关参数,以表单形式提交到指定 url,即可调起支付。
-
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|前端 URL 地址 |400|文本|frontURL  |支付结果前端通知到该地址 
- 8|后端 URL 地址 |400|文本|backURL   |支付结果异步通知到该地址 
- 9|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 10|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 11|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 12|支付渠道代码    |10  |文本|paymentSchema|渠道代码:微信:WX, 支付报"APMP",银联 "UP"
- 13|商品信息    |60  |文本|goodsInfo       | 商品信息
- 14|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 15|签名类型     |3  |文本|signType        |MD5 
- 16|签名      |32  |文本|signature         |采用 MD5 签名 
-
-## 3.2. 异步通知报文
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|清算金额  |12 |文本|settAmount   |如 100 元,表示为 100 或 100.00  
- 8|清算币种  |3|文本|settCurrency    |符合 ISO 标准,填写数字类型 
- 9|清算汇率   |7|文本|rate     |实际汇率,7 位有效数字  
- 10|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 11|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一
- 12|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 13|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 14|支付渠道代码    |10  |文本|paymentSchema|渠道代码:微信:WX, 支付报"APMP",银联 "UP"
- 15|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 16|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 17|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 18|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间
- 19|签名类型     |3  |文本|signType        |MD5 
- 20|签名      |32  |文本|signature         |采用 MD5 签名 
-
-
-## 3.3. 查询交易接口 
-
-
-
-1. 接口说明
-
- 该接口为接入商家提供交易查询的功能。
-
-2. 请求报文格式 
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询填写“INQY”  
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|商户预留字段  |1024 |文本|merReserve    |商户保留 
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|支付渠道代码    |10  |文本|paymentSchema|渠道代码:"WX
- 9|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 10|签名类型     |3  |文本|signType        |MD5 
- 11|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3. 响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询交易填写为“INQY 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-## 3.4. 退款交易接口
-
-1.接口功能说明 
-
-该接口为接入商家提供交易退款的功能。 
-
-2.请求报文格式 
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|退款金额  |12|文本|returnAmount    |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 8|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 9|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 10|支付渠道代码    |10  |文本|paymentSchema|渠道代码:"WX
- 11|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3.响应报文格式
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 

+ 3 - 3
docs/zh/h5/README.md

@@ -1,6 +1,6 @@
-# 移动端H5页面支付接入规范文档V4.2.1
+# 移动端H5页面支付接入规范文档V4.3.0
 
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
-* 版本信息:中文 V4.2.1
-* 更新时间:2018 年6 
+* 版本信息:中文 V4.3.0
+* 更新时间:2018 年11

+ 15 - 0
docs/zh/h5/channel.md

@@ -0,0 +1,15 @@
+# 5.渠道专属配置
+## 
+
+## 5.1 APMP渠道
+
+ 消费接口专属字段
+
+- 请求报文
+
+  | Parameter | Type       | Required | Description                                                  | Sample                                 |
+  | --------- | ---------- | -------- | ------------------------------------------------------------ | -------------------------------------- |
+  | timeout   | String(10) | O        | The default is 12h. Please contact Alipay Technical Support if you need to use other values. Max value is 15d. This parameter controls the valid time from login to completion. | 5m 10m 15m 30m 1h 2h 3h 5h 10h 12h 1d. |
+
+
+

+ 188 - 0
docs/zh/h5/common.md

@@ -0,0 +1,188 @@
+# 6. 通用接口
+
+## 6.1. 接口地址
+
+
+
+通用接口包括 交易异步通知,交易查询,退款,退款查询接口
+
+
+
+接口名称   |测试地址 |生产地址
+ ------- |-----------|-------
+ 交易查询接口 |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
+ 退款接口 |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
+ 退款查询接口 |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>
+
+## 6.2. 异步通知报文
+
+AllPay服务器通过get方式,异步发送到消费接口中上送的backURL地址,商户根据收到的报文来确定交易的支付结果
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| settAmount    | String(12)   | M    | 清算金额:如 100 元,表示为 100 或 100.00                    |
+| settCurrency  | String(3)    | M    | 清算币种:符合 ISO 标准                                      |
+| rate          | String(7)    | M    | 实际汇率,7 位有效数字                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| transID       | String(32)   | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)    | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20)   | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14)   | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | signature                                                    |
+
+
+
+
+
+
+## 6.3. 查询交易接口 
+
+
+
+1. 接口说明
+
+ 该接口为接入商家提供交易查询的功能。
+
+2. 请求报文格式 
+
+  
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+3. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60) | M    | 订单号                                                       |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |
+
+
+
+## 6.4. 退款交易接口
+
+1.接口功能说明 
+
+该接口为接入商家提供交易退款的功能。 
+
+2.请求报文格式 
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 退款填写“REFD”                                               |
+| orderNum      | String(60)   | M    | 原交易订单号                                                 |
+| refundNum     | String(60)   | M    | 退款订单号:商户自行定义,需保证同一商户号下退款订单号不能重复 |
+| returnAmount  | String(12)   | M    | 退款金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3.响应报文格式
+
+| 参数      | 类型       | 属性 | 描述                                           |
+| --------- | ---------- | ---- | ---------------------------------------------- |
+| version   | String(12) | M    | 统一填写为“VER000000002”                       |
+| charSet   | String(6)  | M    | 统一填写为“UTF-8”                              |
+| transType | String(4)  | M    | 退款填写“REFD”                                 |
+| refundNum | String(60) | M    | 退款订单号                                     |
+| transID   | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一         |
+| merID     | String(15) | M    | 商户 ID,由AllPay 分配                         |
+| acqID     | String(11) | M    | 收单行 ID "99020344"                           |
+| RespCode  | String(2)  | M    | 应答码 00-成功                                 |
+| RespMsg   | String(20) | M    | 应答消息,全部为英文字符                       |
+| transTime | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                 |
+| GWTime    | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 |
+| signType  | String(3)  | M    | MD5                                            |
+| signature | String(32) | M    | signature                                      |
+
+
+
+## 6.5. 退款查询接口
+
+1. 1. 接口说明
+
+    该接口为接入商家提供退款查询的功能。
+
+   1. 请求报文格式 
+
+     
+
+   | 参数          | 类型         | 属性 | 描述                                                         |
+   | ------------- | ------------ | ---- | ------------------------------------------------------------ |
+   | version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+   | charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+   | transType     | String(4)    | M    | 查询填写“RFQY”                                               |
+   | refundNum     | String(60)   | M    | 退款订单号                                                   |
+   | merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+   | merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+   | acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+   | paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+   | transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+   | signType      | String(3)    | M    | MD5                                                          |
+   | signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+   1. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“REFD”                                               |
+| refundNum     | String(60) | M    | 退款订单号                                                   |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |

+ 1 - 1
docs/zh/pc/6.md

@@ -1,4 +1,4 @@
-# 6. 错误码
+# 8. 错误码
 
 若商户请求AllPay网关时,请求的参数错误或参数缺失时,AllPay网关会将错误信息以JSON格式返回给客户端,供商户解析调用,以下是相关错误信息返回参数的说明
 

docs/zh/pc/2.md → docs/zh/h5/flow.md


docs/zh/h5/1.md → docs/zh/h5/overview.md


+ 31 - 0
docs/zh/h5/purc.md

@@ -0,0 +1,31 @@
+# 4.消费接口
+
+
+
+| 接口名称 | 测试地址                               | 生产地址                           |
+| -------- | -------------------------------------- | ---------------------------------- |
+| 消费接口 | <https://mchapi.allpayx.com/testjspay> | <https://mchapi.allpayx.com/jspay> |
+
+将相关参数,以表单形式提交到指定 url,即可调起支付。
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号:商户自行定义,需保证同一商户号下订单号不能重复       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| frontURL      | String(400)  | M    | 支付完成后跳转到该地址                                       |
+| backURL       | String(400)  | M    | 支付结果异步通知到该地址                                     |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:微信:WX, 支付报"APMP",银联 "UP"                   |
+| goodsInfo     | String(60)   | M    | 商品信息                                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+

+ 13 - 0
docs/zh/h5/sign.md

@@ -0,0 +1,13 @@
+# 3.签名
+
+1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
+
+3.示例签名串
+
+```js
+acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
+```
+
+## 

+ 3 - 2
docs/zh/pc/5.md

@@ -1,4 +1,4 @@
-# 5.测试账户
+# 7.测试账户
 
  请注意,支付宝、财付通交易需要用中国实名认证的账户进行测试交易,所有测试交 
 易不提供清算服务,请用小额测试。
@@ -18,4 +18,5 @@ CVN2:123
 CVN2:248
 有效期:2019 年 12 月 
 电脑端验证码:111111 
-移动端验证码:123456 
+移动端验证码:123456 
+```

+ 0 - 144
docs/zh/ios/3.md

@@ -1,144 +0,0 @@
-# 3.通用API说明
-
-商户服务器和 AllPay 网关对接的通用接口,每个渠道都具有的功能,包括:消费,退款,查询接口。
-
-## 3.1. 验签说明 
-
-1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
-
-3.示例签名串
-
-```js
-acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
-```
-
-## 3.2. 通用API 接入地址 
-
- 交易名称  |开发调试地址|生产交易地址  
- ------- |-----------|-------
- 消费接口 |<https://testapi.allpayx.com/app/pay> |<https://api.allpayx.com/app/pay>
- 查询接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
- 退款接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
-
-## 3.3. 消费交易接口
-
-1.接口说明
-
-商户网关将订单信息发送给 ALLPAY 网关,由 ALLPAY 网关进行处理后将交易流水 号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。
-
-2.请求报文格式
-
-下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|前端 URL 地址 |400|文本|frontURL  |app 模式默认填"nil" 
- 8|后端 URL 地址 |400|文本|backURL   |支付结果异步通知到该地址 
- 9|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 10|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 11|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 12|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 13|商品信息    |60  |文本|goodsInfo       | 商品信息
- 14|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 15|签名类型     |3  |文本|signType        |MD5 
- 16|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3. 响应报文格式
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
-  1|交易流水号 |32|文本|tn |tn 作为调起 sdk 支付的参数,code等于"00"时返回该字段
-
-## 3.4. 查询交易接口
-
-1. 接口说明
-
- 该接口为接入商家提供交易查询的功能。
-
-2. 请求报文格式 
-
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询填写“INQY”  
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|商户预留字段  |1024 |文本|merReserve    |商户保留 
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 9|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 10|签名类型     |3  |文本|signType        |MD5 
- 11|签名      |32  |文本|signature         |采用 MD5 签名 
-
-
-3. 响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询交易填写为“INQY 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-## 3.5. 退款交易接口
-
-1.接口功能说明 
-
-该接口为接入商家提供交易退款的功能。 
-
-2.请求报文格式 
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|退款金额  |12|文本|returnAmount    |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 8|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 9|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 10|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 11|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3.响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 

+ 0 - 119
docs/zh/ios/4.md

@@ -1,119 +0,0 @@
-# 4.iOS 客户端接入步骤 
-
-## 4.1. 接入说明 
-
-启动支付控件的接口,接口定义如下:
-
-```c
-[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
-
-//此处处理同步支付结果
-
-}];
-
-
-参数说明
-tn: 是从服务器端获取的流水号; mode:测试环境:NO; 生产环境:YES。
-
-Scheme: 可以为任意值推荐填写成"com.xxx.xxx" 等形式, 有特殊配置的渠道会在渠道专属配置里面说明
-
-ViewController: 调用 SDK 时的 ViewController;
-
-onResult: 接收同步结果通知
-```
-
-
-
-
-## 4.2. 添加 SDK 包
-
-1. 将  allpaysdk 下的 AllPaySDK.h,libAllPaySDK.a文件add到项目中
-2. 在 APPDelegate.m 类中导入头文件: #import "allpaysdk/AllPaySDK.h" 并添加如下方法
-
-```c
--(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ 
-
-[AllPaySDK openURL:url]; return YES; 
-
-}
-
--(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ 
-
-[AllPaySDK openURL:url]; return YES; 
-
-} 
-
--(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options{ 
-
-[AllPaySDK openURL:url]; return YES; 
-
-}
-```
-
-3. 根据要使用的渠道的专属配置,对项目进行配置
-
-## 4.3 同步结果通知 
-
-```c
-[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) { 
-
-  //此处处理同步支付结果
-
- }];
- 
-```
-
-resultDic,转为 json 字符串,格式如下:
-
-{
-  "state": "cancel",
-  "paymentSchema": "YL",
-  "orderNum": "604337497032",
-  "errorDetail": "user cancel operation"
-}
-
-报文说明
-
-- state: "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败
-- paymentSchema: 支付渠道, 印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay
-- orderNum: 订单号
-- errorDetail: 错误详情
-
-
-| 参数        | 说明           |
-| ------------- |:-------------:|
-| state      | "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败 |
-| paymentSchema |印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay      |
-| orderNum | 订单号      |
-| errorDetail | 错误详情      |
-
-
-## 4.5. 异步结果通知
-
-商户需要提供一个 http 协议的接口,包含在参数里传递给 SDK,即 backURL。AllPay 
-服务器在支付完成后,会以 Get 方式调用 backURL,通知支付结果。 
-
-参数如下表: 
-
- 序号 |名称  |长度|类型|参数名称|备注
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|清算金额  |12 |文本|settAmount   |如 100 元,表示为 100 或 100.00  
- 8|清算币种  |3|文本|settCurrency    |符合 ISO 标准,填写数字类型 
- 9|清算汇率   |7|文本|rate     |实际汇率,7 位有效数字  
- 10|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 11|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一
- 12|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 13|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 14|支付渠道代码    |10  |文本|paymentSchema       |支付宝:"APMP"; 微信:"WX"; 境外银联:"UP";  ApplePay 支付:"APP" ;印度本地支付:"EB"
- 15|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 16|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 17|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 18|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间
- 19|签名类型     |3  |文本|signType        |MD5 
- 20|签名      |32  |文本|signature         |采用 MD5 签名 

+ 1 - 1
docs/ios/6.md

@@ -1,4 +1,4 @@
-# 6.iOS SDK下载
+# 7.iOS SDK下载
 
 
 

+ 3 - 3
docs/zh/ios/README.md

@@ -1,6 +1,6 @@
-# IOS端控件支付产品接口规范文档4.0.0
+# IOS端控件支付产品接口规范文档4.3.0
 
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
-* 版本信息:中文 V4.0.0
-* 更新时间:2018 年4
+* 版本信息:中文 V4.3.0
+* 更新时间:2018 年11

+ 3 - 1
docs/zh/ios/5.md

@@ -64,9 +64,11 @@
    </dict>
    
    ```
+
+
 ## 5.3 APMP渠道
 
- * 消费接口专属字段
+- 消费接口专属字段
 
 请求报文
 

+ 188 - 0
docs/zh/ios/common.md

@@ -0,0 +1,188 @@
+# 6. 通用接口
+
+## 6.1. 接口地址
+
+
+
+通用接口包括 交易异步通知,交易查询,退款,退款查询接口
+
+
+
+接口名称   |测试地址 |生产地址
+ ------- |-----------|-------
+ 交易查询接口 |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
+ 退款接口 |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
+ 退款查询接口 |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>
+
+## 6.2. 异步通知报文
+
+AllPay服务器通过get方式,异步发送到消费接口中上送的backURL地址,商户根据收到的报文来确定交易的支付结果
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| settAmount    | String(12)   | M    | 清算金额:如 100 元,表示为 100 或 100.00                    |
+| settCurrency  | String(3)    | M    | 清算币种:符合 ISO 标准                                      |
+| rate          | String(7)    | M    | 实际汇率,7 位有效数字                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| transID       | String(32)   | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)    | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20)   | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14)   | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | signature                                                    |
+
+
+
+
+
+
+## 6.3. 查询交易接口 
+
+
+
+1. 接口说明
+
+ 该接口为接入商家提供交易查询的功能。
+
+2. 请求报文格式 
+
+  
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+3. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60) | M    | 订单号                                                       |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |
+
+
+
+## 6.4. 退款交易接口
+
+1.接口功能说明 
+
+该接口为接入商家提供交易退款的功能。 
+
+2.请求报文格式 
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 退款填写“REFD”                                               |
+| orderNum      | String(60)   | M    | 原交易订单号                                                 |
+| refundNum     | String(60)   | M    | 退款订单号:商户自行定义,需保证同一商户号下退款订单号不能重复 |
+| returnAmount  | String(12)   | M    | 退款金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3.响应报文格式
+
+| 参数      | 类型       | 属性 | 描述                                           |
+| --------- | ---------- | ---- | ---------------------------------------------- |
+| version   | String(12) | M    | 统一填写为“VER000000002”                       |
+| charSet   | String(6)  | M    | 统一填写为“UTF-8”                              |
+| transType | String(4)  | M    | 退款填写“REFD”                                 |
+| refundNum | String(60) | M    | 退款订单号                                     |
+| transID   | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一         |
+| merID     | String(15) | M    | 商户 ID,由AllPay 分配                         |
+| acqID     | String(11) | M    | 收单行 ID "99020344"                           |
+| RespCode  | String(2)  | M    | 应答码 00-成功                                 |
+| RespMsg   | String(20) | M    | 应答消息,全部为英文字符                       |
+| transTime | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                 |
+| GWTime    | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 |
+| signType  | String(3)  | M    | MD5                                            |
+| signature | String(32) | M    | signature                                      |
+
+
+
+## 6.5. 退款查询接口
+
+1. 1. 接口说明
+
+    该接口为接入商家提供退款查询的功能。
+
+   1. 请求报文格式 
+
+     
+
+   | 参数          | 类型         | 属性 | 描述                                                         |
+   | ------------- | ------------ | ---- | ------------------------------------------------------------ |
+   | version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+   | charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+   | transType     | String(4)    | M    | 查询填写“RFQY”                                               |
+   | refundNum     | String(60)   | M    | 退款订单号                                                   |
+   | merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+   | merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+   | acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+   | paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+   | transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+   | signType      | String(3)    | M    | MD5                                                          |
+   | signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+   1. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“REFD”                                               |
+| refundNum     | String(60) | M    | 退款订单号                                                   |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |

docs/zh/ios/2.md → docs/zh/ios/flow.md


docs/zh/ios/1.md → docs/zh/ios/overview.md


+ 134 - 0
docs/zh/ios/purc.md

@@ -0,0 +1,134 @@
+# 4.消费交易
+
+## 4.1. 消费交易地址 
+
+ 交易名称  |测试地址|生产地址  
+ ------- |-----------|-------
+ 消费接口 |<https://testapi.allpayx.com/app/pay> |<https://api.allpayx.com/app/pay>
+
+## 4.2. 消费交易接口
+
+1.接口说明
+
+商户网关将订单信息发送给 ALLPAY 网关,由 ALLPAY 网关进行处理后将交易流水 号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。
+
+2.请求报文格式
+
+下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号:商户自行定义,需保证同一商户号下订单号不能重复       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| frontURL      | String(400)  | M    | app 模式默认填"nil"                                          |
+| backURL       | String(400)  | M    | 支付结果异步通知到该地址                                     |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| goodsInfo     | String(60)   | M    | 商品信息                                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3. 响应报文格式
+
+   | 参数 | 类型       | 属性 | 描述                               |
+   | ---- | ---------- | ---- | ---------------------------------- |
+   | tn   | String(32) | M    | 交易流水号,作为调起 sdk 支付的参数 |
+
+
+## 4.4. iOS 客户端接入步骤
+
+## 4.4.1. 接入说明 
+
+启动支付控件的接口,接口定义如下:
+
+```c
+[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
+
+//此处处理同步支付结果
+
+}];
+
+
+参数说明
+tn: 是从服务器端获取的流水号; mode:测试环境:NO; 生产环境:YES。
+
+Scheme: 可以为任意值推荐填写成"com.xxx.xxx" 等形式, 有特殊配置的渠道会在渠道专属配置里面说明
+
+ViewController: 调用 SDK 时的 ViewController;
+
+onResult: 接收同步结果通知
+```
+
+
+
+## 4.4.2. 添加 SDK 包
+
+1. 将  allpaysdk 下的 AllPaySDK.h,libAllPaySDK.a文件add到项目中
+2. 在 APPDelegate.m 类中导入头文件: #import "allpaysdk/AllPaySDK.h" 并添加如下方法
+
+```c
+-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ 
+
+[AllPaySDK openURL:url]; return YES; 
+
+}
+
+-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ 
+
+[AllPaySDK openURL:url]; return YES; 
+
+} 
+
+-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options{ 
+
+[AllPaySDK openURL:url]; return YES; 
+
+}
+```
+
+1. 根据要使用的渠道的专属配置,对项目进行配置
+
+## 4.4.3 同步结果通知 
+
+```c
+[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) { 
+
+  //此处处理同步支付结果
+
+ }];
+ 
+```
+
+resultDic,转为 json 字符串,格式如下:
+
+{
+  "state": "cancel",
+  "paymentSchema": "YL",
+  "orderNum": "604337497032",
+  "errorDetail": "user cancel operation"
+}
+
+报文说明
+
+- state: "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败
+- paymentSchema: 支付渠道, 印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay
+- orderNum: 订单号
+- errorDetail: 错误详情
+
+| 参数          |                             说明                             |
+| ------------- | :----------------------------------------------------------: |
+| state         | "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败  |
+| paymentSchema | 印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay |
+| orderNum      |                            订单号                            |
+| errorDetail   |                           错误详情                           |
+
+## 

+ 13 - 0
docs/zh/ios/sign.md

@@ -0,0 +1,13 @@
+# 3.签名
+
+1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
+
+3.示例签名串
+
+```js
+acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
+```
+
+## 

+ 0 - 164
docs/zh/pc/3.md

@@ -1,164 +0,0 @@
-# 3.通用API说明
-
-商户服务器和 AllPay 网关对接的通用接口,每个渠道都具有的功能,包括:消费,退款,查询接口。 
-
-## 3.1. 验签说明
-
-1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
-
-3.示例签名串
-
-```js
-acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
-```
-
-## 3.2. 通用API 接入地址
-
- 交易名称  |开发调试地址|生产交易地址  
- ------- |-----------|-------
- 消费接口 |<https://testapi.allpayx.com/pay/v1> |<https://api.allpayx.com/pay/v1>
- 查询接口 |<https://testapi.allpayx.com/pay/v1> |<https://api.allpayx.com/pay/v1>
- 退款接口 |<https://testapi.allpayx.com/pay/v1> |<https://api.allpayx.com/pay/v1>
-
-## 3.3. 消费交易接口
-
-1. 请求报文格式
-
-下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看. 消费接口分为跳转型和参数返回型,默认为跳转型,参数返回型会在 第4章(渠道专属配置)里面说明
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|前端 URL 地址 |400|文本|frontURL  |支付结果前端通知到该地址 
- 8|后端 URL 地址 |400|文本|backURL   |支付结果异步通知到该地址 
- 9|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 10|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 11|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 12|支付渠道代码    |10  |文本|paymentSchema|渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
- 13|商品信息    |60  |文本|goodsInfo       | 商品信息
- 14|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 15|签名类型     |3  |文本|signType        |MD5 
- 16|签名      |32  |文本|signature         |采用 MD5 签名 
-
-2. 跳转型消费接口响应报文
-
-商户需要提供一个 http/https 协议的接口,包含在参数里传递给 SDK,即 backURL。AllPay 
-服务器在支付完成后,会以 Get 方式调用 backURL,通知支付结果。 
-
-参数如下表:
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |消费交易填写“PURC” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|订单金额 |12|文本|orderAmount   |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|清算金额  |12 |文本|settAmount   |如 100 元,表示为 100 或 100.00  
- 8|清算币种  |3|文本|settCurrency    |符合 ISO 标准,填写数字类型 
- 9|清算汇率   |7|文本|rate     |实际汇率,7 位有效数字  
- 10|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 11|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一
- 12|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 13|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 14|支付渠道代码    |10  |文本|paymentSchema|渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
- 15|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 16|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 17|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 18|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间
- 19|签名类型     |3  |文本|signType        |MD5 
- 20|签名      |32  |文本|signature         |采用 MD5 签名 
-
-## 3.4. 查询交易接口 
-
-
-1. 接口说明
-
- 该接口为接入商家提供交易查询的功能。
-
-2. 请求报文格式 
-
-
- 序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询填写“INQY”  
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|商户预留字段  |1024 |文本|merReserve    |商户保留 
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|支付渠道代码    |10  |文本|paymentSchema|渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
- 9|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 10|签名类型     |3  |文本|signType        |MD5 
- 11|签名      |32  |文本|signature         |采用 MD5 签名 
-
-
-3. 响应报文格式
-
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |查询交易填写为“INQY 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-## 3.5. 退款交易接口
-
-1.接口功能说明 
-
-该接口为接入商家提供交易退款的功能。 
-
-2.请求报文格式 
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|退款金额  |12|文本|returnAmount    |如 100 元,表示为 100 或 100.00 
- 6|订单币种   |3|文本|orderCurrency |人民币填写“CNY”,美元填写"USD" 
- 7|商户预留字段  |1024 |文本|merReserve    |商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 
- 8|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 9|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 10|支付渠道代码    |10  |文本|paymentSchema|渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md)
- 11|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 
-
-3.响应报文格式
-
-  序号 |名称  |长度|类型|参数名称|备注 
- -----|-----|----|----|------|------
- 1|版本号|12|文本|version |统一填写为“VER000000002” 
- 2|字符集编码 |6|文本|charSet  |统一填写为“UTF-8” 
- 3|交易类型  |4|文本|transType |退款填写“REFD” 
- 4|订单号   |60|文本|orderNum  |商户自行定义,需保证同一商户号下订单号不能重复 
- 5|GW 交易 ID  |32|文本|transID    |GW 系统生成的交易 ID,每笔交易保持唯一  
- 6|商户代码   |15 |文本|merID     |商户 ID,由AllPay 分配 
- 7|收单行 ID    |11  |文本|acqID      |收单行 ID "99020344" 
- 8|交易应答码   |2  |文本|RespCode       |应答码 00-成功  
- 9|应答文字信息    |20  |文本|RespMsg        |应答消息,全部为英文字符 
- 10|交易时间    |14  |文本|transTime       |交易时间,格式:"yyyyMMddHHmmss" 
- 11|GW 处理时间 |14  |文本|GWTime |YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 
- 12|签名类型     |3  |文本|signType        |MD5 
- 13|签名      |32  |文本|signature         |采用 MD5 签名 

+ 3 - 3
docs/zh/pc/README.md

@@ -1,6 +1,6 @@
-# PC端在线支付接入规范文档4.2.1
+# PC端在线支付接入规范文档4.3.0
 
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
-* 版本信息:中文 V4.2.1
-* 更新时间:2018 年6
+* 版本信息:中文 V4.3.0
+* 更新时间:2018 年11

+ 154 - 34
docs/zh/pc/4.md

@@ -1,5 +1,5 @@
-# 4.渠道专属配置
-## 4.1 EB渠道(跳转)
+# 5.渠道专属配置
+## 5.1 EB渠道(跳转)
 
 序号 |名称  |长度|类型|参数名称|备注
  -----|-----|----|----|------|------
@@ -7,19 +7,19 @@
   2| 邮箱     |40  |文本|trxn_email_id         |this is email id of the customer who is doing transaction.
   3|电话 |20  |文本|trxn_phone|Phone number of the customer.
 
-## 4.2 UP渠道(跳转)
+## 5.2 UP渠道(跳转)
 
 序号 |名称  |长度|类型|参数名称|备注 
  -----|-----|----|----|------|------
   1| 银联卡号 |19  | 文本|uCardNumber |境外银联通道,适用于银联优计划。可以不上送,若需要提前填入银行卡号,则上送此字段。
 
-## 4.3 WX渠道(含跳转和参数返回)
+## 5.3 WX渠道(含跳转和参数返回)
 
  序号 |名称  |长度|类型|参数名称|备注 
  -----|-----|----|----|------|------
   1| 交易场景代码|16  | 文本|code |1.“NATIVE“:为参数返回方式,返回微信收款URL值, 要求商户将其转换为 QR 码,自己生成支付前端界 面,提示用户扫码付款; 2.“QUICK”:为跳转方式,打开 AllPay 提供的前端页面,页面包含微信 QR 码
-## 4.4 PPRO相关渠道(跳转)
-## 4.4.1 PPRO_AC
+## 5.4 PPRO相关渠道(跳转)
+## 5.4.1 PPRO_AC
 
  Field name  |M/O   |Type |Description  
  -----|-----|----|----
@@ -28,8 +28,8 @@ accountholdername|M   |文本 |The account holder - minimum of 3 characters, up
 consumerref |M   |文本 |Unique reference identifying the consumer, has to satisfy the regular expression [A-Za-z0-9.%,&/+*$-]{1,20} 
 
 Note: AstroPay Card is available for currency USD and country codes BO, BR, CL, CN, CO, CR, MX, PE, UY, VE. 
-     
-## 4.4.2 PPRO_AD
+     
+## 5.4.2 PPRO_AD
 
 
  Field name  |M/O   |Type |Description  
@@ -41,7 +41,7 @@ consumerref |M   |文本 |Unique reference identifying the consumer, has to sati
 Note: AstroPay Direct is available for currency USD and country codes AR, BR, CL, CN, CO, MX, PE, UY, CN 
 
 
-## 4.4.3 PPRO_AR
+## 5.4.3 PPRO_AR
 
 
  Field name  |M/O   |Type |Description  
@@ -60,7 +60,7 @@ dob    |O   |文本 |Date of birth, format YYYYMMDD
 Note: Aura (Brazil) is available for currency USD and country code BR. 
 
 
-## 4.4.4 PPRO_BA
+## 5.4.4 PPRO_BA
 
 
  Field name  |M/O   |Type |Description  
@@ -77,7 +77,7 @@ dob    |O   |文本 |Date of birth, format YYYYMMDD
 Note: Baloto Cash (Colombia) is available for currency USD and country code CO. 
 
 
-## 4.4.5 PPRO_BB
+## 5.4.5 PPRO_BB
 
 
  Field name  |M/O   |Type |Description  
@@ -94,7 +94,7 @@ dob    |O   |文本 |Date of birth, format YYYYMMDD
 Note: Banco do Brasil (Brazil) is available for currency USD and country code BR. 
 
 
-## 4.4.6 PPRO_BO
+## 5.4.6 PPRO_BO
 
 
  Field name  |M/O   |Type |Description  
@@ -110,7 +110,7 @@ dob    |O   |文本 |Date of birth, format YYYYMMDD
 
 Note: Boleto Bancario is available for currency USD and country code BR. 
 
-## 4.4.7 PPRO_DR
+## 5.4.7 PPRO_DR
 
 
  Field name  |M/O   |Type |Description  
@@ -124,7 +124,7 @@ Note: Dragonpay is only available for currency PHP and country code PH.
 
 
 
-## 4.4.8 PPRO_EN
+## 5.4.8 PPRO_EN
 
 
  Field name  |M/O   |Type |Description  
@@ -136,7 +136,7 @@ phone  |M  |文本 |Valid international phone number of the account holder
 
 Note: eNETS is only available for currency SGD and country code SG. 
 
-## 4.4.9 PPRO_EP
+## 5.4.9 PPRO_EP
 
 
  Field name  |M/O   |Type |Description  
@@ -146,7 +146,7 @@ accountholdername|M   |文本 |The account holder - minimum of 3 characters, up
 
 Note: eps only works for the countrycode “AT” and currency “EUR”. 
 
-## 4.4.10 PPRO_GP
+## 5.4.10 PPRO_GP
 
 
  Field name  |M/O   |Type |Description  
@@ -157,7 +157,7 @@ bic |O  |文本 |Valid BIC (8 or 11 alphanumeric letters) of consumer’s bank
 
 the countrycode “DE” and currency “EUR”. 
 
-## 4.4.11 PPRO_HC
+## 5.4.11 PPRO_HC
 
 
  Field name  |M/O   |Type |Description  
@@ -173,7 +173,7 @@ dob    |O   |文本 |Date of birth, format YYYYMMDD
 
 Note: Hipercard (Brazil) is available for currency USD and country code BR. 
 
-## 4.4.12 PPRO_ID
+## 5.4.12 PPRO_ID
 
 
  Field name  |M/O   |Type |Description  
@@ -188,7 +188,7 @@ Here is the list of currently available issuers and their associated BIC:
 
 ![image](/b2c/bic_list.jpg)
 
-## 4.4.13 PPRO_IT
+## 5.4.13 PPRO_IT
 
 
  Field name  |M/O   |Type |Description  
@@ -204,7 +204,7 @@ dob    |O   |文本 |Date of birth, format YYYYMMDD
 
 Note: Itaú (Brazil) is available for currency USD and country code BR.
 
-## 4.4.14 PPRO_MB
+## 5.4.14 PPRO_MB
 
 
 
@@ -216,7 +216,7 @@ accountholdername|M   |文本 |The account holder - minimum of 3 characters, up
 Note: MyBank only works for the country code IT and currency EUR. 
 
 
-## 4.4.15 PPRO_PC
+## 5.4.15 PPRO_PC
 
 
 
@@ -228,7 +228,7 @@ consumerref |M   |文本 |Unique reference identifying the consumer, has to sati
 
 
 
-## 4.4.16 PPRO_PU
+## 5.4.16 PPRO_PU
 
 
 
@@ -240,7 +240,7 @@ email   |M   |文本 |RFC compliant email address of the account holder
 
 Note: PayU works only for country code/currency combinations CZ/CZK and PL/PLN. 
 
-## 4.4.17 PPRO_PL
+## 5.4.17 PPRO_PL
 
 
  Field name  |M/O   |Type |Description  
@@ -250,7 +250,7 @@ accountholdername|M   |文本 |The account holder - minimum of 3 characters, up
 
 Note: POLi only works for the countrycode/currency combinations “NZ”/”NZD” and “AU/AUD”. 
 
-## 4.4.18 PPRO_P24
+## 5.4.18 PPRO_P24
 
 
  Field name  |M/O   |Type |Description  
@@ -262,7 +262,7 @@ email   |M   |文本 |RFC compliant email address of the account holder
 Note: Przelewy24 only works for the countrycode “PL” and currencies “PLN” and “EUR”. 
 
 
-## 4.4.19 PPRO_QW
+## 5.4.19 PPRO_QW
 
 
  Field name  |M/O   |Type |Description  
@@ -274,7 +274,7 @@ siteid|M/O   |文本 |Unique site identifier, forwarded to qiwi. Required for cl
 
 
 Note:	QIWI Payout only works for the countrycodes “RU”, “KZ” and UA, and - depending on your contract - currency 
“RUB” , “EUR” ,”KZT” and “USD”. 

-## 4.4.20 PPRO_SP
+## 5.4.20 PPRO_SP
 
 
  Field name  |M/O   |Type |Description  
@@ -285,7 +285,7 @@ email   |M   |文本 |RFC compliant email address of the account holder
 
 Note:SafetyPay only works for country codes “AT”, “BE”, “BR”, “CL”, “CR”, “DE”, “EC”, “ES”, “MX”, “NL”, “PE” and currencies “EUR”, “USD”.
 
-## 4.4.21 PPRO_SD
+## 5.4.21 PPRO_SD
 
 
  Field name  |M/O   |Type |Description  
@@ -297,7 +297,7 @@ accountholdername|M   |文本 |The account holder - minimum of 3 characters, up
 Note: SEPA Direct Debit works for all SEPA countries and currency EUR. 
 
 
-## 4.4.22 PPRO_SG
+## 5.4.22 PPRO_SG
 
 
  Field name  |M/O   |Type |Description  
@@ -309,7 +309,7 @@ phone  |M  |文本 |Valid international phone number of the account holder
 
 Note: SingPost (Singapore) is only available for currency SGD and country code SG. 
 
-## 4.4.23 PPRO_SK
+## 5.4.23 PPRO_SK
 
 
  Field name  |M/O   |Type |Description  
@@ -329,7 +329,7 @@ met, the system will not accept the request
 
 ```
 
-## 4.4.24 PPRO_SB
+## 5.4.24 PPRO_SB
 
 
  Field name  |M/O   |Type |Description  
@@ -342,7 +342,7 @@ OFORT Banking (also known as SOFORT überweisung, formally DirectPay24) is avail
 Germany, Spain, Italy and Netherlands (country codes AT, BE, DE, ES, IT, NL). EUR is supported in all countries.
 
 
-## 4.4.25 PPRO_TP
+## 5.4.25 PPRO_TP
 
  Field name  |M/O   |Type |Description  
  -----|-----|----|----
@@ -352,7 +352,7 @@ accountholdername|M   |文本 |The account holder - minimum of 3 characters, up
 Note: TrustPat   is only available for currency EUR and country code CZ, SK 
 
 
-## 4.4.26 PPRO_WP
+## 5.4.26 PPRO_WP
 
 
  Field name  |M/O   |Type |Description  
@@ -370,7 +370,7 @@ Note: WebPay is available for currency USD and country code CL.
 
 
 
-## 4.5 AP渠道
+## 5.5 AP渠道
 
  消费接口专属字段
 
@@ -378,4 +378,124 @@ Note: WebPay is available for currency USD and country code CL.
 
   | Parameter | Type       | Required | Description                                                  | Sample                                 |
   | --------- | ---------- | -------- | ------------------------------------------------------------ | -------------------------------------- |
-  | timeout   | String(10) | O        | The default is 12h. Please contact Alipay Technical Support if you need to use other values. Max value is 15d. This parameter controls the valid time from login to completion. | 5m 10m 15m 30m 1h 2h 3h 5h 10h 12h 1d. |
+  | timeout   | String(10) | O        | The default is 12h. Please contact Alipay Technical Support if you need to use other values. Max value is 15d. This parameter controls the valid time from login to completion. | 5m 10m 15m 30m 1h 2h 3h 5h 10h 12h 1d. |
+
+
+
+## 5.6 MIPAY渠道(跳转)
+
+| 序号 | 名称   | 长度 | 类型 | 参数名称   | 备注                                                         |
+| ---- | ------ | ---- | ---- | ---------- | ------------------------------------------------------------ |
+| 1    | 姓名   | 32   | 文本 | firstname  | This is name of the customer who is doing the transaction.   |
+| 2    | 邮箱   | 40   | 文本 | email      | this is email id of the customer who is doing transaction.   |
+| 3    | 电话   | 20   | 文本 | phone      | Phone number of the customer.                                |
+| 4    | 客户ID | 30   | 文本 | customerId | Customer ID, when client register on merchant, merchant distribute it to client. |
+
+测试环境配置:
+
+修改测试机器hosts,添加如下两条信息
+
+114.80.87.249 account.preview.n.xiaomi.net
+
+114.80.87.249 api.account.preview.n.xiaomi.net
+
+测试参数
+
+测试小米ID:100019995/test123456
+
+卡号:5123456789012346
+
+有效期:0520
+
+cvv:123
+
+## 5.7 IPL渠道(跳转)
+
+| Parameter    | Type       | Required | Description                                                  | Sample |
+| ------------ | ---------- | -------- | ------------------------------------------------------------ | ------ |
+| language     | string(2)  | O        | 显示语言Chinese:zh,English:en,Korean:ko                      | zh     |
+| terminalType | string(16) | M        | 终端类型:web/h5/android/ios                                  | h5     |
+| transTimeout | string(6)  | M        | 订单有效时长,整数格式,单位分钟(min)                        | 10     |
+| country      | string(2)  | O        | 国家二字代码,需要大写。页面将展示这个国家的支付方式。如果不传,根据系统判定的国家展示支付方式 | CN     |
+
+测试卡号:
+
+```javascript
+Visa:
+cardNo: 4000020951595032
+expirationMonth: 06
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+
+Mastercard:
+cardNo: 5333300989521936
+expirationMonth: 06 
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+
+JCB:
+cardNo: 3567860000000000
+expirationMonth: 06 
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+
+American Express:
+cardNo: 375532604034750 
+expirationMonth: 06 
+expirationYear: 28
+cvv: 6688
+firstName: Ken 
+lastName: Swift
+
+Diners Club:
+cardNo: 36259600590707 
+expirationMonth: 06 
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+
+Discover:
+cardNo: 6011492100005191 
+expirationMonth: 06 
+expirationYear: 28
+cvv: 688
+firstName: Ken 
+lastName: Swift
+```
+
+## 5.8 RP渠道(跳转)
+
+| Parameter | Type   | Required | Description                                                | Sample         |
+| --------- | ------ | -------- | ---------------------------------------------------------- | -------------- |
+| firstname | string | M        | This is name of the customer who is doing the transaction. | jim            |
+| email     | string | M        | this is email id of the customer who is doing transaction. | 123456@163.com |
+
+```javascript
+测试卡号
+Domestic
+
+Mastercard:   
+5104_0155_5555_5558, 
+5104_0600_0000_0008
+
+Visa:
+4111_1111_1111_1111
+
+International
+
+Mastercard:
+
+5555_5555_5555_4444
+5105_1051_0510_5100
+
+Visa:
+012_8888_8888_1881
+4000_1841_8621_8826
+```

+ 188 - 0
docs/zh/pc/common.md

@@ -0,0 +1,188 @@
+# 6. 通用接口
+
+## 6.1. 接口地址
+
+
+
+通用接口包括 交易异步通知,交易查询,退款,退款查询接口
+
+
+
+接口名称   |测试地址 |生产地址
+ ------- |-----------|-------
+ 交易查询接口 |<https://testapi.allpayx.com/pay>|<https://api.allpayx.com/pay>
+ 退款接口 |<https://testapi.allpayx.com/refund>|<https://api.allpayx.com/refund>
+ 退款查询接口 |<https://testapi.allpayx.com/refundquery>|<https://api.allpayx.com/refundquery>
+
+## 6.2. 异步通知报文
+
+AllPay服务器通过get方式,异步发送到消费接口中上送的backURL地址,商户根据收到的报文来确定交易的支付结果
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| settAmount    | String(12)   | M    | 清算金额:如 100 元,表示为 100 或 100.00                    |
+| settCurrency  | String(3)    | M    | 清算币种:符合 ISO 标准                                      |
+| rate          | String(7)    | M    | 实际汇率,7 位有效数字                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| transID       | String(32)   | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)    | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20)   | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14)   | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | signature                                                    |
+
+
+
+
+
+
+## 6.3. 查询交易接口 
+
+
+
+1. 接口说明
+
+ 该接口为接入商家提供交易查询的功能。
+
+2. 请求报文格式 
+
+  
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60)   | M    | 订单号                                                       |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+3. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“INQY”                                               |
+| orderNum      | String(60) | M    | 订单号                                                       |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |
+
+
+
+## 6.4. 退款交易接口
+
+1.接口功能说明 
+
+该接口为接入商家提供交易退款的功能。 
+
+2.请求报文格式 
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 退款填写“REFD”                                               |
+| orderNum      | String(60)   | M    | 原交易订单号                                                 |
+| refundNum     | String(60)   | M    | 退款订单号:商户自行定义,需保证同一商户号下退款订单号不能重复 |
+| returnAmount  | String(12)   | M    | 退款金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+3.响应报文格式
+
+| 参数      | 类型       | 属性 | 描述                                           |
+| --------- | ---------- | ---- | ---------------------------------------------- |
+| version   | String(12) | M    | 统一填写为“VER000000002”                       |
+| charSet   | String(6)  | M    | 统一填写为“UTF-8”                              |
+| transType | String(4)  | M    | 退款填写“REFD”                                 |
+| refundNum | String(60) | M    | 退款订单号                                     |
+| transID   | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一         |
+| merID     | String(15) | M    | 商户 ID,由AllPay 分配                         |
+| acqID     | String(11) | M    | 收单行 ID "99020344"                           |
+| RespCode  | String(2)  | M    | 应答码 00-成功                                 |
+| RespMsg   | String(20) | M    | 应答消息,全部为英文字符                       |
+| transTime | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                 |
+| GWTime    | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间 |
+| signType  | String(3)  | M    | MD5                                            |
+| signature | String(32) | M    | signature                                      |
+
+
+
+## 6.5. 退款查询接口
+
+1. 1. 接口说明
+
+    该接口为接入商家提供退款查询的功能。
+
+   1. 请求报文格式 
+
+     
+
+   | 参数          | 类型         | 属性 | 描述                                                         |
+   | ------------- | ------------ | ---- | ------------------------------------------------------------ |
+   | version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+   | charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+   | transType     | String(4)    | M    | 查询填写“RFQY”                                               |
+   | refundNum     | String(60)   | M    | 退款订单号                                                   |
+   | merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+   | merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+   | acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+   | paymentSchema | String(10)   | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+   | transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+   | signType      | String(3)    | M    | MD5                                                          |
+   | signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+   1. 响应报文格式
+
+| 参数          | 类型       | 属性 | 描述                                                         |
+| ------------- | ---------- | ---- | ------------------------------------------------------------ |
+| version       | String(12) | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)  | M    | 查询填写“REFD”                                               |
+| refundNum     | String(60) | M    | 退款订单号                                                   |
+| transID       | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| RespCode      | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg       | String(20) | M    | 应答消息,全部为英文字符                                     |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| GWTime        | String(14) | M    | YYYYMMDDHHMMSS,为 GW 时间,目前为本地交易时间               |
+| signType      | String(3)  | M    | MD5                                                          |
+| signature     | String(32) | M    | signature                                                    |

+ 1 - 1
docs/zh/h5/4.md

@@ -1,4 +1,4 @@
-# 4. 错误码
+# 8. 错误码
 
 若商户请求AllPay网关时,请求的参数错误或参数缺失时,AllPay网关会将错误信息以JSON格式返回给客户端,供商户解析调用,以下是相关错误信息返回参数的说明
 

+ 3 - 0
docs/zh/pc/flow.md

@@ -0,0 +1,3 @@
+# 2.交易流程
+
+![image](/b2c/pc_flowsheet.png)

docs/zh/pc/1.md → docs/zh/pc/overview.md


+ 39 - 0
docs/zh/pc/purc.md

@@ -0,0 +1,39 @@
+# 4.消费接口
+
+## 4.1. 接口地址
+
+ 接口名称 |测试地址|生产地址  
+ ------- |-----------|-------
+ 消费接口 |<https://testapi.allpayx.com/pay> |<https://api.allpayx.com/pay>
+
+## 4.2. 消费交易接口
+
+1. 请求报文格式
+
+下面列举的字段为通用字段,每个渠道都需要上送,部分渠道有渠道专属字段,具体字段请到该渠道的专属渠到字段说明处查看. 消费接口分为跳转型和参数返回型,默认为跳转型,参数返回型会在 第5章(渠道专属配置)里面说明
+
+
+
+| 参数          | 类型         | 属性 | 描述                                                         |
+| ------------- | ------------ | ---- | ------------------------------------------------------------ |
+| version       | String(12)   | M    | 统一填写为“VER000000002”                                     |
+| charSet       | String(6)    | M    | 统一填写为“UTF-8”                                            |
+| transType     | String(4)    | M    | 消费交易填写“PURC”                                           |
+| orderNum      | String(60)   | M    | 订单号:商户自行定义,需保证同一商户号下订单号不能重复       |
+| orderAmount   | String(12)   | M    | 订单金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency | String(3)    | M    | 订单币种:ISO标准 如:人民币填写“CNY”,美元填写"USD"          |
+| frontURL      | String(400)  | M    | 支付完成后跳转到该地址                                       |
+| backURL       | String(400)  | M    | 支付结果异步通知到该地址                                     |
+| merReserve    | String(1024) | M    | 商户预留内容,可传任意内容,如购买商品信息、员号等,但不要传特殊符号,如逗号。 |
+| merID         | String(15)   | M    | 商户 ID,由AllPay 分配                                       |
+| acqID         | String(11)   | M    | 收单行 ID "99020344"                                         |
+| paymentSchema | String(10)   | M    | 渠道代码:[点击查看详情](https://git.allpayx.com/OpenAPI/b2c_pc_payment/src/master/paymentSchema.md) |
+| goodsInfo     | String(60)   | M    | 商品信息                                                     |
+| transTime     | String(14)   | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType      | String(3)    | M    | MD5                                                          |
+| signature     | String(32)   | M    | 采用 MD5 签名                                                |
+
+
+
+
+

+ 13 - 0
docs/zh/pc/sign.md

@@ -0,0 +1,13 @@
+# 3.签名
+
+1.对于发送到 ALLPAY 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 K1(接入时 ALLPAY 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行 md5 运算,得到 signature 的值。
+
+3.示例签名串
+
+```js
+acqID=99020344&backURL=https://www.baidu.com&charSet=UTF-8&frontURL=nil&goodsInfo=iPhone x&merID=800039253992510&merReserve=&orderAmount=1.00&orderCurrency=INR&orderNum=ap0180417163142&paymentSchema=EB&signType=MD5&transTime=20180417163142&transType=PURC&trxn_email_id=benson.zhang@allpayx.com&trxn_firstname=benson zhang&trxn_is_coupon_enabled=1&trxn_phone=15026528888&unique_id=abcde12345&version=VER000000002f3e0e436cd24430aa4aaaed597450f26 
+```
+
+## 

+ 22 - 0
docs/zh/pc/test.md

@@ -0,0 +1,22 @@
+# 7.测试账户
+
+ 请注意,支付宝、财付通交易需要用中国实名认证的账户进行测试交易,所有测试交 
+易不提供清算服务,请用小额测试。
+
+以下是银联渠道测试卡,仅用于测试使用: 
+
+```
+信用卡:5200831111111113 
+手机:13552535506
+CVN2:123
+有效期:2019 年 11 月 
+电脑端验证码:111111 
+移动端验证码:123456
+
+信用卡:6226388000000095 
+手机:18100000000 
+CVN2:248
+有效期:2019 年 12 月 
+电脑端验证码:111111 
+移动端验证码:123456 
+```

+ 1 - 1
npm-debug.log

@@ -19,7 +19,7 @@
 9 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
 10 verbose pkgid b2c@1.0.0
 11 verbose cwd /opt/Desktop/gitwork/OpenAPI/b2c-docs
-12 error Darwin 17.3.0
+12 error Darwin 17.7.0
 13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
 14 error node v4.4.5
 15 error npm  v2.15.5