tao.zhou 6 лет назад
Родитель
Сommit
86112fcf03

+ 2 - 20
AllPay在线支付接入规范文档.md

@@ -293,8 +293,6 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | --------- | ------ | ---- | ----- |
 | tradeFrom | String | M    | "WEB" |
 
-
-
 ##### 5.3 APMP渠道
 
 1.H5支付
@@ -321,8 +319,6 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | RespMsg  | String | M    | 应答消息                                                  |
 | tn       | String | O    | 交易流水号,RespCode为“00”时返回,作为调起 sdk 支付的参数 |
 
-
-
 ##### 5.4 UP渠道
 
 1.H5支付,自适应PC和移动端
@@ -349,11 +345,7 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | RespMsg  | String | M    | 应答消息                                                  |
 | tn       | String | O    | 交易流水号,RespCode为“00”时返回,作为调起 sdk 支付的参数 |
 
-
-
-
-
-##### 5.4 Apple Pay 渠道APP
+##### 5.5 Apple Pay渠道
 
 1. APP支付
 
@@ -371,15 +363,7 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 | RespMsg  | String | M    | 应答消息                                                  |
 | tn       | String | O    | 交易流水号,RespCode为“00”时返回,作为调起 sdk 支付的参数 |
 
-
-
-
-
-
-
-
-
-##### 5.6CA渠道
+##### 5.6 CA渠道
 
 1.APP支付
 
@@ -428,8 +412,6 @@ AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全
 
 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)
 
-
-
 #### 8.技术支持
 
 如果您在调试时遇到问题,请与我们联系:support@allpayx.com

+ 7 - 8
paymentSchema.md

@@ -1,9 +1,8 @@
-
-
-#### 渠道列表
-序号 |渠道名称  |渠道ID|备注 
+#### Channel list
+Serial number |Channel name  |Channel ID|Remarks 
  -----|-----|----|------
-  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

+ 113 - 0
v5/android/AllPay Android Integration Specification V5.0.0.md

@@ -0,0 +1,113 @@
+# AllPay 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%20Web%20Integration%20Specification%20V5.0.0.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 result of the payment control, and add the corresponding processing logic, just implement the call Activity
+In the onActivityResult () method, 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]() 
+- 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 address](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

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

@@ -27,9 +27,9 @@ 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 包
@@ -52,8 +52,8 @@ repositories {
 
 ```java
 /**
- * tn——交易流水号,即 TN,为商户后台从 AllPay 后台获取,获取方式参见 AllPay 网关对接文档
- * false 测试环
+ * tn——交易流水号,作为调起 sdk 支付的参数,商户从 AllPay 后台获取
+ * false代表测试环境,true代表生产环
  */
 AllPayEngine.Pay(ShopCartActivity.this, tn, false);
 ```
@@ -90,7 +90,7 @@ pay_result,为 json 字符串,格式如下:
 报文说明:
 
 - state: "success"代表成功, "cancel"代表用户取消操作,"fail"代表失败,"query"代表 app 需要调用查询接口来确认订单状态
-- paymentSchema: 支付渠道, "APMP"代表支付宝, "WX"代表微信 
+- paymentSchema: 支付渠道, 详见[渠道列表]() 
 - orderNum: 订单号
 - errorDetail: 错误详情
 
@@ -98,8 +98,6 @@ pay_result,为 json 字符串,格式如下:
 
 ##### 4.1 WX渠道
 
-- 渠道专属配置:
-
   在Application Module的build.gradle文件的dependencies下添加
 
   ```

+ 214 - 0
v5/ios/AllPay iOS Integration Specification V5.0.0.md

@@ -0,0 +1,214 @@
+# AllPay 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%20Web%20Integration%20Specification%20V5.0.0.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]() |
+| orderNum      | Order number |
+| errorDetail   | Error details |
+
+
+
+#### 4.Channel specific configuration
+
+##### 4.1 WX channel
+
+1. Add the file under the allpaysdk/EBModule 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 Apple.
+
+##### 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 address](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

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

@@ -93,9 +93,9 @@ resultDic,转为 json 字符串,格式如下:
 | 参数          |                             说明                             |
 | ------------- | :----------------------------------------------------------: |
 | state         | "success"代表成功, "cancel"代表用户取消操作, "fail"代表失败  |
-| paymentSchema | 印度本地支付:"EB", "APMP"代表支付宝,  "WX"代表微信,"APP"代表ApplePay |
-| orderNum      |                            订单号                            |
-| errorDetail   |                           错误详情                           |
+| paymentSchema | 支付渠道, 详见[渠道列表]() |
+| orderNum      | 订单号 |
+| errorDetail   | 错误详情 |
 
 
 

+ 8 - 0
渠道.md

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