Jelajahi Sumber

删除APMP渠道

tao.zhou 5 tahun lalu
induk
melakukan
cf5f03efbe
60 mengubah file dengan 5332 tambahan dan 5336 penghapusan
  1. 248 248
      AllPay_Customs_Integration_Specification_CH.md
  2. 155 155
      AllPay_DirectDeclare_Integration_Specification_CH.md
  3. 499 501
      AllPay_Integration_Specification_CH.md
  4. 499 501
      AllPay_Integration_Specification_EN.md
  5. 109 109
      AllPay_Other_Integration_Specification_CH.md
  6. 10 10
      paymentSchema.md
  7. 124 124
      v5/android/Android_Integration_Specification_CH.md
  8. 124 124
      v5/android/Android_Integration_Specification_EN.md
  9. 10 10
      v5/android/android_sdk/Demo/.gitignore
  10. 1 1
      v5/android/android_sdk/Demo/app/.gitignore
  11. 44 44
      v5/android/android_sdk/Demo/app/build.gradle
  12. 25 25
      v5/android/android_sdk/Demo/app/proguard-rules.pro
  13. 26 26
      v5/android/android_sdk/Demo/app/src/androidTest/java/com/vtpayment/plugin/ExampleInstrumentedTest.java
  14. 47 47
      v5/android/android_sdk/Demo/app/src/main/AndroidManifest.xml
  15. 209 209
      v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/MainActivity.java
  16. 53 53
      v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/util/EncoderUtil.java
  17. 22 22
      v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/util/JsonUtil.java
  18. 30 30
      v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/util/PayOrder.java
  19. 64 64
      v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/util/PayUtil.java
  20. 18 18
      v5/android/android_sdk/Demo/app/src/main/res/drawable/buy_button_bg.xml
  21. 242 242
      v5/android/android_sdk/Demo/app/src/main/res/layout/activity_main.xml
  22. 6 6
      v5/android/android_sdk/Demo/app/src/main/res/values/colors.xml
  23. 13 13
      v5/android/android_sdk/Demo/app/src/main/res/values/strings.xml
  24. 11 11
      v5/android/android_sdk/Demo/app/src/main/res/values/styles.xml
  25. 16 16
      v5/android/android_sdk/Demo/app/src/test/java/com/vtpayment/plugin/ExampleUnitTest.java
  26. 24 24
      v5/android/android_sdk/Demo/build.gradle
  27. 17 17
      v5/android/android_sdk/Demo/gradle.properties
  28. 6 6
      v5/android/android_sdk/Demo/gradle/wrapper/gradle-wrapper.properties
  29. 160 160
      v5/android/android_sdk/Demo/gradlew
  30. 1 1
      v5/android/android_sdk/Demo/settings.gradle
  31. 212 212
      v5/ios/iOS_Integration_Specification_CH.md
  32. 211 211
      v5/ios/iOS_Integration_Specification_EN.md
  33. 786 786
      v5/ios/ios_sdk/Demo/Demo.xcodeproj/project.pbxproj
  34. 7 7
      v5/ios/ios_sdk/Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  35. 8 8
      v5/ios/ios_sdk/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  36. 5 5
      v5/ios/ios_sdk/Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/bensonzhang.xcuserdatad/IDEFindNavigatorScopes.plist
  37. 111 111
      v5/ios/ios_sdk/Demo/Demo.xcodeproj/xcuserdata/bensonzhang.xcuserdatad/xcschemes/Demo.xcscheme
  38. 32 32
      v5/ios/ios_sdk/Demo/Demo.xcodeproj/xcuserdata/bensonzhang.xcuserdatad/xcschemes/xcschememanagement.plist
  39. 38 38
      v5/ios/ios_sdk/Demo/Demo/AllPayRequest.h
  40. 141 141
      v5/ios/ios_sdk/Demo/Demo/AllPayRequest.m
  41. 17 17
      v5/ios/ios_sdk/Demo/Demo/AppDelegate.h
  42. 63 63
      v5/ios/ios_sdk/Demo/Demo/AppDelegate.m
  43. 97 97
      v5/ios/ios_sdk/Demo/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json
  44. 27 27
      v5/ios/ios_sdk/Demo/Demo/Base.lproj/LaunchScreen.storyboard
  45. 27 27
      v5/ios/ios_sdk/Demo/Demo/Base.lproj/Main.storyboard
  46. 15 15
      v5/ios/ios_sdk/Demo/Demo/DateUtil.h
  47. 23 23
      v5/ios/ios_sdk/Demo/Demo/DateUtil.m
  48. 12 12
      v5/ios/ios_sdk/Demo/Demo/Demo.entitlements
  49. 83 83
      v5/ios/ios_sdk/Demo/Demo/Info.plist
  50. 31 31
      v5/ios/ios_sdk/Demo/Demo/PayOrder.h
  51. 13 13
      v5/ios/ios_sdk/Demo/Demo/PayOrder.m
  52. 16 16
      v5/ios/ios_sdk/Demo/Demo/SignUtil.h
  53. 47 47
      v5/ios/ios_sdk/Demo/Demo/SignUtil.m
  54. 15 15
      v5/ios/ios_sdk/Demo/Demo/ViewController.h
  55. 211 211
      v5/ios/ios_sdk/Demo/Demo/ViewController.m
  56. 1 1
      v5/ios/ios_sdk/Demo/Demo/allpaysdk/AliModule/AlipaySDK.bundle/bridge.js
  57. 33 33
      v5/ios/ios_sdk/Demo/Demo/allpaysdk/AliModule/AlipaySDK.framework/Headers/APayAuthInfo.h
  58. 203 203
      v5/ios/ios_sdk/Demo/Demo/allpaysdk/AliModule/AlipaySDK.framework/Headers/AlipaySDK.h
  59. 18 18
      v5/ios/ios_sdk/Demo/Demo/allpaysdk/AllPaySDK.h
  60. 16 16
      v5/ios/ios_sdk/Demo/Demo/main.m

+ 248 - 248
AllPay_Customs_Integration_Specification_CH.md

@@ -1,249 +1,249 @@
-# AllPay报关接口规范说明文档V5.0.0
->[上海偶可贝网络科技有限公司](https://www.allpayx.com)
->
->- 版本信息:中文 V5.0.0
->- 更新时间:2018 年12 月
-
-## 1.概述
-
-本文档规定了商户与AllPay之间的海关申报产品进行联机交易时使用的报文接口。
-
-## 2.验签说明 
-
-```
-1.对于发送到 AllPay 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 Key(接入 AllPay 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行加密运算,得到 signature 的值。
-
-3.示例签名串 IDCard=411422199808080415&acqID=99020344&charSet=UTF-8&customerAccount=ab123456&customs_code=3302462548&customs_name=AAAA&customs_place=CUSTOMSHEADOFFICE&merID=000000000000015&merReserve=dd&name=shi kai feng&orderCurrency=CNY&orderNum=kfvWipRWHEboJPh71m7lXkUILutt&origOrderNum=VzVJhPdX18tDu3vgGfNOIgh71LjY&paymentSchema=UP&productPrice=80&signType=MD5&transTime=20181229171552&transType=DECL&transportPrice=10&version=VER0000000052f2c77e3718c47cfb47a89a6fbc9d361
-```
-
-## 3.通用API说明 
-
-商户服务器和 AllPay 网关对接的海关申报相关接口,包括申报、申报查询、申报更新。
-
-### 3.1 通用 API 接入地址 
-
-| 交易名称 | 开发调试地址                               | 生产交易地址                               |
-| ------- | ----------------------------------------- | ------------------------------------------ |
-| 申报 | https://testapi.allpayx.com/custom/declare | https://api.allpayx.com/custom/declare |
-| 申报查询 | https://testapi.allpayx.com/custom/query   | https://api.allpayx.com/custom/query       |
-| 申报更新 | https://testapi.allpayx.com/custom/update | https://api.allpayx.com/custom/update |
-
-### 3.2 申报接口
-
-1.请求报文格式
-
-| 参数            | 类型        | 属性 | 描述                                                         |
-| --------------- | ----------- | ---- | ------------------------------------------------------------ |
-| version         | String(12)  | M    | 统一填写为“VER000000005”                                     |
-| charSet         | String(6)   | M    | 统一填写为“UTF-8”                                            |
-| transType       | String(4)   | M    | 交易类型代码:“DECL”                                         |
-| orderNum        | String(60)  | M    | 报关订单号:商户自行定义,需保证同一商户号下订单号不能重复       |
-| origOrderNum    | String(60)  | M    | 支付成功的订单号                                   |
-| productPrice    | String(12)  | M    | 商品金额:如 100 元,表示为 100 或 100.00                    |
-| transportPrice  | String(12)  | M    | 运费金额:如 100 元,表示为 100 或 100.00                    |
-| tarPrice        | String(12)  | M    | 关税金额:如 100 元,表示为 100 或 100.00                    |
-| orderCurrency   | String(3)   | M    | 订单币种:ISO标准。如:人民币填写“CNY”,美元填写"USD"          |
-| customs_code    | String(64)  | M    | 商户海关备案编码                                             |
-| customs_name    | String(128) | M    | 商户海关备案名称                                             |
-| customs_place   | String(128) | M    | 海关,详见附件 1 海关列表                                       |
-| name            | String(64)  | M    | 消费者姓名                                                   |
-| IDCard          | String(32)  | M    | 消费者身份证号                                               |
-| customerAccount | String(64)  | M    | 消费者在商家的注册帐号                                       |
-| businessType    | String(2)   | O    | 保税进口:1,直邮进口:2。如果不填,默认为1保税进口,视申报海关需要填写 |
-| merID           | String(15)  | M    | 商户 ID,由AllPay 分配                                       |
-| acqID           | String(11)  | M    | 收单行 ID "99020344"                                         |
-| paymentSchema   | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP                |
-| transTime       | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
-| signType        | String(10)  | M    | MD5或SHA256                                                  |
-| signature       | String(32)  | M    | 采用 MD5或SHA256 签名                                         |
-
-2.响应报文格式
-
-| 参数           | 类型        | 属性 | 描述                                          |
-| -------------- | ----------- | ---- | --------------------------------------------- |
-| version        | String(12)  | M    | 统一填写为“VER000000005”                      |
-| charSet        | String(6)   | M    | 统一填写为“UTF-8”                             |
-| transType      | String(4)   | M    | “DECL”                                        |
-| orderNum       | String(60)  | M    | 报关订单号                                        |
-| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码             |
-| RespMsg        | String(128) | M    | 应答消息                                      |
-| customs_code   | String(64)  | M    | 商户在海关报备的编码                          |
-| customs_name   | String(128) | M    | 商户在海关报备的名称                          |
-| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表                     |
-| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号                    |
-| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                              |
-| merID          | String(15)  | M    | 商户 ID,由AllPay 分配                        |
-| acqID          | String(11)  | M    | 收单行 ID "99020344"                          |
-| paymentSchema  | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP |
-| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"              |
-| signType       | String(10)  | M    | MD5或SHA256                                   |
-| signature      | String(32)  | M    | 采用 MD5或SHA256 签名                         |
-
-### 3.3 申报查询接口
-
-1.请求报文格式
-
-| 参数          | 类型       | 属性 | 描述                                          |
-| ------------- | ---------- | ---- | --------------------------------------------- |
-| version       | String(12) | M    | 统一填写为“VER000000005”                      |
-| charSet       | String(6)  | M    | 统一填写为“UTF-8”                             |
-| transType     | String(4)  | M    | 查询填写“INQY”                                |
-| orderNum      | String(60) | M    | 报关订单号                                        |
-| merID         | String(15) | M    | 商户 ID,由AllPay 分配                        |
-| acqID         | String(11) | M    | 收单行 ID "99020344"                          |
-| paymentSchema | String(10) | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP |
-| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                |
-| signType      | String(10) | M    | MD5或SHA256                                   |
-| signature     | String(32) | M    | 采用 MD5或SHA256 签名                        |
-
-2.响应报文格式
-
-| 参数           | 类型        | 属性 | 描述                                          |
-| ------------- | ----------- | ---- | --------------------------------------------- |
-| version        | String(12)  | M    | 统一填写为“VER000000005”                      |
-| charSet        | String(6)   | M    | 统一填写为“UTF-8”                             |
-| transType      | String(4)   | M    | “DECL”                                        |
-| orderNum       | String(60)  | M    | 报关订单号                                        |
-| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码                                |
-| RespMsg        | String(128) | M    | 应答消息                                      |
-| customs_code   | String(64)  | M    | 商户在海关报备的编码                          |
-| customs_name   | String(128) | M    | 商户在海关报备的名称                          |
-| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表                        |
-| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号                    |
-| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                              |
-| merID          | String(15)  | M    | 商户 ID,由 AllPay 分配                        |
-| acqID          | String(11)  | M    | 收单行 ID "99020344"                          |
-| paymentSchema  | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP |
-| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"              |
-| signType       | String(10)  | M    | MD5或SHA256                                  |
-| signature      | String(32)  | M    | 采用 MD5或SHA256 签名                     |
-
-### 3.4 申报更新接口
-
-1.请求报文格式
-
-| 参数            | 类型        | 属性 | 描述                                                         |
-| --------------- | ----------- | ---- | ------------------------------------------------------------ |
-| version         | String(12)  | M    | 统一填写为“VER000000005”                                     |
-| charSet         | String(6)   | M    | 统一填写为“UTF-8”                                            |
-| transType       | String(4)   | M    | 交易类型代码:“DECL”                                         |
-| orderNum        | String(60)  | M    | 原报关订单号   |
-| origOrderNum    | String(60)  | M    | 支付成功的订单号                                     |
-| productPrice    | String(12)  | M    | 商品金额:如 100 元,表示为 100 或 100.00                    |
-| transportPrice  | String(12)  | M    | 运费金额:如 100 元,表示为 100 或 100.00                    |
-| tarPrice        | String(12)  | M    | 关税金额:如 100 元,表示为 100 或 100.00                    |
-| orderCurrency   | String(3)   | M    | 订单币种:ISO标准。如:人民币填写“CNY”,美元填写"USD"        |
-| customs_code    | String(64)  | M    | 商户海关备案编码                                             |
-| customs_name    | String(128) | M    | 商户海关备案名称                                             |
-| customs_place   | String(128) | M    | 海关,详见附件 1 海关列表                                    |
-| name            | String(64)  | M    | 消费者姓名                                                   |
-| IDCard          | String(32)  | M    | 消费者身份证号                                               |
-| customerAccount | String(64)  | M    | 消费者在商家的注册帐号                                       |
-| businessType    | String(2)   | O    | 保税进口:1,直邮进口:2。如果不填,默认为1保税进口,视申报海关需要填写 |
-| merID           | String(15)  | M    | 商户 ID,由AllPay 分配                                       |
-| acqID           | String(11)  | M    | 收单行 ID "99020344"                                         |
-| paymentSchema   | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP                |
-| transTime       | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"                              |
-| signType        | String(10)  | M    | MD5或SHA256                                                  |
-| signature       | String(32)  | M    | 采用 MD5或SHA256 签名                                        |
-
-2.响应报文格式
-
-| 参数           | 类型        | 属性 | 描述                                          |
-| -------------- | ----------- | ---- | --------------------------------------------- |
-| version        | String(12)  | M    | 统一填写为“VER000000005”                      |
-| charSet        | String(6)   | M    | 统一填写为“UTF-8”                             |
-| transType      | String(4)   | M    | “DECL”                                        |
-| orderNum       | String(60)  | M    | 报关订单号                                        |
-| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码             |
-| RespMsg        | String(128) | M    | 应答消息                                      |
-| customs_code   | String(64)  | M    | 商户在海关报备的编码                          |
-| customs_name   | String(128) | M    | 商户在海关报备的名称                          |
-| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表                     |
-| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号                    |
-| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                              |
-| merID          | String(15)  | M    | 商户 ID,由AllPay 分配                        |
-| acqID          | String(11)  | M    | 收单行 ID "99020344"                          |
-| paymentSchema  | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP |
-| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"              |
-| signType       | String(10)  | M    | MD5或SHA256                                   |
-| signature      | String(32)  | M    | 采用 MD5或SHA256 签名                         |
-
-## 4.附件 1 海关列表
-
-### 4.1 支付宝海关列表
-
-| 海关名称                                                     | 海关编码               |
-| ------------------------------------------------------------ | ---------------------- |
-| 总署                                                          | ZONGSHU                |
-| 杭州海关                                                     | HANGZHOU_ZONGSHU       |
-| 河南保税物流中心                                             | ZHENGZHOU              |
-| 新郑综合保税区(空港)(先推送HENAN,再推送ZONGSHU)            | HENAN        |
-| 宁波海关                                                     | NINGBO                 |
-| 上海海关                                                     | SHANGHAI_CBT           |
-| 南沙国检                                                     | NANSHAGJ               |
-| 天津海关(先推送TIANJIN,再推送ZONGSHU)                       | TIANJIN     |
-| 广州海关(机场)(推送广州机场国检,备案信息需要传企业在广电的备案信息)| GUANGZHOU_AIRPORT   |
-| 广州海关(南沙)(推送广州南沙国检,备案信息需要传企业在广电的备案信息)| GUANGZHOU_NANSHA   |
-| 广州海关(黄埔)(推送广州黄埔国检,备案信息需要传企业在广电的备案信息)| GUANGZHOU_HUANGPU   |
-| 广州海关(沙田)(推送广州沙田国检,备案信息需要传企业在广电的备案信息)| GUANGZHOU_SHATIAN   |
-
-### 4.2 微信海关列表
-
-| 海关名称                                                     | 海关编码        |
-| ------------------------------------------------------------ | --------------- |
-| 广州(总署版)                                               | GUANGZHOU_ZS    |
-| 广州黄埔国检(推送至黄埔国检的订单需分别推送广州(总署版)和广州黄埔国检,即需要请求两次报关接口) | GUANGZHOU_HP_GJ |
-| 广州南沙国检(推送至南沙国检的订单需分别推送广州(总署版)和广州南沙国检,即需要请求两次报关接口) | GUANGZHOU_NS_GJ |
-| 杭州(总署版)                                               | HANGZHOU_ZS     |
-| 宁波                                                         | NINGBO          |
-| 郑州(保税物流中心)                                         | ZHENGZHOU_BS    |
-| 重庆                                                         | CHONGQING       |
-| 上海(总署版)                                               | SHANGHAI_ZS     |
-| 深圳                                                         | SHENZHEN        |
-| 郑州综保(总署版)                                           | ZHENGZHOU_ZH_ZS |
-| 天津                                                         | TIANJIN         |
-
-### 4.3 银联海关列表
-
-| 海关名称       | 海关编码          |
-| -------------- | ----------------- |
-| 海关总署       | CUSTOMSHEADOFFICE |
-| 深圳海关       | SHENZHEN          |
-| 广州海关       | GUANGZHOU         |
-| 南沙国检       | NANSHAGUOJIAN     |
-| 浙江口岸(杭州) | ZHEJIANG          |
-| 上海海关       | SHANGHAI          |
-| 郑州经开       | ZHENGZHOUJK       |
-| 郑州综合       | ZHENGZHOUZH       |
-| 宁波           | NINGBO       |
-
-以上海关列表为各渠道支持通过 API 报关的海关,实际支持情况以各渠道更新为准。
-
-## 5.附件 2 应答码
-
-| 应答码 | 描述       |
-| ------ | ----------- |
-| 00     | 成功         |
-| 01     | 失败         |
-| 04     | 处理中       |
-| 61     | 超过限额     |
-| U1     | 商户不存在 |
-| U2     | 签名错误     |
-| U3     | 报文被篡改   |
-| U4     | 缺失参数     |
-| U5     | 无效的参数   |
-| U6     | 重复的订单号 |
-| U7     | 订单不存在   |
-| U8     | 参数为空 |
-| U9     | 系统错误     |
-| P1     | 渠道未配置   |
-| P2     | 币种未配置   |
-
-*注意:银联渠道申请报关后应答码为04处理中,需要过段时间调用申报查询接口确定最终状态。
-
-## 6.技术支持
-
+# AllPay报关接口规范说明文档V5.0.0
+>[上海偶可贝网络科技有限公司](https://www.allpayx.com)
+>
+>- 版本信息:中文 V5.0.0
+>- 更新时间:2018 年12 月
+
+## 1.概述
+
+本文档规定了商户与AllPay之间的海关申报产品进行联机交易时使用的报文接口。
+
+## 2.验签说明 
+
+```
+1.对于发送到 AllPay 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 Key(接入 AllPay 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行加密运算,得到 signature 的值。
+
+3.示例签名串 IDCard=411422199808080415&acqID=99020344&charSet=UTF-8&customerAccount=ab123456&customs_code=3302462548&customs_name=AAAA&customs_place=CUSTOMSHEADOFFICE&merID=000000000000015&merReserve=dd&name=shi kai feng&orderCurrency=CNY&orderNum=kfvWipRWHEboJPh71m7lXkUILutt&origOrderNum=VzVJhPdX18tDu3vgGfNOIgh71LjY&paymentSchema=UP&productPrice=80&signType=MD5&transTime=20181229171552&transType=DECL&transportPrice=10&version=VER0000000052f2c77e3718c47cfb47a89a6fbc9d361
+```
+
+## 3.通用API说明 
+
+商户服务器和 AllPay 网关对接的海关申报相关接口,包括申报、申报查询、申报更新。
+
+### 3.1 通用 API 接入地址 
+
+| 交易名称 | 开发调试地址                               | 生产交易地址                               |
+| ------- | ----------------------------------------- | ------------------------------------------ |
+| 申报 | https://testapi.allpayx.com/custom/declare | https://api.allpayx.com/custom/declare |
+| 申报查询 | https://testapi.allpayx.com/custom/query   | https://api.allpayx.com/custom/query       |
+| 申报更新 | https://testapi.allpayx.com/custom/update | https://api.allpayx.com/custom/update |
+
+### 3.2 申报接口
+
+1.请求报文格式
+
+| 参数            | 类型        | 属性 | 描述                                                         |
+| --------------- | ----------- | ---- | ------------------------------------------------------------ |
+| version         | String(12)  | M    | 统一填写为“VER000000005”                                     |
+| charSet         | String(6)   | M    | 统一填写为“UTF-8”                                            |
+| transType       | String(4)   | M    | 交易类型代码:“DECL”                                         |
+| orderNum        | String(60)  | M    | 报关订单号:商户自行定义,需保证同一商户号下订单号不能重复       |
+| origOrderNum    | String(60)  | M    | 支付成功的订单号                                   |
+| productPrice    | String(12)  | M    | 商品金额:如 100 元,表示为 100 或 100.00                    |
+| transportPrice  | String(12)  | M    | 运费金额:如 100 元,表示为 100 或 100.00                    |
+| tarPrice        | String(12)  | M    | 关税金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency   | String(3)   | M    | 订单币种:ISO标准。如:人民币填写“CNY”,美元填写"USD"          |
+| customs_code    | String(64)  | M    | 商户海关备案编码                                             |
+| customs_name    | String(128) | M    | 商户海关备案名称                                             |
+| customs_place   | String(128) | M    | 海关,详见附件 1 海关列表                                       |
+| name            | String(64)  | M    | 消费者姓名                                                   |
+| IDCard          | String(32)  | M    | 消费者身份证号                                               |
+| customerAccount | String(64)  | M    | 消费者在商家的注册帐号                                       |
+| businessType    | String(2)   | O    | 保税进口:1,直邮进口:2。如果不填,默认为1保税进口,视申报海关需要填写 |
+| merID           | String(15)  | M    | 商户 ID,由AllPay 分配                                       |
+| acqID           | String(11)  | M    | 收单行 ID "99020344"                                         |
+| paymentSchema   | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP                |
+| transTime       | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"                               |
+| signType        | String(10)  | M    | MD5或SHA256                                                  |
+| signature       | String(32)  | M    | 采用 MD5或SHA256 签名                                         |
+
+2.响应报文格式
+
+| 参数           | 类型        | 属性 | 描述                                          |
+| -------------- | ----------- | ---- | --------------------------------------------- |
+| version        | String(12)  | M    | 统一填写为“VER000000005”                      |
+| charSet        | String(6)   | M    | 统一填写为“UTF-8”                             |
+| transType      | String(4)   | M    | “DECL”                                        |
+| orderNum       | String(60)  | M    | 报关订单号                                        |
+| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码             |
+| RespMsg        | String(128) | M    | 应答消息                                      |
+| customs_code   | String(64)  | M    | 商户在海关报备的编码                          |
+| customs_name   | String(128) | M    | 商户在海关报备的名称                          |
+| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表                     |
+| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号                    |
+| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                              |
+| merID          | String(15)  | M    | 商户 ID,由AllPay 分配                        |
+| acqID          | String(11)  | M    | 收单行 ID "99020344"                          |
+| paymentSchema  | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP |
+| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"              |
+| signType       | String(10)  | M    | MD5或SHA256                                   |
+| signature      | String(32)  | M    | 采用 MD5或SHA256 签名                         |
+
+### 3.3 申报查询接口
+
+1.请求报文格式
+
+| 参数          | 类型       | 属性 | 描述                                          |
+| ------------- | ---------- | ---- | --------------------------------------------- |
+| version       | String(12) | M    | 统一填写为“VER000000005”                      |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”                             |
+| transType     | String(4)  | M    | 查询填写“INQY”                                |
+| orderNum      | String(60) | M    | 报关订单号                                        |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配                        |
+| acqID         | String(11) | M    | 收单行 ID "99020344"                          |
+| paymentSchema | String(10) | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss"                |
+| signType      | String(10) | M    | MD5或SHA256                                   |
+| signature     | String(32) | M    | 采用 MD5或SHA256 签名                        |
+
+2.响应报文格式
+
+| 参数           | 类型        | 属性 | 描述                                          |
+| ------------- | ----------- | ---- | --------------------------------------------- |
+| version        | String(12)  | M    | 统一填写为“VER000000005”                      |
+| charSet        | String(6)   | M    | 统一填写为“UTF-8”                             |
+| transType      | String(4)   | M    | “DECL”                                        |
+| orderNum       | String(60)  | M    | 报关订单号                                        |
+| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码                                |
+| RespMsg        | String(128) | M    | 应答消息                                      |
+| customs_code   | String(64)  | M    | 商户在海关报备的编码                          |
+| customs_name   | String(128) | M    | 商户在海关报备的名称                          |
+| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表                        |
+| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号                    |
+| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                              |
+| merID          | String(15)  | M    | 商户 ID,由 AllPay 分配                        |
+| acqID          | String(11)  | M    | 收单行 ID "99020344"                          |
+| paymentSchema  | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP |
+| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"              |
+| signType       | String(10)  | M    | MD5或SHA256                                  |
+| signature      | String(32)  | M    | 采用 MD5或SHA256 签名                     |
+
+### 3.4 申报更新接口
+
+1.请求报文格式
+
+| 参数            | 类型        | 属性 | 描述                                                         |
+| --------------- | ----------- | ---- | ------------------------------------------------------------ |
+| version         | String(12)  | M    | 统一填写为“VER000000005”                                     |
+| charSet         | String(6)   | M    | 统一填写为“UTF-8”                                            |
+| transType       | String(4)   | M    | 交易类型代码:“DECL”                                         |
+| orderNum        | String(60)  | M    | 原报关订单号   |
+| origOrderNum    | String(60)  | M    | 支付成功的订单号                                     |
+| productPrice    | String(12)  | M    | 商品金额:如 100 元,表示为 100 或 100.00                    |
+| transportPrice  | String(12)  | M    | 运费金额:如 100 元,表示为 100 或 100.00                    |
+| tarPrice        | String(12)  | M    | 关税金额:如 100 元,表示为 100 或 100.00                    |
+| orderCurrency   | String(3)   | M    | 订单币种:ISO标准。如:人民币填写“CNY”,美元填写"USD"        |
+| customs_code    | String(64)  | M    | 商户海关备案编码                                             |
+| customs_name    | String(128) | M    | 商户海关备案名称                                             |
+| customs_place   | String(128) | M    | 海关,详见附件 1 海关列表                                    |
+| name            | String(64)  | M    | 消费者姓名                                                   |
+| IDCard          | String(32)  | M    | 消费者身份证号                                               |
+| customerAccount | String(64)  | M    | 消费者在商家的注册帐号                                       |
+| businessType    | String(2)   | O    | 保税进口:1,直邮进口:2。如果不填,默认为1保税进口,视申报海关需要填写 |
+| merID           | String(15)  | M    | 商户 ID,由AllPay 分配                                       |
+| acqID           | String(11)  | M    | 收单行 ID "99020344"                                         |
+| paymentSchema   | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP                |
+| transTime       | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"                              |
+| signType        | String(10)  | M    | MD5或SHA256                                                  |
+| signature       | String(32)  | M    | 采用 MD5或SHA256 签名                                        |
+
+2.响应报文格式
+
+| 参数           | 类型        | 属性 | 描述                                          |
+| -------------- | ----------- | ---- | --------------------------------------------- |
+| version        | String(12)  | M    | 统一填写为“VER000000005”                      |
+| charSet        | String(6)   | M    | 统一填写为“UTF-8”                             |
+| transType      | String(4)   | M    | “DECL”                                        |
+| orderNum       | String(60)  | M    | 报关订单号                                        |
+| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码             |
+| RespMsg        | String(128) | M    | 应答消息                                      |
+| customs_code   | String(64)  | M    | 商户在海关报备的编码                          |
+| customs_name   | String(128) | M    | 商户在海关报备的名称                          |
+| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表                     |
+| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号                    |
+| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                              |
+| merID          | String(15)  | M    | 商户 ID,由AllPay 分配                        |
+| acqID          | String(11)  | M    | 收单行 ID "99020344"                          |
+| paymentSchema  | String(10)  | M    | 渠道代码。银联:UP,微信:WX,支付宝:AP/APMP |
+| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"              |
+| signType       | String(10)  | M    | MD5或SHA256                                   |
+| signature      | String(32)  | M    | 采用 MD5或SHA256 签名                         |
+
+## 4.附件 1 海关列表
+
+### 4.1 支付宝海关列表
+
+| 海关名称                                                     | 海关编码               |
+| ------------------------------------------------------------ | ---------------------- |
+| 总署                                                          | ZONGSHU                |
+| 杭州海关                                                     | HANGZHOU_ZONGSHU       |
+| 河南保税物流中心                                             | ZHENGZHOU              |
+| 新郑综合保税区(空港)(先推送HENAN,再推送ZONGSHU)            | HENAN        |
+| 宁波海关                                                     | NINGBO                 |
+| 上海海关                                                     | SHANGHAI_CBT           |
+| 南沙国检                                                     | NANSHAGJ               |
+| 天津海关(先推送TIANJIN,再推送ZONGSHU)                       | TIANJIN     |
+| 广州海关(机场)(推送广州机场国检,备案信息需要传企业在广电的备案信息)| GUANGZHOU_AIRPORT   |
+| 广州海关(南沙)(推送广州南沙国检,备案信息需要传企业在广电的备案信息)| GUANGZHOU_NANSHA   |
+| 广州海关(黄埔)(推送广州黄埔国检,备案信息需要传企业在广电的备案信息)| GUANGZHOU_HUANGPU   |
+| 广州海关(沙田)(推送广州沙田国检,备案信息需要传企业在广电的备案信息)| GUANGZHOU_SHATIAN   |
+
+### 4.2 微信海关列表
+
+| 海关名称                                                     | 海关编码        |
+| ------------------------------------------------------------ | --------------- |
+| 广州(总署版)                                               | GUANGZHOU_ZS    |
+| 广州黄埔国检(推送至黄埔国检的订单需分别推送广州(总署版)和广州黄埔国检,即需要请求两次报关接口) | GUANGZHOU_HP_GJ |
+| 广州南沙国检(推送至南沙国检的订单需分别推送广州(总署版)和广州南沙国检,即需要请求两次报关接口) | GUANGZHOU_NS_GJ |
+| 杭州(总署版)                                               | HANGZHOU_ZS     |
+| 宁波                                                         | NINGBO          |
+| 郑州(保税物流中心)                                         | ZHENGZHOU_BS    |
+| 重庆                                                         | CHONGQING       |
+| 上海(总署版)                                               | SHANGHAI_ZS     |
+| 深圳                                                         | SHENZHEN        |
+| 郑州综保(总署版)                                           | ZHENGZHOU_ZH_ZS |
+| 天津                                                         | TIANJIN         |
+
+### 4.3 银联海关列表
+
+| 海关名称       | 海关编码          |
+| -------------- | ----------------- |
+| 海关总署       | CUSTOMSHEADOFFICE |
+| 深圳海关       | SHENZHEN          |
+| 广州海关       | GUANGZHOU         |
+| 南沙国检       | NANSHAGUOJIAN     |
+| 浙江口岸(杭州) | ZHEJIANG          |
+| 上海海关       | SHANGHAI          |
+| 郑州经开       | ZHENGZHOUJK       |
+| 郑州综合       | ZHENGZHOUZH       |
+| 宁波           | NINGBO       |
+
+以上海关列表为各渠道支持通过 API 报关的海关,实际支持情况以各渠道更新为准。
+
+## 5.附件 2 应答码
+
+| 应答码 | 描述       |
+| ------ | ----------- |
+| 00     | 成功         |
+| 01     | 失败         |
+| 04     | 处理中       |
+| 61     | 超过限额     |
+| U1     | 商户不存在 |
+| U2     | 签名错误     |
+| U3     | 报文被篡改   |
+| U4     | 缺失参数     |
+| U5     | 无效的参数   |
+| U6     | 重复的订单号 |
+| U7     | 订单不存在   |
+| U8     | 参数为空 |
+| U9     | 系统错误     |
+| P1     | 渠道未配置   |
+| P2     | 币种未配置   |
+
+*注意:银联渠道申请报关后应答码为04处理中,需要过段时间调用申报查询接口确定最终状态。
+
+## 6.技术支持
+
 如果您有任何问题,请邮件联系support@allpayx.com

+ 155 - 155
AllPay_DirectDeclare_Integration_Specification_CH.md

@@ -1,156 +1,156 @@
-# AllPay报关接口规范说明文档V5.0.0
-
-> [上海偶可贝网络科技有限公司](https://www.allpayx.com)
->
-> - 版本信息:中文 V5.0.0
-> - 更新时间:2019 年 5 月
-
-## 1.概述
-
-本文档规定了商户与AllPay之间的海关申报产品进行联机交易时使用的报文接口。
-
-## 2.验签说明 
-
-```
-1.对于发送到 AllPay 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 Key(接入 AllPay 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行加密运算,得到 signature 的值。
-
-3.示例签名串 acqID=99020344&charSet=UTF-8&customs_code=3302462548&customs_name=宁波鑫海通达仓储服务有限公司&customs_place=GUANGZHOU_ZS&merID=000000000000016&merReserve=dd&orderCurrency=CNY&orderNum=ge6VYVeYbM2TUYkVgPhOZQJmqnoQ&origOrderNum=20190425061047&paymentSchema=WX&productPrice=3&signType=MD5&signature=12a0e499149f5d98b9d439dbe0e1ac9d&tarPrice=0&transTime=20190522171245&transType=DECL&transportPrice=0.1&version=VER000000005
-```
-
-## 3.通用API说明 
-
-商户服务器和 AllPay 网关对接的海关申报相关接口,包括申报、申报查询。
-
-### 3.1 通用 API 接入地址 
-
-| 交易名称 | 开发调试地址                                     | 生产交易地址                                 |
-| -------- | ------------------------------------------------ | -------------------------------------------- |
-| 申报     | https://testapi.allpayx.com/custom/directDeclare | https://api.allpayx.com/custom/directDeclare |
-| 申报查询 | https://testapi.allpayx.com/custom/query         | https://api.allpayx.com/custom/query         |
-
-### 3.2 申报接口
-
-1.请求报文格式
-
-| 参数          | 类型        | 属性 | 描述                                                       |
-| ------------- | ----------- | ---- | ---------------------------------------------------------- |
-| version       | String(12)  | M    | 统一填写为“VER000000005”                                   |
-| charSet       | String(6)   | M    | 统一填写为“UTF-8”                                          |
-| transType     | String(4)   | M    | 交易类型代码:“DECL”                                       |
-| orderNum      | String(60)  | M    | 报关订单号:商户自行定义,需保证同一商户号下订单号不能重复 |
-| origOrderNum  | String(60)  | M    | 支付成功的订单号                                           |
-| orderCurrency | String(3)   | M    | 订单币种:ISO标准。如:人民币填写“CNY”,美元填写"USD"。当前只支持CNY报关      |
-| customs_code  | String(64)  | M    | 商户海关备案编码                                           |
-| customs_name  | String(128) | M    | 商户海关备案名称                                           |
-| customs_place | String(128) | M    | 海关,详见附件 1 海关列表                                  |
-| merID         | String(15)  | M    | 商户 ID,由AllPay 分配                                     |
-| acqID         | String(11)  | M    | 收单行 ID "99020344"                                       |
-| paymentSchema | String(10)  | M    | 渠道代码。微信:WX                                         |
-| transTime     | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"                            |
-| signType      | String(10)  | M    | MD5或SHA256                                                |
-| signature     | String(32)  | M    | 采用 MD5或SHA256 签名                                      |
-
-2.响应报文格式
-
-| 参数           | 类型        | 属性 | 描述                              |
-| -------------- | ----------- | ---- | --------------------------------- |
-| version        | String(12)  | M    | 统一填写为“VER000000005”          |
-| charSet        | String(6)   | M    | 统一填写为“UTF-8”                 |
-| transType      | String(4)   | M    | “DECL”                            |
-| orderNum       | String(60)  | M    | 报关订单号                        |
-| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码 |
-| RespMsg        | String(128) | M    | 应答消息                          |
-| customs_code   | String(64)  | M    | 商户在海关报备的编码              |
-| customs_name   | String(128) | M    | 商户在海关报备的名称              |
-| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表         |
-| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号        |
-| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                  |
-| merID          | String(15)  | M    | 商户 ID,由AllPay 分配            |
-| acqID          | String(11)  | M    | 收单行 ID "99020344"              |
-| paymentSchema  | String(10)  | M    | 渠道代码。微信:WX                |
-| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"  |
-| signType       | String(10)  | M    | MD5或SHA256                       |
-| signature      | String(32)  | M    | 采用 MD5或SHA256 签名             |
-
-### 3.3 申报查询接口
-
-1.请求报文格式
-
-| 参数          | 类型       | 属性 | 描述                            |
-| ------------- | ---------- | ---- | ------------------------------- |
-| version       | String(12) | M    | 统一填写为“VER000000005”        |
-| charSet       | String(6)  | M    | 统一填写为“UTF-8”               |
-| transType     | String(4)  | M    | 查询填写“INQY”                  |
-| orderNum      | String(60) | M    | 报关订单号                      |
-| merID         | String(15) | M    | 商户 ID,由AllPay 分配          |
-| acqID         | String(11) | M    | 收单行 ID "99020344"            |
-| paymentSchema | String(10) | M    | 渠道代码。微信:WX              |
-| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss" |
-| signType      | String(10) | M    | MD5或SHA256                     |
-| signature     | String(32) | M    | 采用 MD5或SHA256 签名           |
-
-2.响应报文格式
-
-| 参数           | 类型        | 属性 | 描述                              |
-| -------------- | ----------- | ---- | --------------------------------- |
-| version        | String(12)  | M    | 统一填写为“VER000000005”          |
-| charSet        | String(6)   | M    | 统一填写为“UTF-8”                 |
-| transType      | String(4)   | M    | “DECL”                            |
-| orderNum       | String(60)  | M    | 报关订单号                        |
-| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码 |
-| RespMsg        | String(128) | M    | 应答消息                          |
-| customs_code   | String(64)  | M    | 商户在海关报备的编码              |
-| customs_name   | String(128) | M    | 商户在海关报备的名称              |
-| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表         |
-| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号        |
-| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                  |
-| merID          | String(15)  | M    | 商户 ID,由 AllPay 分配           |
-| acqID          | String(11)  | M    | 收单行 ID "99020344"              |
-| paymentSchema  | String(10)  | M    | 渠道代码 微信:WX                 |
-| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"  |
-| signType       | String(10)  | M    | MD5或SHA256                       |
-| signature      | String(32)  | M    | 采用 MD5或SHA256 签名             |
-
-### 4.1 微信海关列表
-
-| 海关名称                                                     | 海关编码        |
-| ------------------------------------------------------------ | --------------- |
-| 广州(总署版)                                               | GUANGZHOU_ZS    |
-| 广州黄埔国检(推送至黄埔国检的订单需分别推送广州(总署版)和广州黄埔国检,即需要请求两次报关接口) | GUANGZHOU_HP_GJ |
-| 广州南沙国检(推送至南沙国检的订单需分别推送广州(总署版)和广州南沙国检,即需要请求两次报关接口) | GUANGZHOU_NS_GJ |
-| 杭州(总署版)                                               | HANGZHOU_ZS     |
-| 宁波                                                         | NINGBO          |
-| 郑州(保税物流中心)                                         | ZHENGZHOU_BS    |
-| 重庆                                                         | CHONGQING       |
-| 西安                                                         | XIAN            |
-| 上海(总署版)                                               | SHANGHAI_ZS     |
-| 深圳                                                         | SHENZHEN        |
-| 郑州综保(总署版)                                           | ZHENGZHOU_ZH_ZS |
-| 天津                                                         | TIANJIN         |
-| 北京                                                         | BEIJING         |
-
-## 5.附件 1 应答码
-
-| 应答码 | 描述         |
-| ------ | ------------ |
-| 00     | 成功         |
-| 01     | 失败         |
-| 04     | 处理中       |
-| 61     | 超过限额     |
-| U1     | 商户不存在   |
-| U2     | 签名错误     |
-| U3     | 报文被篡改   |
-| U4     | 缺失参数     |
-| U5     | 无效的参数   |
-| U6     | 重复的订单号 |
-| U7     | 订单不存在   |
-| U8     | 参数为空     |
-| U9     | 系统错误     |
-| P1     | 渠道未配置   |
-| P2     | 币种未配置   |
-
-## 6.技术支持
-
+# AllPay报关接口规范说明文档V5.0.0
+
+> [上海偶可贝网络科技有限公司](https://www.allpayx.com)
+>
+> - 版本信息:中文 V5.0.0
+> - 更新时间:2019 年 5 月
+
+## 1.概述
+
+本文档规定了商户与AllPay之间的海关申报产品进行联机交易时使用的报文接口。
+
+## 2.验签说明 
+
+```
+1.对于发送到 AllPay 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 Key(接入 AllPay 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行加密运算,得到 signature 的值。
+
+3.示例签名串 acqID=99020344&charSet=UTF-8&customs_code=3302462548&customs_name=宁波鑫海通达仓储服务有限公司&customs_place=GUANGZHOU_ZS&merID=000000000000016&merReserve=dd&orderCurrency=CNY&orderNum=ge6VYVeYbM2TUYkVgPhOZQJmqnoQ&origOrderNum=20190425061047&paymentSchema=WX&productPrice=3&signType=MD5&signature=12a0e499149f5d98b9d439dbe0e1ac9d&tarPrice=0&transTime=20190522171245&transType=DECL&transportPrice=0.1&version=VER000000005
+```
+
+## 3.通用API说明 
+
+商户服务器和 AllPay 网关对接的海关申报相关接口,包括申报、申报查询。
+
+### 3.1 通用 API 接入地址 
+
+| 交易名称 | 开发调试地址                                     | 生产交易地址                                 |
+| -------- | ------------------------------------------------ | -------------------------------------------- |
+| 申报     | https://testapi.allpayx.com/custom/directDeclare | https://api.allpayx.com/custom/directDeclare |
+| 申报查询 | https://testapi.allpayx.com/custom/query         | https://api.allpayx.com/custom/query         |
+
+### 3.2 申报接口
+
+1.请求报文格式
+
+| 参数          | 类型        | 属性 | 描述                                                       |
+| ------------- | ----------- | ---- | ---------------------------------------------------------- |
+| version       | String(12)  | M    | 统一填写为“VER000000005”                                   |
+| charSet       | String(6)   | M    | 统一填写为“UTF-8”                                          |
+| transType     | String(4)   | M    | 交易类型代码:“DECL”                                       |
+| orderNum      | String(60)  | M    | 报关订单号:商户自行定义,需保证同一商户号下订单号不能重复 |
+| origOrderNum  | String(60)  | M    | 支付成功的订单号                                           |
+| orderCurrency | String(3)   | M    | 订单币种:ISO标准。如:人民币填写“CNY”,美元填写"USD"。当前只支持CNY报关      |
+| customs_code  | String(64)  | M    | 商户海关备案编码                                           |
+| customs_name  | String(128) | M    | 商户海关备案名称                                           |
+| customs_place | String(128) | M    | 海关,详见附件 1 海关列表                                  |
+| merID         | String(15)  | M    | 商户 ID,由AllPay 分配                                     |
+| acqID         | String(11)  | M    | 收单行 ID "99020344"                                       |
+| paymentSchema | String(10)  | M    | 渠道代码。微信:WX                                         |
+| transTime     | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"                            |
+| signType      | String(10)  | M    | MD5或SHA256                                                |
+| signature     | String(32)  | M    | 采用 MD5或SHA256 签名                                      |
+
+2.响应报文格式
+
+| 参数           | 类型        | 属性 | 描述                              |
+| -------------- | ----------- | ---- | --------------------------------- |
+| version        | String(12)  | M    | 统一填写为“VER000000005”          |
+| charSet        | String(6)   | M    | 统一填写为“UTF-8”                 |
+| transType      | String(4)   | M    | “DECL”                            |
+| orderNum       | String(60)  | M    | 报关订单号                        |
+| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码 |
+| RespMsg        | String(128) | M    | 应答消息                          |
+| customs_code   | String(64)  | M    | 商户在海关报备的编码              |
+| customs_name   | String(128) | M    | 商户在海关报备的名称              |
+| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表         |
+| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号        |
+| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                  |
+| merID          | String(15)  | M    | 商户 ID,由AllPay 分配            |
+| acqID          | String(11)  | M    | 收单行 ID "99020344"              |
+| paymentSchema  | String(10)  | M    | 渠道代码。微信:WX                |
+| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"  |
+| signType       | String(10)  | M    | MD5或SHA256                       |
+| signature      | String(32)  | M    | 采用 MD5或SHA256 签名             |
+
+### 3.3 申报查询接口
+
+1.请求报文格式
+
+| 参数          | 类型       | 属性 | 描述                            |
+| ------------- | ---------- | ---- | ------------------------------- |
+| version       | String(12) | M    | 统一填写为“VER000000005”        |
+| charSet       | String(6)  | M    | 统一填写为“UTF-8”               |
+| transType     | String(4)  | M    | 查询填写“INQY”                  |
+| orderNum      | String(60) | M    | 报关订单号                      |
+| merID         | String(15) | M    | 商户 ID,由AllPay 分配          |
+| acqID         | String(11) | M    | 收单行 ID "99020344"            |
+| paymentSchema | String(10) | M    | 渠道代码。微信:WX              |
+| transTime     | String(14) | M    | 交易时间,格式:"yyyyMMddHHmmss" |
+| signType      | String(10) | M    | MD5或SHA256                     |
+| signature     | String(32) | M    | 采用 MD5或SHA256 签名           |
+
+2.响应报文格式
+
+| 参数           | 类型        | 属性 | 描述                              |
+| -------------- | ----------- | ---- | --------------------------------- |
+| version        | String(12)  | M    | 统一填写为“VER000000005”          |
+| charSet        | String(6)   | M    | 统一填写为“UTF-8”                 |
+| transType      | String(4)   | M    | “DECL”                            |
+| orderNum       | String(60)  | M    | 报关订单号                        |
+| RespCode       | String(2)   | M    | 应答码 00-成功。详见附件 2 应答码 |
+| RespMsg        | String(128) | M    | 应答消息                          |
+| customs_code   | String(64)  | M    | 商户在海关报备的编码              |
+| customs_name   | String(128) | M    | 商户在海关报备的名称              |
+| customs_place  | String(128) | M    | 海关,详见附件 1 海关列表         |
+| allpayOrderNum | String(64)  | M    | AllPay系统的转换商户订单号        |
+| schemaTransId  | String(64)  | M    | 支付渠道的交易ID                  |
+| merID          | String(15)  | M    | 商户 ID,由 AllPay 分配           |
+| acqID          | String(11)  | M    | 收单行 ID "99020344"              |
+| paymentSchema  | String(10)  | M    | 渠道代码 微信:WX                 |
+| transTime      | String(14)  | M    | 交易时间,格式:"yyyyMMddHHmmss"  |
+| signType       | String(10)  | M    | MD5或SHA256                       |
+| signature      | String(32)  | M    | 采用 MD5或SHA256 签名             |
+
+### 4.1 微信海关列表
+
+| 海关名称                                                     | 海关编码        |
+| ------------------------------------------------------------ | --------------- |
+| 广州(总署版)                                               | GUANGZHOU_ZS    |
+| 广州黄埔国检(推送至黄埔国检的订单需分别推送广州(总署版)和广州黄埔国检,即需要请求两次报关接口) | GUANGZHOU_HP_GJ |
+| 广州南沙国检(推送至南沙国检的订单需分别推送广州(总署版)和广州南沙国检,即需要请求两次报关接口) | GUANGZHOU_NS_GJ |
+| 杭州(总署版)                                               | HANGZHOU_ZS     |
+| 宁波                                                         | NINGBO          |
+| 郑州(保税物流中心)                                         | ZHENGZHOU_BS    |
+| 重庆                                                         | CHONGQING       |
+| 西安                                                         | XIAN            |
+| 上海(总署版)                                               | SHANGHAI_ZS     |
+| 深圳                                                         | SHENZHEN        |
+| 郑州综保(总署版)                                           | ZHENGZHOU_ZH_ZS |
+| 天津                                                         | TIANJIN         |
+| 北京                                                         | BEIJING         |
+
+## 5.附件 1 应答码
+
+| 应答码 | 描述         |
+| ------ | ------------ |
+| 00     | 成功         |
+| 01     | 失败         |
+| 04     | 处理中       |
+| 61     | 超过限额     |
+| U1     | 商户不存在   |
+| U2     | 签名错误     |
+| U3     | 报文被篡改   |
+| U4     | 缺失参数     |
+| U5     | 无效的参数   |
+| U6     | 重复的订单号 |
+| U7     | 订单不存在   |
+| U8     | 参数为空     |
+| U9     | 系统错误     |
+| P1     | 渠道未配置   |
+| P2     | 币种未配置   |
+
+## 6.技术支持
+
 如果您有任何问题,请邮件联系support@allpayx.com

File diff ditekan karena terlalu besar
+ 499 - 501
AllPay_Integration_Specification_CH.md


File diff ditekan karena terlalu besar
+ 499 - 501
AllPay_Integration_Specification_EN.md


+ 109 - 109
AllPay_Other_Integration_Specification_CH.md

@@ -1,109 +1,109 @@
-# AllPay其他接口文档V1.0.0
-[上海偶可贝网络科技有限公司](https://www.allpayx.com)
-
-* 版本信息:中文 V1.0.0
-* 更新时间:2019 年2 月
-
-## 1.概述
-
-AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全、集中式的接入支付渠道。
-
-## 2.验签说明 
-```
-1.对于发送到 AllPay 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
-
-2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 Key(接入 AllPay 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行加密运算,得到 signature 的值。
-
-3.示例签名串 merID=000000000000015&signType=MD5&transID=MQkmUGAh3Gw2HEEi2f2c77e3718c47cfb47a89a6fbc9d361
-```
-
-## 3.API 说明
-
-### 3.1 汇率查询接口
-
-该接口提供银联、微信、支付宝渠道汇率查询的功能。
-
-| 测试环境地址                                  | 生产环境地址                              |
-| --------------------------------------------- | ----------------------------------------- |
-| https://test-sapi.allpayx.com/sapi/v1/get_exchange_rate | https://sapi.allpayx.com/sapi/v1/get_exchange_rate |
-
-1.请求交易参数
-
-| 参数      | 属性 | 描述                                  |
-| --------- | ---- | ------------------------------------- |
-| pid     | M    | 商户 ID,由 AllPay 分配                |
-| issuer   | M    | 汇率的提供机构,取值:UPI银联国际,ALP支付宝,WXP微信支付 |
-| original_currency  | M    | 源币种,取值:USD,HKD,……                |
-| conversion_currency | M    | 转换币种,取值:CNY(当前仅支持CNY)                  |
-| sign_type  | M    | sha256                            |
-| sign | M    | 签名                  |
-
-2.成功交易返回参数
-
-| 参数      | 属性 | 描述                                  |
-| --------- | ---- | ------------------------------------- |
-| rate_date     | M    | 汇率日期,8位日期格式YYYYMMDD                |
-| issuer   | M    | 汇率的提供机构,取值:UPI银联国际,ALP支付宝,WXP微信支付 |
-| original_currency  | M    | 源币种,取值:USD,HKD,……                 |
-| conversion_currency | M    | 转换币种,取值:CNY(当前仅支持CNY)                  |
-| exchange_rate  | M    | 参考汇率值                            |
-
-### 3.2 获取渠道流水信息接口
-
-该接口提供通过transID查询渠道流水的功能。
-
-| 测试环境地址                                  | 生产环境地址                              |
-| --------------------------------------------- | ----------------------------------------- |
-| https://testapi.allpayx.com/api/schemaTransId | https://api.allpayx.com/api/schemaTransId |
-
-1.请求参数
-
-| 参数      | 类型       | 属性 | 描述                                  |
-| --------- | ---------- | ---- | ------------------------------------- |
-| merID     | String(15) | M    | 商户 ID,由AllPay 分配                |
-| transID   | String(6)  | M    | GW 系统生成的交易 ID,由AllPay系统返回 |
-| signType  | String(10) | M    | MD5或SHA256                            |
-| signature | String(60) | M    | 采用 MD5或SHA256 签名                  |
-
-2.响应参数
-
-| 参数           | 类型       | 属性 | 描述                                                         |
-| -------------- | ---------- | ---- | ------------------------------------------------------------ |
-| merID          | String(12) | M    | 商户 ID,由AllPay 分配                                       |
-| orderNum       | String(6)  | M    | 商户订单号                                                   |
-| allpayOrderNum | String(4)  | M    | AllPay系统的转换商户订单号                                   |
-| schemaTransId  | String(60) | M    | 支付渠道的交易ID                                             |
-| transID        | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
-| paymentSchema  | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) |
-| RespCode       | String(2)  | M    | 应答码 00-成功                                               |
-| RespMsg        | String(20) | M    | 应答消息                                                     |
-
-## 4.应答码 
-
-| 应答码 | 描  述       |
-| ------ | ------------ |
-| 00     | 成功         |
-| 01     | 失败         |
-| U1     | 商户号不存在 |
-| U2     | 签名错误     |
-| U3     | 报文被篡改   |
-| U4     | 缺失参数     |
-| U5     | 无效的参数   |
-| U7     | 订单不存在   |
-| U8     | 参数为空 |
-| U9     | 系统错误     |
-| P4     | 功能不支持   |
-
-## 5.技术支持
-
-如果您在调试时遇到问题,请与我们联系:support@allpayx.com
-
-
-
-
-
-
-
-  
-
-
+# AllPay其他接口文档V1.0.0
+[上海偶可贝网络科技有限公司](https://www.allpayx.com)
+
+* 版本信息:中文 V1.0.0
+* 更新时间:2019 年2 月
+
+## 1.概述
+
+AllPay 为客户提供统一的API接入,以帮助客户实 现快速、安全、集中式的接入支付渠道。
+
+## 2.验签说明 
+```
+1.对于发送到 AllPay 系统的 POST 请求报文,其中所有传入参数(除 signature 参数外)按照字段名的 ASCII 码从小到大排序后(字典序),使用 URL 键值对的格式(即 key1=value1&key2=value2...)拼接成字符串 String1。
+
+2.在 String1 最后直接拼接(不需要用“&”连接)双方约定的签名密钥 Key(接入 AllPay 时分配),得到 stringSignTemp 字符串,并对 stringSignTemp 进行加密运算,得到 signature 的值。
+
+3.示例签名串 merID=000000000000015&signType=MD5&transID=MQkmUGAh3Gw2HEEi2f2c77e3718c47cfb47a89a6fbc9d361
+```
+
+## 3.API 说明
+
+### 3.1 汇率查询接口
+
+该接口提供银联、微信、支付宝渠道汇率查询的功能。
+
+| 测试环境地址                                  | 生产环境地址                              |
+| --------------------------------------------- | ----------------------------------------- |
+| https://test-sapi.allpayx.com/sapi/v1/get_exchange_rate | https://sapi.allpayx.com/sapi/v1/get_exchange_rate |
+
+1.请求交易参数
+
+| 参数      | 属性 | 描述                                  |
+| --------- | ---- | ------------------------------------- |
+| pid     | M    | 商户 ID,由 AllPay 分配                |
+| issuer   | M    | 汇率的提供机构,取值:UPI银联国际,ALP支付宝,WXP微信支付 |
+| original_currency  | M    | 源币种,取值:USD,HKD,……                |
+| conversion_currency | M    | 转换币种,取值:CNY(当前仅支持CNY)                  |
+| sign_type  | M    | sha256                            |
+| sign | M    | 签名                  |
+
+2.成功交易返回参数
+
+| 参数      | 属性 | 描述                                  |
+| --------- | ---- | ------------------------------------- |
+| rate_date     | M    | 汇率日期,8位日期格式YYYYMMDD                |
+| issuer   | M    | 汇率的提供机构,取值:UPI银联国际,ALP支付宝,WXP微信支付 |
+| original_currency  | M    | 源币种,取值:USD,HKD,……                 |
+| conversion_currency | M    | 转换币种,取值:CNY(当前仅支持CNY)                  |
+| exchange_rate  | M    | 参考汇率值                            |
+
+### 3.2 获取渠道流水信息接口
+
+该接口提供通过transID查询渠道流水的功能。
+
+| 测试环境地址                                  | 生产环境地址                              |
+| --------------------------------------------- | ----------------------------------------- |
+| https://testapi.allpayx.com/api/schemaTransId | https://api.allpayx.com/api/schemaTransId |
+
+1.请求参数
+
+| 参数      | 类型       | 属性 | 描述                                  |
+| --------- | ---------- | ---- | ------------------------------------- |
+| merID     | String(15) | M    | 商户 ID,由AllPay 分配                |
+| transID   | String(6)  | M    | GW 系统生成的交易 ID,由AllPay系统返回 |
+| signType  | String(10) | M    | MD5或SHA256                            |
+| signature | String(60) | M    | 采用 MD5或SHA256 签名                  |
+
+2.响应参数
+
+| 参数           | 类型       | 属性 | 描述                                                         |
+| -------------- | ---------- | ---- | ------------------------------------------------------------ |
+| merID          | String(12) | M    | 商户 ID,由AllPay 分配                                       |
+| orderNum       | String(6)  | M    | 商户订单号                                                   |
+| allpayOrderNum | String(4)  | M    | AllPay系统的转换商户订单号                                   |
+| schemaTransId  | String(60) | M    | 支付渠道的交易ID                                             |
+| transID        | String(32) | M    | GW 系统生成的交易 ID,每笔交易保持唯一                       |
+| paymentSchema  | String(10) | M    | 渠道代码:[点击这里](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) |
+| RespCode       | String(2)  | M    | 应答码 00-成功                                               |
+| RespMsg        | String(20) | M    | 应答消息                                                     |
+
+## 4.应答码 
+
+| 应答码 | 描  述       |
+| ------ | ------------ |
+| 00     | 成功         |
+| 01     | 失败         |
+| U1     | 商户号不存在 |
+| U2     | 签名错误     |
+| U3     | 报文被篡改   |
+| U4     | 缺失参数     |
+| U5     | 无效的参数   |
+| U7     | 订单不存在   |
+| U8     | 参数为空 |
+| U9     | 系统错误     |
+| P4     | 功能不支持   |
+
+## 5.技术支持
+
+如果您在调试时遇到问题,请与我们联系:support@allpayx.com
+
+
+
+
+
+
+
+  
+
+

+ 10 - 10
paymentSchema.md

@@ -1,10 +1,10 @@
-# Channel list
-Serial number |Channel name  |Channel ID|Remark 
- -----|-----|----|------
- 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
- 6 | Mi Pay |MIPAY| Mi Pay 
- 7 | Easebuzz |EB| Easebuzz 
+# Channel list
+Serial number |Channel name  |Channel ID|Remark 
+ -----|-----|----|------
+ 1 | WeChat Pay |WX|WeChat Pay
+ 2 | CCAvenue |CA| CCAvenue 
+ 3 | Alipay |AP| Alipay
+ 4 | UnionPay |UP| UnionPay
+ 5 | Apple Pay |APP| Apple Pay
+ 6 | Mi Pay |MIPAY| Mi Pay 
+ 7 | Easebuzz |EB| Easebuzz 

+ 124 - 124
v5/android/Android_Integration_Specification_CH.md

@@ -1,124 +1,124 @@
-# Android端控件支付产品接口规范文档V5.0.0
-
-[上海偶可贝网络科技有限公司](https://www.allpayx.com)
-
-* 版本信息:中文 V5.0.0
-* 更新时间:2019年4月
-
-## 1.概述
-
-AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“SDK”),以帮助客户实现快速、安全、集中式的接入支付渠道。
-
-## 2.交易流程 
-  ![image](https://git.allpayx.com/OpenAPI/b2c/raw/master/images/moble_sdk_flowsheet.png)
-
-## 3.Android 客户端接入步骤 
-
-### 3.1 接入说明 
-
-商户网关将订单信息发送给 AllPay 网关,由 AllPay 网关进行处理后将交易流水号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。具体请参考[AllPay网关对接文档](https://git.allpayx.com/OpenAPI/common/src/master/AllPay_Integration_Specification_CH.md)
-
-启动支付控件的接口,接口定义如下:
-
-```java
-public static void pay(Activity activity,String tn,boolean mode)
-```
-
-:::tip 参数说明
-activity —— 用于启动支付控件的活动对象
-
-tn —— 交易流水号,作为调起 sdk 支付的参数,商户从 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文件中添加
-
-```java
-repositories {
-    flatDir {
-         dirs 'libs'
-    }
-}
-```
-
-### 3.3 调用支付控件
-
-接着可以通过以下方式调用支付控件:
-
-```java
-/**
- * tn——交易流水号,作为调起 sdk 支付的参数,商户从 AllPay 后台获取
- * false代表测试环境,true代表生产环境
- */
-AllPayEngine.Pay(ShopCartActivity.this, tn, false);
-```
-
-### 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:支付渠道,详见[渠道列表](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) 
-- orderNum:订单号
-- errorDetail:错误详情
-
-## 4.渠道专属配置
-
-### 4.1 WX渠道
-
-  在Application Module的build.gradle文件的dependencies下添加
-
-  ```
-  compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
-  ```
-
-### 4.2 APMP渠道
-
-1.把alipaySdk.arr 拷贝到项目的libs下面
-
-2.在Application Module的build.gradle文件的dependencies下添加
-
-```
-compile(name: 'alipaySdk', ext: 'aar')
-```
-
-## 5.SDK下载
-
-[安卓SDK下载地址](https://git.allpayx.com/OpenAPI/common/raw/master/v5/android/android_sdk.zip)
-
-## 6.技术支持
-
-如果您在调试时遇到问题,请与我们联系:support@allpayx.com
+# Android端控件支付产品接口规范文档V5.0.0
+
+[上海偶可贝网络科技有限公司](https://www.allpayx.com)
+
+* 版本信息:中文 V5.0.0
+* 更新时间:2019年4月
+
+## 1.概述
+
+AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“SDK”),以帮助客户实现快速、安全、集中式的接入支付渠道。
+
+## 2.交易流程 
+  ![image](https://git.allpayx.com/OpenAPI/b2c/raw/master/images/moble_sdk_flowsheet.png)
+
+## 3.Android 客户端接入步骤 
+
+### 3.1 接入说明 
+
+商户网关将订单信息发送给 AllPay 网关,由 AllPay 网关进行处理后将交易流水号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。具体请参考[AllPay网关对接文档](https://git.allpayx.com/OpenAPI/common/src/master/AllPay_Integration_Specification_CH.md)
+
+启动支付控件的接口,接口定义如下:
+
+```java
+public static void pay(Activity activity,String tn,boolean mode)
+```
+
+:::tip 参数说明
+activity —— 用于启动支付控件的活动对象
+
+tn —— 交易流水号,作为调起 sdk 支付的参数,商户从 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文件中添加
+
+```java
+repositories {
+    flatDir {
+         dirs 'libs'
+    }
+}
+```
+
+### 3.3 调用支付控件
+
+接着可以通过以下方式调用支付控件:
+
+```java
+/**
+ * tn——交易流水号,作为调起 sdk 支付的参数,商户从 AllPay 后台获取
+ * false代表测试环境,true代表生产环境
+ */
+AllPayEngine.Pay(ShopCartActivity.this, tn, false);
+```
+
+### 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:支付渠道,详见[渠道列表](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) 
+- orderNum:订单号
+- errorDetail:错误详情
+
+## 4.渠道专属配置
+
+### 4.1 WX渠道
+
+  在Application Module的build.gradle文件的dependencies下添加
+
+  ```
+  compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
+  ```
+
+### 4.2 APMP渠道
+
+1.把alipaySdk.arr 拷贝到项目的libs下面
+
+2.在Application Module的build.gradle文件的dependencies下添加
+
+```
+compile(name: 'alipaySdk', ext: 'aar')
+```
+
+## 5.SDK下载
+
+[安卓SDK下载地址](https://git.allpayx.com/OpenAPI/common/raw/master/v5/android/android_sdk.zip)
+
+## 6.技术支持
+
+如果您在调试时遇到问题,请与我们联系:support@allpayx.com

+ 124 - 124
v5/android/Android_Integration_Specification_EN.md

@@ -1,124 +1,124 @@
-# 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:+'
-  ```
-
-### 4.2 APMP channel
-
-1.Copy alipaySdk.arr to the project's libs.
-
-2.Add in the dependencies of the build.gradle file in the Application Module
-
-```
-compile(name: 'alipaySdk', ext: 'aar')
-```
-
-## 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
+# 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:+'
+  ```
+
+### 4.2 APMP channel
+
+1.Copy alipaySdk.arr to the project's libs.
+
+2.Add in the dependencies of the build.gradle file in the Application Module
+
+```
+compile(name: 'alipaySdk', ext: 'aar')
+```
+
+## 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

+ 10 - 10
v5/android/android_sdk/Demo/.gitignore

@@ -1,10 +1,10 @@
-*.iml
-.gradle
-/local.properties
-/.idea
-.DS_Store
-/build
-/captures
-.externalNativeBuild
-.bugtags.log
-/PushSDK
+*.iml
+.gradle
+/local.properties
+/.idea
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.bugtags.log
+/PushSDK

+ 1 - 1
v5/android/android_sdk/Demo/app/.gitignore

@@ -1 +1 @@
-/build
+/build

+ 44 - 44
v5/android/android_sdk/Demo/app/build.gradle

@@ -1,44 +1,44 @@
-apply plugin: 'com.android.application'
-
-android {
-    compileSdkVersion 28
-    buildToolsVersion "28.0.3"
-    defaultConfig {
-        applicationId "com.vtpayment.plugin"
-        minSdkVersion 19
-        targetSdkVersion 28
-        versionCode 1
-        versionName "1.0"
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-    }
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
-    }
-
-
-
-
-}
-
-dependencies {
-    compile fileTree(include: ['*.jar'], dir: 'libs')
-    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
-    compile 'com.android.support:appcompat-v7:25.3.1'
-    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta1'
-    testCompile 'junit:junit:4.12'
-    compile(name: 'allpaysdk', ext: 'aar')
-    compile(name: 'alipaySdk', ext: 'aar')
-    compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
-}
-
-
-repositories {
-    flatDir {
-        dirs 'libs'
-    }
-}
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 28
+    buildToolsVersion "28.0.3"
+    defaultConfig {
+        applicationId "com.vtpayment.plugin"
+        minSdkVersion 19
+        targetSdkVersion 28
+        versionCode 1
+        versionName "1.0"
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+
+
+
+
+}
+
+dependencies {
+    compile fileTree(include: ['*.jar'], dir: 'libs')
+    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+        exclude group: 'com.android.support', module: 'support-annotations'
+    })
+    compile 'com.android.support:appcompat-v7:25.3.1'
+    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta1'
+    testCompile 'junit:junit:4.12'
+    compile(name: 'allpaysdk', ext: 'aar')
+    compile(name: 'alipaySdk', ext: 'aar')
+    compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
+}
+
+
+repositories {
+    flatDir {
+        dirs 'libs'
+    }
+}

+ 25 - 25
v5/android/android_sdk/Demo/app/proguard-rules.pro

@@ -1,25 +1,25 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/bensonzhang/Library/Android/sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /Users/bensonzhang/Library/Android/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 26 - 26
v5/android/android_sdk/Demo/app/src/androidTest/java/com/vtpayment/plugin/ExampleInstrumentedTest.java

@@ -1,26 +1,26 @@
-package com.vtpayment.plugin;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumentation test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() throws Exception {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getTargetContext();
-
-        assertEquals("com.vtpayment.plugin", appContext.getPackageName());
-    }
-}
+package com.vtpayment.plugin;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumentation test, which will execute on an Android device.
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+    @Test
+    public void useAppContext() throws Exception {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getTargetContext();
+
+        assertEquals("com.vtpayment.plugin", appContext.getPackageName());
+    }
+}

+ 47 - 47
v5/android/android_sdk/Demo/app/src/main/AndroidManifest.xml

@@ -1,48 +1,48 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.vtpayment.plugin">
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-
-    <application
-        android:allowBackup="true"
-        android:icon="@mipmap/ic_launcher"
-        android:label="@string/app_name"
-        android:roundIcon="@mipmap/ic_launcher_round"
-        android:supportsRtl="true"
-        android:theme="@style/AppTheme">
-
-
-        <activity android:name=".MainActivity"
-            android:theme="@style/Theme.AppCompat.Light.NoActionBar"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-
-
-
-        <!-- wpay sdk begin -->
-
-
-        <activity
-            android:name="com.allpayx.sdk.wxapi.WXPayEntryActivity"
-            android:exported="true"
-            android:launchMode="singleTop" />
-
-
-        <activity-alias
-            android:name=".wxapi.WXPayEntryActivity"
-            android:exported="true"
-            android:launchMode="singleTop"
-            android:targetActivity="com.allpayx.sdk.wxapi.WXPayEntryActivity" />
-
-        <!-- wpay sdk end -->
-    </application>
-
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.vtpayment.plugin">
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+
+    <application
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:roundIcon="@mipmap/ic_launcher_round"
+        android:supportsRtl="true"
+        android:theme="@style/AppTheme">
+
+
+        <activity android:name=".MainActivity"
+            android:theme="@style/Theme.AppCompat.Light.NoActionBar"
+            >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+
+
+
+        <!-- wpay sdk begin -->
+
+
+        <activity
+            android:name="com.allpayx.sdk.wxapi.WXPayEntryActivity"
+            android:exported="true"
+            android:launchMode="singleTop" />
+
+
+        <activity-alias
+            android:name=".wxapi.WXPayEntryActivity"
+            android:exported="true"
+            android:launchMode="singleTop"
+            android:targetActivity="com.allpayx.sdk.wxapi.WXPayEntryActivity" />
+
+        <!-- wpay sdk end -->
+    </application>
+
 </manifest>

+ 209 - 209
v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/MainActivity.java

@@ -1,210 +1,210 @@
-package com.vtpayment.plugin;
-
-import android.app.ProgressDialog;
-import android.content.Intent;
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.View;
-import android.widget.ArrayAdapter;
-import android.widget.EditText;
-import android.widget.Spinner;
-import android.widget.Toast;
-
-import com.allpayx.sdk.AllPayEngine;
-import com.allpayx.sdk.constants.AllPayConst;
-import com.allpayx.sdk.util.HttpUtil;
-
-import com.vtpayment.plugin.util.Base64;
-import com.vtpayment.plugin.util.JsonUtil;
-import com.vtpayment.plugin.util.PayUtil;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class MainActivity extends AppCompatActivity {
-
-    private final String TAG = "MainActivity";
-
-    private static final String[] currency = {"CNY","USD","INR","JPY"};
-    private static String payType[];
-    private static final String[] paymentSchemas = {"APMP","WX","UP","CA"};
-
-    private ProgressDialog progressDialog;
-    Map<String, String> params = new HashMap<String, String>();
-    private EditText mAmoutEidt;
-    private EditText mOrderNumEidt;
-    private EditText mMerID;
-    private Spinner mPaymentSchemaSpinner;
-    private Spinner mCurrencySpinner;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_main);
-        payType = new String[4];
-        payType[0] = getResources().getString(R.string.pay_type_apmp);
-        payType[1] = getResources().getString(R.string.pay_type_wx);
-        payType[2] = getResources().getString(R.string.pay_type_up);
-        payType[3] = getResources().getString(R.string.pay_type_ca);
-        // 通用参数
-
-        params.put("version", "VER000000005");
-        params.put("charSet", "UTF-8");
-        params.put("transType", "PURC");
-        params.put("orderNum", getOrderNum());
-        params.put("orderAmount", "0.1");
-        params.put("orderCurrency", "CNY");
-        params.put("frontURL", "nil");
-        params.put("merReserve", "一个又大又圆的苹果");
-        params.put("acqID", "99020344");
-        params.put("backURL", "https://testapi.allpayx.com/test");
-        params.put("merID", "000000000000015");
-        params.put("paymentSchema", "APMP");
-        params.put("goodsInfo", "一个又大又圆的苹果");
-        params.put("transTime", getTransTime());
-        params.put("signType", "MD5");
-        params.put("tradeFrom", "APP");
-
-        String detailInfo = "[{\"goods_name\":\"一个又大又圆的苹果\",\"quantity\":\"1\"},{\"goods_name\":\"华为P20 plus\",\"quantity\":\"4\"}]";
-        try {
-            detailInfo = Base64.encodeBytes(detailInfo.getBytes("utf-8"));
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        params.put("detailInfo", detailInfo);
-
-
-        initLayout();
-        initListener();
-        update();
-
-    }
-
-    private void initLayout() {
-        mAmoutEidt = (EditText) findViewById(R.id.edit_amount);
-        mOrderNumEidt = (EditText) findViewById(R.id.edit_ordernum);
-        mMerID = (EditText) findViewById(R.id.edit_merid);
-        ArrayAdapter<String> currencyArrayAdapter = new ArrayAdapter<String>(
-                this, android.R.layout.simple_spinner_item, currency);
-        currencyArrayAdapter
-                .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-
-        mCurrencySpinner = (Spinner) findViewById(R.id.spinner_currency);
-        mCurrencySpinner.setAdapter(currencyArrayAdapter);
-
-        ArrayAdapter<String> paymentSchemaArrayAdapter = new ArrayAdapter<String>(
-                this, android.R.layout.simple_spinner_item, payType);
-        paymentSchemaArrayAdapter
-                .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-
-        mPaymentSchemaSpinner = (Spinner) findViewById(R.id.spinner_paymentschema);
-        mPaymentSchemaSpinner.setAdapter(paymentSchemaArrayAdapter);
-
-    }
-
-    private void initListener() {
-        findViewById(R.id.submit).setOnClickListener(new View.OnClickListener() {
-
-            @Override
-            public void onClick(View v) {
-                params.put("orderAmount", mAmoutEidt.getText().toString());
-                params.put("orderCurrency", mCurrencySpinner.getSelectedItem().toString());
-                String paymentSchema = paymentSchemas[mPaymentSchemaSpinner.getSelectedItemPosition()];
-                params.put("paymentSchema", paymentSchema);
-
-                switch (paymentSchema) {
-
-                }
-
-                pay(params);
-            }
-        });
-    }
-
-    private void update() {
-        params.put("orderNum", getOrderNum());
-        mMerID.setText(params.get("merID"));
-        mOrderNumEidt.setText(params.get("orderNum"));
-        mAmoutEidt.setText(params.get("orderAmount"));
-    }
-
-
-    private void pay(final Map<String, String> params) {
-        progressDialog = ProgressDialog.show(this, "", "模拟网关获取tn...");
-
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                params.remove("signature");
-                params.put("signature", PayUtil.getSign(params, "2f2c77e3718c47cfb47a89a6fbc9d361", "MD5"));
-                //String result = HttpUtil.reqStr("http://172.30.1.103:8080/app/pay", params, HttpUtil.METHOD_POST); //本地
-                // String result = HttpUtil.reqStr("https://api.allpayx.com/app/pay", params, HttpUtil.METHOD_POST); //生产
-                // final String result = HttpUtil.reqStr("http://172.30.1.112:8080/api/unifiedorder", params, HttpUtil.METHOD_POST);//测试
-
-                final String result = HttpUtil.reqStr("https://testapi.allpayx.com/api/unifiedorder", params, HttpUtil.METHOD_POST); //生产
-
-                progressDialog.dismiss();
-                Log.i(TAG, "result=" + result);
-                String tn = JsonUtil.getParam(result, "tn");
-                if (!TextUtils.isEmpty(tn)) {
-
-                    Log.i(TAG, "tn=" + tn);
-                    AllPayEngine.pay(MainActivity.this, tn, false);
-                } else {
-                    runOnUiThread(new Runnable() {
-                        public void run() {
-                            Toast toast = Toast.makeText(
-                                    getApplicationContext(), "获取tn失败:" + result,
-                                    Toast.LENGTH_SHORT);
-                            toast.show();
-
-                        }
-                    });
-                }
-            }
-        }).start();
-
-    }
-
-
-    private String getOrderNum() {
-        Date now = new Date();
-        SimpleDateFormat spf = new SimpleDateFormat("yyyyMMddHHmmss");
-        return "ap" + spf.format(now).substring(1);
-    }
-
-
-    private String getTransTime() {
-        Date now = new Date();
-        SimpleDateFormat spf = new SimpleDateFormat("yyyyMMddHHmmss");
-        return spf.format(now);
-    }
-
-    @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) {
-
-            update();
-            String result = data.getExtras().getString("pay_result");
-            Toast toast = Toast.makeText(getApplicationContext(), result,
-                    Toast.LENGTH_SHORT);
-            toast.show();
-
-        }
-
-    }
-
-
+package com.vtpayment.plugin;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+import com.allpayx.sdk.AllPayEngine;
+import com.allpayx.sdk.constants.AllPayConst;
+import com.allpayx.sdk.util.HttpUtil;
+
+import com.vtpayment.plugin.util.Base64;
+import com.vtpayment.plugin.util.JsonUtil;
+import com.vtpayment.plugin.util.PayUtil;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class MainActivity extends AppCompatActivity {
+
+    private final String TAG = "MainActivity";
+
+    private static final String[] currency = {"CNY","USD","INR","JPY"};
+    private static String payType[];
+    private static final String[] paymentSchemas = {"APMP","WX","UP","CA"};
+
+    private ProgressDialog progressDialog;
+    Map<String, String> params = new HashMap<String, String>();
+    private EditText mAmoutEidt;
+    private EditText mOrderNumEidt;
+    private EditText mMerID;
+    private Spinner mPaymentSchemaSpinner;
+    private Spinner mCurrencySpinner;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+        payType = new String[4];
+        payType[0] = getResources().getString(R.string.pay_type_apmp);
+        payType[1] = getResources().getString(R.string.pay_type_wx);
+        payType[2] = getResources().getString(R.string.pay_type_up);
+        payType[3] = getResources().getString(R.string.pay_type_ca);
+        // 通用参数
+
+        params.put("version", "VER000000005");
+        params.put("charSet", "UTF-8");
+        params.put("transType", "PURC");
+        params.put("orderNum", getOrderNum());
+        params.put("orderAmount", "0.1");
+        params.put("orderCurrency", "CNY");
+        params.put("frontURL", "nil");
+        params.put("merReserve", "一个又大又圆的苹果");
+        params.put("acqID", "99020344");
+        params.put("backURL", "https://testapi.allpayx.com/test");
+        params.put("merID", "000000000000015");
+        params.put("paymentSchema", "APMP");
+        params.put("goodsInfo", "一个又大又圆的苹果");
+        params.put("transTime", getTransTime());
+        params.put("signType", "MD5");
+        params.put("tradeFrom", "APP");
+
+        String detailInfo = "[{\"goods_name\":\"一个又大又圆的苹果\",\"quantity\":\"1\"},{\"goods_name\":\"华为P20 plus\",\"quantity\":\"4\"}]";
+        try {
+            detailInfo = Base64.encodeBytes(detailInfo.getBytes("utf-8"));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        params.put("detailInfo", detailInfo);
+
+
+        initLayout();
+        initListener();
+        update();
+
+    }
+
+    private void initLayout() {
+        mAmoutEidt = (EditText) findViewById(R.id.edit_amount);
+        mOrderNumEidt = (EditText) findViewById(R.id.edit_ordernum);
+        mMerID = (EditText) findViewById(R.id.edit_merid);
+        ArrayAdapter<String> currencyArrayAdapter = new ArrayAdapter<String>(
+                this, android.R.layout.simple_spinner_item, currency);
+        currencyArrayAdapter
+                .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+
+        mCurrencySpinner = (Spinner) findViewById(R.id.spinner_currency);
+        mCurrencySpinner.setAdapter(currencyArrayAdapter);
+
+        ArrayAdapter<String> paymentSchemaArrayAdapter = new ArrayAdapter<String>(
+                this, android.R.layout.simple_spinner_item, payType);
+        paymentSchemaArrayAdapter
+                .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+
+        mPaymentSchemaSpinner = (Spinner) findViewById(R.id.spinner_paymentschema);
+        mPaymentSchemaSpinner.setAdapter(paymentSchemaArrayAdapter);
+
+    }
+
+    private void initListener() {
+        findViewById(R.id.submit).setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View v) {
+                params.put("orderAmount", mAmoutEidt.getText().toString());
+                params.put("orderCurrency", mCurrencySpinner.getSelectedItem().toString());
+                String paymentSchema = paymentSchemas[mPaymentSchemaSpinner.getSelectedItemPosition()];
+                params.put("paymentSchema", paymentSchema);
+
+                switch (paymentSchema) {
+
+                }
+
+                pay(params);
+            }
+        });
+    }
+
+    private void update() {
+        params.put("orderNum", getOrderNum());
+        mMerID.setText(params.get("merID"));
+        mOrderNumEidt.setText(params.get("orderNum"));
+        mAmoutEidt.setText(params.get("orderAmount"));
+    }
+
+
+    private void pay(final Map<String, String> params) {
+        progressDialog = ProgressDialog.show(this, "", "模拟网关获取tn...");
+
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                params.remove("signature");
+                params.put("signature", PayUtil.getSign(params, "2f2c77e3718c47cfb47a89a6fbc9d361", "MD5"));
+                //String result = HttpUtil.reqStr("http://172.30.1.103:8080/app/pay", params, HttpUtil.METHOD_POST); //本地
+                // String result = HttpUtil.reqStr("https://api.allpayx.com/app/pay", params, HttpUtil.METHOD_POST); //生产
+                // final String result = HttpUtil.reqStr("http://172.30.1.112:8080/api/unifiedorder", params, HttpUtil.METHOD_POST);//测试
+
+                final String result = HttpUtil.reqStr("https://testapi.allpayx.com/api/unifiedorder", params, HttpUtil.METHOD_POST); //生产
+
+                progressDialog.dismiss();
+                Log.i(TAG, "result=" + result);
+                String tn = JsonUtil.getParam(result, "tn");
+                if (!TextUtils.isEmpty(tn)) {
+
+                    Log.i(TAG, "tn=" + tn);
+                    AllPayEngine.pay(MainActivity.this, tn, false);
+                } else {
+                    runOnUiThread(new Runnable() {
+                        public void run() {
+                            Toast toast = Toast.makeText(
+                                    getApplicationContext(), "获取tn失败:" + result,
+                                    Toast.LENGTH_SHORT);
+                            toast.show();
+
+                        }
+                    });
+                }
+            }
+        }).start();
+
+    }
+
+
+    private String getOrderNum() {
+        Date now = new Date();
+        SimpleDateFormat spf = new SimpleDateFormat("yyyyMMddHHmmss");
+        return "ap" + spf.format(now).substring(1);
+    }
+
+
+    private String getTransTime() {
+        Date now = new Date();
+        SimpleDateFormat spf = new SimpleDateFormat("yyyyMMddHHmmss");
+        return spf.format(now);
+    }
+
+    @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) {
+
+            update();
+            String result = data.getExtras().getString("pay_result");
+            Toast toast = Toast.makeText(getApplicationContext(), result,
+                    Toast.LENGTH_SHORT);
+            toast.show();
+
+        }
+
+    }
+
+
 }

+ 53 - 53
v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/util/EncoderUtil.java

@@ -1,53 +1,53 @@
-package com.vtpayment.plugin.util;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-public class EncoderUtil {
-	public static String Encrypt(String strSrc,String encName) {
-		//parameter strSrc is a string will be encrypted,
-		//parameter encName is the algorithm name will be used.
-		//encName dafault to "MD5"
-		MessageDigest md=null;
-		String strDes=null;
-
-		byte[] bt=strSrc.getBytes();
-		try {
-		if (encName==null||encName.equals("")) {
-		encName="MD5";
-		}
-		md=MessageDigest.getInstance(encName);
-		md.update(bt);
-		strDes=bytes2Hex(md.digest()); //to HexString
-		}
-		catch (NoSuchAlgorithmException e) {
-		System.out.println("Invalid algorithm.");
-		return null;
-		}
-		return strDes;
-		}
-
-		private static String bytes2Hex(byte[]bts) {
-		String des="";
-		String tmp=null;
-		for (int i=0;i<bts.length;i++) {
-		tmp=(Integer.toHexString(bts[i] & 0xFF));
-		if (tmp.length()==1) {
-		des+="0";
-		}
-		des+=tmp;
-		}
-		return des;
-		}
-
-//		public static void main(String[]args) {
-//		TestEncrypt te=new TestEncrypt();
-//		String strSrc="可以加密汉字.Oh,and english";
-//		System.out.println("Source String:"+strSrc);
-//		System.out.println("Encrypted String:");
-//		System.out.println("Use Def:"+te.Encrypt(strSrc,null));
-//		System.out.println("Use MD5:"+te.Encrypt(strSrc,"MD5"));
-//		System.out.println("Use SHA:"+te.Encrypt(strSrc,"SHA-1"));
-//		System.out.println("Use SHA-256:"+te.Encrypt(strSrc,"SHA-256"));
-//		}
-}
+package com.vtpayment.plugin.util;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class EncoderUtil {
+	public static String Encrypt(String strSrc,String encName) {
+		//parameter strSrc is a string will be encrypted,
+		//parameter encName is the algorithm name will be used.
+		//encName dafault to "MD5"
+		MessageDigest md=null;
+		String strDes=null;
+
+		byte[] bt=strSrc.getBytes();
+		try {
+		if (encName==null||encName.equals("")) {
+		encName="MD5";
+		}
+		md=MessageDigest.getInstance(encName);
+		md.update(bt);
+		strDes=bytes2Hex(md.digest()); //to HexString
+		}
+		catch (NoSuchAlgorithmException e) {
+		System.out.println("Invalid algorithm.");
+		return null;
+		}
+		return strDes;
+		}
+
+		private static String bytes2Hex(byte[]bts) {
+		String des="";
+		String tmp=null;
+		for (int i=0;i<bts.length;i++) {
+		tmp=(Integer.toHexString(bts[i] & 0xFF));
+		if (tmp.length()==1) {
+		des+="0";
+		}
+		des+=tmp;
+		}
+		return des;
+		}
+
+//		public static void main(String[]args) {
+//		TestEncrypt te=new TestEncrypt();
+//		String strSrc="可以加密汉字.Oh,and english";
+//		System.out.println("Source String:"+strSrc);
+//		System.out.println("Encrypted String:");
+//		System.out.println("Use Def:"+te.Encrypt(strSrc,null));
+//		System.out.println("Use MD5:"+te.Encrypt(strSrc,"MD5"));
+//		System.out.println("Use SHA:"+te.Encrypt(strSrc,"SHA-1"));
+//		System.out.println("Use SHA-256:"+te.Encrypt(strSrc,"SHA-256"));
+//		}
+}

+ 22 - 22
v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/util/JsonUtil.java

@@ -1,22 +1,22 @@
-package com.vtpayment.plugin.util;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-
-public class JsonUtil {
-public static String getParam(String jsonString,String key){
-	String value="";
-	JSONObject jsonObject=null;
-	try {
-		jsonObject = new JSONObject(jsonString);
-	} catch (JSONException e) {
-		// TODO Auto-generated catch block
-		e.printStackTrace();
-	}
-	if(jsonObject!=null){
-		value=jsonObject.optString(key);
-	}
-	return value;
-}
-}
+package com.vtpayment.plugin.util;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+
+public class JsonUtil {
+public static String getParam(String jsonString,String key){
+	String value="";
+	JSONObject jsonObject=null;
+	try {
+		jsonObject = new JSONObject(jsonString);
+	} catch (JSONException e) {
+		// TODO Auto-generated catch block
+		e.printStackTrace();
+	}
+	if(jsonObject!=null){
+		value=jsonObject.optString(key);
+	}
+	return value;
+}
+}

+ 30 - 30
v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/util/PayOrder.java

@@ -1,30 +1,30 @@
-package com.vtpayment.plugin.util;
-
-import java.io.Serializable;
-
-public class PayOrder implements Serializable {
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-	public String orderNum;
-	public String orderAmount;
-	public String orderCurrency;
-	public String backURL;
-	public String merID;
-	public String secretKey;
-	public String  paymentSchema;
-	public String  version;
-	public String charSet;
-	public String transType;
-	public String frontURL;
-	public String merReserve;
-	public String acqID;
-	public String transTime;
-	public String OrderDesc;
-	public String signType;
-	public String signature;
-	public String language;
-	public String customerId;
-	
-}
+package com.vtpayment.plugin.util;
+
+import java.io.Serializable;
+
+public class PayOrder implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	public String orderNum;
+	public String orderAmount;
+	public String orderCurrency;
+	public String backURL;
+	public String merID;
+	public String secretKey;
+	public String  paymentSchema;
+	public String  version;
+	public String charSet;
+	public String transType;
+	public String frontURL;
+	public String merReserve;
+	public String acqID;
+	public String transTime;
+	public String OrderDesc;
+	public String signType;
+	public String signature;
+	public String language;
+	public String customerId;
+	
+}

+ 64 - 64
v5/android/android_sdk/Demo/app/src/main/java/com/vtpayment/plugin/util/PayUtil.java

@@ -1,64 +1,64 @@
-package com.vtpayment.plugin.util;
-
-import android.util.Log;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * Created by bensonzhang on 2017/12/12.
- */
-
-public class PayUtil {
-
-
-
-    public static String getSign(Map<String,String> params,String key,String signType) {
-        Map<String, String> resultMap = sortMapByKey(params);  //按Key进行排序
-        StringBuilder sb = new StringBuilder();
-        for (Map.Entry<String, String> entry : resultMap.entrySet()) {
-            sb.append(entry.getKey());
-            sb.append('=');
-            sb.append(entry.getValue());
-            sb.append('&');
-        }
-        sb.deleteCharAt(sb.lastIndexOf("&"));
-        sb.append(key);
-        Log.i("opp",sb.toString());
-        String sign =EncoderUtil.Encrypt(sb.toString(), signType) ;
-        Log.i("opp",sign);
-        return sign;
-    }
-
-    /**
-     * 使用 Map按key进行排序
-     * @param map
-     * @return
-     */
-    public static Map<String, String> sortMapByKey(Map<String, String> map) {
-        if (map == null || map.isEmpty()) {
-            return null;
-        }
-
-        Map<String, String> sortMap = new TreeMap<>(
-                new MapKeyComparator());
-
-        sortMap.putAll(map);
-
-        return sortMap;
-    }
-
-
-  static   class MapKeyComparator implements Comparator<String> {
-
-        @Override
-        public int compare(String str1, String str2) {
-
-            return str1.compareTo(str2);
-        }
-    }
-
-
-}
+package com.vtpayment.plugin.util;
+
+import android.util.Log;
+
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * Created by bensonzhang on 2017/12/12.
+ */
+
+public class PayUtil {
+
+
+
+    public static String getSign(Map<String,String> params,String key,String signType) {
+        Map<String, String> resultMap = sortMapByKey(params);  //按Key进行排序
+        StringBuilder sb = new StringBuilder();
+        for (Map.Entry<String, String> entry : resultMap.entrySet()) {
+            sb.append(entry.getKey());
+            sb.append('=');
+            sb.append(entry.getValue());
+            sb.append('&');
+        }
+        sb.deleteCharAt(sb.lastIndexOf("&"));
+        sb.append(key);
+        Log.i("opp",sb.toString());
+        String sign =EncoderUtil.Encrypt(sb.toString(), signType) ;
+        Log.i("opp",sign);
+        return sign;
+    }
+
+    /**
+     * 使用 Map按key进行排序
+     * @param map
+     * @return
+     */
+    public static Map<String, String> sortMapByKey(Map<String, String> map) {
+        if (map == null || map.isEmpty()) {
+            return null;
+        }
+
+        Map<String, String> sortMap = new TreeMap<>(
+                new MapKeyComparator());
+
+        sortMap.putAll(map);
+
+        return sortMap;
+    }
+
+
+  static   class MapKeyComparator implements Comparator<String> {
+
+        @Override
+        public int compare(String str1, String str2) {
+
+            return str1.compareTo(str2);
+        }
+    }
+
+
+}

+ 18 - 18
v5/android/android_sdk/Demo/app/src/main/res/drawable/buy_button_bg.xml

@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-  <item android:state_pressed="false"  > 
-    <shape>
-        <stroke android:width="2px" android:color="#DDA755" /><!--边框颜色-->
-        <solid android:color="#DDA755" /><!--填充色-->
-        <corners android:radius="4dp" />
-    </shape>
-  </item>
-  
-    <item  android:state_pressed="true" > 
-    <shape>
-        <stroke android:width="2px" android:color="#BB8533" /><!--边框颜色-->
-        <solid android:color="#BB8533" /><!--填充色-->
-        <corners android:radius="4dp" />
-    </shape>
-  </item>
-</selector>
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+  <item android:state_pressed="false"  > 
+    <shape>
+        <stroke android:width="2px" android:color="#DDA755" /><!--边框颜色-->
+        <solid android:color="#DDA755" /><!--填充色-->
+        <corners android:radius="4dp" />
+    </shape>
+  </item>
+  
+    <item  android:state_pressed="true" > 
+    <shape>
+        <stroke android:width="2px" android:color="#BB8533" /><!--边框颜色-->
+        <solid android:color="#BB8533" /><!--填充色-->
+        <corners android:radius="4dp" />
+    </shape>
+  </item>
+</selector>

+ 242 - 242
v5/android/android_sdk/Demo/app/src/main/res/layout/activity_main.xml

@@ -1,243 +1,243 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    tools:context="com.vtpayment.plugin.MainActivity" >
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="60dp"
-        android:background="#DDA755" >
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="AllPay演示Demo"
-            android:layout_centerInParent="true"
-            android:textStyle="bold"
-            android:textColor="#ffffff"
-            />
-    </RelativeLayout>
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="30dp"
-        >
-
-
-
-        <TextView
-            android:id="@+id/text_merid"
-            android:layout_width="80dp"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="30dp"
-            android:text="商户号:"
-            android:textSize="15sp"
-            android:textStyle="bold"
-            android:textColor="#000000"
-            android:layout_centerVertical="true"
-            />
-
-
-        <EditText
-            android:id="@+id/edit_merid"
-            android:layout_width="180dp"
-            android:layout_height="40dp"
-            android:layout_marginLeft="20dp"
-            android:layout_toRightOf="@id/text_merid"
-            android:textSize="15sp"
-            android:textStyle="bold"
-            android:textColor="#888888"
-            android:inputType="numberDecimal"
-            android:enabled="false"
-            android:focusable="false"
-            android:layout_centerVertical="true"
-            />
-    </RelativeLayout>
-
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="10dp"
-        >
-
-
-
-        <TextView
-            android:id="@+id/text_ordernum"
-            android:layout_width="80dp"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="30dp"
-            android:text="订单号:"
-            android:textSize="15sp"
-            android:textStyle="bold"
-            android:textColor="#000000"
-            android:layout_centerVertical="true"
-            />
-
-
-        <EditText
-            android:id="@+id/edit_ordernum"
-            android:layout_width="180dp"
-            android:layout_height="40dp"
-            android:layout_marginLeft="20dp"
-            android:layout_toRightOf="@id/text_ordernum"
-            android:textSize="15sp"
-            android:textStyle="bold"
-            android:textColor="#888888"
-            android:inputType="numberDecimal"
-            android:enabled="false"
-            android:focusable="false"
-            android:layout_centerVertical="true"
-            />
-    </RelativeLayout>
-
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="10dp"
-        >
-
-        <TextView
-            android:id="@+id/text_amount"
-            android:layout_width="80dp"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="30dp"
-            android:text="订单金额:"
-            android:textSize="15sp"
-            android:textStyle="bold"
-            android:textColor="#000000"
-            android:layout_centerVertical="true"
-            />
-
-
-        <EditText
-            android:id="@+id/edit_amount"
-            android:layout_width="180dp"
-            android:layout_height="40dp"
-            android:layout_marginLeft="20dp"
-            android:layout_toRightOf="@id/text_amount"
-            android:textSize="15sp"
-            android:textStyle="bold"
-            android:textColor="#000000"
-            android:inputType="numberDecimal"
-            android:layout_centerVertical="true"
-            />
-    </RelativeLayout>
-
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="10dp"
-        >
-
-        <TextView
-            android:id="@+id/text_currency"
-            android:layout_width="80dp"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="30dp"
-            android:text="币种:"
-            android:textSize="15sp"
-            android:textStyle="bold"
-            android:textColor="#000000"
-            android:layout_centerVertical="true"
-            />
-
-
-        <Spinner android:id="@+id/spinner_currency"
-            android:layout_width="180dp"
-            android:layout_height="35dp"
-            android:layout_toRightOf="@id/text_currency"
-            android:layout_marginLeft="20dp"
-            android:paddingLeft="5dp"
-            android:background="#ffffff"
-            >
-
-        </Spinner>
-    </RelativeLayout>
-
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="10dp"
-        >
-
-        <TextView
-            android:id="@+id/text_paymentschema"
-            android:layout_width="80dp"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="30dp"
-            android:text="支付渠道:"
-            android:textSize="15sp"
-            android:textStyle="bold"
-            android:textColor="#000000"
-            android:layout_centerVertical="true"
-            />
-
-
-        <Spinner android:id="@+id/spinner_paymentschema"
-            android:layout_width="180dp"
-            android:layout_height="35dp"
-            android:layout_toRightOf="@id/text_paymentschema"
-            android:layout_marginLeft="20dp"
-            android:paddingLeft="5dp"
-            android:background="#ffffff"
-            >
-
-        </Spinner>
-    </RelativeLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginTop="100dp"
-        android:orientation="vertical"
-        android:gravity="center_horizontal"
-        >
-
-        <Button
-            android:id="@+id/submit"
-            android:layout_width="200dp"
-            android:layout_height="50dp"
-            android:layout_margin="10dp"
-            android:text="提交订单"
-            android:background="@drawable/buy_button_bg"
-
-            />
-
-        <Button
-            android:id="@+id/union_pay"
-            android:layout_width="100dp"
-            android:layout_height="wrap_content"
-            android:layout_margin="10dp"
-            android:text="UnionPay"
-            android:visibility="gone"
-            />
-
-        <Button
-            android:id="@+id/ali_pay"
-            android:layout_width="100dp"
-            android:layout_height="wrap_content"
-            android:layout_margin="10dp"
-            android:text="AliPay"
-            android:visibility="gone"
-            />
-
-        <Button
-            android:id="@+id/wx_pay"
-            android:layout_width="100dp"
-            android:layout_height="wrap_content"
-            android:layout_margin="10dp"
-            android:text="WeChat Pay"
-            android:visibility="gone"
-            />
-
-    </LinearLayout>
-
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    tools:context="com.vtpayment.plugin.MainActivity" >
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="60dp"
+        android:background="#DDA755" >
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="AllPay演示Demo"
+            android:layout_centerInParent="true"
+            android:textStyle="bold"
+            android:textColor="#ffffff"
+            />
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="30dp"
+        >
+
+
+
+        <TextView
+            android:id="@+id/text_merid"
+            android:layout_width="80dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="30dp"
+            android:text="商户号:"
+            android:textSize="15sp"
+            android:textStyle="bold"
+            android:textColor="#000000"
+            android:layout_centerVertical="true"
+            />
+
+
+        <EditText
+            android:id="@+id/edit_merid"
+            android:layout_width="180dp"
+            android:layout_height="40dp"
+            android:layout_marginLeft="20dp"
+            android:layout_toRightOf="@id/text_merid"
+            android:textSize="15sp"
+            android:textStyle="bold"
+            android:textColor="#888888"
+            android:inputType="numberDecimal"
+            android:enabled="false"
+            android:focusable="false"
+            android:layout_centerVertical="true"
+            />
+    </RelativeLayout>
+
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        >
+
+
+
+        <TextView
+            android:id="@+id/text_ordernum"
+            android:layout_width="80dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="30dp"
+            android:text="订单号:"
+            android:textSize="15sp"
+            android:textStyle="bold"
+            android:textColor="#000000"
+            android:layout_centerVertical="true"
+            />
+
+
+        <EditText
+            android:id="@+id/edit_ordernum"
+            android:layout_width="180dp"
+            android:layout_height="40dp"
+            android:layout_marginLeft="20dp"
+            android:layout_toRightOf="@id/text_ordernum"
+            android:textSize="15sp"
+            android:textStyle="bold"
+            android:textColor="#888888"
+            android:inputType="numberDecimal"
+            android:enabled="false"
+            android:focusable="false"
+            android:layout_centerVertical="true"
+            />
+    </RelativeLayout>
+
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        >
+
+        <TextView
+            android:id="@+id/text_amount"
+            android:layout_width="80dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="30dp"
+            android:text="订单金额:"
+            android:textSize="15sp"
+            android:textStyle="bold"
+            android:textColor="#000000"
+            android:layout_centerVertical="true"
+            />
+
+
+        <EditText
+            android:id="@+id/edit_amount"
+            android:layout_width="180dp"
+            android:layout_height="40dp"
+            android:layout_marginLeft="20dp"
+            android:layout_toRightOf="@id/text_amount"
+            android:textSize="15sp"
+            android:textStyle="bold"
+            android:textColor="#000000"
+            android:inputType="numberDecimal"
+            android:layout_centerVertical="true"
+            />
+    </RelativeLayout>
+
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        >
+
+        <TextView
+            android:id="@+id/text_currency"
+            android:layout_width="80dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="30dp"
+            android:text="币种:"
+            android:textSize="15sp"
+            android:textStyle="bold"
+            android:textColor="#000000"
+            android:layout_centerVertical="true"
+            />
+
+
+        <Spinner android:id="@+id/spinner_currency"
+            android:layout_width="180dp"
+            android:layout_height="35dp"
+            android:layout_toRightOf="@id/text_currency"
+            android:layout_marginLeft="20dp"
+            android:paddingLeft="5dp"
+            android:background="#ffffff"
+            >
+
+        </Spinner>
+    </RelativeLayout>
+
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        >
+
+        <TextView
+            android:id="@+id/text_paymentschema"
+            android:layout_width="80dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="30dp"
+            android:text="支付渠道:"
+            android:textSize="15sp"
+            android:textStyle="bold"
+            android:textColor="#000000"
+            android:layout_centerVertical="true"
+            />
+
+
+        <Spinner android:id="@+id/spinner_paymentschema"
+            android:layout_width="180dp"
+            android:layout_height="35dp"
+            android:layout_toRightOf="@id/text_paymentschema"
+            android:layout_marginLeft="20dp"
+            android:paddingLeft="5dp"
+            android:background="#ffffff"
+            >
+
+        </Spinner>
+    </RelativeLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginTop="100dp"
+        android:orientation="vertical"
+        android:gravity="center_horizontal"
+        >
+
+        <Button
+            android:id="@+id/submit"
+            android:layout_width="200dp"
+            android:layout_height="50dp"
+            android:layout_margin="10dp"
+            android:text="提交订单"
+            android:background="@drawable/buy_button_bg"
+
+            />
+
+        <Button
+            android:id="@+id/union_pay"
+            android:layout_width="100dp"
+            android:layout_height="wrap_content"
+            android:layout_margin="10dp"
+            android:text="UnionPay"
+            android:visibility="gone"
+            />
+
+        <Button
+            android:id="@+id/ali_pay"
+            android:layout_width="100dp"
+            android:layout_height="wrap_content"
+            android:layout_margin="10dp"
+            android:text="AliPay"
+            android:visibility="gone"
+            />
+
+        <Button
+            android:id="@+id/wx_pay"
+            android:layout_width="100dp"
+            android:layout_height="wrap_content"
+            android:layout_margin="10dp"
+            android:text="WeChat Pay"
+            android:visibility="gone"
+            />
+
+    </LinearLayout>
+
 </LinearLayout>

+ 6 - 6
v5/android/android_sdk/Demo/app/src/main/res/values/colors.xml

@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <color name="colorPrimary">#3F51B5</color>
-    <color name="colorPrimaryDark">#303F9F</color>
-    <color name="colorAccent">#FF4081</color>
-</resources>
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorPrimary">#3F51B5</color>
+    <color name="colorPrimaryDark">#303F9F</color>
+    <color name="colorAccent">#FF4081</color>
+</resources>

+ 13 - 13
v5/android/android_sdk/Demo/app/src/main/res/values/strings.xml

@@ -1,13 +1,13 @@
-<resources>
-    <string name="app_name">Demo</string>
-    <string name="hello_world">Hello world!</string>
-    <string name="action_settings">Settings</string>
-    <string name="pay_type_yl">银联(易联)</string>
-    <string name="pay_type_apmp">支付宝</string>
-    <string name="pay_type_wx">微信</string>
-    <string name="pay_type_up">银联</string>
-    <string name="pay_type_mup">银联信用卡</string>
-    <string name="pay_type_dp">国际卡</string>
-    <string name="pay_type_eb">Easebuzz</string>
-    <string name="pay_type_ca">CCAvenue</string>
-</resources>
+<resources>
+    <string name="app_name">Demo</string>
+    <string name="hello_world">Hello world!</string>
+    <string name="action_settings">Settings</string>
+    <string name="pay_type_yl">银联(易联)</string>
+    <string name="pay_type_apmp">支付宝</string>
+    <string name="pay_type_wx">微信</string>
+    <string name="pay_type_up">银联</string>
+    <string name="pay_type_mup">银联信用卡</string>
+    <string name="pay_type_dp">国际卡</string>
+    <string name="pay_type_eb">Easebuzz</string>
+    <string name="pay_type_ca">CCAvenue</string>
+</resources>

+ 11 - 11
v5/android/android_sdk/Demo/app/src/main/res/values/styles.xml

@@ -1,11 +1,11 @@
-<resources>
-
-    <!-- Base application theme. -->
-    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
-        <!-- Customize your theme here. -->
-        <item name="colorPrimary">@color/colorPrimary</item>
-        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
-        <item name="colorAccent">@color/colorAccent</item>
-    </style>
-
-</resources>
+<resources>
+
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+</resources>

+ 16 - 16
v5/android/android_sdk/Demo/app/src/test/java/com/vtpayment/plugin/ExampleUnitTest.java

@@ -1,17 +1,17 @@
-package com.vtpayment.plugin;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() throws Exception {
-        assertEquals(4, 2 + 2);
-    }
+package com.vtpayment.plugin;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+public class ExampleUnitTest {
+    @Test
+    public void addition_isCorrect() throws Exception {
+        assertEquals(4, 2 + 2);
+    }
 }

+ 24 - 24
v5/android/android_sdk/Demo/build.gradle

@@ -1,24 +1,24 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
-    repositories {
-        jcenter()
-    }
-    dependencies {
-        classpath 'com.android.tools.build:gradle:2.2.3'
-
-        // NOTE: Do not place your application dependencies here; they belong
-        // in the individual module build.gradle files
-    }
-}
-
-allprojects {
-    repositories {
-        jcenter()
-
-    }
-}
-
-task clean(type: Delete) {
-    delete rootProject.buildDir
-}
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+    repositories {
+        jcenter()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:2.2.3'
+
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+    }
+}
+
+allprojects {
+    repositories {
+        jcenter()
+
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}

+ 17 - 17
v5/android/android_sdk/Demo/gradle.properties

@@ -1,17 +1,17 @@
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true

+ 6 - 6
v5/android/android_sdk/Demo/gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
-#Tue Dec 12 16:12:26 CST 2017
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+#Tue Dec 12 16:12:26 CST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

+ 160 - 160
v5/android/android_sdk/Demo/gradlew

@@ -1,160 +1,160 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-##  Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
-    echo "$*"
-}
-
-die ( ) {
-    echo
-    echo "$*"
-    echo
-    exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
-  CYGWIN* )
-    cygwin=true
-    ;;
-  Darwin* )
-    darwin=true
-    ;;
-  MINGW* )
-    msys=true
-    ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
-    ls=`ls -ld "$PRG"`
-    link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '/.*' > /dev/null; then
-        PRG="$link"
-    else
-        PRG=`dirname "$PRG"`"/$link"
-    fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
-    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
-        # IBM's JDK on AIX uses strange locations for the executables
-        JAVACMD="$JAVA_HOME/jre/sh/java"
-    else
-        JAVACMD="$JAVA_HOME/bin/java"
-    fi
-    if [ ! -x "$JAVACMD" ] ; then
-        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-    fi
-else
-    JAVACMD="java"
-    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
-    MAX_FD_LIMIT=`ulimit -H -n`
-    if [ $? -eq 0 ] ; then
-        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
-            MAX_FD="$MAX_FD_LIMIT"
-        fi
-        ulimit -n $MAX_FD
-        if [ $? -ne 0 ] ; then
-            warn "Could not set maximum file descriptor limit: $MAX_FD"
-        fi
-    else
-        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
-    fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
-    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
-    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
-    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-    JAVACMD=`cygpath --unix "$JAVACMD"`
-
-    # We build the pattern for arguments to be converted via cygpath
-    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
-    SEP=""
-    for dir in $ROOTDIRSRAW ; do
-        ROOTDIRS="$ROOTDIRS$SEP$dir"
-        SEP="|"
-    done
-    OURCYGPATTERN="(^($ROOTDIRS))"
-    # Add a user-defined pattern to the cygpath arguments
-    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
-        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
-    fi
-    # Now convert the arguments - kludge to limit ourselves to /bin/sh
-    i=0
-    for arg in "$@" ; do
-        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
-        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
-
-        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
-            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
-        else
-            eval `echo args$i`="\"$arg\""
-        fi
-        i=$((i+1))
-    done
-    case $i in
-        (0) set -- ;;
-        (1) set -- "$args0" ;;
-        (2) set -- "$args0" "$args1" ;;
-        (3) set -- "$args0" "$args1" "$args2" ;;
-        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
-        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
-        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
-        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
-        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
-        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
-    esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
-    JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+#!/usr/bin/env bash
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+    echo "$*"
+}
+
+die ( ) {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+    JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

+ 1 - 1
v5/android/android_sdk/Demo/settings.gradle

@@ -1 +1 @@
-include ':app'
+include ':app'

+ 212 - 212
v5/ios/iOS_Integration_Specification_CH.md

@@ -1,212 +1,212 @@
-# iOS端控件支付产品接口规范文档V5.0.0
-
-[上海偶可贝网络科技有限公司](https://www.allpayx.com)
-
-* 版本信息:中文 V5.0.0
-* 更新时间:2019年4月
-
-## 1.概述
-
-AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“SDK”),以帮助客户实现快速、安全、集中式的接入支付渠道。
-
-## 2.交易流程 
-  ![image](https://git.allpayx.com/OpenAPI/b2c/raw/master/images/moble_sdk_flowsheet.png)
-
-## 3.iOS 客户端接入步骤 
-
-### 3.1 接入说明 
-
-商户网关将订单信息发送给 AllPay 网关,由 AllPay 网关进行处理后将交易流水号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。具体请参考[AllPay网关对接文档](https://git.allpayx.com/OpenAPI/common/src/master/AllPay_Integration_Specification_CH.md)
-
-启动支付控件的接口,接口定义如下:
-
-```c
-[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
-
-//此处处理同步支付结果
-
-}];
-
-
-参数说明
-tn: 交易流水号,作为调起 sdk 支付的参数,商户从 AllPay 后台获取。 
-
-mode:测试环境为NO,生产环境为YES。
-
-scheme: 可以为任意值,推荐填写成"com.xxx.xxx"形式,有特殊配置的渠道会在渠道专属配置里面说明
-
-ViewController: 调用 SDK 时的 ViewController
-
-onResult: 接收同步结果通知
-```
-
-### 3.2 添加 SDK 包
-
-1.将 allpaysdk 下的 AllPaySDK.h,libAllPaySDK.a文件添加到项目中
-
-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.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 | 支付渠道,详见[渠道列表](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) |
-| orderNum      | 订单号 |
-| errorDetail   | 错误详情 |
-
-## 4.渠道专属配置
-
-### 4.1 WX渠道
-
-1.将allpaysdk/WXModule文件夹下的文件添加到项目中
-
-2.项目设置APPID
-   商户在微信开放平台申请开发APP应用后,微信开放平台会生成APP的唯一标识APPID。在Xcode中打开项目,设置项目属性中的URL Schemes为您的APPID,如图标红位置所示
-
-  ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/ios_wx_01.jpg)
-
-3.导入下面框架和链接库
-
-   ```objective-c
-   Security.framework
-   CoreTelephony.framework
-   SystemConfiguration.framework
-   libc++.tbd
-   libz.tbd
-   libsqlite3.tbd
-   ```
-
-4.在“Info.plist”中将要使用的 URL Schemes 列为白名单 
-
-   ```xml
-   <key>LSApplicationQueriesSchemes</key>
-   <array>
-   <string>weixin</string>
-   </array>
-   <key>NSAppTransportSecurity</key>
-   <dict>
-   <key>NSAllowsArbitraryLoads</key>
-   <true/>
-   </dict>
-   ```
-
-### 4.2 APMP渠道
-
-1.将allpaysdk/AliModule文件夹下的文件添加到项目中
-
-2.在Build Phases选项卡的Link Binary With Libraries中,增加以下依赖:
-
-   ```objective-c
-   libc++.tbd
-   libz.tbd
-   SystemConfiguration.framework
-   CoreTelephony.framework
-   QuartzCore.framework
-   CoreText.framework
-   CoreGraphics.framework
-   CFNetwork.framework
-   CoreMotion. .framework
-   ```
-
-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文件夹下的文件添加到项目中
-
-2.导入下面框架和链接库
-
-   ```objective-c
-   CFNetwork.framework
-   SystemConfiguration.framework
-   libz.tbd
-   ```
-
-3.在工程info.plist设置中添加一个URL Types回调协议,用于在支付完成后返回商户客户端。请注意URL Schemes需要是唯一的。设置的Scheme的值要和支付接口中参数scheme的值相同。
-
-4.需要在工程对应的plist文件中,添加LSApplicationQueriesSchemes。Array并加入uppaysdk、uppaywallet、uppayx1、uppayx2、uppayx3五个item 
-
-   ```xml
-   <key>LSApplicationQueriesSchemes</key> 
-   <array>
-       <string>uppaysdk</string> 
-       <string>uppaywallet</string>
-       <string>uppayx1</string> 
-       <string>uppayx2</string> 
-       <string>uppayx3</string> 
-   </array>
-   ```
-
-5.http请求设置(ats) 
-
-   在测试环境时,需要在工程对应的plist文件中添加NSAppTransportSecurity  Dictionary,并同时设置NSAllowsArbitraryLoads属性值为 YES。向App Store发布正式版本时请删除此设置。
-
-### 4.4 Apple Pay渠道
-
-1.将allpaysdk/AppleModule文件夹下的文件添加到项目中
-
-2.用 Xcode 打开 Apple Pay 功能,如下图:
-
-  ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/apple_pay_set.png)
-
-3.用户 app 判断手机是否支持 Apple Pay 功能,以及是否已加载有可用的支付卡片 
-
-   ```objective-c
-   //判读方法为:
-   if([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:@[PKPaymentNetworkChinaUnionPay]] )
-   {
-   // app 展示 Apple Pay 支付图标 
-   }
-   ```
-
-## 5.SDK下载
-
-[iOS SDK下载地址](https://git.allpayx.com/OpenAPI/common/raw/master/v5/ios/ios_sdk.zip)
-
-## 6.技术支持
-
-如果您在调试时遇到问题,请与我们联系:support@allpayx.com
+# iOS端控件支付产品接口规范文档V5.0.0
+
+[上海偶可贝网络科技有限公司](https://www.allpayx.com)
+
+* 版本信息:中文 V5.0.0
+* 更新时间:2019年4月
+
+## 1.概述
+
+AllPay 为基于移动端 APP 支付的客户提供接入插件(下文简称“SDK”),以帮助客户实现快速、安全、集中式的接入支付渠道。
+
+## 2.交易流程 
+  ![image](https://git.allpayx.com/OpenAPI/b2c/raw/master/images/moble_sdk_flowsheet.png)
+
+## 3.iOS 客户端接入步骤 
+
+### 3.1 接入说明 
+
+商户网关将订单信息发送给 AllPay 网关,由 AllPay 网关进行处理后将交易流水号,即 tn,返回给商户网关,tn 作为调起手机 app 支付控件的参数。具体请参考[AllPay网关对接文档](https://git.allpayx.com/OpenAPI/common/src/master/AllPay_Integration_Specification_CH.md)
+
+启动支付控件的接口,接口定义如下:
+
+```c
+[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
+
+//此处处理同步支付结果
+
+}];
+
+
+参数说明
+tn: 交易流水号,作为调起 sdk 支付的参数,商户从 AllPay 后台获取。 
+
+mode:测试环境为NO,生产环境为YES。
+
+scheme: 可以为任意值,推荐填写成"com.xxx.xxx"形式,有特殊配置的渠道会在渠道专属配置里面说明
+
+ViewController: 调用 SDK 时的 ViewController
+
+onResult: 接收同步结果通知
+```
+
+### 3.2 添加 SDK 包
+
+1.将 allpaysdk 下的 AllPaySDK.h,libAllPaySDK.a文件添加到项目中
+
+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.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 | 支付渠道,详见[渠道列表](https://git.allpayx.com/OpenAPI/common/src/master/paymentSchema.md) |
+| orderNum      | 订单号 |
+| errorDetail   | 错误详情 |
+
+## 4.渠道专属配置
+
+### 4.1 WX渠道
+
+1.将allpaysdk/WXModule文件夹下的文件添加到项目中
+
+2.项目设置APPID
+   商户在微信开放平台申请开发APP应用后,微信开放平台会生成APP的唯一标识APPID。在Xcode中打开项目,设置项目属性中的URL Schemes为您的APPID,如图标红位置所示
+
+  ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/ios_wx_01.jpg)
+
+3.导入下面框架和链接库
+
+   ```objective-c
+   Security.framework
+   CoreTelephony.framework
+   SystemConfiguration.framework
+   libc++.tbd
+   libz.tbd
+   libsqlite3.tbd
+   ```
+
+4.在“Info.plist”中将要使用的 URL Schemes 列为白名单 
+
+   ```xml
+   <key>LSApplicationQueriesSchemes</key>
+   <array>
+   <string>weixin</string>
+   </array>
+   <key>NSAppTransportSecurity</key>
+   <dict>
+   <key>NSAllowsArbitraryLoads</key>
+   <true/>
+   </dict>
+   ```
+
+### 4.2 APMP渠道
+
+1.将allpaysdk/AliModule文件夹下的文件添加到项目中
+
+2.在Build Phases选项卡的Link Binary With Libraries中,增加以下依赖:
+
+   ```objective-c
+   libc++.tbd
+   libz.tbd
+   SystemConfiguration.framework
+   CoreTelephony.framework
+   QuartzCore.framework
+   CoreText.framework
+   CoreGraphics.framework
+   CFNetwork.framework
+   CoreMotion. .framework
+   ```
+
+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文件夹下的文件添加到项目中
+
+2.导入下面框架和链接库
+
+   ```objective-c
+   CFNetwork.framework
+   SystemConfiguration.framework
+   libz.tbd
+   ```
+
+3.在工程info.plist设置中添加一个URL Types回调协议,用于在支付完成后返回商户客户端。请注意URL Schemes需要是唯一的。设置的Scheme的值要和支付接口中参数scheme的值相同。
+
+4.需要在工程对应的plist文件中,添加LSApplicationQueriesSchemes。Array并加入uppaysdk、uppaywallet、uppayx1、uppayx2、uppayx3五个item 
+
+   ```xml
+   <key>LSApplicationQueriesSchemes</key> 
+   <array>
+       <string>uppaysdk</string> 
+       <string>uppaywallet</string>
+       <string>uppayx1</string> 
+       <string>uppayx2</string> 
+       <string>uppayx3</string> 
+   </array>
+   ```
+
+5.http请求设置(ats) 
+
+   在测试环境时,需要在工程对应的plist文件中添加NSAppTransportSecurity  Dictionary,并同时设置NSAllowsArbitraryLoads属性值为 YES。向App Store发布正式版本时请删除此设置。
+
+### 4.4 Apple Pay渠道
+
+1.将allpaysdk/AppleModule文件夹下的文件添加到项目中
+
+2.用 Xcode 打开 Apple Pay 功能,如下图:
+
+  ![image](https://git.allpayx.com/OpenAPI/common/raw/master/images/apple_pay_set.png)
+
+3.用户 app 判断手机是否支持 Apple Pay 功能,以及是否已加载有可用的支付卡片 
+
+   ```objective-c
+   //判读方法为:
+   if([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:@[PKPaymentNetworkChinaUnionPay]] )
+   {
+   // app 展示 Apple Pay 支付图标 
+   }
+   ```
+
+## 5.SDK下载
+
+[iOS SDK下载地址](https://git.allpayx.com/OpenAPI/common/raw/master/v5/ios/ios_sdk.zip)
+
+## 6.技术支持
+
+如果您在调试时遇到问题,请与我们联系:support@allpayx.com

+ 211 - 211
v5/ios/iOS_Integration_Specification_EN.md

@@ -1,211 +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
+# 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

File diff ditekan karena terlalu besar
+ 786 - 786
v5/ios/ios_sdk/Demo/Demo.xcodeproj/project.pbxproj


+ 7 - 7
v5/ios/ios_sdk/Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
-   version = "1.0">
-   <FileRef
-      location = "self:">
-   </FileRef>
-</Workspace>
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:">
+   </FileRef>
+</Workspace>

+ 8 - 8
v5/ios/ios_sdk/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>IDEDidComputeMac32BitWarning</key>
-	<true/>
-</dict>
-</plist>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IDEDidComputeMac32BitWarning</key>
+	<true/>
+</dict>
+</plist>

+ 5 - 5
v5/ios/ios_sdk/Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/bensonzhang.xcuserdatad/IDEFindNavigatorScopes.plist

@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<array/>
-</plist>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<array/>
+</plist>

+ 111 - 111
v5/ios/ios_sdk/Demo/Demo.xcodeproj/xcuserdata/bensonzhang.xcuserdatad/xcschemes/Demo.xcscheme

@@ -1,111 +1,111 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "0940"
-   version = "1.3">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "8139EE921BFEE97F0061D7EA"
-               BuildableName = "Demo.app"
-               BlueprintName = "Demo"
-               ReferencedContainer = "container:Demo.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      shouldUseLaunchSchemeArgsEnv = "YES">
-      <Testables>
-         <TestableReference
-            skipped = "NO">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "8139EEAB1BFEE9800061D7EA"
-               BuildableName = "DemoTests.xctest"
-               BlueprintName = "DemoTests"
-               ReferencedContainer = "container:Demo.xcodeproj">
-            </BuildableReference>
-         </TestableReference>
-         <TestableReference
-            skipped = "NO">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "8139EEB61BFEE9800061D7EA"
-               BuildableName = "DemoUITests.xctest"
-               BlueprintName = "DemoUITests"
-               ReferencedContainer = "container:Demo.xcodeproj">
-            </BuildableReference>
-         </TestableReference>
-      </Testables>
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "8139EE921BFEE97F0061D7EA"
-            BuildableName = "Demo.app"
-            BlueprintName = "Demo"
-            ReferencedContainer = "container:Demo.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </TestAction>
-   <LaunchAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      launchStyle = "0"
-      useCustomWorkingDirectory = "NO"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      debugServiceExtension = "internal"
-      allowLocationSimulation = "YES">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "8139EE921BFEE97F0061D7EA"
-            BuildableName = "Demo.app"
-            BlueprintName = "Demo"
-            ReferencedContainer = "container:Demo.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </LaunchAction>
-   <ProfileAction
-      buildConfiguration = "Release"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      debugDocumentVersioning = "YES">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "8139EE921BFEE97F0061D7EA"
-            BuildableName = "Demo.app"
-            BlueprintName = "Demo"
-            ReferencedContainer = "container:Demo.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0940"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "8139EE921BFEE97F0061D7EA"
+               BuildableName = "Demo.app"
+               BlueprintName = "Demo"
+               ReferencedContainer = "container:Demo.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "8139EEAB1BFEE9800061D7EA"
+               BuildableName = "DemoTests.xctest"
+               BlueprintName = "DemoTests"
+               ReferencedContainer = "container:Demo.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "8139EEB61BFEE9800061D7EA"
+               BuildableName = "DemoUITests.xctest"
+               BlueprintName = "DemoUITests"
+               ReferencedContainer = "container:Demo.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "8139EE921BFEE97F0061D7EA"
+            BuildableName = "Demo.app"
+            BlueprintName = "Demo"
+            ReferencedContainer = "container:Demo.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "8139EE921BFEE97F0061D7EA"
+            BuildableName = "Demo.app"
+            BlueprintName = "Demo"
+            ReferencedContainer = "container:Demo.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "8139EE921BFEE97F0061D7EA"
+            BuildableName = "Demo.app"
+            BlueprintName = "Demo"
+            ReferencedContainer = "container:Demo.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 32 - 32
v5/ios/ios_sdk/Demo/Demo.xcodeproj/xcuserdata/bensonzhang.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>SchemeUserState</key>
-	<dict>
-		<key>Demo.xcscheme</key>
-		<dict>
-			<key>orderHint</key>
-			<integer>0</integer>
-		</dict>
-	</dict>
-	<key>SuppressBuildableAutocreation</key>
-	<dict>
-		<key>8139EE921BFEE97F0061D7EA</key>
-		<dict>
-			<key>primary</key>
-			<true/>
-		</dict>
-		<key>8139EEAB1BFEE9800061D7EA</key>
-		<dict>
-			<key>primary</key>
-			<true/>
-		</dict>
-		<key>8139EEB61BFEE9800061D7EA</key>
-		<dict>
-			<key>primary</key>
-			<true/>
-		</dict>
-	</dict>
-</dict>
-</plist>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>SchemeUserState</key>
+	<dict>
+		<key>Demo.xcscheme</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>0</integer>
+		</dict>
+	</dict>
+	<key>SuppressBuildableAutocreation</key>
+	<dict>
+		<key>8139EE921BFEE97F0061D7EA</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+		<key>8139EEAB1BFEE9800061D7EA</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+		<key>8139EEB61BFEE9800061D7EA</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+	</dict>
+</dict>
+</plist>

+ 38 - 38
v5/ios/ios_sdk/Demo/Demo/AllPayRequest.h

@@ -1,38 +1,38 @@
-//
-//  UPRequest.h
-//  VTPayUPDemo
-//
-//  Created by 司瑞华 on 15/7/29.
-//  Copyright (c) 2015年 __VTPayment__. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-typedef void (^FinishBlock)(id finResponseData);
-typedef void (^FailedBlock)(id faiResponseData);
-
-@interface AllPayRequest : NSObject
-
-@property (strong, nonatomic) NSMutableData      *resultData;
-@property (strong, nonatomic) FinishBlock        finishBlock;
-@property (strong, nonatomic) FailedBlock        failedBlock;
-
-/**
- *  这个是post请求
- *
- *  @param urlStr       要访问的网站  NSString类型
- *  @param paramters    请求的参数    NSMutableDictionary
- *  @param succeedBlock 成功时的回调  返回id类型
- *  @param failedBlock  失败时的回调  返回id类型
- */
-+ (void)postRequestWithURL:(NSString *)urlStr
-                 paramters:(NSMutableDictionary *)paramters
-                   succeed:(FinishBlock)succeedBlock
-                    failed:(FailedBlock)failedBlock;
-
-
-/* md5加密 */
-
-+(NSString *) md5: (NSString *) inPutText ;
-
-@end
+//
+//  UPRequest.h
+//  VTPayUPDemo
+//
+//  Created by 司瑞华 on 15/7/29.
+//  Copyright (c) 2015年 __VTPayment__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+typedef void (^FinishBlock)(id finResponseData);
+typedef void (^FailedBlock)(id faiResponseData);
+
+@interface AllPayRequest : NSObject
+
+@property (strong, nonatomic) NSMutableData      *resultData;
+@property (strong, nonatomic) FinishBlock        finishBlock;
+@property (strong, nonatomic) FailedBlock        failedBlock;
+
+/**
+ *  这个是post请求
+ *
+ *  @param urlStr       要访问的网站  NSString类型
+ *  @param paramters    请求的参数    NSMutableDictionary
+ *  @param succeedBlock 成功时的回调  返回id类型
+ *  @param failedBlock  失败时的回调  返回id类型
+ */
++ (void)postRequestWithURL:(NSString *)urlStr
+                 paramters:(NSMutableDictionary *)paramters
+                   succeed:(FinishBlock)succeedBlock
+                    failed:(FailedBlock)failedBlock;
+
+
+/* md5加密 */
+
++(NSString *) md5: (NSString *) inPutText ;
+
+@end

+ 141 - 141
v5/ios/ios_sdk/Demo/Demo/AllPayRequest.m

@@ -1,141 +1,141 @@
-//
-//  UPRequest.m
-//  VTPayUPDemo
-//
-//  Created by 司瑞华 on 15/7/29.
-//  Copyright (c) 2015年 __VTPayment__. All rights reserved.
-//
-
-#import "AllPayRequest.h"
-#import "commonCrypto/CommonDigest.h"
-
-@implementation AllPayRequest
-
-///**
-// *  post请求
-// *
-// *  @param urlStr       要访问的网站  NSString类型
-// *  @param paramters    请求的参数    NSMutableDictionary
-// *  @param succeedBlock 成功时的回调  返回NSString类型
-// *  @param failedBlock  失败时的回调  返回NSString类型
-// */
-+(void)postRequestWithURL:(NSString *)urlStr
-                paramters:(NSMutableDictionary *)paramters
-                  succeed:(FinishBlock)succeedBlock
-                   failed:(FailedBlock)failedBlock
-{
-    AllPayRequest * httpRequest = [[AllPayRequest alloc]init];
-    httpRequest.finishBlock = succeedBlock;
-    httpRequest.failedBlock = failedBlock;
-    
-    NSURL * url = [NSURL URLWithString:urlStr];
-    NSMutableURLRequest * request = [[NSMutableURLRequest alloc]initWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30];
-    
-    NSString * strField;
-    if (paramters.count>0)
-    {
-        strField = [self dictFieldInfo:paramters];
-    }else
-    {
-        strField = @"";
-    }
-    ///把获得的整个请求字段用utf-8编码一下
-    NSData * data = [strField dataUsingEncoding:NSUTF8StringEncoding];
-    [request setHTTPBody:data];
-    [request setHTTPMethod:@"POST"];
-    
-    NSURLConnection * connection = [[NSURLConnection alloc]initWithRequest:request delegate:httpRequest];
-    [connection start];
-}
-
-// 将字典参数 拼接成一个有 &%@=%@ 的字符串
-+(NSString *)dictFieldInfo:(NSMutableDictionary*)dict
-{
-    NSMutableString * Url = [NSMutableString string];
-    NSArray * keys = [dict allKeys];
-    for (int i = 0; i < keys.count; i++)
-    {
-        NSString * string;
-        if (i == 0)
-        {
-            string = [NSString stringWithFormat:@"%@=%@", keys[i],dict[keys[i]]];
-        }else{
-            //拼接时加&
-            string = [NSString stringWithFormat:@"&%@=%@", keys[i],dict[keys[i]]];
-        }
-        [Url appendString:string];
-    }
-    return Url;
-}
-/**
- *  接收到服务器回应的时回调
- */
-- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
-{
-    if (!self.resultData)
-    {
-        self.resultData = [[NSMutableData alloc]init];
-    }else
-    {
-        [self.resultData setLength:0];
-    }
-}
-/**
- *  接收到服务器传输数据的时候调用,此方法根据数据大小执行若干次
- */
-- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
-{
-    [self.resultData appendData:data];
-}
-/**
- *  数据传完之后调用此方法
- */
-- (void)connectionDidFinishLoading:(NSURLConnection *)connection
-{
-    if (self.finishBlock) {
-        self.finishBlock(self.resultData);
-    }
-}
-/**
- *  网络请求过程中,出现任何错误(断网,连接超时等)会进入此方法
- */
-- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
-{
-    NSLog(@"network error : %@", [error localizedDescription]);
-    
-    if (self.failedBlock) {
-        self.failedBlock([error localizedDescription]);
-    }
-}
-
-// 将字符串,转化成数组或字典 objectFromJSONStringWithParseOptions
-- (id)dictionaryOrArrayWithJSONSString:(NSString *)jsonString
-{
-    if (jsonString == nil)
-    {
-        return nil;
-    }
-    
-    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
-    return [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves |  NSJSONReadingMutableContainers error:nil];
-}
-#pragma mark - MD5加密
-+(NSString *) md5: (NSString *) inPutText
-{
-    const char *cStr = [inPutText UTF8String];
-    
-    unsigned char result[CC_MD5_DIGEST_LENGTH];
-    
-    CC_MD5(cStr, (CC_LONG)strlen(cStr), result);
-    
-    
-    return [[NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
-             result[0], result[1], result[2], result[3],
-             result[4], result[5], result[6], result[7],
-             result[8], result[9], result[10], result[11],
-             result[12], result[13], result[14], result[15]
-             ] lowercaseString];
-    
-}
-
-@end
+//
+//  UPRequest.m
+//  VTPayUPDemo
+//
+//  Created by 司瑞华 on 15/7/29.
+//  Copyright (c) 2015年 __VTPayment__. All rights reserved.
+//
+
+#import "AllPayRequest.h"
+#import "commonCrypto/CommonDigest.h"
+
+@implementation AllPayRequest
+
+///**
+// *  post请求
+// *
+// *  @param urlStr       要访问的网站  NSString类型
+// *  @param paramters    请求的参数    NSMutableDictionary
+// *  @param succeedBlock 成功时的回调  返回NSString类型
+// *  @param failedBlock  失败时的回调  返回NSString类型
+// */
++(void)postRequestWithURL:(NSString *)urlStr
+                paramters:(NSMutableDictionary *)paramters
+                  succeed:(FinishBlock)succeedBlock
+                   failed:(FailedBlock)failedBlock
+{
+    AllPayRequest * httpRequest = [[AllPayRequest alloc]init];
+    httpRequest.finishBlock = succeedBlock;
+    httpRequest.failedBlock = failedBlock;
+    
+    NSURL * url = [NSURL URLWithString:urlStr];
+    NSMutableURLRequest * request = [[NSMutableURLRequest alloc]initWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30];
+    
+    NSString * strField;
+    if (paramters.count>0)
+    {
+        strField = [self dictFieldInfo:paramters];
+    }else
+    {
+        strField = @"";
+    }
+    ///把获得的整个请求字段用utf-8编码一下
+    NSData * data = [strField dataUsingEncoding:NSUTF8StringEncoding];
+    [request setHTTPBody:data];
+    [request setHTTPMethod:@"POST"];
+    
+    NSURLConnection * connection = [[NSURLConnection alloc]initWithRequest:request delegate:httpRequest];
+    [connection start];
+}
+
+// 将字典参数 拼接成一个有 &%@=%@ 的字符串
++(NSString *)dictFieldInfo:(NSMutableDictionary*)dict
+{
+    NSMutableString * Url = [NSMutableString string];
+    NSArray * keys = [dict allKeys];
+    for (int i = 0; i < keys.count; i++)
+    {
+        NSString * string;
+        if (i == 0)
+        {
+            string = [NSString stringWithFormat:@"%@=%@", keys[i],dict[keys[i]]];
+        }else{
+            //拼接时加&
+            string = [NSString stringWithFormat:@"&%@=%@", keys[i],dict[keys[i]]];
+        }
+        [Url appendString:string];
+    }
+    return Url;
+}
+/**
+ *  接收到服务器回应的时回调
+ */
+- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
+{
+    if (!self.resultData)
+    {
+        self.resultData = [[NSMutableData alloc]init];
+    }else
+    {
+        [self.resultData setLength:0];
+    }
+}
+/**
+ *  接收到服务器传输数据的时候调用,此方法根据数据大小执行若干次
+ */
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
+{
+    [self.resultData appendData:data];
+}
+/**
+ *  数据传完之后调用此方法
+ */
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection
+{
+    if (self.finishBlock) {
+        self.finishBlock(self.resultData);
+    }
+}
+/**
+ *  网络请求过程中,出现任何错误(断网,连接超时等)会进入此方法
+ */
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
+{
+    NSLog(@"network error : %@", [error localizedDescription]);
+    
+    if (self.failedBlock) {
+        self.failedBlock([error localizedDescription]);
+    }
+}
+
+// 将字符串,转化成数组或字典 objectFromJSONStringWithParseOptions
+- (id)dictionaryOrArrayWithJSONSString:(NSString *)jsonString
+{
+    if (jsonString == nil)
+    {
+        return nil;
+    }
+    
+    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
+    return [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves |  NSJSONReadingMutableContainers error:nil];
+}
+#pragma mark - MD5加密
++(NSString *) md5: (NSString *) inPutText
+{
+    const char *cStr = [inPutText UTF8String];
+    
+    unsigned char result[CC_MD5_DIGEST_LENGTH];
+    
+    CC_MD5(cStr, (CC_LONG)strlen(cStr), result);
+    
+    
+    return [[NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
+             result[0], result[1], result[2], result[3],
+             result[4], result[5], result[6], result[7],
+             result[8], result[9], result[10], result[11],
+             result[12], result[13], result[14], result[15]
+             ] lowercaseString];
+    
+}
+
+@end

+ 17 - 17
v5/ios/ios_sdk/Demo/Demo/AppDelegate.h

@@ -1,17 +1,17 @@
-//
-//  AppDelegate.h
-//  Demo
-//
-//  Created by BensonZhang on 15/11/20.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface AppDelegate : UIResponder <UIApplicationDelegate>
-
-@property (strong, nonatomic) UIWindow *window;
-
-
-@end
-
+//
+//  AppDelegate.h
+//  Demo
+//
+//  Created by BensonZhang on 15/11/20.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+
+@end
+

+ 63 - 63
v5/ios/ios_sdk/Demo/Demo/AppDelegate.m

@@ -1,63 +1,63 @@
-//
-//  AppDelegate.m
-//  Demo
-//
-//  Created by BensonZhang on 15/11/20.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import "AppDelegate.h"
-#import "allpaysdk/AllPaySDK.h"
-
-@interface AppDelegate ()
-
-@end
-
-@implementation AppDelegate
-
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-   
-    return YES;
-}
-
--(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;
-    
-}
-- (void)applicationWillResignActive:(UIApplication *)application {
-    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
-    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application {
-    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
-    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
-}
-
-- (void)applicationWillEnterForeground:(UIApplication *)application {
-    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application {
-    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
-}
-
-- (void)applicationWillTerminate:(UIApplication *)application {
-    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
-}
-
-@end
+//
+//  AppDelegate.m
+//  Demo
+//
+//  Created by BensonZhang on 15/11/20.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import "allpaysdk/AllPaySDK.h"
+
+@interface AppDelegate ()
+
+@end
+
+@implementation AppDelegate
+
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+   
+    return YES;
+}
+
+-(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;
+    
+}
+- (void)applicationWillResignActive:(UIApplication *)application {
+    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end

+ 97 - 97
v5/ios/ios_sdk/Demo/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -1,98 +1,98 @@
-{
-  "images" : [
-    {
-      "idiom" : "iphone",
-      "size" : "20x20",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "iphone",
-      "size" : "20x20",
-      "scale" : "3x"
-    },
-    {
-      "idiom" : "iphone",
-      "size" : "29x29",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "iphone",
-      "size" : "29x29",
-      "scale" : "3x"
-    },
-    {
-      "idiom" : "iphone",
-      "size" : "40x40",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "iphone",
-      "size" : "40x40",
-      "scale" : "3x"
-    },
-    {
-      "idiom" : "iphone",
-      "size" : "60x60",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "iphone",
-      "size" : "60x60",
-      "scale" : "3x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "20x20",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "20x20",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "29x29",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "29x29",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "40x40",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "40x40",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "76x76",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "76x76",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "ipad",
-      "size" : "83.5x83.5",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "ios-marketing",
-      "size" : "1024x1024",
-      "scale" : "1x"
-    }
-  ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
-  }
+{
+  "images" : [
+    {
+      "idiom" : "iphone",
+      "size" : "20x20",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "20x20",
+      "scale" : "3x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "29x29",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "29x29",
+      "scale" : "3x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "40x40",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "40x40",
+      "scale" : "3x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "60x60",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "60x60",
+      "scale" : "3x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "20x20",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "20x20",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "29x29",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "29x29",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "40x40",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "40x40",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "76x76",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "76x76",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "83.5x83.5",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ios-marketing",
+      "size" : "1024x1024",
+      "scale" : "1x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
 }

+ 27 - 27
v5/ios/ios_sdk/Demo/Demo/Base.lproj/LaunchScreen.storyboard

@@ -1,27 +1,27 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
-    </dependencies>
-    <scenes>
-        <!--View Controller-->
-        <scene sceneID="EHf-IW-A2E">
-            <objects>
-                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
-                        <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
-                    </layoutGuides>
-                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
-                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
-                    </view>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="53" y="375"/>
-        </scene>
-    </scenes>
-</document>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="EHf-IW-A2E">
+            <objects>
+                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
+                        <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="53" y="375"/>
+        </scene>
+    </scenes>
+</document>

+ 27 - 27
v5/ios/ios_sdk/Demo/Demo/Base.lproj/Main.storyboard

@@ -1,27 +1,27 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
-    </dependencies>
-    <scenes>
-        <!--View Controller-->
-        <scene sceneID="tne-QT-ifu">
-            <objects>
-                <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
-                        <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
-                    </layoutGuides>
-                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
-                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <animations/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
-                    </view>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
-            </objects>
-        </scene>
-    </scenes>
-</document>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="tne-QT-ifu">
+            <objects>
+                <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
+                        <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <animations/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+            </objects>
+        </scene>
+    </scenes>
+</document>

+ 15 - 15
v5/ios/ios_sdk/Demo/Demo/DateUtil.h

@@ -1,15 +1,15 @@
-//
-//  DateUtil.h
-//  Demo
-//
-//  Created by BensonZhang on 15/11/16.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface DateUtil : NSObject
-
-+(NSString *)getDate:(NSString *)format;
-
-@end
+//
+//  DateUtil.h
+//  Demo
+//
+//  Created by BensonZhang on 15/11/16.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface DateUtil : NSObject
+
++(NSString *)getDate:(NSString *)format;
+
+@end

+ 23 - 23
v5/ios/ios_sdk/Demo/Demo/DateUtil.m

@@ -1,23 +1,23 @@
-//
-//  DateUtil.m
-//  Demo
-//
-//  Created by BensonZhang on 15/11/16.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import "DateUtil.h"
-
-@implementation DateUtil
-
-+(NSString *)getDate:(NSString *)format
-{
-    ///设置标准时间格式
-    NSDate * dateTime = [NSDate date];
-    NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init];
-    [dateFormatter setDateFormat:format];
-    NSString * formatterTime = [dateFormatter stringFromDate:dateTime];
-    return formatterTime;
-}
-
-@end
+//
+//  DateUtil.m
+//  Demo
+//
+//  Created by BensonZhang on 15/11/16.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import "DateUtil.h"
+
+@implementation DateUtil
+
++(NSString *)getDate:(NSString *)format
+{
+    ///设置标准时间格式
+    NSDate * dateTime = [NSDate date];
+    NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init];
+    [dateFormatter setDateFormat:format];
+    NSString * formatterTime = [dateFormatter stringFromDate:dateTime];
+    return formatterTime;
+}
+
+@end

+ 12 - 12
v5/ios/ios_sdk/Demo/Demo/Demo.entitlements

@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>com.apple.developer.in-app-payments</key>
-	<array>
-		<string>merchant.allpay.pay</string>
-		<string>merchant.allpayx.com.test2</string>
-		<string>merchant.allpayx.com.test3</string>
-	</array>
-</dict>
-</plist>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>com.apple.developer.in-app-payments</key>
+	<array>
+		<string>merchant.allpay.pay</string>
+		<string>merchant.allpayx.com.test2</string>
+		<string>merchant.allpayx.com.test3</string>
+	</array>
+</dict>
+</plist>

+ 83 - 83
v5/ios/ios_sdk/Demo/Demo/Info.plist

@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>en</string>
-	<key>CFBundleExecutable</key>
-	<string>$(EXECUTABLE_NAME)</string>
-	<key>CFBundleIdentifier</key>
-	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>$(PRODUCT_NAME)</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleURLTypes</key>
-	<array>
-		<dict>
-			<key>CFBundleTypeRole</key>
-			<string>Editor</string>
-			<key>CFBundleURLName</key>
-			<string>alipay</string>
-			<key>CFBundleURLSchemes</key>
-			<array>
-				<string>com.xxx.xxx</string>
-			</array>
-		</dict>
-		<dict>
-			<key>CFBundleTypeRole</key>
-			<string>Editor</string>
-			<key>CFBundleURLName</key>
-			<string>wxpay</string>
-			<key>CFBundleURLSchemes</key>
-			<array>
-				<string>wx0d48a98252a2fe7a</string>
-			</array>
-		</dict>
-	</array>
-	<key>CFBundleVersion</key>
-	<string>1</string>
-	<key>LSApplicationQueriesSchemes</key>
-	<array>
-		<string>weixin</string>
-		<string>uppaysdk</string>
-		<string>uppaywallet</string>
-		<string>uppayx1</string>
-		<string>uppayx2</string>
-		<string>uppayx3</string>
-	</array>
-	<key>requires iPhone envir Application onment</key>
-	<false/>
-	<key>NSAppTransportSecurity</key>
-	<dict>
-		<key>NSAllowsArbitraryLoads</key>
-		<true/>
-	</dict>
-	<key>UILaunchStoryboardName</key>
-	<string>LaunchScreen</string>
-	<key>UIMainStoryboardFile</key>
-	<string>Main</string>
-	<key>UIRequiredDeviceCapabilities</key>
-	<array>
-		<string>armv7</string>
-	</array>
-	<key>UISupportedInterfaceOrientations</key>
-	<array>
-		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
-	</array>
-	<key>UISupportedInterfaceOrientations~ipad</key>
-	<array>
-		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationPortraitUpsideDown</string>
-		<string>UIInterfaceOrientationLandscapeLeft</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
-	</array>
-</dict>
-</plist>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleURLTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLName</key>
+			<string>alipay</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>com.xxx.xxx</string>
+			</array>
+		</dict>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLName</key>
+			<string>wxpay</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>wx0d48a98252a2fe7a</string>
+			</array>
+		</dict>
+	</array>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>LSApplicationQueriesSchemes</key>
+	<array>
+		<string>weixin</string>
+		<string>uppaysdk</string>
+		<string>uppaywallet</string>
+		<string>uppayx1</string>
+		<string>uppayx2</string>
+		<string>uppayx3</string>
+	</array>
+	<key>requires iPhone envir Application onment</key>
+	<false/>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
+	<key>UILaunchStoryboardName</key>
+	<string>LaunchScreen</string>
+	<key>UIMainStoryboardFile</key>
+	<string>Main</string>
+	<key>UIRequiredDeviceCapabilities</key>
+	<array>
+		<string>armv7</string>
+	</array>
+	<key>UISupportedInterfaceOrientations</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
+	<key>UISupportedInterfaceOrientations~ipad</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
+		<string>UIInterfaceOrientationLandscapeLeft</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
+</dict>
+</plist>

+ 31 - 31
v5/ios/ios_sdk/Demo/Demo/PayOrder.h

@@ -1,31 +1,31 @@
-//
-//  PayOrder.h
-//  Demo
-//
-//  Created by BensonZhang on 15/11/16.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface PayOrder : NSObject
-@property (strong, nonatomic) NSString *version;
-@property (strong, nonatomic) NSString *charSet;
-@property (strong, nonatomic) NSString *transType;
-@property (strong, nonatomic) NSString *orderNum;
-@property (strong, nonatomic) NSString *orderAmount;
-@property (strong, nonatomic) NSString *orderCurrency;
-@property (strong, nonatomic) NSString *frontURL;
-@property (strong, nonatomic) NSString *backURL;
-@property (strong, nonatomic) NSString *merReserve;
-@property (strong, nonatomic) NSString *merID;
-@property (strong, nonatomic) NSString *acqID;
-@property (strong, nonatomic) NSString *paymentSchema;
-@property (strong, nonatomic) NSString *transTime;
-@property (strong, nonatomic) NSString *signType;
-@property (strong, nonatomic) NSString *signature;
-@property (strong, nonatomic) NSString *OrderDesc;
-@property (strong, nonatomic) NSString *language;
-@property (strong, nonatomic) NSString *customerId;
-@property (strong, nonatomic) NSString *signKey;
-@end
+//
+//  PayOrder.h
+//  Demo
+//
+//  Created by BensonZhang on 15/11/16.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface PayOrder : NSObject
+@property (strong, nonatomic) NSString *version;
+@property (strong, nonatomic) NSString *charSet;
+@property (strong, nonatomic) NSString *transType;
+@property (strong, nonatomic) NSString *orderNum;
+@property (strong, nonatomic) NSString *orderAmount;
+@property (strong, nonatomic) NSString *orderCurrency;
+@property (strong, nonatomic) NSString *frontURL;
+@property (strong, nonatomic) NSString *backURL;
+@property (strong, nonatomic) NSString *merReserve;
+@property (strong, nonatomic) NSString *merID;
+@property (strong, nonatomic) NSString *acqID;
+@property (strong, nonatomic) NSString *paymentSchema;
+@property (strong, nonatomic) NSString *transTime;
+@property (strong, nonatomic) NSString *signType;
+@property (strong, nonatomic) NSString *signature;
+@property (strong, nonatomic) NSString *OrderDesc;
+@property (strong, nonatomic) NSString *language;
+@property (strong, nonatomic) NSString *customerId;
+@property (strong, nonatomic) NSString *signKey;
+@end

+ 13 - 13
v5/ios/ios_sdk/Demo/Demo/PayOrder.m

@@ -1,13 +1,13 @@
-//
-//  PayOrder.m
-//  Demo
-//
-//  Created by BensonZhang on 15/11/16.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import "PayOrder.h"
-
-@implementation PayOrder
-
-@end
+//
+//  PayOrder.m
+//  Demo
+//
+//  Created by BensonZhang on 15/11/16.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import "PayOrder.h"
+
+@implementation PayOrder
+
+@end

+ 16 - 16
v5/ios/ios_sdk/Demo/Demo/SignUtil.h

@@ -1,16 +1,16 @@
-//
-//  SignUtil.h
-//  Demo
-//
-//  Created by BensonZhang on 15/11/16.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "PayOrder.h"
-
-@interface SignUtil : NSObject
-
-+(NSString *)getSign:(NSMutableDictionary*)paramDic;
-
-@end
+//
+//  SignUtil.h
+//  Demo
+//
+//  Created by BensonZhang on 15/11/16.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "PayOrder.h"
+
+@interface SignUtil : NSObject
+
++(NSString *)getSign:(NSMutableDictionary*)paramDic;
+
+@end

+ 47 - 47
v5/ios/ios_sdk/Demo/Demo/SignUtil.m

@@ -1,47 +1,47 @@
-//
-//  SignUtil.m
-//  Demo
-//
-//  Created by BensonZhang on 15/11/16.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import "SignUtil.h"
-#import "AllPayRequest.h"
-
-@implementation SignUtil
-
-+(NSString *)getSign:(NSMutableDictionary*)paramDic{
-    
-    return [SignUtil getMD5:[SignUtil getSignStr:paramDic  signkey:@"2f2c77e3718c47cfb47a89a6fbc9d361"]];
-}
-
-+(NSString *)getSignStr:(NSMutableDictionary *)paramDic  signkey:(NSString *)key{
-    
-    NSArray *keys = [paramDic allKeys];
-    NSArray *sortedArray = [keys sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2){
-        return [obj1 compare:obj2 options:NSNumericSearch];
-    }];
-     NSMutableString *signStr=[[NSMutableString alloc]init];
-    int i=0;
-    for (NSString *categoryId in sortedArray) {
-        if(i>0){
-            [signStr appendString:[NSString stringWithFormat:@"&%@=%@",categoryId,[paramDic objectForKey:categoryId]]];
-        }else{
-            [signStr appendString:[NSString stringWithFormat:@"%@=%@",categoryId,[paramDic objectForKey:categoryId]]];
-        }
-        i++;
-    }
-    [signStr appendString:key];
-       return signStr ;
-}
-
-+(NSString *)getMD5:(NSString *)signStr{
-    NSLog(@"%@",signStr);
-    return [AllPayRequest md5:signStr];
-   
-
-}
-
-
-@end
+//
+//  SignUtil.m
+//  Demo
+//
+//  Created by BensonZhang on 15/11/16.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import "SignUtil.h"
+#import "AllPayRequest.h"
+
+@implementation SignUtil
+
++(NSString *)getSign:(NSMutableDictionary*)paramDic{
+    
+    return [SignUtil getMD5:[SignUtil getSignStr:paramDic  signkey:@"2f2c77e3718c47cfb47a89a6fbc9d361"]];
+}
+
++(NSString *)getSignStr:(NSMutableDictionary *)paramDic  signkey:(NSString *)key{
+    
+    NSArray *keys = [paramDic allKeys];
+    NSArray *sortedArray = [keys sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2){
+        return [obj1 compare:obj2 options:NSNumericSearch];
+    }];
+     NSMutableString *signStr=[[NSMutableString alloc]init];
+    int i=0;
+    for (NSString *categoryId in sortedArray) {
+        if(i>0){
+            [signStr appendString:[NSString stringWithFormat:@"&%@=%@",categoryId,[paramDic objectForKey:categoryId]]];
+        }else{
+            [signStr appendString:[NSString stringWithFormat:@"%@=%@",categoryId,[paramDic objectForKey:categoryId]]];
+        }
+        i++;
+    }
+    [signStr appendString:key];
+       return signStr ;
+}
+
++(NSString *)getMD5:(NSString *)signStr{
+    NSLog(@"%@",signStr);
+    return [AllPayRequest md5:signStr];
+   
+
+}
+
+
+@end

+ 15 - 15
v5/ios/ios_sdk/Demo/Demo/ViewController.h

@@ -1,15 +1,15 @@
-//
-//  ViewController.h
-//  Demo
-//
-//  Created by BensonZhang on 15/11/20.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface ViewController : UIViewController
-
-
-@end
-
+//
+//  ViewController.h
+//  Demo
+//
+//  Created by BensonZhang on 15/11/20.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ViewController : UIViewController
+
+
+@end
+

+ 211 - 211
v5/ios/ios_sdk/Demo/Demo/ViewController.m

@@ -1,211 +1,211 @@
-//
-//  ViewController.m
-//  Demo
-//
-//  Created by BensonZhang on 15/11/13.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import "ViewController.h"
-#import "AllPayRequest.h"
-#import "PayOrder.h"
-#import "DateUtil.h"
-#import "SignUtil.h"
-#import "AllPaySDK.h"
-@interface ViewController ()
-
-
-@end
-
-@implementation ViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-   // [self.view setBackgroundColor:[UIColor yellowColor]];
-    UIButton * btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
-    btn1.tag = 1;
-    btn1.frame = CGRectMake(80, 60, 200, 50);
-    [btn1 setTitle:@"微信支付" forState:UIControlStateNormal];
-    [btn1 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:btn1];
-    
-    
-    UIButton * btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
-    btn2.tag = 2;
-    btn2.frame = CGRectMake(80, 120, 200, 50);
-    [btn2 setTitle:@"支付宝支付" forState:UIControlStateNormal];
-    [btn2 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:btn2];
-    
-    UIButton * btn3 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
-    btn3.tag = 3;
-    btn3.frame = CGRectMake(80, 180, 200, 50);
-    [btn3 setTitle:@"银联支付" forState:UIControlStateNormal];
-    [btn3 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:btn3];
-    
-    
-    UIButton * btn4 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
-    btn4.tag = 4;
-    btn4.frame = CGRectMake(80, 240, 200, 50);
-    [btn4 setTitle:@"apple pay 支付" forState:UIControlStateNormal];
-    [btn4 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:btn4];
-    
-    
-  
-}
--(void)btnClick:(UIButton *)btn
-{
-    
-    
-    
-    NSMutableDictionary * paramDic=[[NSMutableDictionary alloc]init];
-    [paramDic setObject:@"VER000000005" forKey:@"version"];
-    [paramDic setObject:@"UTF-8" forKey:@"charSet"];
-    [paramDic setObject:@"PURC" forKey:@"transType"];
-    [paramDic setObject:[DateUtil getDate:@"YYYYMMddHHmmss"] forKey:@"orderNum"];
-    [paramDic setObject:@"0.1" forKey:@"orderAmount"];
-    [paramDic setObject:@"CNY" forKey:@"orderCurrency"];
-    [paramDic setObject:@"nil" forKey:@"frontURL"];
-    [paramDic setObject:@"https://testapi.allpayx.com/test" forKey:@"backURL"];
-    [paramDic setObject:@"nil" forKey:@"merReserve"];
-      [paramDic setObject:@"test商品" forKey:@"goodsInfo"];
-    [paramDic setObject:@"000000000000015" forKey:@"merID"];
-    [paramDic setObject:@"99020344" forKey:@"acqID"];
-    [paramDic setObject:[DateUtil getDate:@"YYYYMMddHHmmss"] forKey:@"transTime"];
-    [paramDic setObject:@"MD5" forKey:@"signType"];
-    
-    NSString *detailInfo = @"IFt7Imdvb2RzX25hbWUiOiLkuIDkuKrlj4jlpKflj4jlnIbnmoToi7nmnpwiLCJxdWFudGl0eSI6IjEifSx7Imdvb2RzX25hbWUiOiLljY7kuLpQMjAgcGx1cyIsInF1YW50aXR5IjoiNCJ9XQ==";
-    
-    
-    [paramDic setObject:detailInfo forKey:@"detailInfo"];
-    [paramDic setObject:@"APP" forKey:@"tradeFrom"];
-    
-    
-    if (btn.tag == 1)//微信
-    {
-          [paramDic setObject:@"WX" forKey:@"paymentSchema"];
-        
-    }
-    
-    if (btn.tag == 2)//支付宝
-    {
-        [paramDic setObject:@"APMP" forKey:@"paymentSchema"];
-        
-    }
-    
-    if (btn.tag == 3)//银联
-    {
-        [paramDic setObject:@"UP" forKey:@"paymentSchema"];
-        
-    }
-    
-    if (btn.tag == 4)//银联
-    {
-        [paramDic setObject:@"APP" forKey:@"paymentSchema"];
-        
-    }
-    
-    [self startPay:paramDic];
-    
-}
-
--(void)startPay:(NSMutableDictionary*)paramDic
-{
-  [paramDic setObject:[SignUtil getSign:paramDic] forKey:@"signature"];
-    
- NSString *url = @"https://testapi.allpayx.com/api/unifiedorder";
-    
-   //  NSString *url = @"https://api.allpayx.com/api/unifiedorder";
-    
-    
-    [AllPayRequest postRequestWithURL:url paramters:paramDic succeed:^(id finResponseData)
-     {
-         NSError *error;
-         NSDictionary * diction = [NSJSONSerialization JSONObjectWithData:finResponseData options:NSJSONReadingMutableContainers error:&error];
-         if(!error){
-             NSLog(@"-----输出数据---%@",diction);
-             
-          
-             [AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO   scheme:@"com.xxx.xxx"  ViewController:self  onResult: ^(NSDictionary *resultDic) {
-                 NSData  *jsonData = [NSJSONSerialization dataWithJSONObject:resultDic options:NSJSONWritingPrettyPrinted error:nil];
-                 NSString *message =[[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-                 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"支付结果" message:message delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-                 [alert show];
-                 
-             }];
-            
-             
-             
-         }else{
-             NSString * dataString = [[NSString alloc]initWithData:finResponseData encoding:NSUTF8StringEncoding];
-             NSLog(@"参数出错===\n %@",dataString);
-             
-             
-         }
-         
-         
-         
-     } failed:^(id faiResponseData) {
-        
-     }];
-    
-    
-    
-}
-
-- (NSString *)getCurrentLanguage
-{
-    NSArray *languages = [NSLocale preferredLanguages];
-    NSString *currentLanguage = [languages objectAtIndex:0];
-    NSLog( @"%@" , currentLanguage);
-    return currentLanguage;
-}
-
-
-@end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+//
+//  ViewController.m
+//  Demo
+//
+//  Created by BensonZhang on 15/11/13.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import "ViewController.h"
+#import "AllPayRequest.h"
+#import "PayOrder.h"
+#import "DateUtil.h"
+#import "SignUtil.h"
+#import "AllPaySDK.h"
+@interface ViewController ()
+
+
+@end
+
+@implementation ViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+   // [self.view setBackgroundColor:[UIColor yellowColor]];
+    UIButton * btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+    btn1.tag = 1;
+    btn1.frame = CGRectMake(80, 60, 200, 50);
+    [btn1 setTitle:@"微信支付" forState:UIControlStateNormal];
+    [btn1 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:btn1];
+    
+    
+    UIButton * btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+    btn2.tag = 2;
+    btn2.frame = CGRectMake(80, 120, 200, 50);
+    [btn2 setTitle:@"支付宝支付" forState:UIControlStateNormal];
+    [btn2 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:btn2];
+    
+    UIButton * btn3 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+    btn3.tag = 3;
+    btn3.frame = CGRectMake(80, 180, 200, 50);
+    [btn3 setTitle:@"银联支付" forState:UIControlStateNormal];
+    [btn3 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:btn3];
+    
+    
+    UIButton * btn4 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+    btn4.tag = 4;
+    btn4.frame = CGRectMake(80, 240, 200, 50);
+    [btn4 setTitle:@"apple pay 支付" forState:UIControlStateNormal];
+    [btn4 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:btn4];
+    
+    
+  
+}
+-(void)btnClick:(UIButton *)btn
+{
+    
+    
+    
+    NSMutableDictionary * paramDic=[[NSMutableDictionary alloc]init];
+    [paramDic setObject:@"VER000000005" forKey:@"version"];
+    [paramDic setObject:@"UTF-8" forKey:@"charSet"];
+    [paramDic setObject:@"PURC" forKey:@"transType"];
+    [paramDic setObject:[DateUtil getDate:@"YYYYMMddHHmmss"] forKey:@"orderNum"];
+    [paramDic setObject:@"0.1" forKey:@"orderAmount"];
+    [paramDic setObject:@"CNY" forKey:@"orderCurrency"];
+    [paramDic setObject:@"nil" forKey:@"frontURL"];
+    [paramDic setObject:@"https://testapi.allpayx.com/test" forKey:@"backURL"];
+    [paramDic setObject:@"nil" forKey:@"merReserve"];
+      [paramDic setObject:@"test商品" forKey:@"goodsInfo"];
+    [paramDic setObject:@"000000000000015" forKey:@"merID"];
+    [paramDic setObject:@"99020344" forKey:@"acqID"];
+    [paramDic setObject:[DateUtil getDate:@"YYYYMMddHHmmss"] forKey:@"transTime"];
+    [paramDic setObject:@"MD5" forKey:@"signType"];
+    
+    NSString *detailInfo = @"IFt7Imdvb2RzX25hbWUiOiLkuIDkuKrlj4jlpKflj4jlnIbnmoToi7nmnpwiLCJxdWFudGl0eSI6IjEifSx7Imdvb2RzX25hbWUiOiLljY7kuLpQMjAgcGx1cyIsInF1YW50aXR5IjoiNCJ9XQ==";
+    
+    
+    [paramDic setObject:detailInfo forKey:@"detailInfo"];
+    [paramDic setObject:@"APP" forKey:@"tradeFrom"];
+    
+    
+    if (btn.tag == 1)//微信
+    {
+          [paramDic setObject:@"WX" forKey:@"paymentSchema"];
+        
+    }
+    
+    if (btn.tag == 2)//支付宝
+    {
+        [paramDic setObject:@"APMP" forKey:@"paymentSchema"];
+        
+    }
+    
+    if (btn.tag == 3)//银联
+    {
+        [paramDic setObject:@"UP" forKey:@"paymentSchema"];
+        
+    }
+    
+    if (btn.tag == 4)//银联
+    {
+        [paramDic setObject:@"APP" forKey:@"paymentSchema"];
+        
+    }
+    
+    [self startPay:paramDic];
+    
+}
+
+-(void)startPay:(NSMutableDictionary*)paramDic
+{
+  [paramDic setObject:[SignUtil getSign:paramDic] forKey:@"signature"];
+    
+ NSString *url = @"https://testapi.allpayx.com/api/unifiedorder";
+    
+   //  NSString *url = @"https://api.allpayx.com/api/unifiedorder";
+    
+    
+    [AllPayRequest postRequestWithURL:url paramters:paramDic succeed:^(id finResponseData)
+     {
+         NSError *error;
+         NSDictionary * diction = [NSJSONSerialization JSONObjectWithData:finResponseData options:NSJSONReadingMutableContainers error:&error];
+         if(!error){
+             NSLog(@"-----输出数据---%@",diction);
+             
+          
+             [AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO   scheme:@"com.xxx.xxx"  ViewController:self  onResult: ^(NSDictionary *resultDic) {
+                 NSData  *jsonData = [NSJSONSerialization dataWithJSONObject:resultDic options:NSJSONWritingPrettyPrinted error:nil];
+                 NSString *message =[[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+                 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"支付结果" message:message delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+                 [alert show];
+                 
+             }];
+            
+             
+             
+         }else{
+             NSString * dataString = [[NSString alloc]initWithData:finResponseData encoding:NSUTF8StringEncoding];
+             NSLog(@"参数出错===\n %@",dataString);
+             
+             
+         }
+         
+         
+         
+     } failed:^(id faiResponseData) {
+        
+     }];
+    
+    
+    
+}
+
+- (NSString *)getCurrentLanguage
+{
+    NSArray *languages = [NSLocale preferredLanguages];
+    NSString *currentLanguage = [languages objectAtIndex:0];
+    NSLog( @"%@" , currentLanguage);
+    return currentLanguage;
+}
+
+
+@end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

File diff ditekan karena terlalu besar
+ 1 - 1
v5/ios/ios_sdk/Demo/Demo/allpaysdk/AliModule/AlipaySDK.bundle/bridge.js


+ 33 - 33
v5/ios/ios_sdk/Demo/Demo/allpaysdk/AliModule/AlipaySDK.framework/Headers/APayAuthInfo.h

@@ -1,33 +1,33 @@
-//
-//  APAuthInfo.h
-//  APAuth
-//
-//  Created by antfin on 17-10-24.
-//  Copyright (c) 2017年 AntFin. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface APayAuthInfo : NSObject
-
-@property(nonatomic, copy)NSString *appID;
-@property(nonatomic, copy)NSString *pid;
-@property(nonatomic, copy)NSString *redirectUri;
-
-/**
- *  初始化AuthInfo
- *
- *  @param appIDStr     应用ID
- *  @param pidStr       商户ID   可不填
- *  @param uriStr       授权的应用回调地址  比如:alidemo://auth
- *
- *  @return authinfo实例
- */
-- (id)initWithAppID:(NSString *)appIDStr
-                pid:(NSString *)pidStr
-        redirectUri:(NSString *)uriStr;
-
-- (NSString *)description;
-- (NSString *)wapDescription;
-
-@end
+//
+//  APAuthInfo.h
+//  APAuth
+//
+//  Created by antfin on 17-10-24.
+//  Copyright (c) 2017年 AntFin. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface APayAuthInfo : NSObject
+
+@property(nonatomic, copy)NSString *appID;
+@property(nonatomic, copy)NSString *pid;
+@property(nonatomic, copy)NSString *redirectUri;
+
+/**
+ *  初始化AuthInfo
+ *
+ *  @param appIDStr     应用ID
+ *  @param pidStr       商户ID   可不填
+ *  @param uriStr       授权的应用回调地址  比如:alidemo://auth
+ *
+ *  @return authinfo实例
+ */
+- (id)initWithAppID:(NSString *)appIDStr
+                pid:(NSString *)pidStr
+        redirectUri:(NSString *)uriStr;
+
+- (NSString *)description;
+- (NSString *)wapDescription;
+
+@end

+ 203 - 203
v5/ios/ios_sdk/Demo/Demo/allpaysdk/AliModule/AlipaySDK.framework/Headers/AlipaySDK.h

@@ -1,203 +1,203 @@
-//
-//  AlipaySDK.h
-//  AlipaySDK
-//
-//  Created by antfin on 17-10-24.
-//  Copyright (c) 2017年 AntFin. All rights reserved.
-//
-
-
-////////////////////////////////////////////////////////
-///////////////// 支付宝标准版本支付SDK ///////////////////
-/////////// version:15.6.2  motify:2019.03.16///////////
-////////////////////////////////////////////////////////
-
-#import <UIKit/UIKit.h>
-#import "APayAuthInfo.h"
-
-typedef void(^CompletionBlock)(NSDictionary *resultDic);
-
-typedef enum {
-    ALIPAY_TIDFACTOR_IMEI,
-    ALIPAY_TIDFACTOR_IMSI,
-    ALIPAY_TIDFACTOR_TID,
-    ALIPAY_TIDFACTOR_CLIENTKEY,
-    ALIPAY_TIDFACTOR_VIMEI,
-    ALIPAY_TIDFACTOR_VIMSI,
-    ALIPAY_TIDFACTOR_CLIENTID,
-    ALIPAY_TIDFACTOR_APDID,
-    ALIPAY_TIDFACTOR_MAX
-} AlipayTidFactor;
-
-@interface AlipaySDK : NSObject
-
-/**
- *  创建支付单例服务
- *
- *  @return 返回单例对象
- */
-+ (AlipaySDK *)defaultService;
-
-/**
- *  用于设置SDK使用的window,如果没有自行创建window无需设置此接口
- */
-@property (nonatomic, weak) UIWindow *targetWindow;
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////支付宝支付相关接口/////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////////
-
-/**
- *  支付接口
- *
- *  @param orderStr        支付订单信息字串
- *  @param schemeStr       调用支付的app注册在info.plist中的scheme
- *  @param completionBlock 支付结果回调Block,用于wap支付结果回调
-                           跳转支付宝支付时只有当processOrderWithPaymentResult接口的completionBlock为nil时会使用这个bolock
- */
-- (void)payOrder:(NSString *)orderStr
-      fromScheme:(NSString *)schemeStr
-        callback:(CompletionBlock)completionBlock;
-
-/**
- *  支付接口 v2
- *
- *  @param orderStr        支付订单信息字串
- *  @param dynamicLaunch   是否使用动态配置策略跳转支付宝支付
- *  @param schemeStr       调用支付的app注册在info.plist中的scheme
- *  @param completionBlock 支付结果回调Block,用于wap支付结果回调
- 跳转支付宝支付时只有当processOrderWithPaymentResult接口的completionBlock为nil时会使用这个bolock
- */
-- (void)payOrder:(NSString *)orderStr
-   dynamicLaunch:(BOOL)dynamicLaunch
-      fromScheme:(NSString *)schemeStr
-        callback:(CompletionBlock)completionBlock;
-
-/**
- *  处理支付宝app支付后跳回商户app携带的支付结果Url
- *
- *  @param resultUrl        支付宝app返回的支付结果url
- *  @param completionBlock  支付结果回调 为nil时默认使用支付接口的completionBlock
- */
-- (void)processOrderWithPaymentResult:(NSURL *)resultUrl
-                      standbyCallback:(CompletionBlock)completionBlock;
-
-/**
- *  获取交易token。
- *
- *  @return 交易token,若无则为空。
- */
-- (NSString *)fetchTradeToken;
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////支付宝授权 2.0 相关接口////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////////
-
-/**
- *  快登授权2.0
- *
- *  @param infoStr          授权请求信息字串
- *  @param schemeStr        调用授权的app注册在info.plist中的scheme
- *  @param completionBlock  授权结果回调,需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果
- *                          若在授权过程中,调用方应用被系统终止则此block无效(此时会调用'processAuth_V2Result:standbyCallback:'传入的standbyCallback)
- */
-- (void)auth_V2WithInfo:(NSString *)infoStr
-             fromScheme:(NSString *)schemeStr
-               callback:(CompletionBlock)completionBlock;
-
-/**
- *  处理支付宝app授权后跳回商户app携带的授权结果Url
- *
- *  @param resultUrl        支付宝app返回的授权结果url
- *  @param completionBlock  授权结果回调,用于处理跳转支付宝授权过程中商户APP被系统终止的情况
- */
-- (void)processAuth_V2Result:(NSURL *)resultUrl
-             standbyCallback:(CompletionBlock)completionBlock;
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////支付宝授权 1.0 相关接口////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////////
-
-
-/**
- *  快登授权
- *  @param authInfo         授权相关信息
- *  @param completionBlock  授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效,
-                            需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果
- */
-- (void)authWithInfo:(APayAuthInfo *)authInfo
-            callback:(CompletionBlock)completionBlock;
-
-/**
- *  处理支付宝app授权后跳回商户app携带的授权结果Url
- *
- *  @param resultUrl        支付宝app返回的授权结果url
- *  @param completionBlock  授权结果回调
- */
-- (void)processAuthResult:(NSURL *)resultUrl
-          standbyCallback:(CompletionBlock)completionBlock;
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////支付宝 h5 支付转 native 支付接口////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////////
-/**
- *  从h5链接中获取订单串并支付接口(自版本15.4.0起,推荐使用该接口)
- *
- *  @param urlStr     拦截的 url string
- *
- *  @return YES为成功获取订单信息并发起支付流程;NO为无法获取订单信息,输入url是普通url
- */
-- (BOOL)payInterceptorWithUrl:(NSString *)urlStr
-                   fromScheme:(NSString *)schemeStr
-                     callback:(CompletionBlock)completionBlock;
-
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////支付宝 tid 相关信息获取接口/////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////////
-
-/**
- *  获取当前tid相关信息
- *
- *  @return tid相关信息
- */
-- (NSString*)queryTidFactor:(AlipayTidFactor)factor;
-
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////支付宝支付环境相关信息接口//////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////////
-
-/**
- *  是否已经使用过
- *
- *  @return YES为已经使用过,NO反之
- */
-- (BOOL)isLogined;
-
-/**
- *  获取当前版本号
- *
- *  @return 当前版本字符串
- */
-- (NSString *)currentVersion;
-
-/**
- *  測試所用,realse包无效
- *
- *  @param url  测试环境
- */
-- (void)setUrl:(NSString *)url;
-
-/**
- *  支付前主动更新本地配置
- *
- *  @param block 更新请求结果回调
- */
-- (void)fetchSdkConfigWithBlock:(void(^)(BOOL success))block;
-@end
+//
+//  AlipaySDK.h
+//  AlipaySDK
+//
+//  Created by antfin on 17-10-24.
+//  Copyright (c) 2017年 AntFin. All rights reserved.
+//
+
+
+////////////////////////////////////////////////////////
+///////////////// 支付宝标准版本支付SDK ///////////////////
+/////////// version:15.6.2  motify:2019.03.16///////////
+////////////////////////////////////////////////////////
+
+#import <UIKit/UIKit.h>
+#import "APayAuthInfo.h"
+
+typedef void(^CompletionBlock)(NSDictionary *resultDic);
+
+typedef enum {
+    ALIPAY_TIDFACTOR_IMEI,
+    ALIPAY_TIDFACTOR_IMSI,
+    ALIPAY_TIDFACTOR_TID,
+    ALIPAY_TIDFACTOR_CLIENTKEY,
+    ALIPAY_TIDFACTOR_VIMEI,
+    ALIPAY_TIDFACTOR_VIMSI,
+    ALIPAY_TIDFACTOR_CLIENTID,
+    ALIPAY_TIDFACTOR_APDID,
+    ALIPAY_TIDFACTOR_MAX
+} AlipayTidFactor;
+
+@interface AlipaySDK : NSObject
+
+/**
+ *  创建支付单例服务
+ *
+ *  @return 返回单例对象
+ */
++ (AlipaySDK *)defaultService;
+
+/**
+ *  用于设置SDK使用的window,如果没有自行创建window无需设置此接口
+ */
+@property (nonatomic, weak) UIWindow *targetWindow;
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////支付宝支付相关接口/////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  支付接口
+ *
+ *  @param orderStr        支付订单信息字串
+ *  @param schemeStr       调用支付的app注册在info.plist中的scheme
+ *  @param completionBlock 支付结果回调Block,用于wap支付结果回调
+                           跳转支付宝支付时只有当processOrderWithPaymentResult接口的completionBlock为nil时会使用这个bolock
+ */
+- (void)payOrder:(NSString *)orderStr
+      fromScheme:(NSString *)schemeStr
+        callback:(CompletionBlock)completionBlock;
+
+/**
+ *  支付接口 v2
+ *
+ *  @param orderStr        支付订单信息字串
+ *  @param dynamicLaunch   是否使用动态配置策略跳转支付宝支付
+ *  @param schemeStr       调用支付的app注册在info.plist中的scheme
+ *  @param completionBlock 支付结果回调Block,用于wap支付结果回调
+ 跳转支付宝支付时只有当processOrderWithPaymentResult接口的completionBlock为nil时会使用这个bolock
+ */
+- (void)payOrder:(NSString *)orderStr
+   dynamicLaunch:(BOOL)dynamicLaunch
+      fromScheme:(NSString *)schemeStr
+        callback:(CompletionBlock)completionBlock;
+
+/**
+ *  处理支付宝app支付后跳回商户app携带的支付结果Url
+ *
+ *  @param resultUrl        支付宝app返回的支付结果url
+ *  @param completionBlock  支付结果回调 为nil时默认使用支付接口的completionBlock
+ */
+- (void)processOrderWithPaymentResult:(NSURL *)resultUrl
+                      standbyCallback:(CompletionBlock)completionBlock;
+
+/**
+ *  获取交易token。
+ *
+ *  @return 交易token,若无则为空。
+ */
+- (NSString *)fetchTradeToken;
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////支付宝授权 2.0 相关接口////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  快登授权2.0
+ *
+ *  @param infoStr          授权请求信息字串
+ *  @param schemeStr        调用授权的app注册在info.plist中的scheme
+ *  @param completionBlock  授权结果回调,需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果
+ *                          若在授权过程中,调用方应用被系统终止则此block无效(此时会调用'processAuth_V2Result:standbyCallback:'传入的standbyCallback)
+ */
+- (void)auth_V2WithInfo:(NSString *)infoStr
+             fromScheme:(NSString *)schemeStr
+               callback:(CompletionBlock)completionBlock;
+
+/**
+ *  处理支付宝app授权后跳回商户app携带的授权结果Url
+ *
+ *  @param resultUrl        支付宝app返回的授权结果url
+ *  @param completionBlock  授权结果回调,用于处理跳转支付宝授权过程中商户APP被系统终止的情况
+ */
+- (void)processAuth_V2Result:(NSURL *)resultUrl
+             standbyCallback:(CompletionBlock)completionBlock;
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////支付宝授权 1.0 相关接口////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+
+/**
+ *  快登授权
+ *  @param authInfo         授权相关信息
+ *  @param completionBlock  授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效,
+                            需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果
+ */
+- (void)authWithInfo:(APayAuthInfo *)authInfo
+            callback:(CompletionBlock)completionBlock;
+
+/**
+ *  处理支付宝app授权后跳回商户app携带的授权结果Url
+ *
+ *  @param resultUrl        支付宝app返回的授权结果url
+ *  @param completionBlock  授权结果回调
+ */
+- (void)processAuthResult:(NSURL *)resultUrl
+          standbyCallback:(CompletionBlock)completionBlock;
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////支付宝 h5 支付转 native 支付接口////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ *  从h5链接中获取订单串并支付接口(自版本15.4.0起,推荐使用该接口)
+ *
+ *  @param urlStr     拦截的 url string
+ *
+ *  @return YES为成功获取订单信息并发起支付流程;NO为无法获取订单信息,输入url是普通url
+ */
+- (BOOL)payInterceptorWithUrl:(NSString *)urlStr
+                   fromScheme:(NSString *)schemeStr
+                     callback:(CompletionBlock)completionBlock;
+
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////支付宝 tid 相关信息获取接口/////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  获取当前tid相关信息
+ *
+ *  @return tid相关信息
+ */
+- (NSString*)queryTidFactor:(AlipayTidFactor)factor;
+
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////支付宝支付环境相关信息接口//////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  是否已经使用过
+ *
+ *  @return YES为已经使用过,NO反之
+ */
+- (BOOL)isLogined;
+
+/**
+ *  获取当前版本号
+ *
+ *  @return 当前版本字符串
+ */
+- (NSString *)currentVersion;
+
+/**
+ *  測試所用,realse包无效
+ *
+ *  @param url  测试环境
+ */
+- (void)setUrl:(NSString *)url;
+
+/**
+ *  支付前主动更新本地配置
+ *
+ *  @param block 更新请求结果回调
+ */
+- (void)fetchSdkConfigWithBlock:(void(^)(BOOL success))block;
+@end

+ 18 - 18
v5/ios/ios_sdk/Demo/Demo/allpaysdk/AllPaySDK.h

@@ -1,18 +1,18 @@
-//
-//  AllPaySDK.h
-//  AllPaySDK
-//
-//  Created by BensonZhang on 15/11/18.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-
-@interface AllPaySDK : NSObject
-
-+(void)pay:(NSString *)tn  mode:(BOOL)mode    scheme:(NSString *)schemeStr   ViewController:(UIViewController *)viewController     onResult:(void(^)(NSDictionary * resultDic))onResult;
-+(void)openURL:(NSURL *)url;
-@end
-
+//
+//  AllPaySDK.h
+//  AllPaySDK
+//
+//  Created by BensonZhang on 15/11/18.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+@interface AllPaySDK : NSObject
+
++(void)pay:(NSString *)tn  mode:(BOOL)mode    scheme:(NSString *)schemeStr   ViewController:(UIViewController *)viewController     onResult:(void(^)(NSDictionary * resultDic))onResult;
++(void)openURL:(NSURL *)url;
+@end
+

+ 16 - 16
v5/ios/ios_sdk/Demo/Demo/main.m

@@ -1,16 +1,16 @@
-//
-//  main.m
-//  Demo
-//
-//  Created by BensonZhang on 15/11/20.
-//  Copyright © 2015年 xunlian. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import "AppDelegate.h"
-
-int main(int argc, char * argv[]) {
-    @autoreleasepool {
-        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
-    }
-}
+//
+//  main.m
+//  Demo
+//
+//  Created by BensonZhang on 15/11/20.
+//  Copyright © 2015年 xunlian. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+    @autoreleasepool {
+        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+    }
+}