├── .gitignore ├── CHANGELOG.md ├── Pingpp.podspec ├── README.md ├── VERSION ├── example ├── .gitignore ├── Podfile ├── demoapp-swift │ ├── .gitignore │ ├── Podfile │ ├── demoapp-swift.xcodeproj │ │ └── project.pbxproj │ ├── demoapp-swift.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── demoapp-swift │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.xib │ │ │ └── Main.storyboard │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── ViewController.swift │ │ └── demoapp-swift-Bridging-Header.h │ └── demoapp-swiftTests │ │ ├── Info.plist │ │ └── demoapp_swiftTests.swift ├── demoapp.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── demoapp.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── demoapp │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── launch-3.5.png │ │ ├── launch-4.0.png │ │ ├── launch-4.7.png │ │ └── launch-5.5.png │ ├── Resources │ ├── ViewController_iPad.xib │ ├── ViewController_iPhone.xib │ └── en.lproj │ │ ├── InfoPlist.strings │ │ └── home.png │ ├── ViewController.h │ ├── ViewController.mm │ ├── demoapp-Info.pch │ ├── demoapp-Info.plist │ └── main.m └── lib ├── Channels ├── Alipay │ ├── AlipaySDK.bundle │ │ ├── alipay_msp_back@2x.png │ │ ├── alipay_msp_refresh@2x.png │ │ ├── bar@2x.png │ │ ├── bridge.js │ │ ├── refresh@2x.png │ │ ├── refresh_click@2x.png │ │ ├── shutdown@2x.png │ │ └── shutdown_click@2x.png │ ├── AlipaySDK.framework │ │ ├── AlipaySDK │ │ ├── AlipaySDK-inside-Info.plist │ │ └── Headers │ │ │ ├── AFServiceCenter.h │ │ │ ├── AFServiceResponse.h │ │ │ ├── APayAuthInfo.h │ │ │ └── AlipaySDK.h │ └── libpingpp+alipay.a ├── ApplePay │ ├── libUPAPayPlugin.a │ └── libpingpp+applepayUpacp.a ├── BfbWap │ └── libpingpp+bfbWap.a ├── CcbPay │ ├── CCBNetPaySDK.framework │ │ ├── CCBNetPaySDK │ │ ├── Headers │ │ │ ├── CCBNetPay.h │ │ │ ├── CCBNetPaySDK.h │ │ │ ├── WXApi.h │ │ │ └── WXApiObject.h │ │ ├── Info.plist │ │ ├── Modules │ │ │ └── module.modulemap │ │ └── _CodeSignature │ │ │ ├── CodeDirectory │ │ │ ├── CodeRequirements │ │ │ ├── CodeRequirements-1 │ │ │ ├── CodeResources │ │ │ └── CodeSignature │ └── libpingpp+ccbpay.a ├── Chinaums │ ├── UMSPPPayPluginSettings.h │ ├── UMSPPPayUnifyPayPlugin.h │ ├── UMSPPPayVersionsInfo.h │ ├── libUMSPosPayOnly.a │ └── libpingpp+chinaums.a ├── CmbWallet │ ├── CMBSDK.framework │ │ ├── CMBSDK │ │ ├── Headers │ │ │ ├── CMBApi.h │ │ │ ├── CMBApiObject.h │ │ │ ├── CMBSDK.h │ │ │ └── CMBWebview.h │ │ ├── Info.plist │ │ ├── Modules │ │ │ └── module.modulemap │ │ └── _CodeSignature │ │ │ ├── CodeDirectory │ │ │ ├── CodeRequirements │ │ │ ├── CodeRequirements-1 │ │ │ ├── CodeResources │ │ │ └── CodeSignature │ └── libpingpp+cmbWallet.a ├── Cmpay │ ├── libCmpayiPosLib.a │ └── libpingpp+cmpay.a ├── Jdpay │ └── libpingpp+jdpay.a ├── Lakala │ ├── PaymaxSDK.h │ ├── libPaymaxSDK.a │ └── libpingpp+lakala.a ├── QQWallet │ ├── QQWalletSDK.h │ └── libpingpp+qqwallet.a ├── UnionPay │ ├── libPaymentControl.a │ └── libpingpp+up.a ├── Wx │ └── libpingpp+wx.a └── Yeepay │ └── libpingpp+yeepay.a ├── Dependencies ├── Agreement │ └── libpingpp+agreement.a ├── Network │ ├── PingppURLResponse.h │ └── libpingpp+network.a └── WebView │ └── libpingpp+webview.a ├── Pingpp.bundle ├── Info.plist ├── about_blank.html ├── en.lproj │ └── Localizable.strings └── zh-Hans.lproj │ └── Localizable.strings ├── Pingpp.h └── libpingppcore.a /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | 3 | *.pbxuser 4 | *.mode1v3 5 | *.mode2v3 6 | *.perspectivev3 7 | *.swp 8 | *.moved-aside 9 | *.xcscmblueprint 10 | .idea 11 | 12 | .DS_Store 13 | profile 14 | DerivedData 15 | 16 | xcuserdata/ 17 | 18 | .swift-version 19 | pack.sh 20 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # ChangeLog 2 | 3 | ### 2.2.35 4 | 5 | > 该版本不支持`支付宝`,请使用 `2.2.34` 6 | 7 | #### 新增 8 | 9 | - 新增银联商务支持 10 | 11 | #### 更改 12 | 13 | - 更新支付宝 SDK 至 15.8.3 14 | 15 | ### 2.2.34 16 | 17 | #### 更改 18 | 19 | - 更新建行 SDK 至 2.4.2,建行 SDK 更新不包含 UIWebView 20 | 21 | ### 2.2.33 22 | 23 | #### 更改 24 | 25 | - 更新支付宝 SDK 至 15.7.9 26 | 27 | ### 2.2.32 28 | 29 | #### 更改 30 | 31 | - 更新拉卡拉 SDK 支持微信(wx_app_lakala) 32 | - `Pingpp.h` nullability 声明修改 33 | - 去掉 idfa 相关获取 34 | 35 | ### 2.2.31 36 | 37 | #### 更改 38 | 39 | - 更新招行 SDK,修改为 WKWebView;针对招行 SDK 进行相应适配; 40 | - 更新支付宝 SDK 至 15.7.4。 41 | 42 | ### 2.2.30 43 | 44 | #### 新增 45 | 46 | - 支持 alipay_app_lakala 47 | 48 | ### 2.2.29 49 | 50 | #### 更改 51 | 52 | - 微信支付支持 Universal Links 方式跳转 53 | - 更新支付宝、银联 SDK 54 | 55 | ### 2.2.28 56 | 57 | #### 修复 58 | 59 | - 修复打开京东支付时可能崩溃的问题 60 | 61 | ### 2.2.27 62 | 63 | #### 新增 64 | 65 | - cb_isv_ailpay, cb_isv_wx 支持 66 | 67 | #### 更改 68 | 69 | - 银联 SDK 更新 3.3.12 70 | - 支付宝 SDK 更新 15.6.4 71 | 72 | ### 2.2.26 73 | 74 | #### 新增 75 | 76 | - 和包支付 77 | 78 | #### 更改 79 | 80 | - 去除 armv7s, i386 架构 81 | 82 | ### 2.2.25 83 | 84 | #### 新增 85 | 86 | - 微信签约接口 87 | 88 | #### 更改 89 | 90 | - `UIWebView` 替换成 `WKWebView` 91 | - 添加 `arm64e` 支持 92 | 93 | ### 2.2.24 94 | 95 | #### 新增 96 | 97 | - 建设银行 app (CcbPay) 渠道 98 | 99 | ### 2.2.23 100 | 101 | #### 修复 102 | 103 | - 招商银行键盘显示不全 104 | 105 | ### 2.2.22 106 | #### 新增 107 | - 招商银行 app 支付 108 | 109 | ### 2.2.21 110 | - 更改:去除 `libstdc++` 依赖 111 | 112 | ### 2.2.20 113 | - 删除:删除 壹收款 模块 114 | - 更改:添加 Ping++ UI 模块 115 | - 更改:更新银联 SDK 到 3.3.11 版本 116 | - 新增:UI 模块 不含渠道选择列表方法 117 | - 新增:`qpay` 渠道 118 | - 新增:`Apple Pay` 渠道 119 | - 新增:`pingpp_ui` 渠道 120 | 121 | ### 2.2.19 122 | - 新增:支付宝境外支付渠 ( CBAlipay ) 123 | - 更改:银联付款 通过 云闪付 方式进行付款 没有回调结果的 BUG 124 | 125 | ### 2.2.18 126 | - 更改:更新支付宝 SDK 到 15.5.0 已适配iPhoneX,支持IPv6_only网络和ATS安全标准 127 | - 删除:分期渠道 ( Fqlpay , Qgbc , Mmdpay) 128 | 129 | ### 2.2.17 130 | - 更改:兼容 Ping++ 最新账户系统版本 1.4 131 | - 新增:添加 支持商户系统 recharge 功能 现在可以传入 (charge | order | recharge) 132 | - 更改:修改 壹收款 花呗分期 显示接口 133 | 134 | ### 2.2.16 135 | - 更改:更新 Alipay SDK (1. 增加防重入功能,确保当前支付或授权不被打扰;2. 增加跳转防控措施;) 136 | - 更改:更新 Unionpay SDK (优化性能。) 137 | - 新增:壹收款 添加 花呗分期渠道 (Channel 不变还是 alipay 需要额外 在自定义参数中添加 installment = true) 138 | 139 | ### 2.2.15 140 | - 更改:更新 Apple Pay SDK 141 | 142 | ### 2.2.14 143 | - 更改:更新 Alipay SDK (1. 修复H5 scheme_url 跳转失败报错问题。2. 去除一些不必要的warning.) 144 | - 更改:更新 Unionpay SDK (更新3.3.8:优化性能。) 145 | - 更改:修复 支付渠道为 支付宝时 URLScheme 为 nil 导致程序崩溃 146 | 147 | ### 2.2.13 148 | - 更改:修复 支付宝 SDK 付款成功后 返回结果 错误 149 | - 更改:优化 京东 SDK 150 | 151 | ### 2.2.12 152 | - 更改:更新 Alipay SDK (兼容 支付宝 2.0) 153 | - 更改:更新 CmbWallet SDK (兼容 招行一网通 2.0) 154 | 155 | ### 2.2.11 156 | - 新增:壹收款 Demo 157 | - 更改:最低系统支持版本为 iOS7.0 以上 158 | - 更改:修改iOS 8.0以下 web支付渠道 点击左上角返回按钮的处理逻辑 159 | - 删除:cnp渠道 (应用内快捷支付) 160 | 161 | ### 2.2.10 162 | - 更改:兼用 支付宝 最新版 客户端同步返回结果 163 | - 更改:优化 京东、招行一网通 支付完成回调 164 | - 更改:更新银联 SDK 到 3.3.6 版本 165 | 166 | ### 2.2.9 167 | - 新增:账户余额系统(SDK 兼容 charge 与 order 对象) 168 | - 更改:Ping++ Debug Log 信息优化 169 | - 更改:优化百度钱包网页支付 170 | - 更改:优化京东支付网页支付 171 | - 更改:更新 Demo 172 | 173 | ### 2.2.8 174 | - 更改:更新 Apple Pay SDK 175 | - 更改:所有web渠道添加 [Pingpp ignoreResultUrl: YES] 方法 176 | - 更改:优化 在某些情况下 会导致 [Pingpp handleOpenURL:url withCompletion:nil] 崩溃的问题 177 | - 更改:优化 壹收款 支付成功页面 178 | - 更改:优化 SDK 支付失败后的回调信息 179 | - 删除:bfb渠道(百度钱包) 可以用(bfb_wap)代替 180 | 181 | ### 2.2.7 182 | - 新增:QQ钱包 (qpay) 183 | - 新增:京东支付 wap版(jdpay_wap) 184 | 185 | ### 2.2.6 186 | - 新增:分期渠道 添加 processing 状态 (交易处理中) 187 | - 更改:更新 ApplePay SDK 188 | - 更改:易宝支付 通过webView打开 189 | - 更改:优化 么么贷 结果回调 190 | 191 | ### 2.2.5 192 | - 新增:招行一网通(cmb_wallet) 193 | - 新增:百度钱包 wap版(bfb_wap) 194 | - 更改:分期乐(fqlpay_wap) 优化支付结果页面 195 | 196 | ### 2.2.4 197 | - 新增:添加么么贷(mmdpay_wap) 198 | - 更改:分期渠道通过 webView 打开 199 | - 更改:iOS 9 以下 livemode 字段兼容以下值 [true, false, 1, 0] 200 | - 更改:更新支付宝 SDK(支持 ipv6),依赖框架(CoreTelephony.framework, CoreMotion.framework) 201 | 202 | ### 2.2.2 203 | * 新增: 204 | 添加分期乐 (fqlpay_wap) 205 | 添加量化派 (qgbc_wap) 206 | 207 | ### 2.2.1 208 | * 更改: 209 | 更新银联 SDK 到 3.3.3 版本 210 | 211 | ### 2.2.0 212 | * 新增: 213 | 添加应用内快捷支付(cnp) 214 | 添加壹收款模块 215 | 216 | ### 2.1.4 217 | * 更改: 218 | 修复编译 warning 问题 219 | 修改 podspec 默认不包含 bfb 220 | 221 | ### 2.1.3 222 | * 更改: 223 | 更新银联 SDK 到 3.1.1 版本 224 | 修复 CocoaPods 导入问题 225 | 更新支付宝 SDK 226 | Ping++ 静态库文件支持 Bitcode 227 | 228 | ### 2.1.2 229 | * 更改: 230 | 更新银联 SDK 到 3.1.0 版本 231 | 232 | ### 2.1.1 233 | * 更改: 234 | 修正 charge 格式不正确时的回调 235 | 236 | ### 2.1.0 237 | * 新增: 238 | 添加 Debug 模式,可打印出 log,方便调试。开启方法:`[Pingpp setDebugMode:YES];` 239 | * 更改: 240 | charge 可以用 NSDictionary 格式传入 241 | 更新支付宝、微信(不支持 armv7s)和百度钱包 SDK 242 | 不包含微信静态库文件也可以调用支付 243 | 244 | ### 2.0.6 245 | * 更改: 246 | 添加 handleOpenURL 返回值 247 | 248 | ### 2.0.5 249 | * 更改: 250 | 分离各渠道静态库 251 | 252 | ### 2.0.4 (20150428) 253 | * 更改: 254 | 分离 Apple Pay 静态库 255 | 更新 AlipaySDK.framework 256 | 257 | ### 2.0.4 258 | * 新增: 259 | 支持 Apple Pay 260 | 261 | ### 2.0.3 262 | * 更改: 263 | 支持 iOS 5.1.1 264 | 265 | ### 2.0.2 266 | * 更改: 267 | 新的测试模式 268 | 百度钱包 SDK 静态库文件更新 269 | 270 | ### 2.0.1(20150112) 271 | * 更改: 272 | 更换银联静态库文件 273 | 274 | ### 2.0.1 275 | * 更改: 276 | 方法 `+handleOpenURL:withCompletion:` 中 `completion` 可以传 `nil` 277 | 278 | ### 2.0.0 279 | * 更改: 280 | 支持 arm64 281 | 添加新渠道:百付宝 282 | 调用方法更改 283 | callback 添加返回错误信息 284 | 285 | ### 1.0.5 286 | * 更改: 287 | 更换了测试环境 URL 288 | -------------------------------------------------------------------------------- /Pingpp.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'Pingpp' 3 | s.version = '2.2.35' 4 | s.summary = 'Pingplusplus iOS SDK' 5 | s.description = <<-DESC 6 | 移动应用支付接口。 7 | 开发者不再需要编写冗长的代码,简单几步就可以使你的应用获得支付功能。 8 | 让你的移动应用接入支付像大厦接入电力一样简单,方便,和温暖。 9 | 支持微信支付,公众账号支付,支付宝钱包,百度钱包,银联手机支付。 10 | DESC 11 | s.homepage = 'https://pingxx.com' 12 | s.license = 'COMMERCIAL' 13 | s.author = { 'Afon Weng' => 'xufeng.weng@pingxx.com' } 14 | s.platform = :ios, '10.0' 15 | s.source = { :http => "https://sdk-assets.oss-cn-shanghai.aliyuncs.com/pingpp/#{s.version}/pingpp-ios-libs.zip" } 16 | s.requires_arc = true 17 | s.default_subspec = 'Core', 'Alipay', 'UnionPay' 18 | s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'} 19 | s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'} 20 | 21 | s.subspec 'Core' do |core| 22 | core.source_files = 'lib/*.h', 'lib/Dependencies/Network/*.h' 23 | core.public_header_files = 'lib/*.h', 'lib/Dependencies/Network/*.h' 24 | core.vendored_libraries = 'lib/*.a', 'lib/Dependencies/Network/*.a' 25 | core.resource = 'lib/*.bundle' 26 | core.frameworks = 'CFNetwork', 'SystemConfiguration', 'Security', 'CoreLocation' 27 | core.ios.library = 'c++', 'z' 28 | core.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC' } 29 | end 30 | 31 | s.subspec 'ApplePay' do |ss| 32 | ss.vendored_libraries = 'lib/Channels/ApplePay/*.a' 33 | ss.frameworks = 'PassKit' 34 | ss.dependency 'Pingpp/Core' 35 | ss.dependency 'PingppUnionPayApplePaySDK' 36 | end 37 | 38 | s.subspec 'Alipay' do |ss| 39 | ss.vendored_libraries = 'lib/Channels/Alipay/*.a' 40 | ss.frameworks = 'CoreMotion', 'CoreTelephony' 41 | ss.dependency 'Pingpp/Core' 42 | ss.dependency 'PingppAlipaySDK' 43 | end 44 | 45 | s.subspec 'CBAlipay' do |ss| 46 | ss.dependency 'Pingpp/Alipay' 47 | end 48 | 49 | s.subspec 'AlipayNoUTDID' do |ss| 50 | ss.vendored_libraries = 'lib/Channels/Alipay/*.a' 51 | ss.frameworks = 'CoreMotion', 'CoreTelephony' 52 | ss.dependency 'Pingpp/Core' 53 | ss.dependency 'PingppAlipaySDKNoUTDID' 54 | end 55 | 56 | s.subspec 'Wx' do |ss| 57 | ss.vendored_libraries = 'lib/Channels/Wx/*.a' 58 | ss.dependency 'Pingpp/Core' 59 | ss.dependency 'WechatOpenSDK' 60 | end 61 | 62 | s.subspec 'UnionPay' do |ss| 63 | ss.vendored_libraries = 'lib/Channels/UnionPay/*.a' 64 | ss.dependency 'Pingpp/Core' 65 | ss.dependency 'PingppUnionPaySDK' 66 | end 67 | 68 | s.subspec 'BfbWap' do |ss| 69 | ss.vendored_libraries = 'lib/Channels/BfbWap/*.a' 70 | ss.dependency 'Pingpp/Core' 71 | ss.dependency 'Pingpp/WebView' 72 | end 73 | 74 | s.subspec 'Yeepay' do |ss| 75 | ss.vendored_libraries = 'lib/Channels/Yeepay/*.a' 76 | ss.dependency 'Pingpp/Core' 77 | ss.dependency 'Pingpp/WebView' 78 | end 79 | 80 | s.subspec 'CmbWallet' do |ss| 81 | ss.vendored_libraries = 'lib/Channels/CmbWallet/*.a' 82 | ss.dependency 'Pingpp/Core' 83 | ss.dependency 'PingppCMBSDK' 84 | end 85 | 86 | s.subspec 'Jdpay' do |ss| 87 | ss.vendored_libraries = 'lib/Channels/Jdpay/*.a' 88 | ss.dependency 'Pingpp/Core' 89 | ss.dependency 'Pingpp/WebView' 90 | end 91 | 92 | s.subspec 'QQWallet' do |ss| 93 | ss.vendored_libraries = 'lib/Channels/QQWallet/*.a' 94 | ss.public_header_files = 'lib/Channels/QQWallet/QQWalletSDK/*.h' 95 | ss.dependency 'Pingpp/Core' 96 | end 97 | 98 | s.subspec 'WebView' do |ss| 99 | ss.vendored_libraries = 'lib/Dependencies/WebView/*.a' 100 | ss.dependency 'Pingpp/Core' 101 | end 102 | 103 | s.subspec 'CcbPay' do |ss| 104 | ss.vendored_libraries = 'lib/Channels/CcbPay/*.a' 105 | ss.dependency 'Pingpp/Core' 106 | ss.dependency 'PingppCcbPaySDK', '~> 2.4.2' 107 | end 108 | 109 | s.subspec 'Agreement' do |ss| 110 | ss.vendored_libraries = 'lib/Dependencies/Agreement/*.a' 111 | ss.dependency 'Pingpp/Core' 112 | end 113 | 114 | s.subspec 'Cmpay' do |ss| 115 | ss.vendored_libraries = 'lib/Channels/Cmpay/*.a' 116 | ss.dependency 'Pingpp/Core' 117 | end 118 | 119 | s.subspec 'Lakala' do |ss| 120 | ss.vendored_libraries = 'lib/Channels/Lakala/*.a' 121 | ss.dependency 'Pingpp/Core' 122 | ss.dependency 'PingppLakalaSDK', '~> 2.0.1' 123 | end 124 | 125 | s.subspec 'Chinaums' do |ss| 126 | ss.vendored_libraries = 'lib/Channels/Chinaums/*.a' 127 | ss.dependency 'Pingpp/Core' 128 | ss.dependency 'PingppChinaUmsSDK' 129 | end 130 | 131 | end 132 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pingpp iOS SDK 2 | 3 | ## 目录 4 | 5 | * [1. 简介](#1) 6 | * [2. 版本要求](#2) 7 | * [3. 接入方法](#3) 8 | * [3. 使用 CocoaPods](#3.1) 9 | * [3. 手动导入](#3.2) 10 | * [4. 接入方法](#4) 11 | * [4.1 使用 Ping++ 标准版 SDK](#4.1) 12 | * [4.2 接收并处理交易结果](#4.2) 13 | * [5. 额外配置](#5) 14 | * [6. 注意事项](#6) 15 | 16 | ##

简介

17 | 18 | lib 文件夹下是 iOS SDK 文件, 19 | example 文件夹里面是一个简单的接入示例,该示例仅供参考。 20 | 21 | ##

版本要求

22 | 23 | iOS SDK 要求 iOS 10.0 及以上版本 24 | 25 | ##

接入方法

26 | 27 | **如不需要使用`银联商务`,请使用 `2.2.34` 版本。** 28 | 29 | ###

使用 CocoaPods

30 | 31 | 1. 在 `Podfile` 添加 32 | 33 | ```ruby 34 | pod 'Pingpp', '2.2.34' 35 | ``` 36 | 37 | 默认会包含支付宝和银联。你也可以自己选择渠道。 38 | 目前支持以下模块: 39 | 40 | - `Alipay`(支付宝移动支付) 41 | - `Wx`(微信支付) 42 | - `CBAlipay`(支付宝移动支付 - 境外支付) 43 | - `AlipayNoUTDID`(支付宝移动支付,独立 `UTDID.framework`) 44 | - `Wx`(微信 app 支付) 45 | - `QQWallet`(QQ 钱包 app 支付) 46 | - `UnionPay`(银联手机支付) 47 | - `ApplePay` 48 | - `CmbWallet`(招行一网通) 49 | - `BfbWap`(百度钱包 Wap 支付) 50 | - `Yeepay`(易宝支付 Wap 支付) 51 | - `Jdpay`(京东支付 Wap 支付) 52 | - `CcbPay`(建设银行 app 支付) 53 | - `Agreement`(带扣签约) 54 | - `Cmpay`(和包支付) 55 | - `Lakala`(拉卡拉 `alipay_app_lakala`, `wx_app_lakala`) 56 | - `Chinaums`(银联商务,仅 `2.2.35` 支持) 57 | 58 | 例如: 59 | 60 | ```ruby 61 | pod 'Pingpp/Alipay', '2.2.34' 62 | pod 'Pingpp/Wx', '2.2.34' 63 | pod 'Pingpp/UnionPay', '2.2.34' 64 | ``` 65 | 66 | 代扣签约 67 | 68 | ```ruby 69 | pod 'Pingpp/Agreement', '2.2.34' 70 | ``` 71 | 72 | 2. 运行 `pod install` 73 | 3. 从现在开始使用 `.xcworkspace` 打开项目,而不是 `.xcodeproj` 74 | 4. 添加 URL Schemes:在 Xcode 中,选择你的工程设置项,选中 "TARGETS" 一栏,在 "Info" 标签栏的 "URL Types" 添加 "URL Schemes",如果使用微信,填入所注册的微信应用程序 id,如果不使用微信,则自定义,允许英文字母和数字,首字母必须是英文字母,建议起名稍复杂一些,尽量避免与其他程序冲突。如果使用 CcbPay,格式为 `comccbpay+商户代码(即 MERCHANTID 字段值)+商户自定义的标示`,示例:`comccbpay105320148140002myapp`。 75 | 5. 2.1.0 及以上版本,可打开 Debug 模式,打印出 log,方便调试。开启方法:`[Pingpp setDebugMode:YES];`。 76 | 6. 2.2.8 及以上版本,可选择是否在 WAP 渠道中支付完成后,点击“返回商户”按钮,直接关闭支付页面。开启方法:`[Pingpp ignoreResultUrl:YES];` 。 77 | 7. 使用银联商务时,最好使用单独的 URL Scheme(使用微信支付时除外),并在调用 `createPayment` 方法时,通过 `appURLScheme` 参数传入。 78 | 79 | ###

手动导入

80 | 81 | 1. 获取 SDK 82 | 下载 SDK, 里面包含了 lib 文件夹和 example 文件夹。lib 文件夹里面是 SDK 的文件。 83 | 2. 依赖 Frameworks: 84 | 85 | 必需: 86 | 87 | ``` 88 | CFNetwork.framework 89 | SystemConfiguration.framework 90 | Security.framework 91 | QuartzCore.framework 92 | CoreTelephony.framework 93 | libc++.tbd 94 | libz.tbd 95 | libsqlite3.0.tbd 96 | CoreMotion.framework 97 | CoreLocation.framework 98 | WebKit.framework 99 | CoreGraphics.framework 100 | ``` 101 | 102 | Apple Pay 所需: 103 | 104 | ``` 105 | PassKit.framework 106 | ``` 107 | 108 | 3. 如果不需要某些渠道,删除 `lib/Channels` 下的相应目录即可。 109 | 4. 添加 URL Schemes:在 Xcode 中,选择你的工程设置项,选中 "TARGETS" 一栏,在 "Info" 标签栏的 "URL Types" 添加 "URL Schemes",如果使用微信,填入所注册的微信应用程序 id,如果不使用微信,则自定义,允许英文字母和数字,首字母必须是英文字母,建议起名稍复杂一些,尽量避免与其他程序冲突。 110 | 5. 添加 Other Linker Flags:在 Build Settings 搜索 Other Linker Flags ,添加 `-ObjC`。 111 | 6. 2.1.0 及以上版本,可打开 Debug 模式,打印出 log,方便调试。开启方法:`[Pingpp setDebugMode:YES];`。 112 | 7. 2.2.8 及以上版本,可选择是否在 WAP 渠道中支付完成后,点击“返回商户”按钮,直接关闭支付页面。开启方法:`[Pingpp ignoreResultUrl: YES];` 。 113 | 114 | ##

接入方法

115 | 116 | ###

使用 Ping++ 标准版 SDK

117 | 118 | ``` 119 | #import 120 | ``` 121 | 122 | Objective-C 123 | 124 | ``` objective-c 125 | // data 表示 Charge/Order/Recharge 的 JSON 字符串 126 | [Pingpp createPayment:data 127 | viewController:viewController 128 | appURLScheme:URLScheme 129 | withCompletion:^(NSString *result, PingppError *error) { 130 | if ([result isEqualToString:@"success"]) { 131 | // 支付成功 132 | } else { 133 | // 支付失败或取消 134 | NSLog(@"Error: code=%lu msg=%@", error.code, [error getMsg]); 135 | } 136 | }]; 137 | ``` 138 | 139 | Swift 140 | 141 | ```swift 142 | // 微信支付 SDK 需要设置 Universal Links 143 | Pingpp.setUniversalLink("https://example.com/sample/") 144 | 145 | Pingpp.createPayment(data as NSObject, viewController: viewController, appURLScheme: URLScheme) { (result: String?, error: PingppError?) in 146 | if error != nil { 147 | // 处理错误 148 | } 149 | // 处理结果 150 | } 151 | ``` 152 | 153 | > Universal Links 配置方法请参考 [Apple 官方文档](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/enabling_universal_links)及[微信相关文档](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html) 154 | 155 | #### 招行相关方法 156 | 157 | ##### 控制支付方式 158 | 159 | 自动判断,安装招行 app 时通过打开 app 支付,未安装时通过 WebView 打开 H5 页面支付。 160 | 161 | ```swift 162 | Pingpp.setCmbPayMethod(PingppCmbPayMethod.auto) 163 | ``` 164 | 165 | 仅通过打开 app 支付,要求必须安装有招行 app。 166 | 167 | ```swift 168 | Pingpp.setCmbPayMethod(PingppCmbPayMethod.appOnly) 169 | ``` 170 | 171 | 仅通过 WebView 打开 H5 页面支付。 172 | 173 | ```swift 174 | Pingpp.setCmbPayMethod(PingppCmbPayMethod.h5Only) 175 | ``` 176 | 177 | ##### 设置招行 H5 地址 178 | 179 | > 生产环境不需要设置。仅在招行要求在招行的测试环境执行测试案例时使用。 180 | 181 | ```swift 182 | // 参数 1,Bool,是否启用招行测试地址; 183 | // 参数 2,String,招行测试 H5 地址。仅参数 1 为 true 时生效。如果参数 2 传 nil,则会使用默认测试地址。 184 | Pingpp.setCmbEnv(true, url: nil) 185 | Pingpp.setCmbEnv(true, url: "https://...") 186 | ``` 187 | 188 | ###

接收并处理交易结果

189 | 190 | > alipay_app_lakala 渠道没有支付结果回调。 191 | 192 | ##### 渠道为支付宝但未安装支付宝钱包时,交易结果会在调起插件时的 Completion 中返回。渠道为微信、支付宝(安装了支付宝钱包)、银联或者测试模式时,请实现 UIApplicationDelegate 的 - application:openURL:options: 方法: 193 | 194 | ``` objective-c 195 | - (BOOL)application:(UIApplication *)app 196 | openURL:(NSURL *)url 197 | options:(NSDictionary *)options { 198 | BOOL canHandleURL = [Pingpp handleOpenURL:url withCompletion:nil]; 199 | 200 | return canHandleURL; 201 | } 202 | ``` 203 | 204 | ```swift 205 | func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { 206 | if Pingpp.handleOpen(url, withCompletion: nil) { 207 | return true; 208 | } else if Pingpp.handleAgreementURL(url, withCompletion: nil) { 209 | return true; 210 | } else { 211 | // 其他逻辑 212 | } 213 | 214 | return false 215 | } 216 | 217 | // 微信使用 Universal Links 的情况,需要该方法 218 | func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { 219 | var ret = Pingpp.handleContinue(userActivity, withCompletion: nil) 220 | if !ret { 221 | // 其他逻辑 222 | // ret = 其他处理 223 | } 224 | 225 | return ret 226 | } 227 | ``` 228 | 229 | ###

使用代扣签约接口

230 | 231 | Podfile 添加 232 | 233 | ```ruby 234 | pod 'Pingpp/Agreement', '2.2.34' 235 | ``` 236 | 237 | 通过服务端获取 `agreement` 对象后,调用接口 238 | 239 | Objective-C 240 | 241 | ```objective-c 242 | [Pingpp signAgreement:agreement 243 | withCompletion:^(NSString *result, PingppError *error) { 244 | // 处理结果/错误 245 | }]; 246 | ``` 247 | 248 | Swift 249 | 250 | ```swift 251 | Pingpp.signAgreement(agreement) { (result: String?, error: PingppError?) in 252 | // 处理结果/错误 253 | } 254 | ``` 255 | 256 | #### 处理签约结果 257 | 258 | Objective-C 259 | 260 | ``` objective-c 261 | - (BOOL)application:(UIApplication *)app 262 | openURL:(NSURL *)url 263 | options:(NSDictionary *)options { 264 | if ([Pingpp handleOpenURL:url withCompletion:nil]) { 265 | // 这个是处理支付回调的 266 | return YES; 267 | } else if ([Pingpp handleAgreementURL:url withCompletion:nil]) { 268 | // 这个是处理签约回调的,签约回调,目前前端只会在 completion 返回 "unknown",需要通过服务端查询实际结果 269 | return YES; 270 | } 271 | 272 | return NO; 273 | } 274 | ``` 275 | 276 | Swift 277 | 278 | ``` swift 279 | func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { 280 | if Pingpp.handleOpen(url, withCompletion: nil) { 281 | return true; 282 | } else if Pingpp.handleAgreementURL(url, withCompletion: nil) { 283 | return true; 284 | } else { 285 | // 其他逻辑 286 | } 287 | 288 | return false 289 | } 290 | 291 | // 微信使用 Universal Links 的情况,需要该方法 292 | func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { 293 | var ret = Pingpp.handleContinue(userActivity, withCompletion: nil) 294 | if !ret { 295 | // 其他逻辑 296 | // ret = 其他处理 297 | } 298 | 299 | return ret 300 | } 301 | ``` 302 | 303 | ##

额外配置

304 | 305 | 1. 如果需要使用支付宝和微信等跳转至渠道 app 的渠道,需要在 `Info.plist` 添加以下代码: 306 | 307 | ```xml 308 | LSApplicationQueriesSchemes 309 | 310 | weixinULAPI 311 | weixin 312 | wechat 313 | alipay 314 | alipays 315 | mqq 316 | mqqwallet 317 | uppaysdk 318 | uppaywallet 319 | uppayx1 320 | uppayx2 321 | uppayx3 322 | cmbmobilebank 323 | mbspay 324 | cmpay 325 | 326 | ``` 327 | 2. 如果 App 需要访问 `http://`,需要在 `Info.plist` 添加如下代码,或者根据需求添加 `NSExceptionDomains`: 328 | 329 | ```xml 330 | NSAppTransportSecurity 331 | 332 | NSAllowsArbitraryLoads 333 | 334 | 335 | ``` 336 | 3. 如果编译失败,遇到错误信息为: 337 | 338 | ``` 339 | XXXXXXX does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. 340 | ``` 341 | 请到 Xcode 项目的 `Build Settings` 标签页搜索 bitcode,将 `Enable Bitcode` 设置为 `NO`。 342 | 4. 招行一网通 app 支付配置招行分配的 `URL Schemes`,并调用方法 `[Pingpp setCmbURLScheme:@"..."];`,该 `URL Scheme` 不要与其他支付方式共用,否则会影响前端支付结果返回; 343 | 5. 判断设备上是否已经安装招商银行 app 的方法:`[Pingpp isCmbWalletInstalled]`。 344 | 6. 使用 CcbPay 请先确保用户手机安装了建设银行 app。判断设备上是否已经安装建设银行 app 的方法:`[Pingpp isCcbAppInstalled]`。 345 | 7. 使用 CcbPay 的情况,需要在 `Info.plist` 的 `NSAppTransportSecurity` 字段添加相应的 `NSExceptionDomains`。 346 | 347 | ```xml 348 | NSExceptionDomains 349 | 350 | ibsbjstar.ccb.com.cn 351 | 352 | NSExceptionAllowsInsecureHTTPLoads 353 | 354 | NSExceptionRequiresForwardSecrecy 355 | 356 | NSIncludesSubdomains 357 | 358 | 359 | 360 | ``` 361 | 362 | ##

注意事项

363 | 364 | ### * 如果不需要 Apple Pay,请不要导入 Apple Pay 的静态库。以免提交到 App Store 时审核不通过。 365 | 366 | ### * 如果 集成 Apple Pay 测试时请注意 以下几点 367 | 368 | 1. 测试时必须是真机进行测试 369 | 2. 检查相关的证书是否正确 370 | 3. 手机必须是 iPhone 6 以上 371 | 4. 支付时必须绑定了真实的银行卡且有充足的余额 372 | 373 | ### * 请勿直接使用客户端支付结果作为最终判定订单状态的依据,支付状态以服务端为准!!!在收到客户端同步返回结果时,请向自己的服务端请求来查询订单状态。 374 | 375 | ### * 支付宝渠道发生包冲突的情况 376 | 377 | 使用阿里百川等阿里系的 SDK 时,可能会出现冲突,请尝试使用 `pod 'Pingpp/AlipayNoUTDID'` 代替 `pod 'Pingpp/Alipay'`。 378 | 379 | 因为 `CocoaPods` 的限制,只有编译通过的才能上传成功,所以使用时,需要删除项目中已经存在的 `UTDID.framework`。 380 | 381 | **关于如何使用 SDK 请参考 [开发者中心](https://www.pingxx.com/docs/index) 或者 [example](https://github.com/PingPlusPlus/pingpp-ios/tree/master/example) 文件夹里的示例。** 382 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 2.2.35 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | Pods/ 37 | Podfile.lock 38 | -------------------------------------------------------------------------------- /example/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '10.0' 2 | use_modular_headers! 3 | 4 | PingppSDKVersion = '2.2.34' 5 | 6 | target 'demoapp' do 7 | pod 'Pingpp/Wx', PingppSDKVersion 8 | pod 'Pingpp/Alipay', PingppSDKVersion 9 | ## pod 'Pingpp/AlipayNoUTDID', PingppSDKVersion 10 | pod 'Pingpp/UnionPay', PingppSDKVersion 11 | pod 'Pingpp/ApplePay', PingppSDKVersion 12 | pod 'Pingpp/QQWallet', PingppSDKVersion 13 | pod 'Pingpp/CmbWallet', PingppSDKVersion 14 | pod 'Pingpp/BfbWap', PingppSDKVersion 15 | pod 'Pingpp/Yeepay', PingppSDKVersion 16 | pod 'Pingpp/Jdpay', PingppSDKVersion 17 | pod 'Pingpp/CcbPay', PingppSDKVersion 18 | pod 'Pingpp/Cmpay', PingppSDKVersion 19 | pod 'Pingpp/Agreement', PingppSDKVersion 20 | pod 'Pingpp/Lakala', PingppSDKVersion 21 | end 22 | 23 | post_install do |installer| 24 | installer.pods_project.targets.each do |target| 25 | target.build_configurations.each do |config| 26 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0' 27 | config.build_settings['ENABLE_BITCODE'] = 'NO' 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /example/demoapp-swift/.gitignore: -------------------------------------------------------------------------------- 1 | Podfile.lock 2 | Pods/ 3 | -------------------------------------------------------------------------------- /example/demoapp-swift/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '10.0' 2 | use_modular_headers! 3 | 4 | PingppSDKVersion = '2.2.30' 5 | 6 | target 'demoapp-swift' do 7 | pod 'Pingpp/Wx', PingppSDKVersion 8 | pod 'Pingpp/Alipay', PingppSDKVersion 9 | ## pod 'Pingpp/AlipayNoUTDID', PingppSDKVersion 10 | pod 'Pingpp/UnionPay', PingppSDKVersion 11 | pod 'Pingpp/ApplePay', PingppSDKVersion 12 | pod 'Pingpp/QQWallet', PingppSDKVersion 13 | pod 'Pingpp/CmbWallet', PingppSDKVersion 14 | pod 'Pingpp/BfbWap', PingppSDKVersion 15 | pod 'Pingpp/Yeepay', PingppSDKVersion 16 | pod 'Pingpp/Jdpay', PingppSDKVersion 17 | pod 'Pingpp/CcbPay', PingppSDKVersion 18 | pod 'Pingpp/Cmpay', PingppSDKVersion 19 | pod 'Pingpp/Agreement', PingppSDKVersion 20 | pod 'Pingpp/Lakala', PingppSDKVersion 21 | end 22 | 23 | post_install do |installer| 24 | installer.pods_project.targets.each do |target| 25 | target.build_configurations.each do |config| 26 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0' 27 | config.build_settings['ENABLE_BITCODE'] = 'NO' 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // demoapp-swift 4 | // 5 | // Created by Afon on 15/4/30. 6 | // Copyright (c) 2015年 Pingplusplus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 17 | // Override point for customization after application launch. 18 | Pingpp.setDebugMode(true) 19 | print(Pingpp.version()!) 20 | 21 | return true 22 | } 23 | 24 | func applicationWillResignActive(_ application: UIApplication) { 25 | // 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. 26 | // 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. 27 | } 28 | 29 | func applicationDidEnterBackground(_ application: UIApplication) { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | func applicationWillEnterForeground(_ application: UIApplication) { 35 | // 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. 36 | } 37 | 38 | func applicationDidBecomeActive(_ application: UIApplication) { 39 | // 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. 40 | } 41 | 42 | func applicationWillTerminate(_ application: UIApplication) { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | // 以下方法调用相关说明请查看 Objective-C 相关文件 47 | func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { 48 | print(url.absoluteString) 49 | 50 | return Pingpp.handleOpen(url, withCompletion: nil) 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleURLTypes 22 | 23 | 24 | CFBundleTypeRole 25 | Editor 26 | CFBundleURLSchemes 27 | 28 | YOUR-APP-URL-SCHEME 29 | 30 | 31 | 32 | CFBundleTypeRole 33 | Editor 34 | CFBundleURLSchemes 35 | 36 | demoappswift 37 | 38 | 39 | 40 | CFBundleVersion 41 | 1 42 | LSApplicationQueriesSchemes 43 | 44 | weixin 45 | weixinULAPI 46 | wechat 47 | alipay 48 | alipays 49 | mqqwallet 50 | mqq 51 | uppaysdk 52 | uppaywallet 53 | uppayx1 54 | uppayx2 55 | uppayx3 56 | mbspay 57 | cmpay 58 | 59 | LSRequiresIPhoneOS 60 | 61 | NSAppTransportSecurity 62 | 63 | NSAllowsArbitraryLoads 64 | 65 | 66 | UILaunchStoryboardName 67 | LaunchScreen 68 | UIMainStoryboardFile 69 | Main 70 | UIRequiredDeviceCapabilities 71 | 72 | armv7 73 | 74 | UISupportedInterfaceOrientations 75 | 76 | UIInterfaceOrientationPortrait 77 | 78 | UISupportedInterfaceOrientations~ipad 79 | 80 | UIInterfaceOrientationPortrait 81 | UIInterfaceOrientationPortraitUpsideDown 82 | UIInterfaceOrientationLandscapeLeft 83 | UIInterfaceOrientationLandscapeRight 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // demoapp-swift 4 | // 5 | // Created by Afon on 15/4/30. 6 | // Copyright (c) 2015年 Pingplusplus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | let kBackendChargeURL = "http://218.244.151.190/demo/charge" // 你的服务端创建并返回 charge 的 URL 地址,此地址仅供测试用。如果该地址失效,请使用你自己的后端接口。 12 | // 以下参数的相关说明请查看 Objective-C 相关文件 13 | let kAppURLScheme = "demoappswift" // 这个是你定义的 URL Scheme,支付宝、微信支付和测试模式需要。 14 | 15 | class ViewController: UIViewController { 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | override func didReceiveMemoryWarning() { 23 | super.didReceiveMemoryWarning() 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | override func viewDidAppear(_ animated: Bool) { 28 | 29 | let postDict : AnyObject = NSDictionary(objects: ["alipay", "10"], forKeys: ["channel" as NSCopying, "amount" as NSCopying]) 30 | var postData: NSData = NSData() 31 | do { 32 | try postData = JSONSerialization.data(withJSONObject: postDict, options: JSONSerialization.WritingOptions.prettyPrinted) as NSData 33 | } catch { 34 | print("Serialization error") 35 | } 36 | 37 | let url = NSURL(string: kBackendChargeURL) 38 | let session = URLSession.shared 39 | let request = NSMutableURLRequest(url: url! as URL) 40 | request.httpMethod = "POST" 41 | request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type") 42 | request.httpBody = postData as Data 43 | 44 | let sessionTask = session.dataTask(with: request as URLRequest) { (data, response, error) -> Void in 45 | if data != nil { 46 | let charge = NSString(data: data!, encoding: String.Encoding.utf8.rawValue) 47 | print(charge! as String) 48 | 49 | DispatchQueue.main.async { 50 | Pingpp.createPayment(charge! as NSObject, appURLScheme: kAppURLScheme) { (result, error) -> Void in 51 | print(result!) 52 | if error != nil { 53 | print(error!.getMsg()!) 54 | } 55 | } 56 | } 57 | } else { 58 | print("response data is nil") 59 | } 60 | } 61 | sessionTask.resume() 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swift/demoapp-swift-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | #import "Pingpp.h" -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swiftTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/demoapp-swift/demoapp-swiftTests/demoapp_swiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // demoapp_swiftTests.swift 3 | // demoapp-swiftTests 4 | // 5 | // Created by Afon on 15/4/30. 6 | // Copyright (c) 2015年 Pingplusplus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class demoapp_swiftTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /example/demoapp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5F61B02119C81A4F0035CD99 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F61B02019C81A4F0035CD99 /* Foundation.framework */; }; 11 | 5F61B02519C81A500035CD99 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F61B02419C81A500035CD99 /* UIKit.framework */; }; 12 | 5FA5761F1A58F551000B36ED /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FA576111A58F551000B36ED /* AppDelegate.m */; }; 13 | 5FA576211A58F551000B36ED /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5FA576141A58F551000B36ED /* Images.xcassets */; }; 14 | 5FA576221A58F551000B36ED /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FA576151A58F551000B36ED /* main.m */; }; 15 | 5FA576231A58F551000B36ED /* home.png in Resources */ = {isa = PBXBuildFile; fileRef = 5FA576171A58F551000B36ED /* home.png */; }; 16 | 5FA576241A58F551000B36ED /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5FA576191A58F551000B36ED /* InfoPlist.strings */; }; 17 | 5FA576251A58F551000B36ED /* ViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5FA5761B1A58F551000B36ED /* ViewController_iPad.xib */; }; 18 | 5FA576261A58F551000B36ED /* ViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5FA5761C1A58F551000B36ED /* ViewController_iPhone.xib */; }; 19 | 5FA576311A58FA7C000B36ED /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5FA576301A58FA7C000B36ED /* ViewController.mm */; }; 20 | 7267367D76FA8E7AAB43888C /* libPods-demoapp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CB829B9C99C045EE201397A3 /* libPods-demoapp.a */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 5F5BBB2019D0189B009A9DCE /* en */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = en; path = en.lproj/home.png; sourceTree = ""; }; 25 | 5F61B01D19C81A4F0035CD99 /* demoapp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demoapp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 5F61B02019C81A4F0035CD99 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 27 | 5F61B02419C81A500035CD99 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 28 | 5F61B05E19C81D390035CD99 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 29 | 5F61B05F19C81D390035CD99 /* ViewController_iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController_iPad.xib; sourceTree = ""; }; 30 | 5F61B06019C81D390035CD99 /* ViewController_iPhone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController_iPhone.xib; sourceTree = ""; }; 31 | 5FA576101A58F551000B36ED /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 32 | 5FA576111A58F551000B36ED /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 33 | 5FA576121A58F551000B36ED /* demoapp-Info.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "demoapp-Info.pch"; sourceTree = ""; }; 34 | 5FA576131A58F551000B36ED /* demoapp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "demoapp-Info.plist"; sourceTree = ""; }; 35 | 5FA576141A58F551000B36ED /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 36 | 5FA576151A58F551000B36ED /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 37 | 5FA576181A58F551000B36ED /* en */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = en; path = en.lproj/home.png; sourceTree = ""; }; 38 | 5FA5761A1A58F551000B36ED /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 39 | 5FA5761B1A58F551000B36ED /* ViewController_iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController_iPad.xib; sourceTree = ""; }; 40 | 5FA5761C1A58F551000B36ED /* ViewController_iPhone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController_iPhone.xib; sourceTree = ""; }; 41 | 5FA5761D1A58F551000B36ED /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 42 | 5FA576301A58FA7C000B36ED /* ViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = ""; }; 43 | CB829B9C99C045EE201397A3 /* libPods-demoapp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-demoapp.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | D9845181D37B049E615F7664 /* Pods-demoapp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoapp.release.xcconfig"; path = "Target Support Files/Pods-demoapp/Pods-demoapp.release.xcconfig"; sourceTree = ""; }; 45 | E59C50552D576E3DBAA72F12 /* Pods-demoapp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoapp.debug.xcconfig"; path = "Target Support Files/Pods-demoapp/Pods-demoapp.debug.xcconfig"; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | 5F61B01A19C81A4F0035CD99 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | 5F61B02519C81A500035CD99 /* UIKit.framework in Frameworks */, 54 | 5F61B02119C81A4F0035CD99 /* Foundation.framework in Frameworks */, 55 | 7267367D76FA8E7AAB43888C /* libPods-demoapp.a in Frameworks */, 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | /* End PBXFrameworksBuildPhase section */ 60 | 61 | /* Begin PBXGroup section */ 62 | 5F61B01419C81A4F0035CD99 = { 63 | isa = PBXGroup; 64 | children = ( 65 | 5FA5760F1A58F551000B36ED /* demoapp */, 66 | 5F61B01F19C81A4F0035CD99 /* Frameworks */, 67 | 5F61B05C19C81D390035CD99 /* Resources */, 68 | 5F61B01E19C81A4F0035CD99 /* Products */, 69 | CA4FDB7F3282F6280264C8FB /* Pods */, 70 | ); 71 | sourceTree = ""; 72 | }; 73 | 5F61B01E19C81A4F0035CD99 /* Products */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 5F61B01D19C81A4F0035CD99 /* demoapp.app */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | 5F61B01F19C81A4F0035CD99 /* Frameworks */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 5F61B02019C81A4F0035CD99 /* Foundation.framework */, 85 | 5F61B02419C81A500035CD99 /* UIKit.framework */, 86 | CB829B9C99C045EE201397A3 /* libPods-demoapp.a */, 87 | ); 88 | name = Frameworks; 89 | sourceTree = ""; 90 | }; 91 | 5F61B05C19C81D390035CD99 /* Resources */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 5F61B05D19C81D390035CD99 /* InfoPlist.strings */, 95 | 5F61B05F19C81D390035CD99 /* ViewController_iPad.xib */, 96 | 5F61B06019C81D390035CD99 /* ViewController_iPhone.xib */, 97 | 5F5BBB1F19D0189B009A9DCE /* home.png */, 98 | ); 99 | name = Resources; 100 | path = demoapp/Resources; 101 | sourceTree = ""; 102 | }; 103 | 5FA5760F1A58F551000B36ED /* demoapp */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 5FA576101A58F551000B36ED /* AppDelegate.h */, 107 | 5FA576111A58F551000B36ED /* AppDelegate.m */, 108 | 5FA5761D1A58F551000B36ED /* ViewController.h */, 109 | 5FA576301A58FA7C000B36ED /* ViewController.mm */, 110 | 5FA576121A58F551000B36ED /* demoapp-Info.pch */, 111 | 5FA576131A58F551000B36ED /* demoapp-Info.plist */, 112 | 5FA576141A58F551000B36ED /* Images.xcassets */, 113 | 5FA576151A58F551000B36ED /* main.m */, 114 | 5FA576161A58F551000B36ED /* Resources */, 115 | ); 116 | path = demoapp; 117 | sourceTree = ""; 118 | }; 119 | 5FA576161A58F551000B36ED /* Resources */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 5FA576171A58F551000B36ED /* home.png */, 123 | 5FA576191A58F551000B36ED /* InfoPlist.strings */, 124 | 5FA5761B1A58F551000B36ED /* ViewController_iPad.xib */, 125 | 5FA5761C1A58F551000B36ED /* ViewController_iPhone.xib */, 126 | ); 127 | path = Resources; 128 | sourceTree = ""; 129 | }; 130 | CA4FDB7F3282F6280264C8FB /* Pods */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | E59C50552D576E3DBAA72F12 /* Pods-demoapp.debug.xcconfig */, 134 | D9845181D37B049E615F7664 /* Pods-demoapp.release.xcconfig */, 135 | ); 136 | path = Pods; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 5F61B01C19C81A4F0035CD99 /* demoapp */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 5F61B04919C81A500035CD99 /* Build configuration list for PBXNativeTarget "demoapp" */; 145 | buildPhases = ( 146 | 0B7EDEFA396153965C531DAB /* [CP] Check Pods Manifest.lock */, 147 | 5F61B01919C81A4F0035CD99 /* Sources */, 148 | 5F61B01A19C81A4F0035CD99 /* Frameworks */, 149 | 5F61B01B19C81A4F0035CD99 /* Resources */, 150 | AD52E3A9659A1F6A6F10C830 /* [CP] Copy Pods Resources */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = demoapp; 157 | productName = demoapp; 158 | productReference = 5F61B01D19C81A4F0035CD99 /* demoapp.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | /* End PBXNativeTarget section */ 162 | 163 | /* Begin PBXProject section */ 164 | 5F61B01519C81A4F0035CD99 /* Project object */ = { 165 | isa = PBXProject; 166 | attributes = { 167 | LastUpgradeCheck = 1020; 168 | ORGANIZATIONNAME = pingplusplus; 169 | }; 170 | buildConfigurationList = 5F61B01819C81A4F0035CD99 /* Build configuration list for PBXProject "demoapp" */; 171 | compatibilityVersion = "Xcode 3.2"; 172 | developmentRegion = en; 173 | hasScannedForEncodings = 0; 174 | knownRegions = ( 175 | en, 176 | Base, 177 | ); 178 | mainGroup = 5F61B01419C81A4F0035CD99; 179 | productRefGroup = 5F61B01E19C81A4F0035CD99 /* Products */; 180 | projectDirPath = ""; 181 | projectRoot = ""; 182 | targets = ( 183 | 5F61B01C19C81A4F0035CD99 /* demoapp */, 184 | ); 185 | }; 186 | /* End PBXProject section */ 187 | 188 | /* Begin PBXResourcesBuildPhase section */ 189 | 5F61B01B19C81A4F0035CD99 /* Resources */ = { 190 | isa = PBXResourcesBuildPhase; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | 5FA576251A58F551000B36ED /* ViewController_iPad.xib in Resources */, 194 | 5FA576211A58F551000B36ED /* Images.xcassets in Resources */, 195 | 5FA576261A58F551000B36ED /* ViewController_iPhone.xib in Resources */, 196 | 5FA576231A58F551000B36ED /* home.png in Resources */, 197 | 5FA576241A58F551000B36ED /* InfoPlist.strings in Resources */, 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | }; 201 | /* End PBXResourcesBuildPhase section */ 202 | 203 | /* Begin PBXShellScriptBuildPhase section */ 204 | 0B7EDEFA396153965C531DAB /* [CP] Check Pods Manifest.lock */ = { 205 | isa = PBXShellScriptBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | ); 209 | inputFileListPaths = ( 210 | ); 211 | inputPaths = ( 212 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 213 | "${PODS_ROOT}/Manifest.lock", 214 | ); 215 | name = "[CP] Check Pods Manifest.lock"; 216 | outputFileListPaths = ( 217 | ); 218 | outputPaths = ( 219 | "$(DERIVED_FILE_DIR)/Pods-demoapp-checkManifestLockResult.txt", 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 224 | showEnvVarsInLog = 0; 225 | }; 226 | AD52E3A9659A1F6A6F10C830 /* [CP] Copy Pods Resources */ = { 227 | isa = PBXShellScriptBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | inputPaths = ( 232 | "${PODS_ROOT}/Target Support Files/Pods-demoapp/Pods-demoapp-resources.sh", 233 | "${PODS_ROOT}/Pingpp/lib/Channels/CmbWallet/SecreteKeyBoard", 234 | "${PODS_ROOT}/Pingpp/lib/Pingpp.bundle", 235 | "${PODS_ROOT}/PingppAlipaySDK/AlipaySDK.bundle", 236 | "${PODS_ROOT}/PingppLakalaSDK/depositorySDK.bundle", 237 | ); 238 | name = "[CP] Copy Pods Resources"; 239 | outputPaths = ( 240 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SecreteKeyBoard", 241 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Pingpp.bundle", 242 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AlipaySDK.bundle", 243 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/depositorySDK.bundle", 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | shellPath = /bin/sh; 247 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demoapp/Pods-demoapp-resources.sh\"\n"; 248 | showEnvVarsInLog = 0; 249 | }; 250 | /* End PBXShellScriptBuildPhase section */ 251 | 252 | /* Begin PBXSourcesBuildPhase section */ 253 | 5F61B01919C81A4F0035CD99 /* Sources */ = { 254 | isa = PBXSourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 5FA576221A58F551000B36ED /* main.m in Sources */, 258 | 5FA5761F1A58F551000B36ED /* AppDelegate.m in Sources */, 259 | 5FA576311A58FA7C000B36ED /* ViewController.mm in Sources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | /* End PBXSourcesBuildPhase section */ 264 | 265 | /* Begin PBXVariantGroup section */ 266 | 5F5BBB1F19D0189B009A9DCE /* home.png */ = { 267 | isa = PBXVariantGroup; 268 | children = ( 269 | 5F5BBB2019D0189B009A9DCE /* en */, 270 | ); 271 | name = home.png; 272 | sourceTree = ""; 273 | }; 274 | 5F61B05D19C81D390035CD99 /* InfoPlist.strings */ = { 275 | isa = PBXVariantGroup; 276 | children = ( 277 | 5F61B05E19C81D390035CD99 /* en */, 278 | ); 279 | name = InfoPlist.strings; 280 | sourceTree = ""; 281 | }; 282 | 5FA576171A58F551000B36ED /* home.png */ = { 283 | isa = PBXVariantGroup; 284 | children = ( 285 | 5FA576181A58F551000B36ED /* en */, 286 | ); 287 | name = home.png; 288 | sourceTree = ""; 289 | }; 290 | 5FA576191A58F551000B36ED /* InfoPlist.strings */ = { 291 | isa = PBXVariantGroup; 292 | children = ( 293 | 5FA5761A1A58F551000B36ED /* en */, 294 | ); 295 | name = InfoPlist.strings; 296 | sourceTree = ""; 297 | }; 298 | /* End PBXVariantGroup section */ 299 | 300 | /* Begin XCBuildConfiguration section */ 301 | 5F61B04719C81A500035CD99 /* Debug */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ALWAYS_SEARCH_USER_PATHS = NO; 305 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 306 | CLANG_ENABLE_MODULES = YES; 307 | CLANG_ENABLE_OBJC_ARC = NO; 308 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 309 | CLANG_WARN_BOOL_CONVERSION = YES; 310 | CLANG_WARN_COMMA = YES; 311 | CLANG_WARN_CONSTANT_CONVERSION = YES; 312 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 313 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 314 | CLANG_WARN_EMPTY_BODY = YES; 315 | CLANG_WARN_ENUM_CONVERSION = YES; 316 | CLANG_WARN_INFINITE_RECURSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 319 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 320 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 321 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 322 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 323 | CLANG_WARN_STRICT_PROTOTYPES = YES; 324 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 325 | CLANG_WARN_UNREACHABLE_CODE = YES; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 328 | COPY_PHASE_STRIP = NO; 329 | ENABLE_STRICT_OBJC_MSGSEND = YES; 330 | ENABLE_TESTABILITY = YES; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_DYNAMIC_NO_PIC = NO; 333 | GCC_NO_COMMON_BLOCKS = YES; 334 | GCC_OPTIMIZATION_LEVEL = 0; 335 | GCC_PREPROCESSOR_DEFINITIONS = ( 336 | "DEBUG=1", 337 | "$(inherited)", 338 | ); 339 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 340 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 341 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 342 | GCC_WARN_UNDECLARED_SELECTOR = YES; 343 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 344 | GCC_WARN_UNUSED_FUNCTION = YES; 345 | GCC_WARN_UNUSED_VARIABLE = YES; 346 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 347 | ONLY_ACTIVE_ARCH = YES; 348 | SDKROOT = iphoneos; 349 | TARGETED_DEVICE_FAMILY = "1,2"; 350 | }; 351 | name = Debug; 352 | }; 353 | 5F61B04819C81A500035CD99 /* Release */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | ALWAYS_SEARCH_USER_PATHS = NO; 357 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 358 | CLANG_ENABLE_MODULES = YES; 359 | CLANG_ENABLE_OBJC_ARC = NO; 360 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 361 | CLANG_WARN_BOOL_CONVERSION = YES; 362 | CLANG_WARN_COMMA = YES; 363 | CLANG_WARN_CONSTANT_CONVERSION = YES; 364 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 365 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 366 | CLANG_WARN_EMPTY_BODY = YES; 367 | CLANG_WARN_ENUM_CONVERSION = YES; 368 | CLANG_WARN_INFINITE_RECURSION = YES; 369 | CLANG_WARN_INT_CONVERSION = YES; 370 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 371 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 372 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 373 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 374 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 375 | CLANG_WARN_STRICT_PROTOTYPES = YES; 376 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 377 | CLANG_WARN_UNREACHABLE_CODE = YES; 378 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 379 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 380 | COPY_PHASE_STRIP = YES; 381 | ENABLE_NS_ASSERTIONS = NO; 382 | ENABLE_STRICT_OBJC_MSGSEND = YES; 383 | GCC_C_LANGUAGE_STANDARD = gnu99; 384 | GCC_NO_COMMON_BLOCKS = YES; 385 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 386 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 387 | GCC_WARN_UNDECLARED_SELECTOR = YES; 388 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 389 | GCC_WARN_UNUSED_FUNCTION = YES; 390 | GCC_WARN_UNUSED_VARIABLE = YES; 391 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 392 | SDKROOT = iphoneos; 393 | TARGETED_DEVICE_FAMILY = "1,2"; 394 | VALIDATE_PRODUCT = YES; 395 | }; 396 | name = Release; 397 | }; 398 | 5F61B04A19C81A500035CD99 /* Debug */ = { 399 | isa = XCBuildConfiguration; 400 | baseConfigurationReference = E59C50552D576E3DBAA72F12 /* Pods-demoapp.debug.xcconfig */; 401 | buildSettings = { 402 | ALWAYS_SEARCH_USER_PATHS = NO; 403 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 404 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 405 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 406 | CLANG_CXX_LIBRARY = "libc++"; 407 | CLANG_ENABLE_OBJC_ARC = YES; 408 | CODE_SIGN_IDENTITY = "iPhone Developer"; 409 | DEVELOPMENT_TEAM = ""; 410 | ENABLE_BITCODE = NO; 411 | FRAMEWORK_SEARCH_PATHS = ( 412 | "$(inherited)", 413 | "$(PROJECT_DIR)/../lib/Channels/Alipay", 414 | ); 415 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 416 | GCC_PREFIX_HEADER = "demoapp/demoapp-Info.pch"; 417 | INFOPLIST_FILE = "$(SRCROOT)/demoapp/demoapp-Info.plist"; 418 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 419 | LIBRARY_SEARCH_PATHS = ( 420 | "$(inherited)", 421 | "$(PROJECT_DIR)/../lib", 422 | "$(PROJECT_DIR)/../lib/Channels/Alipay", 423 | "$(PROJECT_DIR)/../lib/Channels/UnionPay", 424 | "$(PROJECT_DIR)/../lib/Channels/Yeepay", 425 | "$(PROJECT_DIR)/../lib/Channels/BfbWap", 426 | "$(PROJECT_DIR)/../lib/Dependencies/Network", 427 | "$(PROJECT_DIR)/../lib/Channels/QQWallet", 428 | "$(PROJECT_DIR)/../lib/Dependencies/WebView", 429 | ); 430 | OTHER_LDFLAGS = ( 431 | "$(inherited)", 432 | "-ObjC", 433 | "-l\"c++\"", 434 | "-l\"sqlite3\"", 435 | "-l\"pingpp+yeepay\"", 436 | "-l\"stdc++\"", 437 | "-l\"z\"", 438 | "-framework", 439 | "\"AddressBook\"", 440 | "-framework", 441 | "\"AddressBookUI\"", 442 | "-framework", 443 | "\"AlipaySDK\"", 444 | "-framework", 445 | "\"AudioToolbox\"", 446 | "-framework", 447 | "\"CFNetwork\"", 448 | "-framework", 449 | "\"CoreAudio\"", 450 | "-framework", 451 | "\"CoreGraphics\"", 452 | "-framework", 453 | "\"CoreTelephony\"", 454 | "-framework", 455 | "\"ImageIO\"", 456 | "-framework", 457 | "\"MapKit\"", 458 | "-framework", 459 | "\"MessageUI\"", 460 | "-framework", 461 | "\"MobileCoreServices\"", 462 | "-framework", 463 | "\"QuartzCore\"", 464 | "-framework", 465 | "\"Security\"", 466 | "-framework", 467 | "\"SystemConfiguration\"", 468 | "-framework", 469 | "\"CoreMotion\"", 470 | ); 471 | PRODUCT_BUNDLE_IDENTIFIER = com.pingplusplus.demoapp; 472 | PRODUCT_NAME = demoapp; 473 | WRAPPER_EXTENSION = app; 474 | }; 475 | name = Debug; 476 | }; 477 | 5F61B04B19C81A500035CD99 /* Release */ = { 478 | isa = XCBuildConfiguration; 479 | baseConfigurationReference = D9845181D37B049E615F7664 /* Pods-demoapp.release.xcconfig */; 480 | buildSettings = { 481 | ALWAYS_SEARCH_USER_PATHS = NO; 482 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 483 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 484 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 485 | CLANG_CXX_LIBRARY = "libc++"; 486 | CLANG_ENABLE_OBJC_ARC = YES; 487 | CODE_SIGN_IDENTITY = "iPhone Developer"; 488 | DEVELOPMENT_TEAM = ""; 489 | ENABLE_BITCODE = NO; 490 | FRAMEWORK_SEARCH_PATHS = ( 491 | "$(inherited)", 492 | "$(PROJECT_DIR)/../lib/Channels/Alipay", 493 | ); 494 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 495 | GCC_PREFIX_HEADER = "demoapp/demoapp-Info.pch"; 496 | INFOPLIST_FILE = "$(SRCROOT)/demoapp/demoapp-Info.plist"; 497 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 498 | LIBRARY_SEARCH_PATHS = ( 499 | "$(inherited)", 500 | "$(PROJECT_DIR)/../lib", 501 | "$(PROJECT_DIR)/../lib/Channels/Alipay", 502 | "$(PROJECT_DIR)/../lib/Channels/UnionPay", 503 | "$(PROJECT_DIR)/../lib/Channels/Yeepay", 504 | "$(PROJECT_DIR)/../lib/Channels/BfbWap", 505 | "$(PROJECT_DIR)/../lib/Dependencies/Network", 506 | "$(PROJECT_DIR)/../lib/Channels/QQWallet", 507 | "$(PROJECT_DIR)/../lib/Dependencies/WebView", 508 | ); 509 | OTHER_LDFLAGS = ( 510 | "$(inherited)", 511 | "-ObjC", 512 | "-l\"c++\"", 513 | "-l\"sqlite3\"", 514 | "-l\"pingpp+yeepay\"", 515 | "-l\"stdc++\"", 516 | "-l\"z\"", 517 | "-framework", 518 | "\"AddressBook\"", 519 | "-framework", 520 | "\"AddressBookUI\"", 521 | "-framework", 522 | "\"AlipaySDK\"", 523 | "-framework", 524 | "\"AudioToolbox\"", 525 | "-framework", 526 | "\"CFNetwork\"", 527 | "-framework", 528 | "\"CoreAudio\"", 529 | "-framework", 530 | "\"CoreGraphics\"", 531 | "-framework", 532 | "\"CoreTelephony\"", 533 | "-framework", 534 | "\"ImageIO\"", 535 | "-framework", 536 | "\"MapKit\"", 537 | "-framework", 538 | "\"MessageUI\"", 539 | "-framework", 540 | "\"MobileCoreServices\"", 541 | "-framework", 542 | "\"QuartzCore\"", 543 | "-framework", 544 | "\"Security\"", 545 | "-framework", 546 | "\"SystemConfiguration\"", 547 | "-framework", 548 | "\"CoreMotion\"", 549 | ); 550 | PRODUCT_BUNDLE_IDENTIFIER = com.pingplusplus.demoapp; 551 | PRODUCT_NAME = demoapp; 552 | WRAPPER_EXTENSION = app; 553 | }; 554 | name = Release; 555 | }; 556 | /* End XCBuildConfiguration section */ 557 | 558 | /* Begin XCConfigurationList section */ 559 | 5F61B01819C81A4F0035CD99 /* Build configuration list for PBXProject "demoapp" */ = { 560 | isa = XCConfigurationList; 561 | buildConfigurations = ( 562 | 5F61B04719C81A500035CD99 /* Debug */, 563 | 5F61B04819C81A500035CD99 /* Release */, 564 | ); 565 | defaultConfigurationIsVisible = 0; 566 | defaultConfigurationName = Release; 567 | }; 568 | 5F61B04919C81A500035CD99 /* Build configuration list for PBXNativeTarget "demoapp" */ = { 569 | isa = XCConfigurationList; 570 | buildConfigurations = ( 571 | 5F61B04A19C81A500035CD99 /* Debug */, 572 | 5F61B04B19C81A500035CD99 /* Release */, 573 | ); 574 | defaultConfigurationIsVisible = 0; 575 | defaultConfigurationName = Release; 576 | }; 577 | /* End XCConfigurationList section */ 578 | }; 579 | rootObject = 5F61B01519C81A4F0035CD99 /* Project object */; 580 | } 581 | -------------------------------------------------------------------------------- /example/demoapp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/demoapp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/demoapp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/demoapp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AppDelegate 4 | // 5 | // Created by Jacky Hu on 07/14/14. 6 | // 7 | 8 | #import 9 | 10 | @class ViewController; 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | 16 | @property (strong, nonatomic) UINavigationController *viewController; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /example/demoapp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AppDelegate 4 | // 5 | // Created by Jacky Hu on 07/14/14. 6 | // 7 | 8 | #import "AppDelegate.h" 9 | #import "Pingpp.h" 10 | #import "ViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 15 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 16 | // Override point for customization after application launch. 17 | 18 | ViewController* root = [[ViewController alloc] init]; 19 | UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:root]; 20 | 21 | self.viewController = nav; 22 | self.window.rootViewController = self.viewController; 23 | [self.window makeKeyAndVisible]; 24 | 25 | [Pingpp setDebugMode:YES]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application { 30 | // 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. 31 | // 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. 32 | } 33 | 34 | - (void)applicationDidEnterBackground:(UIApplication *)application { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application { 40 | // 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. 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application { 44 | // 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. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application { 48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 | } 50 | 51 | #warning \ 52 | 为了能正确获得结果回调请在工程 AppDelegate 文件中调用 `[Pingpp handleOpenURL:url withCompletion:nil]`。\ 53 | 如果该方法的第二个参数传 nil,请在在 `createPayment` 方法的 `Completion` 中处理回调结果。否则,在这里处理结果。\ 54 | 如果你使用了微信分享、登录等一些看起来在这里“冲突”的模块,你可以先判断 url 的 host 来决定调用哪一方的方法。\ 55 | 也可以先调用 Ping++ 的方法,如果 return 的值为 false,表示这个 url 不是支付相关的,你再调用模块的方法。 56 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { 57 | return [Pingpp handleOpenURL:url withCompletion:nil]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /example/demoapp/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "29x29", 26 | "scale" : "3x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "40x40", 36 | "scale" : "3x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "57x57", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "iphone", 45 | "size" : "57x57", 46 | "scale" : "2x" 47 | }, 48 | { 49 | "idiom" : "iphone", 50 | "size" : "60x60", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "iphone", 55 | "size" : "60x60", 56 | "scale" : "3x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "20x20", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "20x20", 66 | "scale" : "2x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "29x29", 71 | "scale" : "1x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "29x29", 76 | "scale" : "2x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "40x40", 81 | "scale" : "1x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "40x40", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ipad", 90 | "size" : "50x50", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "idiom" : "ipad", 95 | "size" : "50x50", 96 | "scale" : "2x" 97 | }, 98 | { 99 | "idiom" : "ipad", 100 | "size" : "72x72", 101 | "scale" : "1x" 102 | }, 103 | { 104 | "idiom" : "ipad", 105 | "size" : "72x72", 106 | "scale" : "2x" 107 | }, 108 | { 109 | "idiom" : "ipad", 110 | "size" : "76x76", 111 | "scale" : "1x" 112 | }, 113 | { 114 | "idiom" : "ipad", 115 | "size" : "76x76", 116 | "scale" : "2x" 117 | }, 118 | { 119 | "idiom" : "ipad", 120 | "size" : "83.5x83.5", 121 | "scale" : "2x" 122 | }, 123 | { 124 | "idiom" : "ios-marketing", 125 | "size" : "1024x1024", 126 | "scale" : "1x" 127 | } 128 | ], 129 | "info" : { 130 | "version" : 1, 131 | "author" : "xcode" 132 | } 133 | } -------------------------------------------------------------------------------- /example/demoapp/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /example/demoapp/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "launch-5.5.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "orientation" : "landscape", 14 | "idiom" : "iphone", 15 | "extent" : "full-screen", 16 | "minimum-system-version" : "8.0", 17 | "subtype" : "736h", 18 | "scale" : "3x" 19 | }, 20 | { 21 | "extent" : "full-screen", 22 | "idiom" : "iphone", 23 | "subtype" : "667h", 24 | "filename" : "launch-4.7.png", 25 | "minimum-system-version" : "8.0", 26 | "orientation" : "portrait", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "orientation" : "portrait", 31 | "idiom" : "iphone", 32 | "filename" : "launch-3.5.png", 33 | "extent" : "full-screen", 34 | "minimum-system-version" : "7.0", 35 | "scale" : "2x" 36 | }, 37 | { 38 | "extent" : "full-screen", 39 | "idiom" : "iphone", 40 | "subtype" : "retina4", 41 | "filename" : "launch-4.0.png", 42 | "minimum-system-version" : "7.0", 43 | "orientation" : "portrait", 44 | "scale" : "2x" 45 | }, 46 | { 47 | "orientation" : "portrait", 48 | "idiom" : "ipad", 49 | "extent" : "full-screen", 50 | "minimum-system-version" : "7.0", 51 | "scale" : "1x" 52 | }, 53 | { 54 | "orientation" : "landscape", 55 | "idiom" : "ipad", 56 | "extent" : "full-screen", 57 | "minimum-system-version" : "7.0", 58 | "scale" : "1x" 59 | }, 60 | { 61 | "orientation" : "portrait", 62 | "idiom" : "ipad", 63 | "extent" : "full-screen", 64 | "minimum-system-version" : "7.0", 65 | "scale" : "2x" 66 | }, 67 | { 68 | "orientation" : "landscape", 69 | "idiom" : "ipad", 70 | "extent" : "full-screen", 71 | "minimum-system-version" : "7.0", 72 | "scale" : "2x" 73 | }, 74 | { 75 | "orientation" : "portrait", 76 | "idiom" : "iphone", 77 | "extent" : "full-screen", 78 | "scale" : "1x" 79 | }, 80 | { 81 | "orientation" : "portrait", 82 | "idiom" : "iphone", 83 | "extent" : "full-screen", 84 | "scale" : "2x" 85 | }, 86 | { 87 | "orientation" : "portrait", 88 | "idiom" : "iphone", 89 | "extent" : "full-screen", 90 | "subtype" : "retina4", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "orientation" : "portrait", 95 | "idiom" : "ipad", 96 | "extent" : "to-status-bar", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "orientation" : "portrait", 101 | "idiom" : "ipad", 102 | "extent" : "full-screen", 103 | "scale" : "1x" 104 | }, 105 | { 106 | "orientation" : "landscape", 107 | "idiom" : "ipad", 108 | "extent" : "to-status-bar", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "orientation" : "landscape", 113 | "idiom" : "ipad", 114 | "extent" : "full-screen", 115 | "scale" : "1x" 116 | }, 117 | { 118 | "orientation" : "portrait", 119 | "idiom" : "ipad", 120 | "extent" : "to-status-bar", 121 | "scale" : "2x" 122 | }, 123 | { 124 | "orientation" : "portrait", 125 | "idiom" : "ipad", 126 | "extent" : "full-screen", 127 | "scale" : "2x" 128 | }, 129 | { 130 | "orientation" : "landscape", 131 | "idiom" : "ipad", 132 | "extent" : "to-status-bar", 133 | "scale" : "2x" 134 | }, 135 | { 136 | "orientation" : "landscape", 137 | "idiom" : "ipad", 138 | "extent" : "full-screen", 139 | "scale" : "2x" 140 | } 141 | ], 142 | "info" : { 143 | "version" : 1, 144 | "author" : "xcode" 145 | } 146 | } -------------------------------------------------------------------------------- /example/demoapp/Images.xcassets/LaunchImage.launchimage/launch-3.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/example/demoapp/Images.xcassets/LaunchImage.launchimage/launch-3.5.png -------------------------------------------------------------------------------- /example/demoapp/Images.xcassets/LaunchImage.launchimage/launch-4.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/example/demoapp/Images.xcassets/LaunchImage.launchimage/launch-4.0.png -------------------------------------------------------------------------------- /example/demoapp/Images.xcassets/LaunchImage.launchimage/launch-4.7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/example/demoapp/Images.xcassets/LaunchImage.launchimage/launch-4.7.png -------------------------------------------------------------------------------- /example/demoapp/Images.xcassets/LaunchImage.launchimage/launch-5.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/example/demoapp/Images.xcassets/LaunchImage.launchimage/launch-5.5.png -------------------------------------------------------------------------------- /example/demoapp/Resources/ViewController_iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12A206j 6 | 2519 7 | 1172.1 8 | 613.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1856 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBIPadFramework 28 | 29 | 30 | IBFirstResponder 31 | IBIPadFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {768, 1004}} 37 | 38 | 39 | 40 | 3 41 | MQA 42 | 43 | 2 44 | 45 | 46 | 47 | 2 48 | 49 | IBIPadFramework 50 | 51 | 52 | 53 | 54 | 55 | 56 | view 57 | 58 | 59 | 60 | 3 61 | 62 | 63 | 64 | 65 | 66 | 0 67 | 68 | 69 | 70 | 71 | 72 | -1 73 | 74 | 75 | File's Owner 76 | 77 | 78 | -2 79 | 80 | 81 | 82 | 83 | 2 84 | 85 | 86 | 87 | 88 | 89 | 90 | ViewController 91 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 92 | UIResponder 93 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 94 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 95 | 96 | 97 | 98 | 99 | 100 | 3 101 | 102 | 103 | 104 | 105 | ViewController 106 | UIViewController 107 | 108 | IBProjectSource 109 | ./Classes/ViewController.h 110 | 111 | 112 | 113 | 114 | 0 115 | IBIPadFramework 116 | YES 117 | 3 118 | YES 119 | 1856 120 | 121 | 122 | -------------------------------------------------------------------------------- /example/demoapp/Resources/ViewController_iPhone.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12A269 6 | 2835 7 | 1187 8 | 624.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1919 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBCocoaTouchFramework 28 | 29 | 30 | IBFirstResponder 31 | IBCocoaTouchFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {320, 548}} 37 | 38 | 39 | 40 | 41 | 3 42 | MC43NQA 43 | 44 | 2 45 | 46 | 47 | NO 48 | 49 | 50 | IBUIScreenMetrics 51 | 52 | YES 53 | 54 | 55 | 56 | 57 | 58 | {320, 568} 59 | {568, 320} 60 | 61 | 62 | IBCocoaTouchFramework 63 | Retina 4 Full Screen 64 | 2 65 | 66 | IBCocoaTouchFramework 67 | 68 | 69 | 70 | 71 | 72 | 73 | view 74 | 75 | 76 | 77 | 7 78 | 79 | 80 | 81 | 82 | 83 | 0 84 | 85 | 86 | 87 | 88 | 89 | -1 90 | 91 | 92 | File's Owner 93 | 94 | 95 | -2 96 | 97 | 98 | 99 | 100 | 6 101 | 102 | 103 | 104 | 105 | 106 | 107 | ViewController 108 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 109 | UIResponder 110 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 111 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 112 | 113 | 114 | 115 | 116 | 117 | 7 118 | 119 | 120 | 121 | 122 | ViewController 123 | UIViewController 124 | 125 | IBProjectSource 126 | ./Classes/ViewController.h 127 | 128 | 129 | 130 | 131 | 0 132 | IBCocoaTouchFramework 133 | YES 134 | 3 135 | YES 136 | 1919 137 | 138 | 139 | -------------------------------------------------------------------------------- /example/demoapp/Resources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /example/demoapp/Resources/en.lproj/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/example/demoapp/Resources/en.lproj/home.png -------------------------------------------------------------------------------- /example/demoapp/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ViewController 4 | // 5 | // Created by Jacky Hu on 07/14/14. 6 | // 7 | 8 | #import 9 | 10 | @interface ViewController : UIViewController 11 | { 12 | UIAlertView* mAlert; 13 | UITextField *mTextField; 14 | } 15 | 16 | @property(nonatomic, retain)NSString *channel; 17 | @property(nonatomic ,retain)UITextField *mTextField; 18 | 19 | - (void)showAlertWait; 20 | - (void)showAlertMessage:(NSString*)msg; 21 | - (void)hideAlert; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /example/demoapp/ViewController.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ViewController 4 | // 5 | // Created by Jacky Hu on 07/14/14. 6 | // 7 | 8 | #include // Per msqr 9 | #include 10 | #include 11 | #include 12 | #import "ViewController.h" 13 | #import "AppDelegate.h" 14 | #import "Pingpp.h" 15 | 16 | #define KBtn_width 200 17 | #define KBtn_height 40 18 | #define KXOffSet (self.view.frame.size.width - KBtn_width) / 2 19 | #define KYOffSet 20 20 | 21 | #define kWaiting @"正在获取支付凭据,请稍后..." 22 | #define kNote @"提示" 23 | #define kConfirm @"确定" 24 | #define kErrorNet @"网络错误" 25 | #define kResult @"支付结果:%@" 26 | 27 | #define kPlaceHolder @"支付金额" 28 | #define kMaxAmount 9999999 29 | 30 | #warning \ 31 | URL Schemes 需要在 Xcode 的 Info 标签页的 URL Types 中添加,\ 32 | 需要你自定义(不能使用 "alipay", "wx", "wechat" 等等这些),首字母必须是英文字母,支持英文和数字,不建议使用特殊符号。\ 33 | 如果这个不设置,可能会导致支付完成之后,无法跳转回 App 或者无法得到结果回调。\ 34 | 对于微信支付来说,必须添加一项值为微信平台上注册的应用程序 id("wx" 开头的字符串)作为 URL Scheme。 35 | #define kUrlScheme @"demoapp001" // 这个是你定义的 URL Scheme,支付宝、微信支付、银联和测试模式需要。 36 | 37 | #define kUrl @"http://218.244.151.190/demo/charge" // 你的服务端创建并返回 charge 的 URL 地址。该地址仅供测试用。如果该地址失效,请使用你自己的后端接口。 38 | 39 | @interface ViewController () 40 | 41 | @end 42 | 43 | @implementation ViewController 44 | @synthesize channel; 45 | @synthesize mTextField; 46 | 47 | - (void)viewDidLoad 48 | { 49 | [super viewDidLoad]; 50 | self.view.backgroundColor = [UIColor whiteColor]; 51 | [self.navigationController setNavigationBarHidden:YES]; 52 | // Do any additional setup after loading the view, typically from a nib. 53 | CGRect viewRect = self.view.frame; 54 | UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:viewRect]; 55 | [scrollView setScrollEnabled:YES]; 56 | [self.view addSubview:scrollView]; 57 | 58 | CGRect windowRect = [[UIScreen mainScreen] bounds]; 59 | UIImage *headerImg = [UIImage imageNamed:@"home.png"]; 60 | CGFloat imgViewWith = windowRect.size.width * 0.9; 61 | CGFloat imgViewHeight = headerImg.size.height * imgViewWith / headerImg.size.width; 62 | UIImageView *imgView = [[UIImageView alloc] initWithImage:headerImg]; 63 | [imgView setContentScaleFactor:[[UIScreen mainScreen] scale]]; 64 | CGFloat imgx = windowRect.size.width/2-imgViewWith/2; 65 | [imgView setFrame:CGRectMake(imgx, KYOffSet, imgViewWith, imgViewHeight)]; 66 | [scrollView addSubview:imgView]; 67 | 68 | mTextField = [[UITextField alloc]initWithFrame:CGRectMake(imgx, KYOffSet+imgViewHeight+40, imgViewWith-40, 40)]; 69 | mTextField.borderStyle = UITextBorderStyleRoundedRect; 70 | mTextField.backgroundColor = [UIColor whiteColor]; 71 | mTextField.placeholder = kPlaceHolder; 72 | mTextField.keyboardType = UIKeyboardTypeNumberPad; 73 | mTextField.returnKeyType =UIReturnKeyDone; 74 | mTextField.delegate = self; 75 | [mTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; 76 | [scrollView addSubview:mTextField]; 77 | 78 | UIButton* doneButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 79 | [doneButton setTitle:@"OK" forState:UIControlStateNormal]; 80 | [doneButton addTarget:self action:@selector(okButtonAction:) forControlEvents:UIControlEventTouchUpInside]; 81 | [doneButton setFrame:CGRectMake(imgx+imgViewWith-35, KYOffSet+imgViewHeight+40, 40, 40)]; 82 | [doneButton.layer setMasksToBounds:YES]; 83 | [doneButton.layer setCornerRadius:8.0]; 84 | [doneButton.layer setBorderWidth:1.0]; 85 | [doneButton.layer setBorderColor:[UIColor grayColor].CGColor]; 86 | [scrollView addSubview:doneButton]; 87 | 88 | UIButton* wxButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 89 | [wxButton setTitle:@"微信" forState:UIControlStateNormal]; 90 | [wxButton addTarget:self action:@selector(normalPayAction:) forControlEvents:UIControlEventTouchUpInside]; 91 | [wxButton setFrame:CGRectMake(imgx, KYOffSet+imgViewHeight+90, imgViewWith, KBtn_height)]; 92 | [wxButton.layer setMasksToBounds:YES]; 93 | [wxButton.layer setCornerRadius:8.0]; 94 | [wxButton.layer setBorderWidth:1.0]; 95 | [wxButton.layer setBorderColor:[UIColor grayColor].CGColor]; 96 | wxButton.titleLabel.font = [UIFont systemFontOfSize: 18.0]; 97 | [wxButton setTag:1]; 98 | [scrollView addSubview:wxButton]; 99 | 100 | UIButton* alipayButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 101 | [alipayButton setTitle:@"支付宝" forState:UIControlStateNormal]; 102 | [alipayButton addTarget:self action:@selector(normalPayAction:) forControlEvents:UIControlEventTouchUpInside]; 103 | [alipayButton setFrame:CGRectMake(imgx, KYOffSet+imgViewHeight+140, imgViewWith, KBtn_height)]; 104 | [alipayButton.layer setMasksToBounds:YES]; 105 | [alipayButton.layer setCornerRadius:8.0]; 106 | [alipayButton.layer setBorderWidth:1.0]; 107 | [alipayButton.layer setBorderColor:[UIColor grayColor].CGColor]; 108 | alipayButton.titleLabel.font = [UIFont systemFontOfSize: 18.0]; 109 | [alipayButton setTag:2]; 110 | [scrollView addSubview:alipayButton]; 111 | 112 | UIButton* upmpButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 113 | [upmpButton setTitle:@"银联" forState:UIControlStateNormal]; 114 | [upmpButton addTarget:self action:@selector(normalPayAction:) forControlEvents:UIControlEventTouchUpInside]; 115 | [upmpButton setFrame:CGRectMake(imgx, KYOffSet+imgViewHeight+190, imgViewWith, KBtn_height)]; 116 | [upmpButton.layer setMasksToBounds:YES]; 117 | [upmpButton.layer setCornerRadius:8.0]; 118 | [upmpButton.layer setBorderWidth:1.0]; 119 | [upmpButton.layer setBorderColor:[UIColor grayColor].CGColor]; 120 | upmpButton.titleLabel.font = [UIFont systemFontOfSize: 18.0]; 121 | [upmpButton setTag:3]; 122 | [scrollView addSubview:upmpButton]; 123 | 124 | UIButton* bfbButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 125 | [bfbButton setTitle:@"百度钱包" forState:UIControlStateNormal]; 126 | [bfbButton addTarget:self action:@selector(normalPayAction:) forControlEvents:UIControlEventTouchUpInside]; 127 | [bfbButton setFrame:CGRectMake(imgx, KYOffSet+imgViewHeight+240, imgViewWith, KBtn_height)]; 128 | [bfbButton.layer setMasksToBounds:YES]; 129 | [bfbButton.layer setCornerRadius:8.0]; 130 | [bfbButton.layer setBorderWidth:1.0]; 131 | [bfbButton.layer setBorderColor:[UIColor grayColor].CGColor]; 132 | bfbButton.titleLabel.font = [UIFont systemFontOfSize: 18.0]; 133 | [bfbButton setTag:4]; 134 | [scrollView addSubview:bfbButton]; 135 | 136 | [scrollView setContentSize:CGSizeMake(viewRect.size.width, KYOffSet+imgViewHeight+260+KBtn_height)]; 137 | } 138 | 139 | - (void)didReceiveMemoryWarning 140 | { 141 | [super didReceiveMemoryWarning]; 142 | // Dispose of any resources that can be recreated. 143 | } 144 | 145 | - (void)showAlertWait 146 | { 147 | mAlert = [[UIAlertView alloc] initWithTitle:kWaiting message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil]; 148 | [mAlert show]; 149 | UIActivityIndicatorView* aiv = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; 150 | aiv.center = CGPointMake(mAlert.frame.size.width / 2.0f - 15, mAlert.frame.size.height / 2.0f + 10 ); 151 | [aiv startAnimating]; 152 | [mAlert addSubview:aiv]; 153 | } 154 | 155 | - (void)showAlertMessage:(NSString*)msg 156 | { 157 | mAlert = [[UIAlertView alloc] initWithTitle:kNote message:msg delegate:nil cancelButtonTitle:kConfirm otherButtonTitles:nil, nil]; 158 | [mAlert show]; 159 | } 160 | 161 | - (void)hideAlert 162 | { 163 | if (mAlert != nil) 164 | { 165 | [mAlert dismissWithClickedButtonIndex:0 animated:YES]; 166 | mAlert = nil; 167 | } 168 | } 169 | 170 | - (void)normalPayAction:(id)sender 171 | { 172 | NSInteger tag = ((UIButton*)sender).tag; 173 | if (tag == 1) { 174 | self.channel = @"wx"; 175 | [self normalPayAction:nil]; 176 | } else if (tag == 2) { 177 | self.channel = @"alipay"; 178 | } else if (tag == 3) { 179 | self.channel = @"upacp"; 180 | } else if (tag == 4) { 181 | self.channel = @"bfb_wap"; 182 | } else { 183 | return; 184 | } 185 | 186 | [mTextField resignFirstResponder]; 187 | long long amount = [[self.mTextField.text stringByReplacingOccurrencesOfString:@"." withString:@""] longLongValue]; 188 | if (amount == 0) { 189 | return; 190 | } 191 | NSString *amountStr = [NSString stringWithFormat:@"%lld", amount]; 192 | NSURL* url = [NSURL URLWithString:kUrl]; 193 | NSMutableURLRequest * postRequest=[NSMutableURLRequest requestWithURL:url]; 194 | 195 | NSDictionary* dict = @{ 196 | @"channel" : self.channel, 197 | @"amount" : amountStr 198 | }; 199 | NSData* data = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:nil]; 200 | NSString *bodyData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 201 | 202 | [postRequest setHTTPBody:[NSData dataWithBytes:[bodyData UTF8String] length:strlen([bodyData UTF8String])]]; 203 | [postRequest setHTTPMethod:@"POST"]; 204 | [postRequest setValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; 205 | 206 | ViewController * __weak weakSelf = self; 207 | [self showAlertWait]; 208 | 209 | NSURLSession *session = [NSURLSession sessionWithConfiguration: [NSURLSessionConfiguration defaultSessionConfiguration]]; 210 | NSURLSessionDataTask *task = [session dataTaskWithRequest:postRequest completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { 211 | dispatch_async(dispatch_get_main_queue(), ^{ 212 | NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response; 213 | [weakSelf hideAlert]; 214 | if (httpResponse.statusCode != 200) { 215 | NSLog(@"statusCode=%ld error = %@", (long)httpResponse.statusCode, error); 216 | [weakSelf showAlertMessage:kErrorNet]; 217 | return; 218 | } 219 | if (error != nil) { 220 | NSLog(@"error = %@", error); 221 | [weakSelf showAlertMessage:kErrorNet]; 222 | return; 223 | } 224 | NSString* charge = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 225 | NSLog(@"charge = %@", charge); 226 | [Pingpp createPayment:charge 227 | viewController:weakSelf 228 | appURLScheme:kUrlScheme 229 | withCompletion:^(NSString *result, PingppError *error) { 230 | NSLog(@"completion block: %@", result); 231 | if (error == nil) { 232 | NSLog(@"PingppError is nil"); 233 | } else { 234 | NSLog(@"PingppError: code=%lu msg=%@", (unsigned long)error.code, [error getMsg]); 235 | } 236 | [weakSelf showAlertMessage:result]; 237 | }]; 238 | }); 239 | }]; 240 | [task resume]; 241 | } 242 | 243 | - (void)okButtonAction:(id)sender 244 | { 245 | [mTextField resignFirstResponder]; 246 | } 247 | 248 | - (void) textFieldDidChange:(UITextField *) textField 249 | { 250 | NSString *text = textField.text; 251 | NSUInteger index = [text rangeOfString:@"."].location; 252 | if (index != NSNotFound) { 253 | double amount = [[text stringByReplacingOccurrencesOfString:@"." withString:@""] doubleValue]; 254 | text = [NSString stringWithFormat:@"%.02f", MIN(amount, kMaxAmount)/100]; 255 | } else { 256 | double amount = [text doubleValue]; 257 | text = [NSString stringWithFormat:@"%.02f", MIN(amount, kMaxAmount)/100]; 258 | } 259 | textField.text = text; 260 | } 261 | 262 | -(void)textFieldDidBeginEditing:(UITextField *)textField 263 | { 264 | CGRect frame = textField.frame; 265 | if (self.view.frame.size.height > 480) { 266 | return; 267 | } 268 | int offset = frame.origin.y + 45 - (self.view.frame.size.height - 216.0); 269 | NSTimeInterval animationDuration = 0.30f; 270 | [UIView beginAnimations:@"ResizeForKeyboard" context:nil]; 271 | [UIView setAnimationDuration:animationDuration]; 272 | if(offset > 0) 273 | self.view.frame = CGRectMake(0.0f, -offset, self.view.frame.size.width, self.view.frame.size.height); 274 | [UIView commitAnimations]; 275 | } 276 | 277 | -(void)textFieldDidEndEditing:(UITextField *)textField 278 | { 279 | self.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); 280 | } 281 | 282 | @end 283 | -------------------------------------------------------------------------------- /example/demoapp/demoapp-Info.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'demoapp' target in the 'demoapp' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /example/demoapp/demoapp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleAllowMixedLocalizations 6 | 7 | CFBundleDevelopmentRegion 8 | zh_CN 9 | CFBundleDisplayName 10 | ${PRODUCT_NAME} 11 | CFBundleExecutable 12 | ${EXECUTABLE_NAME} 13 | CFBundleIcons 14 | 15 | CFBundleIcons~ipad 16 | 17 | CFBundleIdentifier 18 | $(PRODUCT_BUNDLE_IDENTIFIER) 19 | CFBundleInfoDictionaryVersion 20 | 6.0 21 | CFBundleName 22 | ${PRODUCT_NAME} 23 | CFBundlePackageType 24 | APPL 25 | CFBundleShortVersionString 26 | 1.0 27 | CFBundleSignature 28 | ???? 29 | CFBundleURLTypes 30 | 31 | 32 | CFBundleTypeRole 33 | Editor 34 | CFBundleURLSchemes 35 | 36 | YOUR-APP-URL-SCHEME 37 | 38 | 39 | 40 | CFBundleTypeRole 41 | Editor 42 | CFBundleURLSchemes 43 | 44 | demoapp001 45 | 46 | 47 | 48 | CFBundleVersion 49 | 1.0 50 | LSApplicationQueriesSchemes 51 | 52 | weixin 53 | weixinULAPI 54 | wechat 55 | alipay 56 | alipays 57 | mqqwallet 58 | mqq 59 | uppaysdk 60 | uppaywallet 61 | uppayx1 62 | uppayx2 63 | uppayx3 64 | mbspay 65 | cmpay 66 | 67 | LSRequiresIPhoneOS 68 | 69 | NSAppTransportSecurity 70 | 71 | NSAllowsArbitraryLoads 72 | 73 | 74 | UIRequiredDeviceCapabilities 75 | 76 | armv7 77 | 78 | UISupportedInterfaceOrientations 79 | 80 | UIInterfaceOrientationPortrait 81 | 82 | UISupportedInterfaceOrientations~ipad 83 | 84 | UIInterfaceOrientationPortrait 85 | UIInterfaceOrientationPortraitUpsideDown 86 | UIInterfaceOrientationLandscapeLeft 87 | UIInterfaceOrientationLandscapeRight 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /example/demoapp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // main 4 | // 5 | // Created by Jacky Hu on 07/14/14. 6 | // 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/Channels/Alipay/AlipaySDK.bundle/alipay_msp_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Alipay/AlipaySDK.bundle/alipay_msp_back@2x.png -------------------------------------------------------------------------------- /lib/Channels/Alipay/AlipaySDK.bundle/alipay_msp_refresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Alipay/AlipaySDK.bundle/alipay_msp_refresh@2x.png -------------------------------------------------------------------------------- /lib/Channels/Alipay/AlipaySDK.bundle/bar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Alipay/AlipaySDK.bundle/bar@2x.png -------------------------------------------------------------------------------- /lib/Channels/Alipay/AlipaySDK.bundle/bridge.js: -------------------------------------------------------------------------------- 1 | !function(){if(!window.AlipayJSBridge){window.alipayjsbridgeSetTitle=function(e){document.title=e,t("alipayjsbridge://setTitle?title="+encodeURIComponent(e))},window.alipayjsbridgeRefresh=function(){t("alipayjsbridge://onRefresh?")},window.alipayjsbridgeBack=function(){t("alipayjsbridge://onBack?")},window.alipayjsbridgeExit=function(e){t("alipayjsbridge://onExit?bsucc="+e)},window.alipayjsbridgeShowBackButton=function(e){t("alipayjsbridge://showBackButton?bshow="+e)},window.AlipayJSBridge={version:"2.0",addListener:function(e,i){a[e]=i},hasListener:function(e){if(!a[e])return!1;return!0},callListener:function(e,i,n){var t;n&&(t=function(e){var i="";e&&(i=encodeURIComponent(JSON.stringify(e)));var a="func=h5JsFuncCallback&cbId="+n+"&data="+i;o(a)});var r=a[e];r?r(i,t):console.log("AlipayJSBridge: no h5JsFunc ",e+i)},callNativeFunc:function(e,a,t){var r="";t&&(r="cb_"+i+++"_"+(new Date).getTime(),n[r]=t);var d="";a&&(d=encodeURIComponent(JSON.stringify(a)));o("func="+e+"&cbId="+r+"&data="+d)},callBackFromNativeFunc:function(e,i){var a=n[e];a&&(a(i),delete n[i])}};var e,i=1,n={},a={};window.CustomEvent?e=new CustomEvent("alipayjsbridgeready"):(e=document.createEvent("Event")).initEvent("alipayjsbridgeready",!0,!0),document.dispatchEvent(e),setTimeout(function(){if(window.AlipayJSBridgeInitArray){var e=window.AlipayJSBridgeInitArray;delete window.AlipayJSBridgeInitArray;for(var i=0;i 10 | 11 | @class AFServiceResponse; 12 | 13 | /** 14 | SDK支持的业务枚举值 15 | 16 | - AFServiceEInvoice: 电子发票 17 | - AFServiceAuth: 账户授权 18 | */ 19 | typedef NS_ENUM(NSUInteger, AFService) { 20 | AFServiceEInvoice, 21 | AFServiceAuth, 22 | AFServiceDeduct 23 | }; 24 | 25 | 26 | extern NSString * const kAFServiceOptionBizParams; // 钱包服务调用入参 27 | extern NSString * const kAFServiceOptionCallbackScheme; // 业务回跳当前app的scheme 28 | extern NSString * const kAFServiceOptionNotUseLanding; // 不使用支付宝提示下载页做补偿,为true时需要商户自己处理用户未安装支付宝的情况 29 | extern NSString * const kAFServiceBizParamsKeyUrl; // 独立签约入参url 30 | 31 | typedef void(^AFServiceResultBlock)(AFServiceResponse *response); 32 | 33 | @interface AFServiceCenter : NSObject 34 | 35 | /** 36 | 调用钱包服务 37 | 38 | @param service 业务service, 见AFService枚举值 39 | @param params 参数Dictionary, key值详情参见kAFServiceOptionBizParams、kAFServiceOptionCallbackScheme注释 40 | @param block 业务结果回调的block, block参数是AFServiceResponse类型,业务结果通过result属性获取,如果未用户未安装支付宝并且kAFServiceOptionNotUseLanding未设置为true,会使用H5landing页做补偿,这种情况下不会有block回调结果。 41 | */ 42 | + (void)callService:(AFService)service 43 | withParams:(NSDictionary *)params 44 | andCompletion:(AFServiceResultBlock)block; 45 | 46 | 47 | /** 48 | 处理钱包服务回跳APP的URL 49 | 50 | @param url 回跳URL 51 | @param block 业务结果回掉的block,详情见调用接口入参上的block。注意此接口上的block只有在跳转钱包后,当前APP被系统回收的情况下回跳才生效 52 | */ 53 | + (void)handleResponseURL:(NSURL *)url 54 | withCompletion:(AFServiceResultBlock)block; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /lib/Channels/Alipay/AlipaySDK.framework/Headers/AFServiceResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // AFServiceResponse.h 3 | // AFServiceSDK 4 | // 5 | // Created by jiajunchen on 08/01/2018. 6 | // Copyright © 2018 antfin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 钱包服务调用结果状态吗 13 | 14 | - AFResSuccess: 默认值,业务调用成功,结果数据参见result字段 15 | - AFResInvalidService: service枚举值错误 16 | - AFResInvalidURL: 钱包回跳URL错误 17 | - AFResRepeatCall: 业务重复调用(3s内) 18 | - AFResOpenURLErr: 跳转失败 19 | */ 20 | typedef NS_ENUM(NSUInteger, AFResCode) { 21 | AFResSuccess = 0, 22 | AFResInvalidService = 100, 23 | AFResInvalidURL, 24 | AFResRepeatCall, 25 | AFResOpenURLErr, 26 | }; 27 | 28 | 29 | @interface AFServiceResponse : NSObject 30 | 31 | 32 | /** 33 | 业务调用状态吗 34 | */ 35 | @property (nonatomic, assign) AFResCode responseCode; 36 | 37 | 38 | /** 39 | 业务结果Dictionary, 内容请参考具体业务方接入文档 40 | */ 41 | @property (readonly) NSDictionary *result; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /lib/Channels/Alipay/AlipaySDK.framework/Headers/APayAuthInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // APAuthInfo.h 3 | // APAuth 4 | // 5 | // Created by antfin on 17-10-24. 6 | // Copyright (c) 2017年 AntFin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface APayAuthInfo : NSObject 12 | 13 | @property(nonatomic, copy)NSString *appID; 14 | @property(nonatomic, copy)NSString *pid; 15 | @property(nonatomic, copy)NSString *redirectUri; 16 | 17 | /** 18 | * 初始化AuthInfo 19 | * 20 | * @param appIDStr 应用ID 21 | * @param pidStr 商户ID 可不填 22 | * @param uriStr 授权的应用回调地址 比如:alidemo://auth 23 | * 24 | * @return authinfo实例 25 | */ 26 | - (id)initWithAppID:(NSString *)appIDStr 27 | pid:(NSString *)pidStr 28 | redirectUri:(NSString *)uriStr; 29 | 30 | - (NSString *)description; 31 | - (NSString *)wapDescription; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /lib/Channels/Alipay/AlipaySDK.framework/Headers/AlipaySDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // AlipaySDK.h 3 | // AlipaySDK 4 | // 5 | // Created by antfin on 17-10-24. 6 | // Copyright (c) 2017年 AntFin. All rights reserved. 7 | // 8 | 9 | 10 | //////////////////////////////////////////////////////// 11 | ///////////////// 支付宝标准版本支付SDK /////////////////// 12 | ///////// version:15.8.03 motify:2021.04.29/////////// 13 | //////////////////////////////////////////////////////// 14 | 15 | #import 16 | #import "APayAuthInfo.h" 17 | #import "AFServiceCenter.h" 18 | #import "AFServiceResponse.h" 19 | 20 | typedef void(^CompletionBlock)(NSDictionary *resultDic); 21 | 22 | typedef enum { 23 | ALIPAY_TIDFACTOR_IMEI, 24 | ALIPAY_TIDFACTOR_IMSI, 25 | ALIPAY_TIDFACTOR_TID, 26 | ALIPAY_TIDFACTOR_CLIENTKEY, 27 | ALIPAY_TIDFACTOR_VIMEI, 28 | ALIPAY_TIDFACTOR_VIMSI, 29 | ALIPAY_TIDFACTOR_CLIENTID, 30 | ALIPAY_TIDFACTOR_APDID, 31 | ALIPAY_TIDFACTOR_MAX 32 | } AlipayTidFactor; 33 | 34 | @interface AlipaySDK : NSObject 35 | 36 | /** 37 | * 创建支付单例服务 38 | * 39 | * @return 返回单例对象 40 | */ 41 | + (AlipaySDK *)defaultService; 42 | 43 | /** 44 | * 用于设置SDK使用的window,如果没有自行创建window无需设置此接口 45 | */ 46 | @property (nonatomic, weak) UIWindow *targetWindow; 47 | 48 | ////////////////////////////////////////////////////////////////////////////////////////////// 49 | //////////////////////////支付宝支付相关接口///////////////////////////////////////////////////// 50 | ////////////////////////////////////////////////////////////////////////////////////////////// 51 | 52 | /** 53 | * 支付接口 54 | * 55 | * @param orderStr 支付订单信息字串 56 | * @param schemeStr 调用支付的app注册在info.plist中的scheme 57 | * @param completionBlock 支付结果回调Block,用于wap支付结果回调 58 | 跳转支付宝支付时只有当processOrderWithPaymentResult接口的completionBlock为nil时会使用这个bolock 59 | */ 60 | - (void)payOrder:(NSString *)orderStr 61 | fromScheme:(NSString *)schemeStr 62 | callback:(CompletionBlock)completionBlock; 63 | 64 | /** 65 | * 支付接口 v2 66 | * 67 | * @param orderStr 支付订单信息字串 68 | * @param dynamicLaunch 是否使用动态配置策略跳转支付宝支付 69 | * @param schemeStr 调用支付的app注册在info.plist中的scheme 70 | * @param completionBlock 支付结果回调Block,用于wap支付结果回调 71 | 跳转支付宝支付时只有当processOrderWithPaymentResult接口的completionBlock为nil时会使用这个bolock 72 | */ 73 | - (void)payOrder:(NSString *)orderStr 74 | dynamicLaunch:(BOOL)dynamicLaunch 75 | fromScheme:(NSString *)schemeStr 76 | callback:(CompletionBlock)completionBlock; 77 | 78 | /** 79 | * 处理支付宝app支付后跳回商户app携带的支付结果Url 80 | * 81 | * @param resultUrl 支付宝app返回的支付结果url 82 | * @param completionBlock 支付结果回调 为nil时默认使用支付接口的completionBlock 83 | */ 84 | - (void)processOrderWithPaymentResult:(NSURL *)resultUrl 85 | standbyCallback:(CompletionBlock)completionBlock; 86 | 87 | /** 88 | * 获取交易token。 89 | * 90 | * @return 交易token,若无则为空。 91 | */ 92 | - (NSString *)fetchTradeToken; 93 | 94 | 95 | ////////////////////////////////////////////////////////////////////////////////////////////// 96 | //////////////////////////支付宝授权 2.0 相关接口//////////////////////////////////////////////// 97 | ////////////////////////////////////////////////////////////////////////////////////////////// 98 | 99 | /** 100 | * 快登授权2.0 101 | * 102 | * @param infoStr 授权请求信息字串 103 | * @param schemeStr 调用授权的app注册在info.plist中的scheme 104 | * @param completionBlock 授权结果回调,需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果 105 | * 若在授权过程中,调用方应用被系统终止则此block无效(此时会调用'processAuth_V2Result:standbyCallback:'传入的standbyCallback) 106 | */ 107 | - (void)auth_V2WithInfo:(NSString *)infoStr 108 | fromScheme:(NSString *)schemeStr 109 | callback:(CompletionBlock)completionBlock; 110 | 111 | /** 112 | * 处理支付宝app授权后跳回商户app携带的授权结果Url 113 | * 114 | * @param resultUrl 支付宝app返回的授权结果url 115 | * @param completionBlock 授权结果回调,用于处理跳转支付宝授权过程中商户APP被系统终止的情况 116 | */ 117 | - (void)processAuth_V2Result:(NSURL *)resultUrl 118 | standbyCallback:(CompletionBlock)completionBlock; 119 | 120 | 121 | ////////////////////////////////////////////////////////////////////////////////////////////// 122 | //////////////////////////支付宝授权 1.0 相关接口//////////////////////////////////////////////// 123 | ////////////////////////////////////////////////////////////////////////////////////////////// 124 | 125 | 126 | /** 127 | * 快登授权 128 | * @param authInfo 授权相关信息 129 | * @param completionBlock 授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效, 130 | 需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果 131 | */ 132 | - (void)authWithInfo:(APayAuthInfo *)authInfo 133 | callback:(CompletionBlock)completionBlock; 134 | 135 | /** 136 | * 处理支付宝app授权后跳回商户app携带的授权结果Url 137 | * 138 | * @param resultUrl 支付宝app返回的授权结果url 139 | * @param completionBlock 授权结果回调 140 | */ 141 | - (void)processAuthResult:(NSURL *)resultUrl 142 | standbyCallback:(CompletionBlock)completionBlock; 143 | 144 | 145 | ////////////////////////////////////////////////////////////////////////////////////////////// 146 | //////////////////////////支付宝 h5 支付转 native 支付接口//////////////////////////////////////// 147 | ////////////////////////////////////////////////////////////////////////////////////////////// 148 | /** 149 | * 从h5链接中获取订单串并支付接口(自版本15.4.0起,推荐使用该接口) 150 | * 151 | * @param urlStr 拦截的 url string 152 | * 153 | * @return YES为成功获取订单信息并发起支付流程;NO为无法获取订单信息,输入url是普通url 154 | */ 155 | - (BOOL)payInterceptorWithUrl:(NSString *)urlStr 156 | fromScheme:(NSString *)schemeStr 157 | callback:(CompletionBlock)completionBlock; 158 | 159 | 160 | 161 | ////////////////////////////////////////////////////////////////////////////////////////////// 162 | //////////////////////////支付宝 tid 相关信息获取接口///////////////////////////////////////////// 163 | ////////////////////////////////////////////////////////////////////////////////////////////// 164 | 165 | /** 166 | * 获取当前tid相关信息 167 | * 168 | * @return tid相关信息 169 | */ 170 | - (NSString*)queryTidFactor:(AlipayTidFactor)factor; 171 | 172 | 173 | 174 | ////////////////////////////////////////////////////////////////////////////////////////////// 175 | //////////////////////////支付宝支付环境相关信息接口////////////////////////////////////////////// 176 | ////////////////////////////////////////////////////////////////////////////////////////////// 177 | 178 | /** 179 | * 是否已经使用过 180 | * 181 | * @return YES为已经使用过,NO反之 182 | */ 183 | - (BOOL)isLogined; 184 | 185 | /** 186 | * 获取当前版本号 187 | * 188 | * @return 当前版本字符串 189 | */ 190 | - (NSString *)currentVersion; 191 | 192 | /** 193 | * 測試所用,realse包无效 194 | * 195 | * @param url 测试环境 196 | */ 197 | - (void)setUrl:(NSString *)url; 198 | 199 | /** 200 | * 支付前主动更新本地配置 201 | * 202 | * @param block 更新请求结果回调 203 | */ 204 | - (void)fetchSdkConfigWithBlock:(void(^)(BOOL success))block; 205 | 206 | 207 | typedef void(^APLogBlock)(NSString *log); 208 | 209 | /** 210 | * 接收AlipaySDK的log信息 211 | * 212 | * @param logBlock 打印log的回调block 213 | */ 214 | + (void)startLogWithBlock:(APLogBlock)logBlock; 215 | 216 | /** 217 | * 停止输出log,会释放logBlock 218 | * 219 | * 220 | */ 221 | + (void)stopLog; 222 | 223 | @end 224 | -------------------------------------------------------------------------------- /lib/Channels/Alipay/libpingpp+alipay.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Alipay/libpingpp+alipay.a -------------------------------------------------------------------------------- /lib/Channels/ApplePay/libUPAPayPlugin.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/ApplePay/libUPAPayPlugin.a -------------------------------------------------------------------------------- /lib/Channels/ApplePay/libpingpp+applepayUpacp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/ApplePay/libpingpp+applepayUpacp.a -------------------------------------------------------------------------------- /lib/Channels/BfbWap/libpingpp+bfbWap.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/BfbWap/libpingpp+bfbWap.a -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/CCBNetPaySDK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CcbPay/CCBNetPaySDK.framework/CCBNetPaySDK -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/Headers/CCBNetPay.h: -------------------------------------------------------------------------------- 1 | // 2 | // CCBNetPay.h 3 | // CCBNetPaySDK 4 | // 5 | // Created by chenjunqi on 2017/1/6. 6 | // Copyright © 2017年 chenjunqi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "WXApi.h" 12 | 13 | typedef void(^CompletionBlock)(NSDictionary *dic); 14 | 15 | @interface CCBNetPay : NSObject 16 | 17 | /** 18 | * 创建支付单例服务 19 | * 20 | * @return 返回单例对象 21 | */ 22 | + (instancetype)defaultService; 23 | 24 | /** 25 | * 获取当前版本号 26 | * 27 | * @return 当前版本字符串 28 | */ 29 | - (NSString *)currentVersion; 30 | 31 | /** 32 | 龙支付接口 (合并支付) 能跳转APP则APP跳转支付,否则网页支付 33 | @param orderStr 订单信息 以 key1=value1&key2=value2 拼接 34 | @param completionBlock 支付结果回调 35 | */ 36 | - (void)payOrder:(NSString *)orderStr 37 | callback:(CompletionBlock)completionBlock; 38 | 39 | /** 40 | * 龙支付接口(APP支付) 41 | * 42 | * @param orderStr 订单信息 以 key1=value1&key2=value2 拼接 43 | */ 44 | - (void)payAppOrder:(NSString *)orderStr 45 | callback:(CompletionBlock)completionBlock; 46 | 47 | /** 48 | * 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url 49 | * 50 | * @param resultUrl 支付结果url 51 | * @param completionBlock 支付结果回调 52 | * 在application openURL方法 调用 53 | */ 54 | - (void)processOrderWithPaymentResult:(NSURL *)resultUrl 55 | standbyCallback:(CompletionBlock)completionBlock; 56 | 57 | /** 58 | * 龙支付接口(网页支付) 网页界面包含微信、支付宝支付 59 | * 60 | * @param orderStr 订单信息 61 | * @param completionBlock 支付结果回调Block 62 | */ 63 | - (void)payUrlOrder:(NSString *)orderStr 64 | callback:(CompletionBlock)completionBlock; 65 | 66 | 67 | //******************************************** 68 | // 2.0.0版本新增方法 69 | //******************************************** 70 | 71 | /** 72 | 微信支付接口 73 | @param orderStr 订单信息 以 key1=value1&key2=value2 拼接 74 | @param completionBlock 支付结果回调 75 | */ 76 | - (void)payWechatOrder:(NSString *)orderStr 77 | callback:(CompletionBlock)completionBlock; 78 | 79 | /** 80 | 注册微信支付app接口 81 | 需要在每次启动第三方应用程序时调用 82 | @param appid 微信开发者ID,需在微信支付平台注册app获得 83 | @param universalLink 通用链接,为在微信支付平台配置的值 84 | @return 成功返回YES,失败返回NO 85 | */ 86 | - (BOOL)registerWechatPayApp:(NSString *)appid universalLink:(NSString *)universalLink; 87 | 88 | /** 89 | 支付宝支付接口 90 | @param orderStr 订单信息 以 key1=value1&key2=value2 拼接 91 | @param completionBlock 支付结果回调 92 | */ 93 | - (void)payAliOrder:(NSString *)orderStr 94 | callback:(CompletionBlock)completionBlock; 95 | 96 | 97 | /** 98 | 银联支付接口 99 | @param orderStr 订单信息 以 key1=value1&key2=value2 拼接 100 | @param completionBlock 支付结果回调 101 | */ 102 | - (void)payUnionOrder:(NSString *)orderStr 103 | callback:(CompletionBlock)completionBlock; 104 | 105 | /** 106 | 界面选择支付接口 107 | @param orderStr 订单信息 以 key1=value1&key2=value2 拼接 108 | @param completionBlock 支付结果回调 109 | */ 110 | - (void)payViewOrder:(NSString *)orderStr 111 | callback:(CompletionBlock)completionBlock; 112 | 113 | /** 114 | 授权接口 115 | @param info 授权用户相关信息 以 key1=value1&key2=value2 拼接 116 | @param completionBlock 授权结果回调 117 | */ 118 | -(void)authorizeWithInfo:(NSString *)info callback:(CompletionBlock)completionBlock; 119 | 120 | - (NSString *)getIPAddress; 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/Headers/CCBNetPaySDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // CCBNetPaySDK.h 3 | // CCBNetPaySDK 4 | // 5 | // Created by chenjunqi on 2017/1/20. 6 | // Copyright © 2017年 chenjunqi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CCBNetPay.h" 11 | 12 | -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/Headers/WXApi.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXApi.h 3 | // 所有Api接口 4 | // 5 | // Created by Wechat on 12-2-28. 6 | // Copyright (c) 2012年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WXApiObject.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | #pragma mark - WXApiDelegate 15 | /*! @brief 接收并处理来自微信终端程序的事件消息 16 | * 17 | * 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。 18 | * WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。 19 | */ 20 | @protocol WXApiDelegate 21 | @optional 22 | 23 | /*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果 24 | * 25 | * 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。 26 | * 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。 27 | * @param req 具体请求内容,是自动释放的 28 | */ 29 | - (void)onReq:(BaseReq*)req; 30 | 31 | 32 | 33 | /*! @brief 发送一个sendReq后,收到微信的回应 34 | * 35 | * 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。 36 | * 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。 37 | * @param resp具体的回应内容,是自动释放的 38 | */ 39 | - (void)onResp:(BaseResp*)resp; 40 | 41 | @end 42 | 43 | #pragma mark - WXApiLogDelegate 44 | 45 | @protocol WXApiLogDelegate 46 | 47 | - (void)onLog:(NSString*)log logLevel:(WXLogLevel)level; 48 | 49 | @end 50 | 51 | #pragma mark - WXApi 52 | 53 | /*! @brief 微信Api接口函数类 54 | * 55 | * 该类封装了微信终端SDK的所有接口 56 | */ 57 | @interface WXApi : NSObject 58 | 59 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 60 | * 61 | * 需要在每次启动第三方应用程序时调用。 62 | * @attention 请保证在主线程中调用此函数 63 | * @param appid 微信开发者ID 64 | * @param universalLink 微信开发者Universal Link 65 | * @return 成功返回YES,失败返回NO。 66 | */ 67 | + (BOOL)registerApp:(NSString *)appid universalLink:(NSString *)universalLink; 68 | 69 | 70 | /*! @brief 处理旧版微信通过URL启动App时传递的数据 71 | * 72 | * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 73 | * @param url 微信启动第三方应用时传递过来的URL 74 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 75 | * @return 成功返回YES,失败返回NO。 76 | */ 77 | + (BOOL)handleOpenURL:(NSURL *)url delegate:(nullable id)delegate; 78 | 79 | 80 | /*! @brief 处理微信通过Universal Link启动App时传递的数据 81 | * 82 | * 需要在 application:continueUserActivity:restorationHandler:中调用。 83 | * @param userActivity 微信启动第三方应用时系统API传递过来的userActivity 84 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 85 | * @return 成功返回YES,失败返回NO。 86 | */ 87 | + (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity delegate:(nullable id)delegate; 88 | 89 | 90 | /*! @brief 检查微信是否已被用户安装 91 | * 92 | * @return 微信已安装返回YES,未安装返回NO。 93 | */ 94 | + (BOOL)isWXAppInstalled; 95 | 96 | 97 | 98 | /*! @brief 判断当前微信的版本是否支持OpenApi 99 | * 100 | * @return 支持返回YES,不支持返回NO。 101 | */ 102 | + (BOOL)isWXAppSupportApi; 103 | 104 | 105 | 106 | /*! @brief 获取微信的itunes安装地址 107 | * 108 | * @return 微信的安装地址字符串。 109 | */ 110 | + (NSString *)getWXAppInstallUrl; 111 | 112 | 113 | 114 | /*! @brief 获取当前微信SDK的版本号 115 | * 116 | * @return 返回当前微信SDK的版本号 117 | */ 118 | + (NSString *)getApiVersion; 119 | 120 | 121 | 122 | /*! @brief 打开微信 123 | * 124 | * @return 成功返回YES,失败返回NO。 125 | */ 126 | + (BOOL)openWXApp; 127 | 128 | 129 | 130 | /*! @brief 发送请求到微信,等待微信返回onResp 131 | * 132 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型 133 | * SendAuthReq、SendMessageToWXReq、PayReq等。 134 | * @param req 具体的发送请求。 135 | * @param completion 调用结果回调block 136 | */ 137 | + (void)sendReq:(BaseReq *)req completion:(void (^ __nullable)(BOOL success))completion; 138 | 139 | /*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面 140 | * 141 | * 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有 142 | * GetMessageFromWXResp、ShowMessageFromWXResp等。 143 | * @param resp 具体的应答内容 144 | * @param completion 调用结果回调block 145 | */ 146 | + (void)sendResp:(BaseResp*)resp completion:(void (^ __nullable)(BOOL success))completion; 147 | 148 | 149 | /*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp 150 | * 151 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。 152 | * @param req 具体的发送请求。 153 | * @param viewController 当前界面对象。 154 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 155 | * @param completion 调用结果回调block 156 | */ 157 | + (void)sendAuthReq:(SendAuthReq *)req viewController:(UIViewController*)viewController delegate:(nullable id)delegate completion:(void (^ __nullable)(BOOL success))completion; 158 | 159 | 160 | /*! @brief WXApi的成员函数,接受微信的log信息。byBlock 161 | 注意1:SDK会强引用这个block,注意不要导致内存泄漏,注意不要导致内存泄漏 162 | 注意2:调用过一次startLog by block之后,如果再调用一次任意方式的startLoad,会释放上一次logBlock,不再回调上一个logBlock 163 | * 164 | * @param level 打印log的级别 165 | * @param logBlock 打印log的回调block 166 | */ 167 | + (void)startLogByLevel:(WXLogLevel)level logBlock:(WXLogBolock)logBlock; 168 | 169 | /*! @brief WXApi的成员函数,接受微信的log信息。byDelegate 170 | 注意1:sdk会弱引用这个delegate,这里可加任意对象为代理,不需要与WXApiDelegate同一个对象 171 | 注意2:调用过一次startLog by delegate之后,再调用一次任意方式的startLoad,不会再回调上一个logDelegate对象 172 | * @param level 打印log的级别 173 | * @param logDelegate 打印log的回调代理, 174 | */ 175 | + (void)startLogByLevel:(WXLogLevel)level logDelegate:(id)logDelegate; 176 | 177 | /*! @brief 停止打印log,会清理block或者delegate为空,释放block 178 | * @param 179 | */ 180 | + (void)stopLog; 181 | @end 182 | 183 | NS_ASSUME_NONNULL_END 184 | -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/Headers/WXApiObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMApiObject.h 3 | // Api对象,包含所有接口和对象数据定义 4 | // 5 | // Created by Wechat on 12-2-28. 6 | // Copyright (c) 2012年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /*! @brief 错误码 15 | * 16 | */ 17 | enum WXErrCode { 18 | WXSuccess = 0, /**< 成功 */ 19 | WXErrCodeCommon = -1, /**< 普通错误类型 */ 20 | WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */ 21 | WXErrCodeSentFail = -3, /**< 发送失败 */ 22 | WXErrCodeAuthDeny = -4, /**< 授权失败 */ 23 | WXErrCodeUnsupport = -5, /**< 微信不支持 */ 24 | }; 25 | 26 | 27 | 28 | /*! @brief 请求发送场景 29 | * 30 | */ 31 | enum WXScene { 32 | WXSceneSession = 0, /**< 聊天界面 */ 33 | WXSceneTimeline = 1, /**< 朋友圈 */ 34 | WXSceneFavorite = 2, /**< 收藏 */ 35 | WXSceneSpecifiedSession = 3, /**< 指定联系人 */ 36 | }; 37 | 38 | 39 | enum WXAPISupport { 40 | WXAPISupportSession = 0, 41 | }; 42 | 43 | 44 | 45 | /*! @brief 跳转profile类型 46 | * 47 | */ 48 | enum WXBizProfileType { 49 | WXBizProfileType_Normal = 0, //**< 普通公众号 */ 50 | WXBizProfileType_Device = 1, //**< 硬件公众号 */ 51 | }; 52 | 53 | /*! @brief 分享小程序类型 54 | * 55 | */ 56 | typedef NS_ENUM(NSUInteger, WXMiniProgramType) { 57 | WXMiniProgramTypeRelease = 0, //**< 正式版 */ 58 | WXMiniProgramTypeTest = 1, //**< 开发版 */ 59 | WXMiniProgramTypePreview = 2, //**< 体验版 */ 60 | }; 61 | 62 | /*! @brief 跳转mp网页类型 63 | * 64 | */ 65 | enum WXMPWebviewType { 66 | WXMPWebviewType_Ad = 0, /**< 广告网页 **/ 67 | }; 68 | 69 | /*! @brief log的级别 70 | * 71 | */ 72 | typedef NS_ENUM(NSInteger,WXLogLevel) { 73 | WXLogLevelNormal = 0, // 打印日常的日志 74 | WXLogLevelDetail = 1, // 打印详细的日志 75 | }; 76 | 77 | 78 | /*! @brief 打印回调的block 79 | * 80 | */ 81 | typedef void(^WXLogBolock)(NSString *log); 82 | 83 | #pragma mark - BaseReq 84 | /*! @brief 该类为微信终端SDK所有请求类的基类 85 | * 86 | */ 87 | @interface BaseReq : NSObject 88 | 89 | /** 请求类型 */ 90 | @property (nonatomic, assign) int type; 91 | /** 由用户微信号和AppID组成的唯一标识,需要校验微信用户是否换号登录时填写*/ 92 | @property (nonatomic, copy) NSString *openID; 93 | 94 | @end 95 | 96 | 97 | 98 | #pragma mark - BaseResp 99 | /*! @brief 该类为微信终端SDK所有响应类的基类 100 | * 101 | */ 102 | @interface BaseResp : NSObject 103 | /** 错误码 */ 104 | @property (nonatomic, assign) int errCode; 105 | /** 错误提示字符串 */ 106 | @property (nonatomic, copy) NSString *errStr; 107 | /** 响应类型 */ 108 | @property (nonatomic, assign) int type; 109 | 110 | @end 111 | 112 | 113 | 114 | #pragma mark - WXMediaMessage 115 | @class WXMediaMessage; 116 | 117 | #ifndef BUILD_WITHOUT_PAY 118 | 119 | #pragma mark - PayReq 120 | /*! @brief 第三方向微信终端发起支付的消息结构体 121 | * 122 | * 第三方向微信终端发起支付的消息结构体,微信终端处理后会向第三方返回处理结果 123 | * @see PayResp 124 | */ 125 | @interface PayReq : BaseReq 126 | 127 | /** 商家向财付通申请的商家id */ 128 | @property (nonatomic, copy) NSString *partnerId; 129 | /** 预支付订单 */ 130 | @property (nonatomic, copy) NSString *prepayId; 131 | /** 随机串,防重发 */ 132 | @property (nonatomic, copy) NSString *nonceStr; 133 | /** 时间戳,防重发 */ 134 | @property (nonatomic, assign) UInt32 timeStamp; 135 | /** 商家根据财付通文档填写的数据和签名 */ 136 | @property (nonatomic, copy) NSString *package; 137 | /** 商家根据微信开放平台文档对数据做的签名 */ 138 | @property (nonatomic, copy) NSString *sign; 139 | 140 | @end 141 | 142 | 143 | #pragma mark - PayResp 144 | /*! @brief 微信终端返回给第三方的关于支付结果的结构体 145 | * 146 | * 微信终端返回给第三方的关于支付结果的结构体 147 | */ 148 | @interface PayResp : BaseResp 149 | 150 | /** 财付通返回给商家的信息 */ 151 | @property (nonatomic, copy) NSString *returnKey; 152 | 153 | @end 154 | 155 | #pragma mark - WXOfflinePay 156 | /*! @brief 第三方向微信终端发起离线支付 157 | * 158 | * 第三方向微信终端发起离线支付的消息结构体 159 | */ 160 | @interface WXOfflinePayReq : BaseReq 161 | 162 | @end 163 | 164 | /*! @brief 第三方向微信终端发起离线支付返回 165 | * 166 | * 第三方向微信终端发起离线支付返回的消息结构体 167 | */ 168 | @interface WXOfflinePayResp : BaseResp 169 | 170 | @end 171 | 172 | 173 | #pragma mark - WXNontaxPayReq 174 | @interface WXNontaxPayReq:BaseReq 175 | 176 | @property (nonatomic, copy) NSString *urlString; 177 | 178 | @end 179 | 180 | #pragma mark - WXNontaxPayResp 181 | @interface WXNontaxPayResp : BaseResp 182 | 183 | @property (nonatomic, copy) NSString *wxOrderId; 184 | 185 | @end 186 | 187 | #pragma mark - WXPayInsuranceReq 188 | @interface WXPayInsuranceReq : BaseReq 189 | 190 | @property (nonatomic, copy) NSString *urlString; 191 | 192 | @end 193 | 194 | #pragma mark - WXPayInsuranceResp 195 | @interface WXPayInsuranceResp : BaseResp 196 | 197 | @property (nonatomic, copy) NSString *wxOrderId; 198 | 199 | @end 200 | 201 | #endif 202 | 203 | 204 | #pragma mark - SendAuthReq 205 | /*! @brief 第三方程序向微信终端请求认证的消息结构 206 | * 207 | * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数, 208 | * 向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。 209 | * @see SendAuthResp 210 | */ 211 | @interface SendAuthReq : BaseReq 212 | /** 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。 213 | * @see SendAuthResp 214 | * @note scope字符串长度不能超过1K 215 | */ 216 | @property (nonatomic, copy) NSString *scope; 217 | /** 第三方程序本身用来标识其请求的唯一性,最后跳转回第三方程序时,由微信终端回传。 218 | * @note state字符串长度不能超过1K 219 | */ 220 | @property (nonatomic, copy) NSString *state; 221 | 222 | @end 223 | 224 | #pragma mark - SendAuthResp 225 | /*! @brief 微信处理完第三方程序的认证和权限申请后向第三方程序回送的处理结果。 226 | * 227 | * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。 228 | * 微信终端处理完后会向第三方程序发送一个SendAuthResp。 229 | * @see onResp 230 | */ 231 | @interface SendAuthResp : BaseResp 232 | @property (nonatomic, copy, nullable) NSString *code; 233 | /** 第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传 234 | * @note state字符串长度不能超过1K 235 | */ 236 | @property (nonatomic, copy, nullable) NSString *state; 237 | @property (nonatomic, copy, nullable) NSString *lang; 238 | @property (nonatomic, copy, nullable) NSString *country; 239 | @end 240 | 241 | 242 | 243 | #pragma mark - SendMessageToWXReq 244 | /*! @brief 第三方程序发送消息至微信终端程序的消息结构体 245 | * 246 | * 第三方程序向微信发送信息需要传入SendMessageToWXReq结构体,信息类型包括文本消息和多媒体消息, 247 | * 分别对应于text和message成员。调用该方法后,微信处理完信息会向第三方程序发送一个处理结果。 248 | * @see SendMessageToWXResp 249 | */ 250 | @interface SendMessageToWXReq : BaseReq 251 | /** 发送消息的文本内容 252 | * @note 文本长度必须大于0且小于10K 253 | */ 254 | @property (nonatomic, copy) NSString *text; 255 | /** 发送消息的多媒体内容 256 | * @see WXMediaMessage 257 | */ 258 | @property (nonatomic, strong) WXMediaMessage *message; 259 | /** 发送消息的类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */ 260 | @property (nonatomic, assign) BOOL bText; 261 | /** 发送的目标场景,可以选择发送到会话(WXSceneSession)或者朋友圈(WXSceneTimeline)。 默认发送到会话。 262 | * @see WXScene 263 | */ 264 | @property (nonatomic, assign) int scene; 265 | /** 指定发送消息的人 266 | * @note WXSceneSpecifiedSession时有效 267 | */ 268 | @property (nonatomic, copy, nullable) NSString *toUserOpenId; 269 | @end 270 | 271 | #pragma mark - SendMessageToWXResp 272 | /*! @brief 微信终端向第三方程序返回的SendMessageToWXReq处理结果。 273 | * 274 | * 第三方程序向微信终端发送SendMessageToWXReq后,微信发送回来的处理结果,该结果用SendMessageToWXResp表示。 275 | */ 276 | @interface SendMessageToWXResp : BaseResp 277 | @property(nonatomic, copy) NSString *lang; 278 | @property(nonatomic, copy) NSString *country; 279 | @end 280 | 281 | #pragma mark - GetMessageFromWXReq 282 | /*! @brief 微信终端向第三方程序请求提供内容的消息结构体。 283 | * 284 | * 微信终端向第三方程序请求提供内容,微信终端会向第三方程序发送GetMessageFromWXReq消息结构体, 285 | * 需要第三方程序调用sendResp返回一个GetMessageFromWXResp消息结构体。 286 | */ 287 | @interface GetMessageFromWXReq : BaseReq 288 | @property (nonatomic, strong) NSString *lang; 289 | @property (nonatomic, strong) NSString *country; 290 | @end 291 | 292 | 293 | 294 | #pragma mark - GetMessageFromWXResp 295 | /*! @brief 微信终端向第三方程序请求提供内容,第三方程序向微信终端返回的消息结构体。 296 | * 297 | * 微信终端向第三方程序请求提供内容,第三方程序调用sendResp向微信终端返回一个GetMessageFromWXResp消息结构体。 298 | */ 299 | @interface GetMessageFromWXResp : BaseResp 300 | /** 向微信终端提供的文本内容 301 | @note 文本长度必须大于0且小于10K 302 | */ 303 | @property (nonatomic, strong) NSString *text; 304 | /** 向微信终端提供的多媒体内容。 305 | * @see WXMediaMessage 306 | */ 307 | @property (nonatomic, strong) WXMediaMessage *message; 308 | /** 向微信终端提供内容的消息类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */ 309 | @property (nonatomic, assign) BOOL bText; 310 | @end 311 | 312 | 313 | 314 | #pragma mark - ShowMessageFromWXReq 315 | /*! @brief 微信通知第三方程序,要求第三方程序显示的消息结构体。 316 | * 317 | * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。 318 | * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。 319 | */ 320 | @interface ShowMessageFromWXReq : BaseReq 321 | /** 微信终端向第三方程序发送的要求第三方程序处理的多媒体内容 322 | * @see WXMediaMessage 323 | */ 324 | @property (nonatomic, strong) WXMediaMessage *message; 325 | @property (nonatomic, copy) NSString *lang; 326 | @property (nonatomic, copy) NSString *country; 327 | @end 328 | 329 | 330 | 331 | #pragma mark - ShowMessageFromWXResp 332 | /*! @brief 微信通知第三方程序,要求第三方程序显示或处理某些消息,第三方程序处理完后向微信终端发送的处理结果。 333 | * 334 | * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。 335 | * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。 336 | */ 337 | @interface ShowMessageFromWXResp : BaseResp 338 | @end 339 | 340 | 341 | #pragma mark - LaunchFromWXReq 342 | /*! @brief 微信终端打开第三方程序携带的消息结构体 343 | * 344 | * 微信向第三方发送的结构体,第三方不需要返回 345 | */ 346 | @interface LaunchFromWXReq : BaseReq 347 | @property (nonatomic, strong) WXMediaMessage *message; 348 | @property (nonatomic, copy) NSString *lang; 349 | @property (nonatomic, copy) NSString *country; 350 | @end 351 | 352 | 353 | #pragma mark - OpenWebviewReq 354 | /* ! @brief 第三方通知微信启动内部浏览器,打开指定网页 355 | * 356 | * 第三方通知微信启动内部浏览器,打开指定Url对应的网页 357 | */ 358 | @interface OpenWebviewReq : BaseReq 359 | /** 需要打开的网页对应的Url 360 | * @attention 长度不能超过1024 361 | */ 362 | @property(nonatomic, copy) NSString *url; 363 | 364 | @end 365 | 366 | #pragma mark - OpenWebviewResp 367 | /*! @brief 微信终端向第三方程序返回的OpenWebviewReq处理结果 368 | * 369 | * 第三方程序向微信终端发送OpenWebviewReq后,微信发送回来的处理结果,该结果用OpenWebviewResp表示 370 | */ 371 | @interface OpenWebviewResp : BaseResp 372 | 373 | @end 374 | 375 | 376 | 377 | #pragma mark - WXOpenBusinessWebViewReq 378 | /*! @brief 第三方通知微信启动内部浏览器,打开指定业务的网页 379 | * 380 | * 381 | */ 382 | @interface WXOpenBusinessWebViewReq : BaseReq 383 | 384 | /** 网页业务类型 385 | * @attention 386 | */ 387 | @property (nonatomic, assign) UInt32 businessType; 388 | 389 | /** 网页业务参数 390 | * @attention 391 | */ 392 | @property (nonatomic, strong, nullable) NSDictionary *queryInfoDic; 393 | 394 | @end 395 | 396 | #pragma mark - WXOpenBusinessWebViewResp 397 | /*! @brief 微信终端向第三方程序返回的WXOpenBusinessWebViewResp处理结果。 398 | * 399 | * 第三方程序向微信终端发送WXOpenBusinessWebViewReq后,微信发送回来的处理结果,该结果用WXOpenBusinessWebViewResp表示。 400 | */ 401 | @interface WXOpenBusinessWebViewResp : BaseResp 402 | /** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理 403 | * @attention 长度不能超过2k 404 | */ 405 | @property (nonatomic, copy) NSString *result; 406 | 407 | /** 网页业务类型 408 | * @attention 409 | */ 410 | @property (nonatomic, assign) UInt32 businessType; 411 | 412 | @end 413 | 414 | 415 | #pragma mark - OpenRankListReq 416 | /* ! @brief 第三方通知微信,打开硬件排行榜 417 | * 418 | * 第三方通知微信,打开硬件排行榜 419 | */ 420 | @interface OpenRankListReq : BaseReq 421 | 422 | @end 423 | 424 | #pragma mark - OpenRanklistResp 425 | /*! @brief 微信终端向第三方程序返回的OpenRankListReq处理结果。 426 | * 427 | * 第三方程序向微信终端发送OpenRankListReq后,微信发送回来的处理结果,该结果用OpenRankListResp表示。 428 | */ 429 | @interface OpenRankListResp : BaseResp 430 | 431 | @end 432 | 433 | 434 | #pragma mark - WXCardItem 435 | 436 | @interface WXCardItem : NSObject 437 | /** 卡id 438 | * @attention 长度不能超过1024字节 439 | */ 440 | @property (nonatomic, copy) NSString *cardId; 441 | /** ext信息 442 | * @attention 长度不能超过2024字节 443 | */ 444 | @property (nonatomic, copy, nullable) NSString *extMsg; 445 | /** 446 | * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。 447 | */ 448 | @property (nonatomic, assign) UInt32 cardState; 449 | /** 450 | * @attention req不需要填,chooseCard返回的。 451 | */ 452 | @property (nonatomic, copy) NSString *encryptCode; 453 | /** 454 | * @attention req不需要填,chooseCard返回的。 455 | */ 456 | @property (nonatomic, copy) NSString *appID; 457 | @end; 458 | 459 | #pragma mark - WXInvoiceItem 460 | 461 | @interface WXInvoiceItem : NSObject 462 | /** 卡id 463 | * @attention 长度不能超过1024字节 464 | */ 465 | @property (nonatomic, copy) NSString *cardId; 466 | /** ext信息 467 | * @attention 长度不能超过2024字节 468 | */ 469 | @property (nonatomic, copy, nullable) NSString *extMsg; 470 | /** 471 | * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。 472 | */ 473 | @property (nonatomic, assign) UInt32 cardState; 474 | /** 475 | * @attention req不需要填,chooseCard返回的。 476 | */ 477 | @property (nonatomic, copy) NSString *encryptCode; 478 | /** 479 | * @attention req不需要填,chooseCard返回的。 480 | */ 481 | @property (nonatomic, copy) NSString *appID; 482 | 483 | @end 484 | 485 | #pragma mark - AddCardToWXCardPackageReq 486 | /* ! @brief 请求添加卡券至微信卡包 487 | * 488 | */ 489 | 490 | @interface AddCardToWXCardPackageReq : BaseReq 491 | /** 卡列表 492 | * @attention 个数不能超过40个 类型WXCardItem 493 | */ 494 | @property (nonatomic, strong) NSArray *cardAry; 495 | 496 | @end 497 | 498 | 499 | #pragma mark - AddCardToWXCardPackageResp 500 | /** ! @brief 微信返回第三方添加卡券结果 501 | * 502 | */ 503 | 504 | @interface AddCardToWXCardPackageResp : BaseResp 505 | /** 卡列表 506 | * @attention 个数不能超过40个 类型WXCardItem 507 | */ 508 | @property (nonatomic, strong) NSArray *cardAry; 509 | @end 510 | 511 | #pragma mark - WXChooseCardReq 512 | /* ! @brief 请求从微信选取卡券 513 | * 514 | */ 515 | 516 | @interface WXChooseCardReq : BaseReq 517 | @property (nonatomic, copy) NSString *appID; 518 | @property (nonatomic, assign) UInt32 shopID; 519 | @property (nonatomic, assign) UInt32 canMultiSelect; 520 | @property (nonatomic, copy) NSString *cardType; 521 | @property (nonatomic, copy) NSString *cardTpID; 522 | @property (nonatomic, copy) NSString *signType; 523 | @property (nonatomic, copy) NSString *cardSign; 524 | @property (nonatomic, assign) UInt32 timeStamp; 525 | @property (nonatomic, copy) NSString *nonceStr; 526 | @end 527 | 528 | 529 | #pragma mark - WXChooseCardResp 530 | /** ! @brief 微信返回第三方请求选择卡券结果 531 | * 532 | */ 533 | 534 | @interface WXChooseCardResp : BaseResp 535 | @property (nonatomic, strong ) NSArray* cardAry; 536 | @end 537 | 538 | 539 | #pragma mark - WXChooseInvoiceReq 540 | /* ! @brief 请求从微信选取发票 541 | * 542 | */ 543 | @interface WXChooseInvoiceReq : BaseReq 544 | @property (nonatomic, copy) NSString *appID; 545 | @property (nonatomic, assign) UInt32 shopID; 546 | @property (nonatomic, copy) NSString *signType; 547 | @property (nonatomic, copy) NSString *cardSign; 548 | @property (nonatomic, assign) UInt32 timeStamp; 549 | @property (nonatomic, copy) NSString *nonceStr; 550 | @end 551 | 552 | #pragma mark - WXChooseInvoiceResp 553 | /** ! @brief 微信返回第三方请求选择发票结果 554 | * 555 | */ 556 | @interface WXChooseInvoiceResp : BaseResp 557 | @property (nonatomic, strong) NSArray* cardAry; 558 | @end 559 | 560 | #pragma mark - WXSubscriptionReq 561 | @interface WXSubscribeMsgReq : BaseReq 562 | @property (nonatomic, assign) UInt32 scene; 563 | @property (nonatomic, copy) NSString *templateId; 564 | @property (nonatomic, copy, nullable) NSString *reserved; 565 | @end 566 | 567 | #pragma mark - WXSubscriptionReq 568 | @interface WXSubscribeMsgResp : BaseResp 569 | 570 | @property (nonatomic, copy) NSString *templateId; 571 | @property (nonatomic, assign) UInt32 scene; 572 | @property (nonatomic, copy) NSString *action; 573 | @property (nonatomic, copy) NSString *reserved; 574 | @property (nonatomic, copy, nullable) NSString *openId; 575 | 576 | @end 577 | 578 | #pragma mark - WXSubscribeMiniProgramMsg 579 | /** ! @brief 第三方请求订阅小程序消息 580 | * 581 | */ 582 | @interface WXSubscribeMiniProgramMsgReq : BaseReq 583 | @property (nonatomic, copy) NSString *miniProgramAppid; 584 | @end 585 | 586 | #pragma mark - WXSubscriptionReq 587 | @interface WXSubscribeMiniProgramMsgResp : BaseResp 588 | 589 | @property(nonatomic, copy) NSString *openId; // 小程序openid 590 | @property(nonatomic, copy) NSString *unionId; // unionId 591 | @property(nonatomic, copy) NSString *nickName; // 用户昵称 592 | 593 | @end 594 | 595 | #pragma mark - WXinvoiceAuthInsertReq 596 | @interface WXInvoiceAuthInsertReq : BaseReq 597 | 598 | @property (nonatomic, copy) NSString *urlString; 599 | 600 | @end 601 | 602 | #pragma mark - WXinvoiceAuthInsertResp 603 | 604 | @interface WXInvoiceAuthInsertResp : BaseResp 605 | 606 | @property (nonatomic, copy) NSString *wxOrderId; 607 | 608 | @end 609 | 610 | #pragma mark - WXMediaMessage 611 | 612 | /*! @brief 多媒体消息结构体 613 | * 614 | * 用于微信终端和第三方程序之间传递消息的多媒体消息内容 615 | */ 616 | @interface WXMediaMessage : NSObject 617 | 618 | + (WXMediaMessage *)message; 619 | 620 | /** 标题 621 | * @note 长度不能超过512字节 622 | */ 623 | @property (nonatomic, copy) NSString *title; 624 | /** 描述内容 625 | * @note 长度不能超过1K 626 | */ 627 | @property (nonatomic, copy) NSString *description; 628 | /** 缩略图数据 629 | * @note 大小不能超过64K 630 | */ 631 | @property (nonatomic, strong, nullable) NSData *thumbData; 632 | /** 633 | * @note 长度不能超过64字节 634 | */ 635 | @property (nonatomic, copy, nullable) NSString *mediaTagName; 636 | /** 637 | * 638 | */ 639 | @property (nonatomic, copy, nullable) NSString *messageExt; 640 | @property (nonatomic, copy, nullable) NSString *messageAction; 641 | /** 642 | * 多媒体数据对象,可以为WXImageObject,WXMusicObject,WXVideoObject,WXWebpageObject等。 643 | */ 644 | @property (nonatomic, strong) id mediaObject; 645 | 646 | /*! @brief 设置消息缩略图的方法 647 | * 648 | * @param image 缩略图 649 | * @note 大小不能超过64K 650 | */ 651 | - (void)setThumbImage:(UIImage *)image; 652 | 653 | @end 654 | 655 | 656 | 657 | #pragma mark - WXImageObject 658 | /*! @brief 多媒体消息中包含的图片数据对象 659 | * 660 | * 微信终端和第三方程序之间传递消息中包含的图片数据对象。 661 | * @note imageData成员不能为空 662 | * @see WXMediaMessage 663 | */ 664 | @interface WXImageObject : NSObject 665 | /*! @brief 返回一个WXImageObject对象 666 | * 667 | * @note 返回的WXImageObject对象是自动释放的 668 | */ 669 | + (WXImageObject *)object; 670 | 671 | /** 图片真实数据内容 672 | * @note 大小不能超过25M 673 | */ 674 | @property (nonatomic, strong) NSData *imageData; 675 | 676 | @end 677 | 678 | 679 | #pragma mark - WXMusicObject 680 | /*! @brief 多媒体消息中包含的音乐数据对象 681 | * 682 | * 微信终端和第三方程序之间传递消息中包含的音乐数据对象。 683 | * @note musicUrl和musicLowBandUrl成员不能同时为空。 684 | * @see WXMediaMessage 685 | */ 686 | @interface WXMusicObject : NSObject 687 | /*! @brief 返回一个WXMusicObject对象 688 | * 689 | * @note 返回的WXMusicObject对象是自动释放的 690 | */ 691 | + (WXMusicObject *)object; 692 | 693 | /** 音乐网页的url地址 694 | * @note 长度不能超过10K 695 | */ 696 | @property (nonatomic, copy) NSString *musicUrl; 697 | /** 音乐lowband网页的url地址 698 | * @note 长度不能超过10K 699 | */ 700 | @property (nonatomic, copy) NSString *musicLowBandUrl; 701 | /** 音乐数据url地址 702 | * @note 长度不能超过10K 703 | */ 704 | @property (nonatomic, copy) NSString *musicDataUrl; 705 | 706 | /**音乐lowband数据url地址 707 | * @note 长度不能超过10K 708 | */ 709 | @property (nonatomic, copy) NSString *musicLowBandDataUrl; 710 | 711 | /**音乐封面图Url 712 | * @note 长度不能超过10K 713 | */ 714 | @property (nonatomic, copy) NSString *songAlbumUrl; 715 | 716 | /**歌词信息 LRC格式 717 | * @note 长度不能超过32K 718 | */ 719 | @property (nonatomic, copy, nullable) NSString *songLyric; 720 | @end 721 | 722 | 723 | 724 | #pragma mark - WXVideoObject 725 | /*! @brief 多媒体消息中包含的视频数据对象 726 | * 727 | * 微信终端和第三方程序之间传递消息中包含的视频数据对象。 728 | * @note videoUrl和videoLowBandUrl不能同时为空。 729 | * @see WXMediaMessage 730 | */ 731 | @interface WXVideoObject : NSObject 732 | /*! @brief 返回一个WXVideoObject对象 733 | * 734 | * @note 返回的WXVideoObject对象是自动释放的 735 | */ 736 | + (WXVideoObject *)object; 737 | 738 | /** 视频网页的url地址 739 | * @note 长度不能超过10K 740 | */ 741 | @property (nonatomic, copy) NSString *videoUrl; 742 | /** 视频lowband网页的url地址 743 | * @note 长度不能超过10K 744 | */ 745 | @property (nonatomic, copy) NSString *videoLowBandUrl; 746 | 747 | @end 748 | 749 | 750 | 751 | #pragma mark - WXWebpageObject 752 | /*! @brief 多媒体消息中包含的网页数据对象 753 | * 754 | * 微信终端和第三方程序之间传递消息中包含的网页数据对象。 755 | * @see WXMediaMessage 756 | */ 757 | @interface WXWebpageObject : NSObject 758 | /*! @brief 返回一个WXWebpageObject对象 759 | * 760 | * @note 返回的WXWebpageObject对象是自动释放的 761 | */ 762 | + (WXWebpageObject *)object; 763 | 764 | /** 网页的url地址 765 | * @note 不能为空且长度不能超过10K 766 | */ 767 | @property (nonatomic, copy) NSString *webpageUrl; 768 | 769 | @end 770 | 771 | 772 | 773 | #pragma mark - WXAppExtendObject 774 | /*! @brief 多媒体消息中包含的App扩展数据对象 775 | * 776 | * 第三方程序向微信终端发送包含WXAppExtendObject的多媒体消息, 777 | * 微信需要处理该消息时,会调用该第三方程序来处理多媒体消息内容。 778 | * @note url,extInfo和fileData不能同时为空 779 | * @see WXMediaMessage 780 | */ 781 | @interface WXAppExtendObject : NSObject 782 | /*! @brief 返回一个WXAppExtendObject对象 783 | * 784 | * @note 返回的WXAppExtendObject对象是自动释放的 785 | */ 786 | + (WXAppExtendObject *)object; 787 | 788 | /** 若第三方程序不存在,微信终端会打开该url所指的App下载地址 789 | * @note 长度不能超过10K 790 | */ 791 | @property (nonatomic, copy) NSString *url; 792 | /** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理 793 | * @note 长度不能超过2K 794 | */ 795 | @property (nonatomic, copy, nullable) NSString *extInfo; 796 | /** App文件数据,该数据发送给微信好友,微信好友需要点击后下载数据,微信终端会回传给第三方程序处理 797 | * @note 大小不能超过10M 798 | */ 799 | @property (nonatomic, strong, nullable) NSData *fileData; 800 | 801 | @end 802 | 803 | 804 | 805 | #pragma mark - WXEmoticonObject 806 | /*! @brief 多媒体消息中包含的表情数据对象 807 | * 808 | * 微信终端和第三方程序之间传递消息中包含的表情数据对象。 809 | * @see WXMediaMessage 810 | */ 811 | @interface WXEmoticonObject : NSObject 812 | 813 | /*! @brief 返回一个WXEmoticonObject对象 814 | * 815 | * @note 返回的WXEmoticonObject对象是自动释放的 816 | */ 817 | + (WXEmoticonObject *)object; 818 | 819 | /** 表情真实数据内容 820 | * @note 大小不能超过10M 821 | */ 822 | @property (nonatomic, strong) NSData *emoticonData; 823 | 824 | @end 825 | 826 | 827 | 828 | #pragma mark - WXFileObject 829 | /*! @brief 多媒体消息中包含的文件数据对象 830 | * 831 | * @see WXMediaMessage 832 | */ 833 | @interface WXFileObject : NSObject 834 | 835 | /*! @brief 返回一个WXFileObject对象 836 | * 837 | * @note 返回的WXFileObject对象是自动释放的 838 | */ 839 | + (WXFileObject *)object; 840 | 841 | /** 文件后缀名 842 | * @note 长度不超过64字节 843 | */ 844 | @property (nonatomic, copy) NSString *fileExtension; 845 | 846 | /** 文件真实数据内容 847 | * @note 大小不能超过10M 848 | */ 849 | @property (nonatomic, strong) NSData *fileData; 850 | 851 | @end 852 | 853 | 854 | #pragma mark - WXLocationObject 855 | /*! @brief 多媒体消息中包含的地理位置数据对象 856 | * 857 | * 微信终端和第三方程序之间传递消息中包含的地理位置数据对象。 858 | * @see WXMediaMessage 859 | */ 860 | @interface WXLocationObject : NSObject 861 | 862 | /*! @brief 返回一个WXLocationObject对象 863 | * 864 | * @note 返回的WXLocationObject对象是自动释放的 865 | */ 866 | + (WXLocationObject *)object; 867 | 868 | /** 地理位置信息 869 | * @note 经纬度 870 | */ 871 | @property (nonatomic, assign) double lng; //经度 872 | @property (nonatomic, assign) double lat; //纬度 873 | 874 | @end 875 | 876 | #pragma mark - WXTextObject 877 | /*! @brief 多媒体消息中包含的文本数据对象 878 | * 879 | * 微信终端和第三方程序之间传递消息中包含的文本数据对象。 880 | * @see WXMediaMessage 881 | */ 882 | @interface WXTextObject : NSObject 883 | 884 | /*! @brief 返回一个WXTextObject对象 885 | * 886 | * @note 返回的WXTextObject对象是自动释放的 887 | */ 888 | + (WXTextObject *)object; 889 | 890 | /** 地理位置信息 891 | * @note 文本内容 892 | */ 893 | @property (nonatomic, copy) NSString *contentText; 894 | 895 | @end 896 | 897 | #pragma mark - WXMiniProgramObject 898 | 899 | @interface WXMiniProgramObject : NSObject 900 | 901 | /*! @brief WXMiniProgramObject对象 902 | * 903 | * @note 返回的WXMiniProgramObject对象是自动释放的 904 | */ 905 | + (WXMiniProgramObject *)object; 906 | 907 | /** 低版本网页链接 908 | * @attention 长度不能超过1024字节 909 | */ 910 | @property (nonatomic, copy) NSString *webpageUrl; 911 | 912 | /** 小程序username */ 913 | @property (nonatomic, copy) NSString *userName; 914 | 915 | /** 小程序页面的路径 916 | * @attention 不填默认拉起小程序首页 917 | */ 918 | @property (nonatomic, copy, nullable) NSString *path; 919 | 920 | /** 小程序新版本的预览图 921 | * @attention 大小不能超过128k 922 | */ 923 | @property (nonatomic, strong, nullable) NSData *hdImageData; 924 | 925 | /** 是否使用带 shareTicket 的转发 */ 926 | @property (nonatomic, assign) BOOL withShareTicket; 927 | 928 | /** 分享小程序的版本 929 | * @attention (正式,开发,体验) 930 | */ 931 | @property (nonatomic, assign) WXMiniProgramType miniProgramType; 932 | 933 | /** 是否禁用转发 */ 934 | @property (nonatomic, assign) BOOL disableForward; 935 | 936 | @end 937 | 938 | #pragma mark - WXLaunchMiniProgramReq 939 | 940 | /*! @brief WXLaunchMiniProgramReq对象, 可实现通过sdk拉起微信小程序 941 | * 942 | * @note 返回的WXLaunchMiniProgramReq对象是自动释放的 943 | */ 944 | @interface WXLaunchMiniProgramReq : BaseReq 945 | 946 | + (WXLaunchMiniProgramReq *)object; 947 | 948 | /** 小程序username */ 949 | @property (nonatomic, copy) NSString *userName; 950 | 951 | /** 小程序页面的路径 952 | * @attention 不填默认拉起小程序首页 953 | */ 954 | @property (nonatomic, copy, nullable) NSString *path; 955 | 956 | /** 分享小程序的版本 957 | * @attention (正式,开发,体验) 958 | */ 959 | @property (nonatomic, assign) WXMiniProgramType miniProgramType; 960 | 961 | /** ext信息 962 | * @attention json格式 963 | */ 964 | @property (nonatomic, copy, nullable) NSString *extMsg; 965 | 966 | /** extDic 967 | * @attention 字典,可存放图片等比较大的数据 968 | */ 969 | @property (nonatomic, copy, nullable) NSDictionary *extDic; 970 | 971 | @end 972 | 973 | #pragma mark - WXLaunchMiniProgramResp 974 | /*! @brief 微信终端向第三方程序返回的WXLaunchMiniProgramReq处理结果。 975 | * 976 | * 第三方程序向微信终端发送WXLaunchMiniProgramReq后,微信发送回来的处理结果,该结果用WXLaunchMiniProgramResp表示。 977 | */ 978 | @interface WXLaunchMiniProgramResp : BaseResp 979 | 980 | @property (nonatomic, copy, nullable) NSString *extMsg; 981 | 982 | @end 983 | 984 | 985 | #pragma mark - WXOpenBusinessViewReq 986 | /*! @brief WXOpenBusinessViewReq对象, 可实现第三方通知微信启动,打开业务页面 987 | * 988 | * @note 返回的WXOpenBusinessViewReq对象是自动释放的 989 | */ 990 | 991 | @interface WXOpenBusinessViewReq : BaseReq 992 | 993 | + (WXOpenBusinessViewReq *)object; 994 | 995 | /** 业务类型 996 | */ 997 | @property (nonatomic, copy) NSString *businessType; 998 | 999 | /** 业务参数 1000 | */ 1001 | @property (nonatomic, copy, nullable) NSString *query; 1002 | 1003 | /** ext信息 1004 | * @note 选填,json格式 1005 | */ 1006 | @property (nonatomic, copy, nullable) NSString *extInfo; 1007 | 1008 | /** extData数据 1009 | * @note 1010 | */ 1011 | @property (nonatomic, strong, nullable) NSData *extData; 1012 | @end 1013 | 1014 | 1015 | @interface WXOpenBusinessViewResp : BaseResp 1016 | 1017 | /** 业务类型 1018 | */ 1019 | @property (nonatomic, copy) NSString *businessType; 1020 | 1021 | /** 业务返回数据 1022 | */ 1023 | @property (nonatomic, copy, nullable) NSString *extMsg; 1024 | 1025 | @end 1026 | NS_ASSUME_NONNULL_END 1027 | -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CcbPay/CCBNetPaySDK.framework/Info.plist -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module CCBNetPaySDK { 2 | umbrella header "CCBNetPaySDK.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeDirectory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeDirectory -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeRequirements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeRequirements -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeRequirements-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeRequirements-1 -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Headers/CCBNetPay.h 8 | 9 | 9kddTfAbGzKoTfgpsIxkRp4wfdw= 10 | 11 | Headers/CCBNetPaySDK.h 12 | 13 | EX6LglWdINcIA7y5SoqKYRMzM6s= 14 | 15 | Headers/WXApi.h 16 | 17 | of3HAMWBF0r6nn7zU6AnTXGqZns= 18 | 19 | Headers/WXApiObject.h 20 | 21 | n1CBQkB//auDee0ebZI/36WNMV8= 22 | 23 | Info.plist 24 | 25 | UzZdBxEE3QTmiotC1WFLry1HmWU= 26 | 27 | Modules/module.modulemap 28 | 29 | Bfz63eNS59DXN54fQQCnIT/FuJ4= 30 | 31 | 32 | files2 33 | 34 | Headers/CCBNetPay.h 35 | 36 | hash 37 | 38 | 9kddTfAbGzKoTfgpsIxkRp4wfdw= 39 | 40 | hash2 41 | 42 | BArsuMfy9nA5O6DmUgAD2aquLLR6bfiNIAquNrQrYrA= 43 | 44 | 45 | Headers/CCBNetPaySDK.h 46 | 47 | hash 48 | 49 | EX6LglWdINcIA7y5SoqKYRMzM6s= 50 | 51 | hash2 52 | 53 | gaaLz0xip376Nf5+s3r7BSYQZ4VDJYkJbLjLTTsNvDQ= 54 | 55 | 56 | Headers/WXApi.h 57 | 58 | hash 59 | 60 | of3HAMWBF0r6nn7zU6AnTXGqZns= 61 | 62 | hash2 63 | 64 | 5iyPfC1RWTuouER0WbrzNo7LX7f1NkTQKJg/bafZLMY= 65 | 66 | 67 | Headers/WXApiObject.h 68 | 69 | hash 70 | 71 | n1CBQkB//auDee0ebZI/36WNMV8= 72 | 73 | hash2 74 | 75 | DF1qr8spy1g2UKtyBGrkfvkiqpBqUBe7HTwK6i7Qzac= 76 | 77 | 78 | Modules/module.modulemap 79 | 80 | hash 81 | 82 | Bfz63eNS59DXN54fQQCnIT/FuJ4= 83 | 84 | hash2 85 | 86 | GhRxPEQZQky4q++K038yKnW0DGBAz8MaIG6717wLZJs= 87 | 88 | 89 | 90 | rules 91 | 92 | ^.* 93 | 94 | ^.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^version.plist$ 114 | 115 | 116 | rules2 117 | 118 | .*\.dSYM($|/) 119 | 120 | weight 121 | 11 122 | 123 | ^(.*/)?\.DS_Store$ 124 | 125 | omit 126 | 127 | weight 128 | 2000 129 | 130 | ^.* 131 | 132 | ^.*\.lproj/ 133 | 134 | optional 135 | 136 | weight 137 | 1000 138 | 139 | ^.*\.lproj/locversion.plist$ 140 | 141 | omit 142 | 143 | weight 144 | 1100 145 | 146 | ^Base\.lproj/ 147 | 148 | weight 149 | 1010 150 | 151 | ^Info\.plist$ 152 | 153 | omit 154 | 155 | weight 156 | 20 157 | 158 | ^PkgInfo$ 159 | 160 | omit 161 | 162 | weight 163 | 20 164 | 165 | ^embedded\.provisionprofile$ 166 | 167 | weight 168 | 20 169 | 170 | ^version\.plist$ 171 | 172 | weight 173 | 20 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeSignature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CcbPay/CCBNetPaySDK.framework/_CodeSignature/CodeSignature -------------------------------------------------------------------------------- /lib/Channels/CcbPay/libpingpp+ccbpay.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CcbPay/libpingpp+ccbpay.a -------------------------------------------------------------------------------- /lib/Channels/Chinaums/UMSPPPayPluginSettings.h: -------------------------------------------------------------------------------- 1 | // 2 | // UMSPluginSettings.h 3 | // UMSPosPay 4 | // 5 | // Created by chinaums on 15/10/19. 6 | // Copyright © 2015年 ChinaUMS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //1 是走apple 0是不走 12 | //#define SHOULD_CONTAIN_APPLE_PAY_CODES 0 13 | 14 | /*! 15 | @enum 16 | @abstract 交易环境 17 | @constant UMSP_PROD 生产环境 18 | @constant UMSP_TEST 测试环境 19 | */ 20 | typedef NS_ENUM(NSInteger, UMSPluginEnvironment) { 21 | UMSP_PROD, 22 | UMSP_TEST 23 | }; 24 | 25 | /** 26 | * 进入插件的方式 27 | */ 28 | typedef NS_ENUM(NSInteger, UMSPluginEnterType) { 29 | ///默认方式 30 | UMSPluginEnterType_Default, 31 | ///C扫B方式 32 | UMSPluginEnterType_ScanCode 33 | }; 34 | 35 | 36 | @interface UMSPPPayPluginSettings : NSObject 37 | 38 | + (UMSPPPayPluginSettings *)sharedInstance; 39 | 40 | /*! 41 | @property 42 | @abstract 设置交易环境,默认UMSP_PROD 43 | */ 44 | @property (nonatomic, assign) UMSPluginEnvironment umspEnviroment; 45 | 46 | /** 47 | * 进入插件方式,默认UMSPluginEnterType_Default 48 | */ 49 | @property (nonatomic, assign) UMSPluginEnterType umspEnterType; 50 | 51 | /*! 52 | @property 53 | @abstract 设置是否需要启动页,默认YES 54 | */ 55 | @property (nonatomic, assign) BOOL umspSplash; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /lib/Channels/Chinaums/UMSPPPayUnifyPayPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // UMSPPPayUnifyPayPlugin.h 3 | // UMSPosPay 4 | // 5 | // Created by SunXP on 17/4/25. 6 | // Copyright © 2017年 ChinaUMS. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WXApi.h" 11 | 12 | /** 13 | * 支付渠道 14 | * 15 | * @param CHANNEL_WEIXIN 微信支付 16 | * @param CHANNEL_ALIPAY 支付宝支付 17 | * @param CHANNEL_ALIMINIPAY 支付宝小程序支付 18 | */ 19 | FOUNDATION_EXTERN NSString *const CHANNEL_WEIXIN; 20 | FOUNDATION_EXTERN NSString *const CHANNEL_ALIPAY; 21 | FOUNDATION_EXTERN NSString *const CHANNEL_ALIMINIPAY; 22 | 23 | typedef void(^TransactionResultBlock)(NSString *resultCode, NSString *resultInfo); 24 | 25 | @interface UMSPPPayUnifyPayPlugin : NSObject 26 | 27 | /** 28 | * 商户下单支付接口 29 | * 30 | * @param payChannel 支付渠道 31 | * @param payData 订单信息:appPayRequest对应的json字符串 32 | * @param callbackBlock 交易结果回调Block 33 | */ 34 | + (void)payWithPayChannel:(NSString *)payChannel payData:(NSString *)payData callbackBlock:(TransactionResultBlock)callbackBlock; 35 | 36 | /** 37 | 云闪付下单接口 38 | 39 | @param schemes url schemes 40 | @param payData 订单信息:appPayRequest对应的json字符串 41 | @param viewController 启动支付控件的viewController 42 | @param callbackBlock 交易结果回调Block 43 | */ 44 | + (void)cloudPayWithURLSchemes:(NSString *)schemes 45 | payData:(NSString *)payData 46 | viewController:(UIViewController *)viewController 47 | callbackBlock:(TransactionResultBlock)callbackBlock; 48 | 49 | /** 50 | * 微信支付配置参数 51 | * 52 | * @param appId 商户注册的微信支付appId 53 | * @param universalLink 微信开发者Universal Link 54 | * @return YES:成功 NO:失败 55 | * 需在AppDelegate的didFinishLaunchingWithOptions方法中调用 56 | */ 57 | + (BOOL)registerApp:(NSString *)appId universalLink:(NSString *)universalLink; 58 | 59 | /** 60 | * 微信支付配置参数 61 | * 62 | * @param url App处理的openUrl 63 | * @param otherDelegate WXApiDelegate对象,用来接收微信触发的非本功能的消息。 64 | * @return YES:成功 NO:失败 65 | * 需在AppDelegate中的方法中调用: 66 | * iOS9.0之前版本:- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url 67 | * - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 68 | * iOS9.0之后版本:- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options 69 | */ 70 | + (BOOL)handleOpenURL:(NSURL *)url otherDelegate:(id)otherDelegate; 71 | 72 | /*! @brief 处理微信通过Universal Link启动App时传递的数据 73 | * 74 | * 需要在 application:continueUserActivity:restorationHandler:中调用。 75 | * @param userActivity 微信启动第三方应用时系统API传递过来的userActivity 76 | * @param otherDelegate WXApiDelegate对象,用来接收微信触发的非本功能的消息。 77 | * 需在AppDelegate中的方法中调用: 78 | 需要在 application:continueUserActivity:restorationHandler:中调用。 79 | * @return 成功返回YES,失败返回NO。 80 | */ 81 | +(BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity otherDelegate:(id)otherDelegate API_AVAILABLE(ios(8.0)); 82 | /** 83 | 云闪付处理 84 | 85 | @param url App处理的openUrl 86 | @return YES:成功 NO:失败 87 | */ 88 | + (BOOL)cloudPayHandleOpenURL:(NSURL *)url; 89 | 90 | /** 91 | 支付宝小程序处理 92 | 93 | @param url App处理的openUrl 94 | */ 95 | + (void)aliMiniPayHandleOpenURL:(NSURL *)url; 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /lib/Channels/Chinaums/UMSPPPayVersionsInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // libUMSVersionsInfo.h 3 | // UMSPosPay 4 | // 5 | // Created by diudiu on 16/6/28. 6 | // Copyright © 2016年 ChinaUMS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UMSPPPayVersionsInfo : NSObject 12 | 13 | + (NSMutableDictionary *)getVersionsInfoForPosPayPlugin; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /lib/Channels/Chinaums/libUMSPosPayOnly.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Chinaums/libUMSPosPayOnly.a -------------------------------------------------------------------------------- /lib/Channels/Chinaums/libpingpp+chinaums.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Chinaums/libpingpp+chinaums.a -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/CMBSDK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CmbWallet/CMBSDK.framework/CMBSDK -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/Headers/CMBApi.h: -------------------------------------------------------------------------------- 1 | // 2 | // CMBApi.h 3 | // 4 | // Created by Mbank on 2018/5/29. 5 | // 6 | 7 | #import 8 | #import 9 | #import "CMBApiObject.h" 10 | #import "CMBWebview.h" 11 | 12 | @protocol CMBApiDelegate 13 | @optional 14 | 15 | /*! @brief 发送一个sendReq后,收到招商银行APP的回应 16 | * 17 | * 收到一个来自招商银行APP的处理结果。调用一次sendReq后会收到onResp。 18 | * @param resp 具体的回应内容,是自动释放的 19 | */ 20 | -(void)onResp:(CMBResponse*)resp; 21 | 22 | @end 23 | 24 | @interface CMBApi : NSObject 25 | 26 | /*! @brief 检查招商银行APP是否已被用户安装,涉及跳转招商银行APP的业务功能须先 27 | *用此接口检查是否已安装招商银行APP 28 | * 29 | * @return 招商银行APP已安装返回YES,未安装返回NO。 30 | */ 31 | +(BOOL)isCMBAppInstalled; 32 | 33 | /*! @brief 跳转到AppStore的招商银行APP下载更新页面 34 | * 35 | * @return 跳转成功返回YES,失败返回NO。 36 | */ 37 | +(BOOL)jumpToAppStore; 38 | 39 | /*! @brief 获取当前招商银行SDK的版本号 40 | * 41 | * @return 返回当前招商银行SDK的版本号 42 | */ 43 | +(NSString *)getApiVersion; 44 | 45 | /*! @brief 发送请求到招商银行APP,支持用户没安装招商银行APP,等待招商银行APP返回onResp 46 | * 47 | * 函数调用后,会切换到招商银行APP的界面。第三方应用程序等待招商银行APP返回onResp。招商银行APP在异步处理完成后一定会调用onResp。 48 | * @param request 具体的发送请求,在调用函数后,请自己释放。 49 | * @param appid 商户在招商银行商户系统中的appid。 50 | * @param viewController 当前界面对象。 51 | * @param delegate CMBApiDelegate对象,用来接收招商银行APP触发的消息。 52 | * @return 成功返回YES,失败返回NO。 53 | */ 54 | +(BOOL)sendRequest:(CMBRequest *)request 55 | appid:(NSString *)appid 56 | viewController:(UIViewController *)viewController 57 | delegate:(id)delegate; 58 | 59 | /*! @brief 获取招行浏览器控件。 60 | * 61 | * 函数调用后,会根据请求信息生成招行浏览器并打开H5页面,可通过浏览器获取响应结果。 62 | * 注:仅在商户需要自定义实现导航栏时调用。 63 | * @param request 具体的发送请求,在调用函数后,请自己释放,具体内容参考CMBRequest参数说明。 64 | * @param appid 商户在招商银行商户系统中的appid。 65 | * @param delegate 对象,用来接收请求执行回调和标题变更的消息。 66 | * @return 返回浏览器控件,参数非法则返回nil。 67 | */ 68 | +(CMBWebview *) initCMBWebview: (CMBRequest *)request 69 | appid:(NSString *)appid 70 | delegate:(id)delegate; 71 | 72 | 73 | /*! @brief 发送请求打开H5支付页面或者跳转到招商银行APP完成支付,并等待招商银行APP返回结果。 74 | * 75 | * 函数调用后,会根据是否安装招商银行APP切换到招商银行APP的界面或直接打开H5支付界面, 第三方应用程序等待招商银行APP回调errBlock或succBlock。 76 | * 注:普通商户请勿使用该接口 77 | * @param payUrl 具体的支付请求(URL+支付参数)。 78 | * @param appid 选传,商户在招商银行相应的业务功能商户系统中的appid,请产品经理给出。 79 | * @param method 选传,业务功能类型,请产品经理给出。 80 | * @param errBlock 支付失败后回调的block。 81 | * @param succBlock 支付成功后回调的block。 82 | */ 83 | +(void)callPay:(NSString *)payUrl 84 | appid:(NSString *)appid 85 | method:(NSString *)method 86 | onError:(void(^)(NSString *url))errBlock 87 | onSuccess:(void(^)(NSString *url))succBlock; 88 | 89 | /*! @brief 处理招商银行APP通过URL启动商户App时传递的数据 90 | * 91 | * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 92 | * @param url 招商银行APP启动第三方应用时传递过来的URL 93 | * @param delegate CMBApiDelegate对象,用来接收招商银行APP触发的消息。 94 | * @return 成功返回YES,失败返回NO。 95 | */ 96 | +(BOOL)handleOpenURL:(NSURL *) url delegate:(id) delegate; 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/Headers/CMBApiObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // CMBApiObject.h 3 | // 4 | // Created by Mbank on 2018/5/29. 5 | // 6 | 7 | #import 8 | 9 | @interface CMBApiObject : NSObject 10 | 11 | @end 12 | 13 | 14 | @interface CMBRequest: NSObject 15 | 16 | /** 支付、协议、领券等业务功能等请求参数 **/ 17 | @property (nonatomic, strong) NSString *requestData; 18 | 19 | /** 业务功能类型,客户端透传 **/ 20 | @property (nonatomic, strong) NSString *method; 21 | 22 | /** 可选,app没有安装时在商户APP打开H5页面,并把request参数post过去。默认为支付的h5Url。 **/ 23 | @property (nonatomic, strong) NSString *h5Url; 24 | 25 | /** 可选,app已经安装时要跳转到的招商银行APP具体功能的url,需业务功能给出。默认为支付的CMBJumpUrl **/ 26 | @property (nonatomic, strong) NSString *CMBJumpUrl; 27 | 28 | /** 可选,用于控制H5场景下导航栏是否展示,默认展示 **/ 29 | @property (nonatomic, assign) BOOL navigationBarHidden; 30 | 31 | @end 32 | 33 | 34 | 35 | @interface CMBResponse: NSObject 36 | 37 | /** 应答码 */ 38 | @property (nonatomic, assign) int respCode; 39 | /** 错误提示字符串 */ 40 | @property (nonatomic, retain) NSString *respMessage; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/Headers/CMBSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // CMBSDK.h 3 | // CMBSDK 4 | // 5 | // Created by mahuanran on 2018/6/12. 6 | // Copyright © 2018年 mahuanran. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for CMBSDK. 12 | FOUNDATION_EXPORT double CMBSDKVersionNumber; 13 | 14 | //! Project version string for CMBSDK. 15 | FOUNDATION_EXPORT const unsigned char CMBSDKVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import 20 | #import 21 | 22 | -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/Headers/CMBWebview.h: -------------------------------------------------------------------------------- 1 | // 2 | // CMBWebview.h 3 | // CMBSDK 4 | // 5 | // Created by peters wang on 2020/1/15. 6 | // 7 | 8 | #import 9 | #import "CMBApiObject.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol CMBWebviewDelegate 14 | @optional 15 | 16 | /*! @brief 收到页面关闭响应 17 | * 18 | * 用户主动关闭/取消页面请求、或收到业务响应结果 19 | * @param resp 具体的回应内容,是自动释放的 20 | */ 21 | -(void)onClosed:(CMBResponse*)resp; 22 | 23 | /*! @brief 收到页面标题变更通知 24 | * 25 | * 页面跳转时设置的标题内容 26 | * @param title 变更后的标题 27 | */ 28 | -(void)titleChanged:(NSString *)title; 29 | 30 | @end 31 | 32 | @interface CMBWebview : UIView 33 | 34 | @property (nonatomic, strong) CMBResponse *response; 35 | 36 | /*! @brief 初始化招行浏览器控件 37 | * 38 | * 注:商户请勿使用该方法初始化。 39 | * 40 | */ 41 | - (instancetype)initWithRequest:(CMBRequest *)request 42 | appid:(NSString *)appid 43 | payUrl:(nullable NSString *)payUrl 44 | delegate:(id)delegate; 45 | 46 | @end 47 | 48 | NS_ASSUME_NONNULL_END 49 | -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CmbWallet/CMBSDK.framework/Info.plist -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module CMBSDK { 2 | umbrella header "CMBSDK.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeDirectory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeDirectory -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeRequirements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeRequirements -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeRequirements-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeRequirements-1 -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Headers/CMBApi.h 8 | 9 | GhkjUBsG2mHm4+LnpLBW52B1Yso= 10 | 11 | Headers/CMBApiObject.h 12 | 13 | 796XnpHJebtqYVoVcW9ZzrtLxdI= 14 | 15 | Headers/CMBSDK.h 16 | 17 | 9WGhCOX0oZ57++xyu4eV1rWDtWw= 18 | 19 | Headers/CMBWebview.h 20 | 21 | 9jYQwlDzh7/+g1EDz6poXu/IORg= 22 | 23 | Info.plist 24 | 25 | 2iIi+tXGBRUCj+RzYpMx3rUXsvw= 26 | 27 | Modules/module.modulemap 28 | 29 | DSuFZRkgrbRVn2rPB0yqsT7NkOI= 30 | 31 | 32 | files2 33 | 34 | Headers/CMBApi.h 35 | 36 | hash 37 | 38 | GhkjUBsG2mHm4+LnpLBW52B1Yso= 39 | 40 | hash2 41 | 42 | D6L7yXW5lB5g2GlbTNUKBBiLvEYYy9GoDfL6nYr45Mk= 43 | 44 | 45 | Headers/CMBApiObject.h 46 | 47 | hash 48 | 49 | 796XnpHJebtqYVoVcW9ZzrtLxdI= 50 | 51 | hash2 52 | 53 | Sustk+rt+HpjxBgqjxl0LUSypmAC/cXOStoJRG44l/M= 54 | 55 | 56 | Headers/CMBSDK.h 57 | 58 | hash 59 | 60 | 9WGhCOX0oZ57++xyu4eV1rWDtWw= 61 | 62 | hash2 63 | 64 | EfVSDTAYyjpeXf5/Kdv77n2n806/1g8ufpRalwQarsg= 65 | 66 | 67 | Headers/CMBWebview.h 68 | 69 | hash 70 | 71 | 9jYQwlDzh7/+g1EDz6poXu/IORg= 72 | 73 | hash2 74 | 75 | x2OzCFBm7z/FR+jnWX4X0ocU/wo2jZ5oLBj/dvm+riA= 76 | 77 | 78 | Modules/module.modulemap 79 | 80 | hash 81 | 82 | DSuFZRkgrbRVn2rPB0yqsT7NkOI= 83 | 84 | hash2 85 | 86 | rOD64/Yyssegs2b8J/qrY3kwi6SPoUAIRdGiMlq8/C0= 87 | 88 | 89 | 90 | rules 91 | 92 | ^.* 93 | 94 | ^.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^version.plist$ 114 | 115 | 116 | rules2 117 | 118 | .*\.dSYM($|/) 119 | 120 | weight 121 | 11 122 | 123 | ^(.*/)?\.DS_Store$ 124 | 125 | omit 126 | 127 | weight 128 | 2000 129 | 130 | ^.* 131 | 132 | ^.*\.lproj/ 133 | 134 | optional 135 | 136 | weight 137 | 1000 138 | 139 | ^.*\.lproj/locversion.plist$ 140 | 141 | omit 142 | 143 | weight 144 | 1100 145 | 146 | ^Base\.lproj/ 147 | 148 | weight 149 | 1010 150 | 151 | ^Info\.plist$ 152 | 153 | omit 154 | 155 | weight 156 | 20 157 | 158 | ^PkgInfo$ 159 | 160 | omit 161 | 162 | weight 163 | 20 164 | 165 | ^embedded\.provisionprofile$ 166 | 167 | weight 168 | 20 169 | 170 | ^version\.plist$ 171 | 172 | weight 173 | 20 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeSignature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CmbWallet/CMBSDK.framework/_CodeSignature/CodeSignature -------------------------------------------------------------------------------- /lib/Channels/CmbWallet/libpingpp+cmbWallet.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/CmbWallet/libpingpp+cmbWallet.a -------------------------------------------------------------------------------- /lib/Channels/Cmpay/libCmpayiPosLib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Cmpay/libCmpayiPosLib.a -------------------------------------------------------------------------------- /lib/Channels/Cmpay/libpingpp+cmpay.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Cmpay/libpingpp+cmpay.a -------------------------------------------------------------------------------- /lib/Channels/Jdpay/libpingpp+jdpay.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Jdpay/libpingpp+jdpay.a -------------------------------------------------------------------------------- /lib/Channels/Lakala/PaymaxSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // PaymaxSDK.h 3 | // PaymaxSDK 4 | // 5 | // Created by ying.wang on 2019/6/4. 6 | // Copyright © 2019 lakala. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | /** 13 | * 返回值详解 14 | */ 15 | typedef NS_ENUM(NSUInteger, PaymaxBackType) { 16 | PAYMAX_CODE_SUCCESS = 2000, /**< 成功*/ 17 | PAYMAX_CODE_FAIL_CANCEL = 4004, /**< 用户取消支付*/ 18 | PAYMAX_CODE_ERROR_DEAL = 4201, /**< 处理中*/ 19 | PAYMAX_CODE_FAILURE = 4005, /**< 失败*/ 20 | PAYMAX_CODE_ERROR_CONNECT = 4202, /**< 网络错误*/ 21 | PAYMAX_CODE_CHANNEL_WRONG = 4003, /**< 渠道信息错误*/ 22 | PAYMAX_CODE_ERROR_CHARGE_PARAMETER = 4002, /**< 参数信息错误*/ 23 | PAYMAX_CODE_ERROR_WX_NOT_INSTALL = 4101, /**< 未安装微信*/ 24 | PAYMAX_CODE_ERROR_WX_NOT_SUPPORT_PAY = 4102, /**< 微信不支持*/ 25 | PAYMAX_CODE_ERROR_WX_UNKNOW = 4103 /**< 微信未知错误*/ 26 | }; 27 | 28 | static NSString *alipay = @"ALIPAYAPP"; 29 | static NSString *wxpay = @"WECHATAPP"; 30 | static NSString *lklpay = @"LKLAPP"; 31 | 32 | @interface PaymaxResult :NSObject 33 | 34 | /** 35 | * 返回码 36 | */ 37 | @property (assign, nonatomic) PaymaxBackType type; 38 | /** 39 | * 支付渠道返回的错误码 40 | */ 41 | @property (copy, nonatomic) NSString *channelBackCode; 42 | /** 43 | * 返回提示字符串 44 | */ 45 | @property (copy, nonatomic) NSString *backStr; 46 | /** 47 | * 支付渠道 48 | */ 49 | @property (copy, nonatomic) NSString *channel; 50 | 51 | @end 52 | 53 | typedef void(^callbackBlock)(PaymaxResult * _Nonnull result); 54 | 55 | ///////////////////////////////////////////////////// PaymaxSDK /////////////////////////////////////////////////////////////////// 56 | 57 | @interface PaymaxSDK : NSObject { 58 | @package 59 | PaymaxResult *_result; 60 | } 61 | 62 | /** 63 | * 支付接口 64 | * 65 | * @param charge 支付要素 66 | * @param viewController 当前的viewController 67 | * @param completionBlock 支付结果回调Block 68 | */ 69 | + (void)pay:(NSDictionary *_Nonnull)charge viewController:(UIViewController *_Nonnull)viewController completion:(callbackBlock _Nonnull )completionBlock; 70 | 71 | +(void)payWithAppid:(nonnull NSString*)wxappid universalLink:(nonnull NSString*)universalLink payObj:(nonnull NSDictionary*)payObj viewController:(nonnull UIViewController *)viewController completion:(nonnull callbackBlock)completionBlock; 72 | 73 | +(void)payWithAliToken:(NSDictionary *_Nonnull)charge viewController:(UIViewController *_Nonnull)viewController completion:(callbackBlock _Nonnull )completionBlock; 74 | 75 | /** 76 | * 处理支付渠道通过URL启动App时传递的数据 77 | * 78 | * @param url 支付渠道再启动第三方应用时传递过来的URL 79 | * @param completionBlock 保证跳转钱包支付过程中,即使调用方app被系统kill时,能通过这个回调取到支付结果 80 | * 81 | * @return 成功返回YES,失败返回NO。 82 | */ 83 | + (BOOL)handleOpenURL:(NSURL *_Nonnull)url; 84 | 85 | + (BOOL)handleOpenUniversalLink:(NSUserActivity *_Nonnull)userActivity; 86 | 87 | /** 88 | * SDK当前版本号 89 | * 90 | * @return SDK当前版本号 91 | */ 92 | + (NSString *)currentSDKVersion; 93 | @end 94 | 95 | -------------------------------------------------------------------------------- /lib/Channels/Lakala/libPaymaxSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Lakala/libPaymaxSDK.a -------------------------------------------------------------------------------- /lib/Channels/Lakala/libpingpp+lakala.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Lakala/libpingpp+lakala.a -------------------------------------------------------------------------------- /lib/Channels/QQWallet/QQWalletSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // QQWalletSDK.h 3 | // QQWalletSDK 4 | // 5 | // Created by Eric on 17/9/1. 6 | // Copyright (c) 2017年 Teccent. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * QQ钱包SDK 13 | */ 14 | #define QQWalletURLScheme @"mqqwallet" 15 | #define QQWalletAppID @"appId" 16 | #define QQWalletBargainorId @"bargainorId" 17 | #define QQWalletNonce @"nonce" 18 | #define QQWalletPubAcc @"pubAcc" 19 | #define QQWalletTokenId @"tokenId" 20 | #define QQWalletSignature @"sig" 21 | #define QQWalletAppVersion @"appVersion" 22 | #define QQWalletParams @"params" 23 | #define QQWalletApplication @"application" 24 | #define QQWalletSchemeKey @"urlScheme" 25 | 26 | @interface QQWalletSDK : NSObject 27 | 28 | /** 29 | * 错误码 30 | */ 31 | typedef enum{ 32 | QQWalletErrCodeSuccess = 0, /**< 成功 */ 33 | QQWalletErrCodeCommon = -1, /**< 普通错误类型 */ 34 | QQWalletErrCodeUserCancel = -11001, /**< 用户点击取消并返回 */ 35 | }QQWalletErrCode; 36 | 37 | /** 38 | * 获取QQWalletSDK的单例 39 | */ 40 | + (instancetype)sharedInstance; 41 | 42 | /** 43 | * 调起QQ钱包进行支付,参数为从第三方APP从服务器获取的参数,透传到手机QQ内,唤起支付功能 44 | * @param appId 第三方APP在QQ钱包开放平台申请的appID 45 | * @param bargainorId 第三方APP在财付通后台的商户号 46 | * @param tokenId 在财付通后台下单的订单号 47 | * @param sig 参数按照规则签名后的字符串 48 | * @param nonce 签名过程中使用的随机串 49 | * @param scheme 在您的工程中的plist文件中创建用于回调的URL SCHEMA。此URL SCHEMA用于手机QQ完成功能后,传递结果信息用。请尽量保证此URL SCHEMA不会与其他冲突。 50 | * @param completion 支付完成后调用的block,包含错误码和错误信息 51 | */ 52 | - (void)startPayWithAppId:(NSString *)appId 53 | bargainorId:(NSString *)bargainorId 54 | tokenId:(NSString *)tokenId 55 | signature:(NSString *)sig 56 | nonce:(NSString *)nonce 57 | scheme:(NSString *)scheme 58 | completion:(void (^)(QQWalletErrCode errCode, NSString *errStr))completion; 59 | 60 | /** 61 | * 在手机QQ完成支付后,对本APP进行回调,传递支付执行结果 62 | * @param url QQ钱包跳回第三方应用时传递过来的URL 63 | * @return 是否能够响应该回调 64 | */ 65 | - (BOOL)hanldeOpenURL:(NSURL *)url; 66 | 67 | /** 68 | * 检查当前系统环境是否支持QQWallet调用 69 | * @return BOOL 当前系统环境是否支持QQWallet调用 70 | */ 71 | + (BOOL)isSupportQQWallet; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /lib/Channels/QQWallet/libpingpp+qqwallet.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/QQWallet/libpingpp+qqwallet.a -------------------------------------------------------------------------------- /lib/Channels/UnionPay/libPaymentControl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/UnionPay/libPaymentControl.a -------------------------------------------------------------------------------- /lib/Channels/UnionPay/libpingpp+up.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/UnionPay/libpingpp+up.a -------------------------------------------------------------------------------- /lib/Channels/Wx/libpingpp+wx.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Wx/libpingpp+wx.a -------------------------------------------------------------------------------- /lib/Channels/Yeepay/libpingpp+yeepay.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Channels/Yeepay/libpingpp+yeepay.a -------------------------------------------------------------------------------- /lib/Dependencies/Agreement/libpingpp+agreement.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Dependencies/Agreement/libpingpp+agreement.a -------------------------------------------------------------------------------- /lib/Dependencies/Network/PingppURLResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // PingppURLResponse.h 3 | // Pingpp 4 | // 5 | // Created by afon on 15/8/29. 6 | // Copyright (c) 2015年 PingPluspPlus. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PingppURLResponse : NSObject 14 | 15 | /** 16 | The last response received by the operation's connection. 17 | */ 18 | @property (readonly, nonatomic, strong, nullable) NSURLResponse *response; 19 | 20 | /** 21 | The data received during the request. 22 | */ 23 | @property (readonly, nonatomic, strong, nullable) NSData *responseData; 24 | 25 | /** 26 | The string representation of the response data. 27 | */ 28 | @property (readonly, nonatomic, copy, nullable) NSString *responseString; 29 | 30 | /** 31 | The string encoding of the response. 32 | */ 33 | @property (readonly, nonatomic, assign) NSStringEncoding responseStringEncoding; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /lib/Dependencies/Network/libpingpp+network.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Dependencies/Network/libpingpp+network.a -------------------------------------------------------------------------------- /lib/Dependencies/WebView/libpingpp+webview.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Dependencies/WebView/libpingpp+webview.a -------------------------------------------------------------------------------- /lib/Pingpp.bundle/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Pingpp.bundle/Info.plist -------------------------------------------------------------------------------- /lib/Pingpp.bundle/about_blank.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 正在创建支付链接... 6 | 40 | 41 | 42 |
43 |

正在创建支付链接...

44 |
45 | 46 | -------------------------------------------------------------------------------- /lib/Pingpp.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Pingpp.bundle/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /lib/Pingpp.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/Pingpp.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /lib/Pingpp.h: -------------------------------------------------------------------------------- 1 | // 2 | // Pingpp.h 3 | // Pingpp 4 | // 5 | // Created by afon on 14/11/20. 6 | // 7 | #ifndef Pingpp_Pingpp_h 8 | #define Pingpp_Pingpp_h 9 | 10 | #import 11 | #import 12 | 13 | typedef NS_ENUM(NSInteger, PingppErrorOption) 14 | { 15 | PingppErrNone = -1, 16 | PingppErrInvalidCharge = 0, 17 | PingppErrInvalidCredential, 18 | PingppErrInvalidChannel, 19 | PingppErrWxNotInstalled, 20 | PingppErrWxAppNotSupported, 21 | PingppErrCancelled, 22 | PingppErrUnknownCancel, 23 | PingppErrViewControllerIsNil, 24 | PingppErrTestmodeNotifyFailed, 25 | PingppErrChannelReturnFail, 26 | PingppErrConnectionError, 27 | PingppErrUnknownError, 28 | PingppErrActivation, 29 | PingppErrRequestTimeOut, 30 | PingppErrProcessing, 31 | PingppErrQqNotInstalled, 32 | PingppErrCmbWalletNotInstalled, 33 | PingppErrInvalidInputData, 34 | PingppErrInvalidLibrary, 35 | PingppErrOpenURLFailed, 36 | PingppErrStatusUnknown, 37 | PingppErrCmpayAppNotInstalled, 38 | PingppErrChannelAppNotInstalled, 39 | }; 40 | 41 | typedef NS_ENUM(NSUInteger, PingppRequestContentTypeOption) { 42 | PingppRequestContentTypeJSON, 43 | PingppRequestContentTypeForm 44 | }; 45 | 46 | typedef NS_ENUM(NSUInteger, PingppCmbPayMethod) { 47 | PingppCmbPayMethodAuto = 0x03, // 自动判断 48 | PingppCmbPayMethodAppOnly = 0x01, // 仅使用打开 app 支付 49 | PingppCmbPayMethodH5Only = 0x02 // 仅使用 H5(WebView) 支付 50 | }; 51 | 52 | NS_ASSUME_NONNULL_BEGIN 53 | 54 | @interface PingppError : NSObject 55 | 56 | @property(readonly, assign) PingppErrorOption code; 57 | 58 | - (NSString *)getMsg; 59 | 60 | @end 61 | 62 | 63 | typedef void (^PingppCompletion)(NSString *result, PingppError * _Nullable error); 64 | 65 | 66 | @interface Pingpp : NSObject 67 | 68 | /** 69 | * 支付调用接口 70 | * 71 | * @param charge Charge 对象(JSON 格式字符串 或 NSDictionary) 72 | * @param viewController 银联渠道需要 73 | * @param scheme URL Scheme,支付宝渠道回调需要 74 | * @param completionBlock 支付结果回调 Block 75 | */ 76 | + (void)createPayment:(NSObject *)charge 77 | viewController:(nullable UIViewController*)viewController 78 | appURLScheme:(nullable NSString *)scheme 79 | withCompletion:(nullable PingppCompletion)completionBlock; 80 | 81 | /** 82 | * 支付调用接口(支付宝/微信) 83 | * 84 | * @param charge Charge 对象(JSON 格式字符串 或 NSDictionary) 85 | * @param scheme URL Scheme,支付宝渠道回调需要 86 | * @param completion 支付结果回调 Block 87 | */ 88 | + (void)createPayment:(NSObject *)charge 89 | appURLScheme:(nullable NSString *)scheme 90 | withCompletion:(nullable PingppCompletion)completion; 91 | 92 | /** 93 | * 支付调用接口(附带 Universal Link) 94 | * 95 | * @param charge Charge 对象(JSON 格式字符串 或 NSDictionary) 96 | * @param viewController 银联渠道需要 97 | * @param scheme URL Scheme,支付宝渠道回调需要 98 | * @param universalLink Universal Link 99 | * @param completionBlock 支付结果回调 Block 100 | */ 101 | + (void)createPayment:(NSObject *)charge 102 | viewController:(nullable UIViewController*)viewController 103 | appURLScheme:(nullable NSString *)scheme 104 | universalLink:(nullable NSString *)universalLink 105 | withCompletion:(nullable PingppCompletion)completionBlock; 106 | 107 | /** 108 | * 回调结果接口(支付宝/微信/测试模式) 109 | * 110 | * @param url 结果url 111 | * @param completion 支付结果回调 Block,保证跳转支付过程中,当 app 被 kill 掉时,能通过这个接口得到支付结果 112 | * 113 | * @return 当无法处理 URL 或者 URL 格式不正确时,会返回 NO。 114 | */ 115 | + (BOOL)handleOpenURL:(NSURL *)url 116 | withCompletion:(nullable PingppCompletion)completion; 117 | 118 | /** 119 | * 回调结果接口(支付宝/微信/测试模式) 120 | * 121 | * @param url 结果url 122 | * @param sourceApplication 源应用 Bundle identifier 123 | * @param completion 支付结果回调 Block,保证跳转支付过程中,当 app 被 kill 掉时,能通过这个接口得到支付结果 124 | * 125 | * @return 当无法处理 URL 或者 URL 格式不正确时,会返回 NO。 126 | */ 127 | + (BOOL)handleOpenURL:(NSURL *)url 128 | sourceApplication:(nullable NSString *)sourceApplication 129 | withCompletion:(nullable PingppCompletion)completion; 130 | 131 | /** 132 | * web渠道支付成功后点击 "返回商户" 直接关闭支付页面 133 | * @enabled 是否启用 134 | */ 135 | + (void)ignoreResultUrl:(BOOL)enabled; 136 | 137 | /** 138 | * 版本号 139 | * 140 | * @return Pingpp SDK 版本号 141 | */ 142 | + (NSString *)version; 143 | 144 | /** 145 | * 设置 Debug 模式 146 | * 147 | * @param enabled 是否启用 148 | */ 149 | + (void)setDebugMode:(BOOL)enabled; 150 | 151 | /** 152 | * 设置 App ID 153 | * @param appId Ping++ 的应用 ID,请登录 https://dashboard.pingxx.com 查看 154 | */ 155 | + (void)setAppId:(nullable NSString *)appId; 156 | 157 | + (nullable NSString *)appId; 158 | 159 | /** 160 | * 设置请求的 Content-Type 161 | * @param type 可设置为 JSON 或 Form,默认为 JSON 162 | */ 163 | + (void)setRequestContentType:(PingppRequestContentTypeOption)type; 164 | 165 | + (PingppRequestContentTypeOption)requestContentType; 166 | 167 | /** 168 | * 允许 https 自签证书,当你的 chargeURL 为 https 且为自签证书时使用该方法设置 169 | * @param allowInvalidCertificates BOOL 170 | */ 171 | + (void)setAllowInvalidCertificates:(BOOL)allowInvalidCertificates; 172 | 173 | + (BOOL)allowInvalidCertificates; 174 | 175 | /** 176 | * 设置网络请求延时(使用壹收款或者应用内快捷支付时有用) 177 | * 178 | * @param timeout 延时时间,单位:秒 179 | */ 180 | + (void)setNetworkTimeout:(NSTimeInterval)timeout; 181 | 182 | 183 | /** 184 | * 设置webView navigationItem 颜色 185 | */ 186 | + (void)setWebViewItemColor:(UIColor *)itemColor 187 | buttonColor:(UIColor *)bntColor; 188 | 189 | /** 190 | * 是否已安装招商银行 app 191 | * @return BOOL 192 | */ 193 | + (BOOL)isCmbWalletInstalled; 194 | 195 | /** 196 | * 是否已安装建设银行 app 197 | * @return BOOL 198 | */ 199 | + (BOOL)isCcbAppInstalled; 200 | 201 | /** 202 | * 签约 203 | * 204 | * @param agreement Agreement 对象(JSON 格式字符串 或 NSDictionary) 205 | * @param completion 签约结果回调 206 | */ 207 | + (void)signAgreement:(NSObject *)agreement 208 | withCompletion:(nullable PingppCompletion)completion; 209 | 210 | /** 211 | * 签约回调结果接口 212 | * 213 | * @param url 结果 URL 214 | * @param completion 回调 Block,保证签约跳转过程中,当 app 被 kill 掉时,能通过这个接口得到支付结果 215 | * 216 | * @return 当无法处理 URL 或者 URL 格式不正确时,会返回 NO。 217 | */ 218 | + (BOOL)handleAgreementURL:(NSURL *)url 219 | withCompletion:(nullable PingppCompletion)completion; 220 | 221 | /** 222 | * 设置 Universal Link 223 | * 224 | * @param universalLink Universal Link 225 | */ 226 | + (void)setUniversalLink:(nullable NSString *)universalLink; 227 | 228 | 229 | /** 230 | * 获取已设置的 Universal Link 231 | * 232 | */ 233 | + (nullable NSString *)universalLink; 234 | 235 | /** 236 | * Universal Link 回调结果接口 237 | * 238 | * @param userActivity NSUserActivity 239 | * @param completion 支付结果回调 Block,保证跳转支付过程中,当 app 被 kill 掉时,能通过这个接口得到支付结果 240 | * 241 | * @return 当无法处理 URL 或者 URL 格式不正确时,会返回 NO。 242 | */ 243 | + (BOOL)handleContinueUserActivity:(NSUserActivity *)userActivity 244 | withCompletion:(nullable PingppCompletion)completion; 245 | 246 | /** 247 | * 设置招行分配的 URL Scheme 248 | * 249 | * @param URLScheme 招行分配的 URL Scheme 250 | */ 251 | + (void)setCmbURLScheme:(nullable NSString *)URLScheme; 252 | 253 | /** 254 | * 获取已设置的招行分配的 URL Scheme 255 | * 256 | */ 257 | + (nullable NSString *)cmbURLScheme; 258 | 259 | /** 260 | * 控制招行支付的方式 261 | * 262 | * @param method 支付的方式 263 | */ 264 | + (void)setCmbPayMethod:(PingppCmbPayMethod)method; 265 | 266 | /** 267 | * 获取控制招行支付的方式 268 | */ 269 | + (PingppCmbPayMethod)cmbPayMethod; 270 | 271 | /** 272 | * 设置招行支付的环境,生产/测试 273 | * 274 | * @param test 是否设置为测试环境 275 | * @param url 测试环境使用的 H5 URL 276 | */ 277 | + (void)setCmbEnv:(BOOL)test url:(nullable NSString *)url; 278 | 279 | @end 280 | 281 | NS_ASSUME_NONNULL_END 282 | 283 | #endif 284 | -------------------------------------------------------------------------------- /lib/libpingppcore.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PingPlusPlus/pingpp-ios/39aa611be74e3314f63ed082084519af15646fe3/lib/libpingppcore.a --------------------------------------------------------------------------------