Browse Source

Merge branch 'master' of https://git.allpayx.com/OpenAPI/common

benson 6 years ago
parent
commit
54a260b307

AllPay报关接口规范说明文档.md → AllPay_Customs_Integration_Specification_CH.md


+ 12 - 22
AllPay在线支付接入规范文档.md

@@ -283,6 +283,8 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | RespMsg  | String | M    | 应答消息                                                  |
 | tn       | String | O    | 交易流水号,RespCode为“00”时返回,作为调起 sdk 支付的参数 |
 
+获取到tn后,根据本文档第7节调用SDK进行支付。
+
 ##### 5.2 AP渠道
 
 1.WebSite支付
@@ -293,8 +295,6 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | --------- | ------ | ---- | ----- |
 | tradeFrom | String | M    | "WEB" |
 
-
-
 ##### 5.3 APMP渠道
 
 1.H5支付
@@ -321,7 +321,7 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | RespMsg  | String | M    | 应答消息                                                  |
 | tn       | String | O    | 交易流水号,RespCode为“00”时返回,作为调起 sdk 支付的参数 |
 
-
+获取到tn后,根据本文档第7节调用SDK进行支付。
 
 ##### 5.4 UP渠道
 
@@ -349,13 +349,11 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | RespMsg  | String | M    | 应答消息                                                  |
 | tn       | String | O    | 交易流水号,RespCode为“00”时返回,作为调起 sdk 支付的参数 |
 
+获取到tn后,根据本文档第7节调用SDK进行支付。
 
+##### 5.5 Apple Pay渠道
 
-
-
-##### 5.4 Apple Pay 渠道APP
-
-1. APP支付
+1.APP支付
 
  消费接口专属字段
 
@@ -371,15 +369,9 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | RespMsg  | String | M    | 应答消息                                                  |
 | tn       | String | O    | 交易流水号,RespCode为“00”时返回,作为调起 sdk 支付的参数 |
 
+获取到tn后,根据本文档第7节调用SDK进行支付。
 
-
-
-
-
-
-
-
-##### 5.6CA渠道
+##### 5.6 CA渠道
 
 1.APP支付
 
@@ -397,7 +389,7 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | RespMsg  | String | M    | 应答消息                                                  |
 | tn       | String | O    | 交易流水号,RespCode为“00”时返回,作为调起 sdk 支付的参数 |
 
- 获取到tn后,根据[安卓对接文档](https://git.allpayx.com/OpenAPI/common/src/master/v5/android/Android%E7%AB%AF%E6%8E%A7%E4%BB%B6%E6%94%AF%E4%BB%98%E4%BA%A7%E5%93%81%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3.md)调用sdk进行支付
+ 获取到tn后,根据[Android对接文档](https://git.allpayx.com/OpenAPI/common/src/master/v5/android/Android_Integration_Specification_CH.md)调用SDK进行支付
 
 #### 6.应答码 
 
@@ -422,13 +414,11 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | P4     | 功能不支持  |
 | P5     | 渠道返回错误  |
 
-#### 7.SDK下载
-
-安卓SDK对接文档地址:[安卓SDK](https://git.allpayx.com/OpenAPI/common/src/master/v5/android/Android%E7%AB%AF%E6%8E%A7%E4%BB%B6%E6%94%AF%E4%BB%98%E4%BA%A7%E5%93%81%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3.md)
-
-iOS SDK对接文档地址:[iOS SDK](https://git.allpayx.com/OpenAPI/common/src/master/v5/ios/iOS%E7%AB%AF%E6%8E%A7%E4%BB%B6%E6%94%AF%E4%BB%98%E4%BA%A7%E5%93%81%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3.md)
+#### 7.APP模式对接文档
 
+Android对接文档:[点击这里](https://git.allpayx.com/OpenAPI/common/src/master/v5/android/Android_Integration_Specification_CH.md)
 
+iOS对接文档:[点击这里](https://git.allpayx.com/OpenAPI/common/src/master/v5/ios/iOS_Integration_Specification_CH.md)
 
 #### 8.技术支持
 

+ 96 - 22
AllPay Web Integration Specification V5.0.0.md

@@ -1,4 +1,4 @@
-# AllPay Web Integration Specification V5.0.0
+# AllPay Integration Specification V5.0.0
 [Shanghai AllPay Technology Co., Ltd.](https://www.allpayx.com)
 
 * Version:English V5.0.0
@@ -65,7 +65,7 @@ This field is a list of common fields, sending, every channel needs some channel
 
 Parameters as follows:
 
-| parameter          | Type         | Required | Description                                                         |
+| parameter          | Type         | Required | Description          |
 | ------------- | ------------ | ---- | ------------------------------------------------------------ |
 | version       | String(12)   | M    | "VER000000005"                                     |
 | charSet       | String(6)    | M    | "UTF-8"                                            |
@@ -83,7 +83,7 @@ Parameters as follows:
 | transTime     | String(14)   | M    | Transaction time, format :" yyymmddhhmmss"                             |
 | merReserve    | String(1024) | O    | Merchant reserved content, can pass any content, such as purchase information, account number, etc., but do not pass special symbols, such as commas. |
 | signType      | String(10)   | M    | "MD5" or "SHA256"                                                  |
-| signature     | String(32)   | M    | MD5 or SHA256 signature                                        |
+| signature     | String(32)   | M    | MD5 or SHA256 signature                                        |
 
 ##### 4.3. Inqiury interface 
 
@@ -106,7 +106,7 @@ Parameters as follows:
 | signType      | String(10) | M    | "MD5" or "SHA256"                                                          |
 | signature     | String(32) | M    | MD5 or SHA256 signature                                                |
 
-3..Response message format
+3.Response message format
 
 | Parameter          | Type       | Required | Description                                                         |
 | ------------- | ---------- | ---- | ------------------------------------------------------------ |
@@ -240,7 +240,7 @@ It's jump mode, open the front-end page provided by AllPay, which contains WeCha
 | --------- | ------ | ---- | ------- |
 | tradeFrom | String | M    | "QUICK" |
 
-3.Wechat Official Accounts payment
+3.WeChat Official Accounts payment
 
  Purchase interface specific fields
 
@@ -248,7 +248,7 @@ It's jump mode, open the front-end page provided by AllPay, which contains WeCha
 | --------- | ------ | ---- | ------- |
 | tradeFrom | String | M    | "JSAPI" |
 
-4.Wechat Mini Programs payment
+4.WeChat Mini Programs payment
 
  Purchase interface specific fields
 
@@ -267,7 +267,7 @@ Response message:
 
 Parameter sdk_params is used to call up the WeChat Mini Programs payment. Please refer to the Mini Programs integration specification.
 
-5.APP
+5.APP mode
 
  Purchase interface specific fields
 
@@ -279,41 +279,117 @@ Response message:
 
 | Parameter     | Type   | Required | Description                                                      |
 | -------- | ------ | ---- | --------------------------------------------------------- |
-| RespCode | String | M    | 00 stands for success; 01 stands for fail.                                            |
+| RespCode | String | M    | 00 stands for success; 01 stands for fail.                                 |
 | RespMsg  | String | M    | Response message                                                  |
 | tn       | String | O    | Transaction serial number. Required parameter for Wechat app payment. When RespCode=00 returns it. |
 
-##### 5.3 AP
+After getting tn, call the SDK to pay according to Section 7 of this document.
+
+##### 5.2 AP
 
 1.WebSite mode
 
  Purchase interface specific fields
 
-| Parameter      | Type   | Required | Description  |
+| Parameter | Type   | Required | Description  |
 | --------- | ------ | ---- | ----- |
 | tradeFrom | String | M    | "WEB" |
 
+##### 5.3 APMP
 
+1.H5 mode
 
-##### 5.3 CA
+ Purchase interface specific fields
+
+| Parameter | Type   | Required | Description |
+| --------- | ------ | ---- | ------- |
+| tradeFrom | String | M    | "JSAPI" |
 
-1.APP
+2.APP mode
 
  Purchase interface specific fields
 
-| Parameter      | Type   | Required | Description  |
+| Parameter | Type   | Required | Description |
 | --------- | ------ | ---- | ----- |
 | tradeFrom | String | M    | "APP" |
 
-Response message:
+Response message
 
-| Parameter     | Type   | Required | Description                                                      |
+| Parameter | Type   | Required | Description |
+| -------- | ------ | ---- | --------------------------------------------------------- |
+| RespCode | String | M    | 00 stands for success; 01 stands for fail.                                 |
+| RespMsg  | String | M    | Response message                                                  |
+| tn       | String | O    | Transaction serial number. Required parameter for Wechat app payment. When RespCode=00 returns it. |
+
+After getting tn, call the SDK to pay according to Section 7 of this document.
+
+##### 5.4 UP
+
+1.H5 mode, adaptive PC and mobile
+
+ Purchase interface specific fields
+
+| Parameter | Type   | Required | Description |
+| --------- | ------ | ---- | ---- |
+| tradeFrom | String | M    | "H5" |
+
+2.APP mode
+
+ Purchase interface specific fields
+
+| Parameter | Type   | Required | Description |
+| --------- | ------ | ---- | ----- |
+| tradeFrom | String | M    | "APP" |
+
+Response message:
+
+| Parameter | Type   | Required | Description |
 | -------- | ------ | ---- | --------------------------------------------------------- |
-| RespCode | String | M    | 00 stands for success; 01 stands for fail.                                            |
+| RespCode | String | M    | 00 stands for success; 01 stands for fail.                                 |
 | RespMsg  | String | M    | Response message                                                  |
+| tn       | String | O    | Transaction serial number. Required parameter for Wechat app payment. When RespCode=00 returns it. |
+
+After getting tn, call the SDK to pay according to Section 7 of this document.
+
+##### 5.5 Apple Pay
+
+1.APP mode
+
+ Purchase interface specific fields
+
+| Parameter | Type   | Required | Description |
+| --------- | ------ | ---- | ----- |
+| tradeFrom | String | M    | "APP" |
+
+Response message:
+
+| Parameter | Type   | Required | Description |
+| -------- | ------ | ---- | --------------------------------------------------------- |
+| RespCode | String | M    | 00 stands for success; 01 stands for fail.                                 |
+| RespMsg  | String | M    | Response message                                                  |
+| tn       | String | O    | Transaction serial number. Required parameter for Wechat app payment. When RespCode=00 returns it. |
+
+After getting tn, call the SDK to pay according to Section 7 of this document.
+
+##### 5.6 CA
+
+1.APP mode
+
+ Purchase interface specific fields
+
+| Parameter | Type   | Required | Description  |
+| --------- | ------ | ---- | ----- |
+| tradeFrom | String | M    | "APP" |
+
+Response message:
+
+| Parameter | Type   | Required | Description                                          |
+| -------- | ------ | ---- | --------------------------------------------------------- |
+| RespCode | String | M    | 00 stands for success; 01 stands for fail. |
+| RespMsg  | String | M    | Response message |
 | tn       | String | O    | Transaction serial number. Required parameter for CA app payment. When RespCode=00 returns it.|
 
- After you get tn,please integrate according to [Android Integration Specification](https://git.allpayx.com/OpenAPI/common/src/master/v5/android/Android%E7%AB%AF%E6%8E%A7%E4%BB%B6%E6%94%AF%E4%BB%98%E4%BA%A7%E5%93%81%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3.md)
+ After you get tn,please integrate according to [Android Integration Specification](https://git.allpayx.com/OpenAPI/common/src/master/v5/android/Android_Integration_Specification_EN.md)
 
 #### 6.RespCode 
 
@@ -338,13 +414,11 @@ Response message:
 | P4     | Function is not supported  |
 | P5     | Channel returns "Error"  |
 
-#### 7.SDK Download
-
-Android SDK integration specification:[Android SDK](https://git.allpayx.com/OpenAPI/common/src/master/v5/android/Android%E7%AB%AF%E6%8E%A7%E4%BB%B6%E6%94%AF%E4%BB%98%E4%BA%A7%E5%93%81%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3.md)
-
-iOS SDK integration specification:[iOS SDK](https://git.allpayx.com/OpenAPI/common/src/master/v5/ios/iOS%E7%AB%AF%E6%8E%A7%E4%BB%B6%E6%94%AF%E4%BB%98%E4%BA%A7%E5%93%81%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3.md)
+#### 7.APP mode integration specification
 
+Android Integration Specification:[Click Here](https://git.allpayx.com/OpenAPI/common/src/master/v5/android/Android_Integration_Specification_EN.md)
 
+iOS Integration Specification:[Click Here](https://git.allpayx.com/OpenAPI/common/src/master/v5/ios/iOS_Integration_Specification_EN.md)
 
 #### 8.Technical support
 

AllPay其他接口文档.md → AllPay_Other_Integration_Specification_CH.md


+ 7 - 8
paymentSchema.md

@@ -1,9 +1,8 @@
-
-
-#### 渠道列表
-序号 |渠道名称  |渠道ID|备注 
+#### Channel list
+Serial number |Channel name  |Channel ID|Remark 
  -----|-----|----|------
-  1| 微信-Wechat Pay |WX|微信
-  2| CCAvenue |CA| CCAvenue 
- 3 | 支付宝 - Alipay |AP/APMP| 支付宝
- 4 | 银联 - UnionPay |UP| 银联
+ 1 | WeChat Pay |WX|WeChat Pay
+ 2 | CCAvenue |CA| CCAvenue 
+ 3 | Alipay |AP/APMP| Alipay
+ 4 | UnionPay |UP| UnionPay
+ 5 | Apple Pay |APP| Apple Pay

+ 13 - 14
v5/android/Android端控件支付产品接口规范文档.md

@@ -3,7 +3,7 @@
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
 * 版本信息:中文 V5.0.0
-* 更新时间:2019 年3 
+* 更新时间:2019年4
 
 #### 1.概述
 
@@ -16,7 +16,7 @@ AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“S
 
 ##### 3.1. 接入说明 
 
-商户网关将订单信息发送给 AllPay 网关,由 AllPay 网关进行处理后将交易流水号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。具体请参考[AllPay网关对接文档](https://git.allpayx.com/OpenAPI/common/src/master/AllPay%E5%9C%A8%E7%BA%BF%E6%94%AF%E4%BB%98%E6%8E%A5%E5%85%A5%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3.md)
+商户网关将订单信息发送给 AllPay 网关,由 AllPay 网关进行处理后将交易流水号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。具体请参考[AllPay网关对接文档](https://git.allpayx.com/OpenAPI/common/src/master/AllPay_Integration_Specification_CH.md)
 
 启动支付控件的接口,接口定义如下:
 
@@ -27,16 +27,18 @@ public static void pay(Activity activity,String tn,boolean mode)
 ::: tip 参数说明
 activity —— 用于启动支付控件的活动对象
 
-tn —— 订单信息为交易流水号,即 TN,为商户后台从 AllPay 后台获取
+tn —— 交易流水号,作为调起 sdk 支付的参数,商户从 AllPay 后台获取
 
-mode —— AllPay 后台环境标识,true 将在 AllPay 正式环境发起交易,false 将在 AllPay 测试环 境发起交易
+mode —— AllPay 后台环境标识,true表示从AllPay的正式环境发起交易,false表示从AllPay的测试环境发起交易
 :::
 
 ##### 3.2. 添加 SDK 包
 
-1. 把allpaysdk.arr 拷贝到项目的libs下面
-2. 在Application Module的build.gradle文件的dependencies下添加compile(name: 'allpaysdk', ext: 'aar')
-3. 在Application Module的build.gradle文件中添加
+1.把allpaysdk.arr 拷贝到项目的libs下面
+
+2.在Application Module的build.gradle文件的dependencies下添加compile(name: 'allpaysdk', ext: 'aar')
+
+3.在Application Module的build.gradle文件中添加
 
 ```java
 repositories {
@@ -52,16 +54,15 @@ repositories {
 
 ```java
 /**
- * tn——交易流水号,即 TN,为商户后台从 AllPay 后台获取,获取方式参见 AllPay 网关对接文档
- * false 测试环���
+ * tn——交易流水号,作为调起 sdk 支付的参数,商户从 AllPay 后台获取
+ * false代表测试环境,true代表生产环���
  */
 AllPayEngine.Pay(ShopCartActivity.this, tn, false);
 ```
 
 ##### 3.4. 同步结果通知
 
-支付完成后,获取支付控件支付结果,并添加相应处理逻辑,只需实现调用 Activity 
-中的 onActivityResult()方法即可,实例代码如下:
+支付完成后,获取支付控件支付结果,并添加相应处理逻辑,只需实现调用 Activity 中的 onActivityResult()方法即可,实例代码如下:
 
 ```java
 @Override
@@ -90,7 +91,7 @@ pay_result,为 json 字符串,格式如下:
 报文说明:
 
 - state: "success"代表成功, "cancel"代表用户取消操作,"fail"代表失败,"query"代表 app 需要调用查询接口来确认订单状态
-- paymentSchema: 支付渠道, "APMP"代表支付宝, "WX"代表微信 
+- paymentSchema: 支付渠道, 详见[渠道列表](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) 
 - orderNum: 订单号
 - errorDetail: 错误详情
 
@@ -98,8 +99,6 @@ pay_result,为 json 字符串,格式如下:
 
 ##### 4.1 WX渠道
 
-- 渠道专属配置:
-
   在Application Module的build.gradle文件的dependencies下添加
 
   ```

+ 114 - 0
v5/android/Android_Integration_Specification_EN.md

@@ -0,0 +1,114 @@
+# Android Integration Specification V5.0.0
+
+[Shanghai AllPay Technology Co., Ltd.](https://www.allpayx.com)
+
+* Version:English V5.0.0
+* Update Time:2019/04
+
+#### 1.Overview
+
+AllPay provides access plug-ins (hereinafter referred to as "SDK") for customers based on mobile APP payments to help customers achieve fast, secure and centralized access to payment channels.
+
+#### 2.Transaction process 
+  ![image](https://git.allpayx.com/OpenAPI/b2c/raw/master/images/moble_sdk_flowsheet.png)
+
+#### 3. Android client access steps 
+
+##### 3.1. Access instructions 
+
+The merchant gateway sends the order information to the AllPay gateway, and the AllPay gateway processes the transaction serial number, ie tn, back to the merchant gateway, and tn is used as a parameter to adjust the mobile app payment control. Please refer to the specific [AllPay Gateway Docking Document](https://git.allpayx.com/OpenAPI/common/src/master/AllPay_Integration_Specification_EN.md)
+
+Start the interface of the payment control, the interface is defined as follows:
+
+```java
+public static void pay(Activity activity,String tn,boolean mode)
+```
+
+::: tip Parameter Description
+activity - Active object used to initiate the payment control.
+
+tn - Transaction serial number. Required parameter for app payment. Merchants get from the AllPay backend.
+
+mode - AllPay background environment ID, true means to initiate a transaction from the AllPay formal environment, false means to initiate a transaction from the AllPay test environment.
+:::
+
+##### 3.2. Add SDK
+
+1.Copy allpaysdk.arr to the project's libs.
+
+2.Add compile(name: 'allpaysdk', ext: 'aar') under the dependencies of the build.gradle file in the Application Module.
+
+3.Add in the build.gradle file of the Application Module
+
+```java
+repositories {
+    flatDir {
+         dirs 'libs'
+    }
+}
+```
+
+##### 3.3. Call payment control
+
+Call the payment control in the following way:
+
+```java
+/**
+ * tn - Transaction serial number. Required parameter for app payment. Merchants get from the AllPay backend.
+ * false represents the test environment, true represents the formal environment.
+ */
+AllPayEngine.Pay(ShopCartActivity.this, tn, false);
+```
+
+##### 3.4. Synchronization result notification
+
+After the payment is completed, obtain the payment control payment result, and add the corresponding processing logic, just implement the onActivityResult() method in the Activity, and the example code is as follows:
+
+```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, which is a json string, in the following format:
+
+```text
+{
+    "state": "cancel",
+    "paymentSchema": "UP",
+    "orderNum": "604337497032",
+    "errorDetail": "user cancel operation "
+}
+```
+
+Message description:
+
+- state: "success" stands for success, "cancel" means the user cancels the operation, "fail" means the failure, and "query" means the app needs to call the query interface to confirm the order status.
+- paymentSchema: Payment channel, see [Channel List](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) 
+- orderNum: Order number
+- errorDetail: Error details
+
+#### 4.Channel specific configuration
+
+##### 4.1 WX channel
+
+  Add in the dependencies of the build.gradle file in the Application Module
+
+  ```
+  compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
+  ```
+
+#### 5.SDK download
+
+[Download link](https://git.allpayx.com/OpenAPI/common/raw/master/v5/android/android_sdk.zip)
+
+#### 6.Technical Support
+
+If you have problems debugging, please contact us: support@allpayx.com

+ 35 - 54
v5/ios/iOS端控件支付产品接口规范文档.md

@@ -3,7 +3,7 @@
 [上海偶可贝网络科技有限公司](https://www.allpayx.com)
 
 * 版本信息:中文 V5.0.0
-* 更新时间:2019 年3 
+* 更新时间:2019年4
 
 #### 1.概述
 
@@ -16,7 +16,7 @@ AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“S
 
 ##### 3.1. 接入说明 
 
-商户网关将订单信息发送给 AllPay 网关,由 AllPay 网关进行处理后将交易流水号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。[AllPay 网关对接文档](https://git.allpayx.com/OpenAPI/common/src/master/AllPay%20%E5%9C%A8%E7%BA%BF%E6%94%AF%E4%BB%98%E6%8E%A5%E5%85%A5%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3.md)地址
+商户网关将订单信息发送给 AllPay 网关,由 AllPay 网关进行处理后将交易流水号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。[AllPay网关对接文档](https://git.allpayx.com/OpenAPI/common/src/master/AllPay_Integration_Specification_CH.md)
 
 启动支付控件的接口,接口定义如下:
 
@@ -29,22 +29,22 @@ AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“S
 
 
 参数说明
-tn: 是从服务器端获取的流水号; mode:测试环境:NO; 生产环境:YES。
+tn: 交易流水号,作为调起 sdk 支付的参数,商户从 AllPay 后台获取。 
 
-Scheme: 可以为任意值推荐填写成"com.xxx.xxx" 等形式, 有特殊配置的渠道会在渠道专属配置里面说明
+mode:测试环境为NO,生产环境为YES。
+
+scheme: 可以为任意值,推荐填写成"com.xxx.xxx"形式, 有特殊配置的渠道会在渠道专属配置里面说明
 
 ViewController: 调用 SDK 时的 ViewController;
 
 onResult: 接收同步结果通知
 ```
 
-
-
 ##### 3.2. 添加 SDK 包
 
+1.将  allpaysdk 下的 AllPaySDK.h,libAllPaySDK.a文件添加到项目中
 
-1. 将  allpaysdk 下的 AllPaySDK.h,libAllPaySDK.a文件add到项目中
-2. 在 APPDelegate.m 类中导入头文件: #import "allpaysdk/AllPaySDK.h" 并添加如下方法
+2.在 APPDelegate.m 类中导入头文件: #import "allpaysdk/AllPaySDK.h",并添加如下方法
 
 ```c
 -(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ 
@@ -66,7 +66,7 @@ onResult: 接收同步结果通知
 }
 ```
 
-3. 根据要使用的渠道的专属配置(见第5节),对项目进行配置
+3.根据要使用的渠道的专属配置(见第4节),对项目进行配置。
 
 ##### 3.3 同步结果通知 
 
@@ -76,10 +76,9 @@ onResult: 接收同步结果通知
   //此处处理同步支付结果
 
  }];
- 
 ```
 
-resultDic,转为 json 字符串,格式如下:
+resultDic,转为 json 字符串,格式如下:
 
 {
   "state": "cancel",
@@ -91,27 +90,24 @@ resultDic,转为 json 字符串,格式如下:
 报文说明
 
 | 参数          |                             说明                             |
-| ------------- | :----------------------------------------------------------: |
+| ------------- | ---------------------------------------------------------- |
 | state         | "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败  |
-| paymentSchema | 印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay |
-| orderNum      |                            订单号                            |
-| errorDetail   |                           错误详情                           |
-
-
+| paymentSchema | 支付渠道, 详见[渠道列表](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) |
+| orderNum      | 订单号 |
+| errorDetail   | 错误详情 |
 
 #### 4.渠道专属配置
 
 ##### 4.1 WX渠道
 
-- 渠道专属配置:
+1.将allpaysdk/WXModule文件夹下的文件添加到项目中
 
-1. 将allpaysdk/EBModule文件夹下的文件add到项目中
-2. 项目设置APPID
-   商户在微信开放平台申请开发APP应用后,微信开放平台会生成APP的唯一标识APPID。在Xcode中打开项目,设置项目属性中的URL Schemes为您的APPID 如图标红位置所示
+2.项目设置APPID
+   商户在微信开放平台申请开发APP应用后,微信开放平台会生成APP的唯一标识APPID。在Xcode中打开项目,设置项目属性中的URL Schemes为您的APPID,如图标红位置所示
 
   ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/ios_wx_01.jpg)
 
-1.导入下面框架和链接库
+3.导入下面框架和链接库
 
    ```objective-c
    Security.framework
@@ -122,7 +118,7 @@ resultDic,转为 json 字符串,格式如下:
    libsqlite3.tbd
    ```
 
-2.在“Info.plist”中将要使用的 URL Schemes 列为白名单 
+4.在“Info.plist”中将要使用的 URL Schemes 列为白名单 
 
    ```xml
    <key>LSApplicationQueriesSchemes</key>
@@ -134,20 +130,13 @@ resultDic,转为 json 字符串,格式如下:
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    </dict>
-   
    ```
 
-
-
-
-
 ##### 4.2 APMP渠道
 
-- 渠道专属配置:
+1.将allpaysdk/AliModule文件夹下的文件添加到项目中
 
-1. 将allpaysdk/AliModule文件夹下的文件add到项目中
-
-2. 在Build Phases选项卡的Link Binary With Libraries中,增加以下依赖:
+2.在Build Phases选项卡的Link Binary With Libraries中,增加以下依赖:
 
    ```objective-c
    libc++.tbd
@@ -158,36 +147,33 @@ resultDic,转为 json 字符串,格式如下:
    CoreText.framework
    CoreGraphics.framework
    CFNetwork.framework
-   CoreMotion. .framework    
-      
+   CoreMotion. .framework
    ```
 
-3. 点击项目名称,点击“Info”选项卡,在“URL Types”选项中,点击“+”,在“URL Schemes”中输入alipay, , 如图标红位置所示
+3.点击项目名称,点击“Info”选项卡,在“URL Types”选项中,点击“+”,在“URL Schemes”中输入alipay,如图标红位置所示
 
   ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/ios_wx_01.jpg)
 
 ##### 4.3 UP渠道
 
-- 渠道专属配置:
-
-1. 将allpaysdk/UPModule文件夹下的文件add到项目中
+1.将allpaysdk/UPModule文件夹下的文件添加到项目中
 
-2. 导入下面框架和链接库
+2.导入下面框架和链接库
 
    ```objective-c
    CFNetwork.framework
    SystemConfiguration.framework
-   libz.tbd    
+   libz.tbd
    ```
 
-3. 在工程info.plist设置中添加一个URL Types回调协议,用于在支付完成后返回商户客户端。请注意URL Schemes需要是唯一的, 设置的Scheme的值要和支付接口中参数scheme的值相同。
+3.在工程info.plist设置中添加一个URL Types回调协议,用于在支付完成后返回商户客户端。请注意URL Schemes需要是唯一的。设置的Scheme的值要和支付接口中参数scheme的值相同。
 
-4. 需要在工程对应的plist文件中,添加LSApplicationQueriesSchemes  Array并加入uppaysdk、uppaywallet、uppayx1、uppayx2、uppayx3五个item 
+4.需要在工程对应的plist文件中,添加LSApplicationQueriesSchemesArray并加入uppaysdk、uppaywallet、uppayx1、uppayx2、uppayx3五个item 
 
    ```xml
    <key>LSApplicationQueriesSchemes</key> 
    <array>
-   <string>uppaysdk</string> 
+       <string>uppaysdk</string> 
        <string>uppaywallet</string>
        <string>uppayx1</string> 
        <string>uppayx2</string> 
@@ -195,33 +181,28 @@ resultDic,转为 json 字符串,格式如下:
    </array>
    ```
 
-5. http请求设置(ats) 
+5.http请求设置(ats) 
 
-   在测试环境测试时,需要在工程对应的plist文件中添加NSAppTransportSecurity  Dictionary 并同时设置里面NSAllowsArbitraryLoads 属性值为 YES,发生产环境可删除此设置。向Apple发布正式版本时请删除此设置。
+   在测试环境时,需要在工程对应的plist文件中添加NSAppTransportSecurity  Dictionary,并同时设置NSAllowsArbitraryLoads属性值为 YES。向App Store发布正式版本时请删除此设置。
 
 ##### 4.4 Apple Pay渠道
 
-- 渠道专属配置:
+1.将allpaysdk/AppleModule文件夹下的文件添加到项目中
 
-1. 将allpaysdk/AppleModule文件夹下的文件add到项目中
-2. xcode 打开 apple pay 功能,如下图
+2.用 Xcode 打开 Apple Pay 功能,如下图:
 
   ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/apple_pay_set.png)
 
-1. 用户 app 判断手机是否支持 Apple Pay 功能,以及是否已加载有可用的支付卡片 
+3.用户 app 判断手机是否支持 Apple Pay 功能,以及是否已加载有可用的支付卡片 
 
    ```objective-c
    //判读方法为:
    if([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:@[PKPaymentNetworkChinaUnionPay]] )
    {
-   // app 展示 apple pay 支付图标 
+   // app 展示 Apple Pay 支付图标 
    }
-   
-   
    ```
 
-
-
 #### 5.SDK下载
 
 [iOS SDK下载地址](https://git.allpayx.com/OpenAPI/common/raw/master/v5/ios/ios_sdk.zip)

+ 211 - 0
v5/ios/iOS_Integration_Specification_EN.md

@@ -0,0 +1,211 @@
+# iOS Integration Specification V5.0.0
+
+[Shanghai AllPay Technology Co., Ltd.](https://www.allpayx.com)
+
+* Version:English V5.0.0
+* Update Time:2019/04
+
+#### 1.Overview
+
+AllPay provides access plug-ins (hereinafter referred to as "SDK") for customers based on mobile APP payments to help customers achieve fast, secure and centralized access to payment channels.
+
+#### 2.Transaction process 
+  ![image](https://git.allpayx.com/OpenAPI/b2c/raw/master/images/moble_sdk_flowsheet.png)
+
+#### 3. iOS client access steps 
+
+##### 3.1. Access instructions 
+
+The merchant gateway sends the order information to the AllPay gateway, and the AllPay gateway processes the transaction serial number, ie tn, back to the merchant gateway, and tn is used as a parameter to adjust the mobile app payment control. Please refer to the specific [AllPay Gateway Docking Document](https://git.allpayx.com/OpenAPI/common/src/master/AllPay_Integration_Specification_EN.md)
+
+Start the interface of the payment control, the interface is defined as follows:
+
+```c
+[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
+
+//Processing synchronous payment results here
+
+}];
+
+
+Parameter Description
+tn: Transaction serial number. Required parameter for app payment. Merchants get from the AllPay backend.
+mode: AllPay background environment ID. NO stands for test environment and YES stands for formal environment.
+
+scheme: Can be any value, recommended to fill in the form "com.xxx.xxx", channels with special configuration will be explained in the channel exclusive configuration.
+
+ViewController: The ViewController when the SDK is called.
+
+onResult: Receive sync result notifications.
+```
+
+##### 3.2. Add SDK
+
+1.Add the AllPaySDK.h, libAllPaySDK.a files in allpaysdk to the project.
+
+2.Import header files in the APPDelegate.m class: #import "allpaysdk/AllPaySDK.h", and add the following method
+
+```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.Configure the project according to the exclusive configuration of the channel to be used (see Section 4).
+
+##### 3.3 Synchronization result notification 
+
+```c
+[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) { 
+
+  //Processing synchronous payment results here
+
+ }];
+```
+
+resultDic, converted to json string, the format is as follows:
+
+{
+  "state": "cancel",
+  "paymentSchema": "YL",
+  "orderNum": "604337497032",
+  "errorDetail": "user cancel operation"
+}
+
+Message description
+
+| Parameter          |                             Description                             |
+| ------------- | ---------------------------------------------------------- |
+| state         | "success" stands for success, "cancel" means the user cancels the operation, and "fail" stands for the failure.  |
+| paymentSchema | Payment channel, see [Channel List](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) |
+| orderNum      | Order number |
+| errorDetail   | Error details |
+
+#### 4.Channel specific configuration
+
+##### 4.1 WX channel
+
+1.Add the file under the allpaysdk/WXModule folder to the project.
+
+2.Set APPID
+   After the merchant applies for the development of the APP application on the WeChat open platform, the WeChat open platform will generate the unique identifier APPID of the APP. Open the project in Xcode and set the URL Schemes in the project properties to your APPID, as shown by the icon red location.
+
+  ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/ios_wx_01.jpg)
+
+3.Import the following framework and link library
+
+   ```objective-c
+   Security.framework
+   CoreTelephony.framework
+   SystemConfiguration.framework
+   libc++.tbd
+   libz.tbd
+   libsqlite3.tbd
+   ```
+
+4.List the URL Schemes to be used in "Info.plist" as a whitelist 
+
+   ```xml
+   <key>LSApplicationQueriesSchemes</key>
+   <array>
+   <string>weixin</string>
+   </array>
+   <key>NSAppTransportSecurity</key>
+   <dict>
+   <key>NSAllowsArbitraryLoads</key>
+   <true/>
+   </dict>
+   ```
+
+##### 4.2 APMP channel
+
+1.Add the file under the allpaysdk/AliModule folder to the project.
+
+2.In the Link Binary With Libraries of the Build Phases tab, add the following dependencies:
+
+   ```objective-c
+   libc++.tbd
+   libz.tbd
+   SystemConfiguration.framework
+   CoreTelephony.framework
+   QuartzCore.framework
+   CoreText.framework
+   CoreGraphics.framework
+   CFNetwork.framework
+   CoreMotion. .framework
+   ```
+
+3.Click the project name, then click the "Info" tab, in the "URL Types" option, click "+", enter alipay in "URL Schemes", as shown by the icon red position.
+
+  ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/ios_wx_01.jpg)
+
+##### 4.3 UP channel
+
+1.Add the file under the allpaysdk/UPModule folder to the project.
+
+2.Import the following framework and link library
+
+   ```objective-c
+   CFNetwork.framework
+   SystemConfiguration.framework
+   libz.tbd
+   ```
+
+3.Add a URL Types callback protocol to the project info.plist settings to return to the merchant client after the payment is complete. Please note that URL Schemes need to be unique. The value of Scheme is set to be the same as the value of the parameter scheme in the payment interface.
+
+4.You need to add LSApplicationQueriesSchemes to the plist file corresponding to the project. Array and add uppaysdk, uppaywallet, uppayx1, uppayx2, uppayx3 five items. 
+
+   ```xml
+   <key>LSApplicationQueriesSchemes</key> 
+   <array>
+       <string>uppaysdk</string> 
+       <string>uppaywallet</string>
+       <string>uppayx1</string> 
+       <string>uppayx2</string> 
+       <string>uppayx3</string> 
+   </array>
+   ```
+
+5.Http request settings(ats) 
+
+   In the environment test, you need to add NSAppTransportSecurity Dictionary to the project's corresponding plist file and set the NSAllowsArbitraryLoads property to YES. Please remove this setting when releasing the official version to App Store.
+
+##### 4.4 Apple Pay
+
+1.Add the file under the allpaysdk/AppleModule folder to the project.
+
+2.Open the apple pay function with Xcode, as shown below:
+
+  ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/apple_pay_set.png)
+
+3.The user's app determines if the phone supports the Apple Pay feature and if a payment card is available for loading. 
+
+   ```objective-c
+   //The method of interpretation is:
+   if([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:@[PKPaymentNetworkChinaUnionPay]] )
+   {
+   // app show Apple Pay payment icon 
+   }
+   ```
+
+#### 5.SDK download
+
+[Download link](https://git.allpayx.com/OpenAPI/common/raw/master/v5/ios/ios_sdk.zip)
+
+#### 6.Technical Support
+
+If you have problems debugging, please contact us: support@allpayx.com