├── .gitignore ├── DWQPayManager.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── DWQPayManager ├── Alipay │ ├── AlipaySDK.bundle │ │ ├── bar@2x.png │ │ ├── refresh@2x.png │ │ ├── refresh_click@2x.png │ │ ├── shutdown@2x.png │ │ └── shutdown_click@2x.png │ └── AlipaySDK.framework │ │ ├── AlipaySDK │ │ ├── Headers │ │ ├── APayAuthInfo.h │ │ └── AlipaySDK.h │ │ ├── Info.plist │ │ └── en.lproj │ │ └── InfoPlist.strings ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── DWQPayManager │ ├── DWQPayManager.h │ └── DWQPayManager.m ├── Info.plist ├── ViewController.h ├── ViewController.m ├── WechatPay │ ├── WXApi.h │ ├── WXApiObject.h │ ├── WechatAuthSDK.h │ └── libWeChatSDK.a └── main.m ├── DWQPayManagerTests ├── DWQPayManagerTests.m └── Info.plist ├── DWQPayManagerUITests ├── DWQPayManagerUITests.m └── Info.plist ├── LICENSE └── README.md /.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 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 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 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /DWQPayManager.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 047454C41E55702300403002 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 047454C31E55702300403002 /* main.m */; }; 11 | 047454C71E55702300403002 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 047454C61E55702300403002 /* AppDelegate.m */; }; 12 | 047454CA1E55702300403002 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 047454C91E55702300403002 /* ViewController.m */; }; 13 | 047454CD1E55702300403002 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 047454CB1E55702300403002 /* Main.storyboard */; }; 14 | 047454CF1E55702300403002 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 047454CE1E55702300403002 /* Assets.xcassets */; }; 15 | 047454D21E55702300403002 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 047454D01E55702300403002 /* LaunchScreen.storyboard */; }; 16 | 047454DD1E55702400403002 /* DWQPayManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 047454DC1E55702400403002 /* DWQPayManagerTests.m */; }; 17 | 047454E81E55702400403002 /* DWQPayManagerUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 047454E71E55702400403002 /* DWQPayManagerUITests.m */; }; 18 | 047454FD1E55709500403002 /* AlipaySDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 047454F61E55709500403002 /* AlipaySDK.bundle */; }; 19 | 047454FE1E55709500403002 /* AlipaySDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047454F71E55709500403002 /* AlipaySDK.framework */; }; 20 | 047454FF1E55709500403002 /* libWeChatSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 047454F91E55709500403002 /* libWeChatSDK.a */; }; 21 | 047455031E55722500403002 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455021E55722500403002 /* CoreGraphics.framework */; }; 22 | 047455051E55723200403002 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455041E55723200403002 /* CoreText.framework */; }; 23 | 047455071E55723C00403002 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455061E55723C00403002 /* QuartzCore.framework */; }; 24 | 047455091E55725200403002 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455081E55725200403002 /* CoreTelephony.framework */; }; 25 | 0474550B1E55725D00403002 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0474550A1E55725D00403002 /* SystemConfiguration.framework */; }; 26 | 0474550D1E55726400403002 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0474550C1E55726400403002 /* CFNetwork.framework */; }; 27 | 0474550F1E55726E00403002 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0474550E1E55726E00403002 /* CoreMotion.framework */; }; 28 | 047455111E55727D00403002 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455101E55727D00403002 /* libc++.tbd */; }; 29 | 047455131E55728300403002 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455121E55728300403002 /* libz.tbd */; }; 30 | 047455151E55729200403002 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455141E55729200403002 /* Security.framework */; }; 31 | 047455171E5572A300403002 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455161E5572A300403002 /* libsqlite3.0.tbd */; }; 32 | 047455191E5572AD00403002 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 047455181E5572AD00403002 /* UIKit.framework */; }; 33 | 0474551B1E5572B600403002 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0474551A1E5572B600403002 /* Foundation.framework */; }; 34 | 0474551E1E5572FC00403002 /* DWQPayManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0474551D1E5572FC00403002 /* DWQPayManager.m */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXContainerItemProxy section */ 38 | 047454D91E55702400403002 /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = 047454B71E55702300403002 /* Project object */; 41 | proxyType = 1; 42 | remoteGlobalIDString = 047454BE1E55702300403002; 43 | remoteInfo = DWQPayManager; 44 | }; 45 | 047454E41E55702400403002 /* PBXContainerItemProxy */ = { 46 | isa = PBXContainerItemProxy; 47 | containerPortal = 047454B71E55702300403002 /* Project object */; 48 | proxyType = 1; 49 | remoteGlobalIDString = 047454BE1E55702300403002; 50 | remoteInfo = DWQPayManager; 51 | }; 52 | /* End PBXContainerItemProxy section */ 53 | 54 | /* Begin PBXFileReference section */ 55 | 047454BF1E55702300403002 /* DWQPayManager.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DWQPayManager.app; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 047454C31E55702300403002 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 57 | 047454C51E55702300403002 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 58 | 047454C61E55702300403002 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 59 | 047454C81E55702300403002 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 60 | 047454C91E55702300403002 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 61 | 047454CC1E55702300403002 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 62 | 047454CE1E55702300403002 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 63 | 047454D11E55702300403002 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 64 | 047454D31E55702400403002 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65 | 047454D81E55702400403002 /* DWQPayManagerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DWQPayManagerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 047454DC1E55702400403002 /* DWQPayManagerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DWQPayManagerTests.m; sourceTree = ""; }; 67 | 047454DE1E55702400403002 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 68 | 047454E31E55702400403002 /* DWQPayManagerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DWQPayManagerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | 047454E71E55702400403002 /* DWQPayManagerUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DWQPayManagerUITests.m; sourceTree = ""; }; 70 | 047454E91E55702400403002 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 71 | 047454F61E55709500403002 /* AlipaySDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = AlipaySDK.bundle; sourceTree = ""; }; 72 | 047454F71E55709500403002 /* AlipaySDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AlipaySDK.framework; sourceTree = ""; }; 73 | 047454F91E55709500403002 /* libWeChatSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWeChatSDK.a; sourceTree = ""; }; 74 | 047454FA1E55709500403002 /* WechatAuthSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WechatAuthSDK.h; sourceTree = ""; }; 75 | 047454FB1E55709500403002 /* WXApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApi.h; sourceTree = ""; }; 76 | 047454FC1E55709500403002 /* WXApiObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiObject.h; sourceTree = ""; }; 77 | 047455021E55722500403002 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 78 | 047455041E55723200403002 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; 79 | 047455061E55723C00403002 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 80 | 047455081E55725200403002 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; 81 | 0474550A1E55725D00403002 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 82 | 0474550C1E55726400403002 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; 83 | 0474550E1E55726E00403002 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; 84 | 047455101E55727D00403002 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 85 | 047455121E55728300403002 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 86 | 047455141E55729200403002 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 87 | 047455161E5572A300403002 /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; }; 88 | 047455181E5572AD00403002 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 89 | 0474551A1E5572B600403002 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 90 | 0474551C1E5572FB00403002 /* DWQPayManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWQPayManager.h; sourceTree = ""; }; 91 | 0474551D1E5572FC00403002 /* DWQPayManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWQPayManager.m; sourceTree = ""; }; 92 | /* End PBXFileReference section */ 93 | 94 | /* Begin PBXFrameworksBuildPhase section */ 95 | 047454BC1E55702300403002 /* Frameworks */ = { 96 | isa = PBXFrameworksBuildPhase; 97 | buildActionMask = 2147483647; 98 | files = ( 99 | 0474551B1E5572B600403002 /* Foundation.framework in Frameworks */, 100 | 047455191E5572AD00403002 /* UIKit.framework in Frameworks */, 101 | 047455171E5572A300403002 /* libsqlite3.0.tbd in Frameworks */, 102 | 047455151E55729200403002 /* Security.framework in Frameworks */, 103 | 047455131E55728300403002 /* libz.tbd in Frameworks */, 104 | 047455111E55727D00403002 /* libc++.tbd in Frameworks */, 105 | 0474550F1E55726E00403002 /* CoreMotion.framework in Frameworks */, 106 | 0474550D1E55726400403002 /* CFNetwork.framework in Frameworks */, 107 | 0474550B1E55725D00403002 /* SystemConfiguration.framework in Frameworks */, 108 | 047455091E55725200403002 /* CoreTelephony.framework in Frameworks */, 109 | 047455071E55723C00403002 /* QuartzCore.framework in Frameworks */, 110 | 047455051E55723200403002 /* CoreText.framework in Frameworks */, 111 | 047455031E55722500403002 /* CoreGraphics.framework in Frameworks */, 112 | 047454FF1E55709500403002 /* libWeChatSDK.a in Frameworks */, 113 | 047454FE1E55709500403002 /* AlipaySDK.framework in Frameworks */, 114 | ); 115 | runOnlyForDeploymentPostprocessing = 0; 116 | }; 117 | 047454D51E55702400403002 /* Frameworks */ = { 118 | isa = PBXFrameworksBuildPhase; 119 | buildActionMask = 2147483647; 120 | files = ( 121 | ); 122 | runOnlyForDeploymentPostprocessing = 0; 123 | }; 124 | 047454E01E55702400403002 /* Frameworks */ = { 125 | isa = PBXFrameworksBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | ); 129 | runOnlyForDeploymentPostprocessing = 0; 130 | }; 131 | /* End PBXFrameworksBuildPhase section */ 132 | 133 | /* Begin PBXGroup section */ 134 | 047454B61E55702300403002 = { 135 | isa = PBXGroup; 136 | children = ( 137 | 047454C11E55702300403002 /* DWQPayManager */, 138 | 047454DB1E55702400403002 /* DWQPayManagerTests */, 139 | 047454E61E55702400403002 /* DWQPayManagerUITests */, 140 | 047454C01E55702300403002 /* Products */, 141 | 047455011E55722500403002 /* Frameworks */, 142 | ); 143 | sourceTree = ""; 144 | }; 145 | 047454C01E55702300403002 /* Products */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 047454BF1E55702300403002 /* DWQPayManager.app */, 149 | 047454D81E55702400403002 /* DWQPayManagerTests.xctest */, 150 | 047454E31E55702400403002 /* DWQPayManagerUITests.xctest */, 151 | ); 152 | name = Products; 153 | sourceTree = ""; 154 | }; 155 | 047454C11E55702300403002 /* DWQPayManager */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 047455001E5570CB00403002 /* DWQPayManager */, 159 | 047454F51E55709500403002 /* Alipay */, 160 | 047454F81E55709500403002 /* WechatPay */, 161 | 047454C51E55702300403002 /* AppDelegate.h */, 162 | 047454C61E55702300403002 /* AppDelegate.m */, 163 | 047454C81E55702300403002 /* ViewController.h */, 164 | 047454C91E55702300403002 /* ViewController.m */, 165 | 047454CB1E55702300403002 /* Main.storyboard */, 166 | 047454CE1E55702300403002 /* Assets.xcassets */, 167 | 047454D01E55702300403002 /* LaunchScreen.storyboard */, 168 | 047454D31E55702400403002 /* Info.plist */, 169 | 047454C21E55702300403002 /* Supporting Files */, 170 | ); 171 | path = DWQPayManager; 172 | sourceTree = ""; 173 | }; 174 | 047454C21E55702300403002 /* Supporting Files */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 047454C31E55702300403002 /* main.m */, 178 | ); 179 | name = "Supporting Files"; 180 | sourceTree = ""; 181 | }; 182 | 047454DB1E55702400403002 /* DWQPayManagerTests */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 047454DC1E55702400403002 /* DWQPayManagerTests.m */, 186 | 047454DE1E55702400403002 /* Info.plist */, 187 | ); 188 | path = DWQPayManagerTests; 189 | sourceTree = ""; 190 | }; 191 | 047454E61E55702400403002 /* DWQPayManagerUITests */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | 047454E71E55702400403002 /* DWQPayManagerUITests.m */, 195 | 047454E91E55702400403002 /* Info.plist */, 196 | ); 197 | path = DWQPayManagerUITests; 198 | sourceTree = ""; 199 | }; 200 | 047454F51E55709500403002 /* Alipay */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | 047454F61E55709500403002 /* AlipaySDK.bundle */, 204 | 047454F71E55709500403002 /* AlipaySDK.framework */, 205 | ); 206 | path = Alipay; 207 | sourceTree = ""; 208 | }; 209 | 047454F81E55709500403002 /* WechatPay */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | 047454F91E55709500403002 /* libWeChatSDK.a */, 213 | 047454FA1E55709500403002 /* WechatAuthSDK.h */, 214 | 047454FB1E55709500403002 /* WXApi.h */, 215 | 047454FC1E55709500403002 /* WXApiObject.h */, 216 | ); 217 | path = WechatPay; 218 | sourceTree = ""; 219 | }; 220 | 047455001E5570CB00403002 /* DWQPayManager */ = { 221 | isa = PBXGroup; 222 | children = ( 223 | 0474551C1E5572FB00403002 /* DWQPayManager.h */, 224 | 0474551D1E5572FC00403002 /* DWQPayManager.m */, 225 | ); 226 | path = DWQPayManager; 227 | sourceTree = ""; 228 | }; 229 | 047455011E55722500403002 /* Frameworks */ = { 230 | isa = PBXGroup; 231 | children = ( 232 | 0474551A1E5572B600403002 /* Foundation.framework */, 233 | 047455181E5572AD00403002 /* UIKit.framework */, 234 | 047455161E5572A300403002 /* libsqlite3.0.tbd */, 235 | 047455141E55729200403002 /* Security.framework */, 236 | 047455121E55728300403002 /* libz.tbd */, 237 | 047455101E55727D00403002 /* libc++.tbd */, 238 | 0474550E1E55726E00403002 /* CoreMotion.framework */, 239 | 0474550C1E55726400403002 /* CFNetwork.framework */, 240 | 0474550A1E55725D00403002 /* SystemConfiguration.framework */, 241 | 047455081E55725200403002 /* CoreTelephony.framework */, 242 | 047455061E55723C00403002 /* QuartzCore.framework */, 243 | 047455041E55723200403002 /* CoreText.framework */, 244 | 047455021E55722500403002 /* CoreGraphics.framework */, 245 | ); 246 | name = Frameworks; 247 | sourceTree = ""; 248 | }; 249 | /* End PBXGroup section */ 250 | 251 | /* Begin PBXNativeTarget section */ 252 | 047454BE1E55702300403002 /* DWQPayManager */ = { 253 | isa = PBXNativeTarget; 254 | buildConfigurationList = 047454EC1E55702400403002 /* Build configuration list for PBXNativeTarget "DWQPayManager" */; 255 | buildPhases = ( 256 | 047454BB1E55702300403002 /* Sources */, 257 | 047454BC1E55702300403002 /* Frameworks */, 258 | 047454BD1E55702300403002 /* Resources */, 259 | ); 260 | buildRules = ( 261 | ); 262 | dependencies = ( 263 | ); 264 | name = DWQPayManager; 265 | productName = DWQPayManager; 266 | productReference = 047454BF1E55702300403002 /* DWQPayManager.app */; 267 | productType = "com.apple.product-type.application"; 268 | }; 269 | 047454D71E55702400403002 /* DWQPayManagerTests */ = { 270 | isa = PBXNativeTarget; 271 | buildConfigurationList = 047454EF1E55702400403002 /* Build configuration list for PBXNativeTarget "DWQPayManagerTests" */; 272 | buildPhases = ( 273 | 047454D41E55702400403002 /* Sources */, 274 | 047454D51E55702400403002 /* Frameworks */, 275 | 047454D61E55702400403002 /* Resources */, 276 | ); 277 | buildRules = ( 278 | ); 279 | dependencies = ( 280 | 047454DA1E55702400403002 /* PBXTargetDependency */, 281 | ); 282 | name = DWQPayManagerTests; 283 | productName = DWQPayManagerTests; 284 | productReference = 047454D81E55702400403002 /* DWQPayManagerTests.xctest */; 285 | productType = "com.apple.product-type.bundle.unit-test"; 286 | }; 287 | 047454E21E55702400403002 /* DWQPayManagerUITests */ = { 288 | isa = PBXNativeTarget; 289 | buildConfigurationList = 047454F21E55702400403002 /* Build configuration list for PBXNativeTarget "DWQPayManagerUITests" */; 290 | buildPhases = ( 291 | 047454DF1E55702400403002 /* Sources */, 292 | 047454E01E55702400403002 /* Frameworks */, 293 | 047454E11E55702400403002 /* Resources */, 294 | ); 295 | buildRules = ( 296 | ); 297 | dependencies = ( 298 | 047454E51E55702400403002 /* PBXTargetDependency */, 299 | ); 300 | name = DWQPayManagerUITests; 301 | productName = DWQPayManagerUITests; 302 | productReference = 047454E31E55702400403002 /* DWQPayManagerUITests.xctest */; 303 | productType = "com.apple.product-type.bundle.ui-testing"; 304 | }; 305 | /* End PBXNativeTarget section */ 306 | 307 | /* Begin PBXProject section */ 308 | 047454B71E55702300403002 /* Project object */ = { 309 | isa = PBXProject; 310 | attributes = { 311 | LastUpgradeCheck = 0810; 312 | ORGANIZATIONNAME = com.sdzw.duwenquan; 313 | TargetAttributes = { 314 | 047454BE1E55702300403002 = { 315 | CreatedOnToolsVersion = 8.1; 316 | DevelopmentTeam = N8RQBX5PQW; 317 | ProvisioningStyle = Automatic; 318 | }; 319 | 047454D71E55702400403002 = { 320 | CreatedOnToolsVersion = 8.1; 321 | DevelopmentTeam = N8RQBX5PQW; 322 | ProvisioningStyle = Automatic; 323 | TestTargetID = 047454BE1E55702300403002; 324 | }; 325 | 047454E21E55702400403002 = { 326 | CreatedOnToolsVersion = 8.1; 327 | DevelopmentTeam = N8RQBX5PQW; 328 | ProvisioningStyle = Automatic; 329 | TestTargetID = 047454BE1E55702300403002; 330 | }; 331 | }; 332 | }; 333 | buildConfigurationList = 047454BA1E55702300403002 /* Build configuration list for PBXProject "DWQPayManager" */; 334 | compatibilityVersion = "Xcode 3.2"; 335 | developmentRegion = English; 336 | hasScannedForEncodings = 0; 337 | knownRegions = ( 338 | en, 339 | Base, 340 | ); 341 | mainGroup = 047454B61E55702300403002; 342 | productRefGroup = 047454C01E55702300403002 /* Products */; 343 | projectDirPath = ""; 344 | projectRoot = ""; 345 | targets = ( 346 | 047454BE1E55702300403002 /* DWQPayManager */, 347 | 047454D71E55702400403002 /* DWQPayManagerTests */, 348 | 047454E21E55702400403002 /* DWQPayManagerUITests */, 349 | ); 350 | }; 351 | /* End PBXProject section */ 352 | 353 | /* Begin PBXResourcesBuildPhase section */ 354 | 047454BD1E55702300403002 /* Resources */ = { 355 | isa = PBXResourcesBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | 047454D21E55702300403002 /* LaunchScreen.storyboard in Resources */, 359 | 047454CF1E55702300403002 /* Assets.xcassets in Resources */, 360 | 047454FD1E55709500403002 /* AlipaySDK.bundle in Resources */, 361 | 047454CD1E55702300403002 /* Main.storyboard in Resources */, 362 | ); 363 | runOnlyForDeploymentPostprocessing = 0; 364 | }; 365 | 047454D61E55702400403002 /* Resources */ = { 366 | isa = PBXResourcesBuildPhase; 367 | buildActionMask = 2147483647; 368 | files = ( 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | }; 372 | 047454E11E55702400403002 /* Resources */ = { 373 | isa = PBXResourcesBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | ); 377 | runOnlyForDeploymentPostprocessing = 0; 378 | }; 379 | /* End PBXResourcesBuildPhase section */ 380 | 381 | /* Begin PBXSourcesBuildPhase section */ 382 | 047454BB1E55702300403002 /* Sources */ = { 383 | isa = PBXSourcesBuildPhase; 384 | buildActionMask = 2147483647; 385 | files = ( 386 | 047454CA1E55702300403002 /* ViewController.m in Sources */, 387 | 047454C71E55702300403002 /* AppDelegate.m in Sources */, 388 | 047454C41E55702300403002 /* main.m in Sources */, 389 | 0474551E1E5572FC00403002 /* DWQPayManager.m in Sources */, 390 | ); 391 | runOnlyForDeploymentPostprocessing = 0; 392 | }; 393 | 047454D41E55702400403002 /* Sources */ = { 394 | isa = PBXSourcesBuildPhase; 395 | buildActionMask = 2147483647; 396 | files = ( 397 | 047454DD1E55702400403002 /* DWQPayManagerTests.m in Sources */, 398 | ); 399 | runOnlyForDeploymentPostprocessing = 0; 400 | }; 401 | 047454DF1E55702400403002 /* Sources */ = { 402 | isa = PBXSourcesBuildPhase; 403 | buildActionMask = 2147483647; 404 | files = ( 405 | 047454E81E55702400403002 /* DWQPayManagerUITests.m in Sources */, 406 | ); 407 | runOnlyForDeploymentPostprocessing = 0; 408 | }; 409 | /* End PBXSourcesBuildPhase section */ 410 | 411 | /* Begin PBXTargetDependency section */ 412 | 047454DA1E55702400403002 /* PBXTargetDependency */ = { 413 | isa = PBXTargetDependency; 414 | target = 047454BE1E55702300403002 /* DWQPayManager */; 415 | targetProxy = 047454D91E55702400403002 /* PBXContainerItemProxy */; 416 | }; 417 | 047454E51E55702400403002 /* PBXTargetDependency */ = { 418 | isa = PBXTargetDependency; 419 | target = 047454BE1E55702300403002 /* DWQPayManager */; 420 | targetProxy = 047454E41E55702400403002 /* PBXContainerItemProxy */; 421 | }; 422 | /* End PBXTargetDependency section */ 423 | 424 | /* Begin PBXVariantGroup section */ 425 | 047454CB1E55702300403002 /* Main.storyboard */ = { 426 | isa = PBXVariantGroup; 427 | children = ( 428 | 047454CC1E55702300403002 /* Base */, 429 | ); 430 | name = Main.storyboard; 431 | sourceTree = ""; 432 | }; 433 | 047454D01E55702300403002 /* LaunchScreen.storyboard */ = { 434 | isa = PBXVariantGroup; 435 | children = ( 436 | 047454D11E55702300403002 /* Base */, 437 | ); 438 | name = LaunchScreen.storyboard; 439 | sourceTree = ""; 440 | }; 441 | /* End PBXVariantGroup section */ 442 | 443 | /* Begin XCBuildConfiguration section */ 444 | 047454EA1E55702400403002 /* Debug */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | ALWAYS_SEARCH_USER_PATHS = NO; 448 | CLANG_ANALYZER_NONNULL = YES; 449 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 450 | CLANG_CXX_LIBRARY = "libc++"; 451 | CLANG_ENABLE_MODULES = YES; 452 | CLANG_ENABLE_OBJC_ARC = YES; 453 | CLANG_WARN_BOOL_CONVERSION = YES; 454 | CLANG_WARN_CONSTANT_CONVERSION = YES; 455 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 456 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 457 | CLANG_WARN_EMPTY_BODY = YES; 458 | CLANG_WARN_ENUM_CONVERSION = YES; 459 | CLANG_WARN_INFINITE_RECURSION = YES; 460 | CLANG_WARN_INT_CONVERSION = YES; 461 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 462 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 463 | CLANG_WARN_UNREACHABLE_CODE = YES; 464 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 465 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 466 | COPY_PHASE_STRIP = NO; 467 | DEBUG_INFORMATION_FORMAT = dwarf; 468 | ENABLE_STRICT_OBJC_MSGSEND = YES; 469 | ENABLE_TESTABILITY = YES; 470 | GCC_C_LANGUAGE_STANDARD = gnu99; 471 | GCC_DYNAMIC_NO_PIC = NO; 472 | GCC_NO_COMMON_BLOCKS = YES; 473 | GCC_OPTIMIZATION_LEVEL = 0; 474 | GCC_PREPROCESSOR_DEFINITIONS = ( 475 | "DEBUG=1", 476 | "$(inherited)", 477 | ); 478 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 479 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 480 | GCC_WARN_UNDECLARED_SELECTOR = YES; 481 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 482 | GCC_WARN_UNUSED_FUNCTION = YES; 483 | GCC_WARN_UNUSED_VARIABLE = YES; 484 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 485 | MTL_ENABLE_DEBUG_INFO = YES; 486 | ONLY_ACTIVE_ARCH = YES; 487 | SDKROOT = iphoneos; 488 | }; 489 | name = Debug; 490 | }; 491 | 047454EB1E55702400403002 /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | ALWAYS_SEARCH_USER_PATHS = NO; 495 | CLANG_ANALYZER_NONNULL = YES; 496 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 497 | CLANG_CXX_LIBRARY = "libc++"; 498 | CLANG_ENABLE_MODULES = YES; 499 | CLANG_ENABLE_OBJC_ARC = YES; 500 | CLANG_WARN_BOOL_CONVERSION = YES; 501 | CLANG_WARN_CONSTANT_CONVERSION = YES; 502 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 503 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 504 | CLANG_WARN_EMPTY_BODY = YES; 505 | CLANG_WARN_ENUM_CONVERSION = YES; 506 | CLANG_WARN_INFINITE_RECURSION = YES; 507 | CLANG_WARN_INT_CONVERSION = YES; 508 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 509 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 510 | CLANG_WARN_UNREACHABLE_CODE = YES; 511 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 512 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 513 | COPY_PHASE_STRIP = NO; 514 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 515 | ENABLE_NS_ASSERTIONS = NO; 516 | ENABLE_STRICT_OBJC_MSGSEND = YES; 517 | GCC_C_LANGUAGE_STANDARD = gnu99; 518 | GCC_NO_COMMON_BLOCKS = YES; 519 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 520 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 521 | GCC_WARN_UNDECLARED_SELECTOR = YES; 522 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 523 | GCC_WARN_UNUSED_FUNCTION = YES; 524 | GCC_WARN_UNUSED_VARIABLE = YES; 525 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 526 | MTL_ENABLE_DEBUG_INFO = NO; 527 | SDKROOT = iphoneos; 528 | VALIDATE_PRODUCT = YES; 529 | }; 530 | name = Release; 531 | }; 532 | 047454ED1E55702400403002 /* Debug */ = { 533 | isa = XCBuildConfiguration; 534 | buildSettings = { 535 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 536 | DEVELOPMENT_TEAM = N8RQBX5PQW; 537 | FRAMEWORK_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "$(PROJECT_DIR)/DWQPayManager/Alipay", 540 | ); 541 | INFOPLIST_FILE = DWQPayManager/Info.plist; 542 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 543 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 544 | LIBRARY_SEARCH_PATHS = ( 545 | "$(inherited)", 546 | "$(PROJECT_DIR)/DWQPayManager/WechatPay", 547 | ); 548 | OTHER_LDFLAGS = "-ObjC"; 549 | PRODUCT_BUNDLE_IDENTIFIER = com.sdzw.DWQPayManager; 550 | PRODUCT_NAME = "$(TARGET_NAME)"; 551 | }; 552 | name = Debug; 553 | }; 554 | 047454EE1E55702400403002 /* Release */ = { 555 | isa = XCBuildConfiguration; 556 | buildSettings = { 557 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 558 | DEVELOPMENT_TEAM = N8RQBX5PQW; 559 | FRAMEWORK_SEARCH_PATHS = ( 560 | "$(inherited)", 561 | "$(PROJECT_DIR)/DWQPayManager/Alipay", 562 | ); 563 | INFOPLIST_FILE = DWQPayManager/Info.plist; 564 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 565 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 566 | LIBRARY_SEARCH_PATHS = ( 567 | "$(inherited)", 568 | "$(PROJECT_DIR)/DWQPayManager/WechatPay", 569 | ); 570 | OTHER_LDFLAGS = "-ObjC"; 571 | PRODUCT_BUNDLE_IDENTIFIER = com.sdzw.DWQPayManager; 572 | PRODUCT_NAME = "$(TARGET_NAME)"; 573 | }; 574 | name = Release; 575 | }; 576 | 047454F01E55702400403002 /* Debug */ = { 577 | isa = XCBuildConfiguration; 578 | buildSettings = { 579 | BUNDLE_LOADER = "$(TEST_HOST)"; 580 | DEVELOPMENT_TEAM = N8RQBX5PQW; 581 | INFOPLIST_FILE = DWQPayManagerTests/Info.plist; 582 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 583 | PRODUCT_BUNDLE_IDENTIFIER = com.sdzw.DWQPayManagerTests; 584 | PRODUCT_NAME = "$(TARGET_NAME)"; 585 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DWQPayManager.app/DWQPayManager"; 586 | }; 587 | name = Debug; 588 | }; 589 | 047454F11E55702400403002 /* Release */ = { 590 | isa = XCBuildConfiguration; 591 | buildSettings = { 592 | BUNDLE_LOADER = "$(TEST_HOST)"; 593 | DEVELOPMENT_TEAM = N8RQBX5PQW; 594 | INFOPLIST_FILE = DWQPayManagerTests/Info.plist; 595 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 596 | PRODUCT_BUNDLE_IDENTIFIER = com.sdzw.DWQPayManagerTests; 597 | PRODUCT_NAME = "$(TARGET_NAME)"; 598 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DWQPayManager.app/DWQPayManager"; 599 | }; 600 | name = Release; 601 | }; 602 | 047454F31E55702400403002 /* Debug */ = { 603 | isa = XCBuildConfiguration; 604 | buildSettings = { 605 | DEVELOPMENT_TEAM = N8RQBX5PQW; 606 | INFOPLIST_FILE = DWQPayManagerUITests/Info.plist; 607 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 608 | PRODUCT_BUNDLE_IDENTIFIER = com.sdzw.DWQPayManagerUITests; 609 | PRODUCT_NAME = "$(TARGET_NAME)"; 610 | TEST_TARGET_NAME = DWQPayManager; 611 | }; 612 | name = Debug; 613 | }; 614 | 047454F41E55702400403002 /* Release */ = { 615 | isa = XCBuildConfiguration; 616 | buildSettings = { 617 | DEVELOPMENT_TEAM = N8RQBX5PQW; 618 | INFOPLIST_FILE = DWQPayManagerUITests/Info.plist; 619 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 620 | PRODUCT_BUNDLE_IDENTIFIER = com.sdzw.DWQPayManagerUITests; 621 | PRODUCT_NAME = "$(TARGET_NAME)"; 622 | TEST_TARGET_NAME = DWQPayManager; 623 | }; 624 | name = Release; 625 | }; 626 | /* End XCBuildConfiguration section */ 627 | 628 | /* Begin XCConfigurationList section */ 629 | 047454BA1E55702300403002 /* Build configuration list for PBXProject "DWQPayManager" */ = { 630 | isa = XCConfigurationList; 631 | buildConfigurations = ( 632 | 047454EA1E55702400403002 /* Debug */, 633 | 047454EB1E55702400403002 /* Release */, 634 | ); 635 | defaultConfigurationIsVisible = 0; 636 | defaultConfigurationName = Release; 637 | }; 638 | 047454EC1E55702400403002 /* Build configuration list for PBXNativeTarget "DWQPayManager" */ = { 639 | isa = XCConfigurationList; 640 | buildConfigurations = ( 641 | 047454ED1E55702400403002 /* Debug */, 642 | 047454EE1E55702400403002 /* Release */, 643 | ); 644 | defaultConfigurationIsVisible = 0; 645 | defaultConfigurationName = Release; 646 | }; 647 | 047454EF1E55702400403002 /* Build configuration list for PBXNativeTarget "DWQPayManagerTests" */ = { 648 | isa = XCConfigurationList; 649 | buildConfigurations = ( 650 | 047454F01E55702400403002 /* Debug */, 651 | 047454F11E55702400403002 /* Release */, 652 | ); 653 | defaultConfigurationIsVisible = 0; 654 | defaultConfigurationName = Release; 655 | }; 656 | 047454F21E55702400403002 /* Build configuration list for PBXNativeTarget "DWQPayManagerUITests" */ = { 657 | isa = XCConfigurationList; 658 | buildConfigurations = ( 659 | 047454F31E55702400403002 /* Debug */, 660 | 047454F41E55702400403002 /* Release */, 661 | ); 662 | defaultConfigurationIsVisible = 0; 663 | defaultConfigurationName = Release; 664 | }; 665 | /* End XCConfigurationList section */ 666 | }; 667 | rootObject = 047454B71E55702300403002 /* Project object */; 668 | } 669 | -------------------------------------------------------------------------------- /DWQPayManager.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.bundle/bar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/Alipay/AlipaySDK.bundle/bar@2x.png -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.bundle/refresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/Alipay/AlipaySDK.bundle/refresh@2x.png -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.bundle/refresh_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/Alipay/AlipaySDK.bundle/refresh_click@2x.png -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.bundle/shutdown@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/Alipay/AlipaySDK.bundle/shutdown@2x.png -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.bundle/shutdown_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/Alipay/AlipaySDK.bundle/shutdown_click@2x.png -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.framework/AlipaySDK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/Alipay/AlipaySDK.framework/AlipaySDK -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.framework/Headers/APayAuthInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // APAuthInfo.h 3 | // AliSDKDemo 4 | // 5 | // Created by 方彬 on 14-7-18. 6 | // Copyright (c) 2014年 Alipay.com. 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 productIDStr 产品码 该商户在aboss签约的产品,用户获取pid获取的参数 22 | * @param pidStr 商户ID 可不填 23 | * @param uriStr 授权的应用回调地址 比如:alidemo://auth 24 | * 25 | * @return authinfo实例 26 | */ 27 | - (id)initWithAppID:(NSString *)appIDStr 28 | pid:(NSString *)pidStr 29 | redirectUri:(NSString *)uriStr; 30 | 31 | - (NSString *)description; 32 | - (NSString *)wapDescription; 33 | @end 34 | -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.framework/Headers/AlipaySDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // AlipaySDK.h 3 | // AlipaySDK 4 | // 5 | // Created by 方彬 on 14-4-28. 6 | // Copyright (c) 2014年 Alipay. All rights reserved. 7 | // 8 | 9 | 10 | //////////////////////////////////////////////////////// 11 | ////////////////version:2.1 motify:2014.12.24////////// 12 | ///////////////////Merry Christmas=。=////////////////// 13 | //////////////////////////////////////////////////////// 14 | 15 | 16 | #import "APayAuthInfo.h" 17 | @import UIKit; 18 | typedef enum { 19 | ALIPAY_TIDFACTOR_IMEI, 20 | ALIPAY_TIDFACTOR_IMSI, 21 | ALIPAY_TIDFACTOR_TID, 22 | ALIPAY_TIDFACTOR_CLIENTKEY, 23 | ALIPAY_TIDFACTOR_VIMEI, 24 | ALIPAY_TIDFACTOR_VIMSI, 25 | ALIPAY_TIDFACTOR_CLIENTID, 26 | ALIPAY_TIDFACTOR_APDID, 27 | ALIPAY_TIDFACTOR_MAX 28 | } AlipayTidFactor; 29 | 30 | typedef void(^CompletionBlock)(NSDictionary *resultDic); 31 | 32 | @interface AlipaySDK : NSObject 33 | 34 | /** 35 | * 创建支付单例服务 36 | * 37 | * @return 返回单例对象 38 | */ 39 | + (AlipaySDK *)defaultService; 40 | 41 | /** 42 | * 用于设置SDK使用的window,如果没有自行创建window无需设置此接口 43 | */ 44 | @property (nonatomic, weak) UIWindow *targetWindow; 45 | 46 | /** 47 | * 支付接口 48 | * 49 | * @param orderStr 订单信息 50 | * @param schemeStr 调用支付的app注册在info.plist中的scheme 51 | * @param completionBlock 支付结果回调Block,用于wap支付结果回调(非跳转钱包支付) 52 | */ 53 | - (void)payOrder:(NSString *)orderStr 54 | fromScheme:(NSString *)schemeStr 55 | callback:(CompletionBlock)completionBlock; 56 | 57 | /** 58 | * 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url 59 | * 60 | * @param resultUrl 支付结果url 61 | * @param completionBlock 支付结果回调 62 | */ 63 | - (void)processOrderWithPaymentResult:(NSURL *)resultUrl 64 | standbyCallback:(CompletionBlock)completionBlock; 65 | 66 | 67 | 68 | /** 69 | * 获取交易token。 70 | * 71 | * @return 交易token,若无则为空。 72 | */ 73 | - (NSString *)fetchTradeToken; 74 | 75 | /** 76 | * 是否已经使用过 77 | * 78 | * @return YES为已经使用过,NO反之 79 | */ 80 | - (BOOL)isLogined; 81 | 82 | /** 83 | * 当前版本号 84 | * 85 | * @return 当前版本字符串 86 | */ 87 | - (NSString *)currentVersion; 88 | 89 | /** 90 | * 当前版本号 91 | * 92 | * @return tid相关信息 93 | */ 94 | - (NSString*)queryTidFactor:(AlipayTidFactor)factor; 95 | 96 | /** 97 | * 測試所用,realse包无效 98 | * 99 | * @param url 测试环境 100 | */ 101 | - (void)setUrl:(NSString *)url; 102 | 103 | 104 | ////////////////////////////////////////////////////////////////////////////////////////////// 105 | //////////////////////////h5 拦截支付入口/////////////////////////////////////////////////////// 106 | ////////////////////////////////////////////////////////////////////////////////////////////// 107 | 108 | /** 109 | * url order 获取接口 110 | * 111 | * @param urlStr 拦截的 url string 112 | * 113 | * @return 获取到的url order info 114 | */ 115 | - (NSString*)fetchOrderInfoFromH5PayUrl:(NSString*)urlStr; 116 | 117 | 118 | /** 119 | * url支付接口 120 | * 121 | * @param orderStr 订单信息 122 | * @param schemeStr 调用支付的app注册在info.plist中的scheme 123 | * @param compltionBlock 支付结果回调Block 124 | */ 125 | - (void)payUrlOrder:(NSString *)orderStr 126 | fromScheme:(NSString *)schemeStr 127 | callback:(CompletionBlock)completionBlock; 128 | 129 | 130 | ////////////////////////////////////////////////////////////////////////////////////////////// 131 | //////////////////////////授权1.0////////////////////////////////////////////////////////////// 132 | ////////////////////////////////////////////////////////////////////////////////////////////// 133 | 134 | /** 135 | * 快登授权 136 | * @param authInfo 需授权信息 137 | * @param completionBlock 授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效, 138 | 需要调用方在appDelegate中调用processAuthResult:standbyCallback:方法获取授权结果 139 | */ 140 | - (void)authWithInfo:(APayAuthInfo *)authInfo 141 | callback:(CompletionBlock)completionBlock; 142 | 143 | 144 | /** 145 | * 处理授权信息Url 146 | * 147 | * @param resultUrl 钱包返回的授权结果url 148 | * @param completionBlock 授权结果回调 149 | */ 150 | - (void)processAuthResult:(NSURL *)resultUrl 151 | standbyCallback:(CompletionBlock)completionBlock; 152 | 153 | ////////////////////////////////////////////////////////////////////////////////////////////// 154 | //////////////////////////授权2.0////////////////////////////////////////////////////////////// 155 | ////////////////////////////////////////////////////////////////////////////////////////////// 156 | 157 | /** 158 | * 快登授权2.0 159 | * 160 | * @param infoStr 授权请求信息字符串 161 | * @param schemeStr 调用授权的app注册在info.plist中的scheme 162 | * @param completionBlock 授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效, 163 | 需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果 164 | */ 165 | - (void)auth_V2WithInfo:(NSString *)infoStr 166 | fromScheme:(NSString *)schemeStr 167 | callback:(CompletionBlock)completionBlock; 168 | 169 | /** 170 | * 处理授权信息Url 171 | * 172 | * @param resultUrl 钱包返回的授权结果url 173 | * @param completionBlock 授权结果回调 174 | */ 175 | - (void)processAuth_V2Result:(NSURL *)resultUrl 176 | standbyCallback:(CompletionBlock)completionBlock; 177 | 178 | @end 179 | -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/Alipay/AlipaySDK.framework/Info.plist -------------------------------------------------------------------------------- /DWQPayManager/Alipay/AlipaySDK.framework/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/Alipay/AlipaySDK.framework/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /DWQPayManager/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DWQPayManager 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DWQPayManager/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DWQPayManager 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "DWQPayManager.h" 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | [DWQPAYMANAGER dwq_registerApp]; 21 | return YES; 22 | } 23 | 24 | /** 25 | * @author DevelopmentEngineer-DWQ 26 | * 27 | * 最老的版本,最好也写上 28 | */ 29 | - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { 30 | 31 | return [DWQPAYMANAGER dwq_handleUrl:url]; 32 | } 33 | /** 34 | * @author DevelopmentEngineer-DWQ 35 | * 36 | * iOS 9.0 之前 会调用 37 | */ 38 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { 39 | 40 | return [DWQPAYMANAGER dwq_handleUrl:url]; 41 | } 42 | /** 43 | * @author DevelopmentEngineer-DWQ 44 | * 45 | * iOS 9.0 以上(包括iOS9.0) 46 | */ 47 | 48 | - (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary *)options{ 49 | 50 | return [DWQPAYMANAGER dwq_handleUrl:url]; 51 | } 52 | 53 | 54 | - (void)applicationWillResignActive:(UIApplication *)application { 55 | // 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. 56 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 57 | } 58 | 59 | 60 | - (void)applicationDidEnterBackground:(UIApplication *)application { 61 | // 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. 62 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 63 | } 64 | 65 | 66 | - (void)applicationWillEnterForeground:(UIApplication *)application { 67 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 68 | } 69 | 70 | 71 | - (void)applicationDidBecomeActive:(UIApplication *)application { 72 | // 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. 73 | } 74 | 75 | 76 | - (void)applicationWillTerminate:(UIApplication *)application { 77 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 78 | } 79 | 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /DWQPayManager/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /DWQPayManager/Base.lproj/LaunchScreen.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 | 27 | 28 | -------------------------------------------------------------------------------- /DWQPayManager/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 | 27 | -------------------------------------------------------------------------------- /DWQPayManager/DWQPayManager/DWQPayManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWQPayManager.h 3 | // DWQPayManager 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WXApi.h" 11 | #import 12 | /** 13 | * @author DevelopmentEngineer-DWQ 14 | * 15 | * 此处必须保证在Info.plist 中的 URL Types 的 Identifier 对应一致 16 | */ 17 | #define DWQWECHATURLNAME @"weixin" 18 | #define DWQALIPAYURLNAME @"zhifubao" 19 | 20 | #define DWQPAYMANAGER [DWQPayManager shareManager] 21 | /** 22 | * @author DevelopmentEngineer-DWQ 23 | * 24 | * 回调状态码 25 | */ 26 | typedef NS_ENUM(NSInteger,DWQErrCode){ 27 | DWQErrCodeSuccess,// 成功 28 | DWQErrCodeFailure,// 失败 29 | DWQErrCodeCancel// 取消 30 | }; 31 | 32 | typedef void(^DWQCompleteCallBack)(DWQErrCode errCode,NSString *errStr); 33 | @interface DWQPayManager : NSObject 34 | /** 35 | * @author DevelopmentEngineer-DWQ 36 | * 37 | * 单例管理 38 | */ 39 | + (instancetype)shareManager; 40 | /** 41 | * @author DevelopmentEngineer-DWQ 42 | * 43 | * 处理跳转url,回到应用,需要在delegate中实现 44 | */ 45 | - (BOOL)dwq_handleUrl:(NSURL *)url; 46 | /** 47 | * @author DevelopmentEngineer-DWQ 48 | * 49 | * 注册App,需要在 didFinishLaunchingWithOptions 中调用 50 | */ 51 | - (void)dwq_registerApp; 52 | 53 | /** 54 | * @author DevelopmentEngineer-DWQ 55 | * 56 | * 发起支付 57 | * 58 | * @param orderMessage 传入订单信息,如果是字符串,则对应是跳转支付宝支付;如果传入PayReq 对象,这跳转微信支付,注意,不能传入空字符串或者nil 59 | * @param callBack 回调,有返回状态信息 60 | */ 61 | - (void)dwq_payWithOrderMessage:(id)orderMessage callBack:(DWQCompleteCallBack)callBack; 62 | @end 63 | -------------------------------------------------------------------------------- /DWQPayManager/DWQPayManager/DWQPayManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWQPayManager.m 3 | // DWQPayManager 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | 9 | #import "DWQPayManager.h" 10 | // 回调url地址为空 11 | #define DWQTIP_CALLBACKURL @"url地址不能为空!" 12 | // 订单信息为空字符串或者nil 13 | #define DWQTIP_ORDERMESSAGE @"订单信息不能为空!" 14 | // 没添加 URL Types 15 | #define DWQTIP_URLTYPE @"请先在Info.plist 添加 URL Type" 16 | // 添加了 URL Types 但信息不全 17 | #define DWQTIP_URLTYPE_SCHEME(name) [NSString stringWithFormat:@"请先在Info.plist 的 URL Type 添加 %@ 对应的 URL Scheme",name] 18 | @interface DWQPayManager () 19 | // 缓存回调 20 | @property (nonatomic,copy)DWQCompleteCallBack callBack; 21 | // 缓存appScheme 22 | @property (nonatomic,strong)NSMutableDictionary *appSchemeDict; 23 | @end 24 | 25 | @implementation DWQPayManager 26 | + (instancetype)shareManager{ 27 | static DWQPayManager *instance; 28 | static dispatch_once_t onceToken; 29 | dispatch_once(&onceToken, ^{ 30 | instance = [[self alloc] init]; 31 | }); 32 | return instance; 33 | } 34 | 35 | - (BOOL)dwq_handleUrl:(NSURL *)url{ 36 | 37 | NSAssert(url, DWQTIP_CALLBACKURL); 38 | if ([url.host isEqualToString:@"pay"]) {// 微信 39 | return [WXApi handleOpenURL:url delegate:self]; 40 | } 41 | else if ([url.host isEqualToString:@"safepay"]) {// 支付宝 42 | // 支付跳转支付宝钱包进行支付,处理支付结果(在app被杀模式下,通过这个方法获取支付结果) 43 | [[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) { 44 | NSString *resultStatus = resultDic[@"resultStatus"]; 45 | NSString *errStr = resultDic[@"memo"]; 46 | DWQErrCode errorCode = DWQErrCodeSuccess; 47 | switch (resultStatus.integerValue) { 48 | case 9000:// 成功 49 | errorCode = DWQErrCodeSuccess; 50 | break; 51 | case 6001:// 取消 52 | errorCode = DWQErrCodeCancel; 53 | break; 54 | default: 55 | errorCode = DWQErrCodeFailure; 56 | break; 57 | } 58 | if ([DWQPayManager shareManager].callBack) { 59 | [DWQPayManager shareManager].callBack(errorCode,errStr); 60 | } 61 | }]; 62 | 63 | // 授权跳转支付宝钱包进行支付,处理支付结果 64 | [[AlipaySDK defaultService] processAuth_V2Result:url standbyCallback:^(NSDictionary *resultDic) { 65 | NSLog(@"result = %@",resultDic); 66 | // 解析 auth code 67 | NSString *result = resultDic[@"result"]; 68 | NSString *authCode = nil; 69 | if (result.length>0) { 70 | NSArray *resultArr = [result componentsSeparatedByString:@"&"]; 71 | for (NSString *subResult in resultArr) { 72 | if (subResult.length > 10 && [subResult hasPrefix:@"auth_code="]) { 73 | authCode = [subResult substringFromIndex:10]; 74 | break; 75 | } 76 | } 77 | } 78 | NSLog(@"授权结果 authCode = %@", authCode?:@""); 79 | }]; 80 | return YES; 81 | } 82 | else{ 83 | return NO; 84 | } 85 | } 86 | 87 | - (void)dwq_registerApp{ 88 | NSString *path = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"]; 89 | NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; 90 | NSArray *urlTypes = dict[@"CFBundleURLTypes"]; 91 | NSAssert(urlTypes, DWQTIP_URLTYPE); 92 | for (NSDictionary *urlTypeDict in urlTypes) { 93 | NSString *urlName = urlTypeDict[@"CFBundleURLName"]; 94 | NSArray *urlSchemes = urlTypeDict[@"CFBundleURLSchemes"]; 95 | NSAssert(urlSchemes.count, DWQTIP_URLTYPE_SCHEME(urlName)); 96 | // 一般对应只有一个 97 | NSString *urlScheme = urlSchemes.lastObject; 98 | if ([urlName isEqualToString:DWQWECHATURLNAME]) { 99 | [self.appSchemeDict setValue:urlScheme forKey:DWQWECHATURLNAME]; 100 | // 注册微信 101 | [WXApi registerApp:urlScheme]; 102 | } 103 | else if ([urlName isEqualToString:DWQALIPAYURLNAME]){ 104 | // 保存支付宝scheme,以便发起支付使用 105 | [self.appSchemeDict setValue:urlScheme forKey:DWQALIPAYURLNAME]; 106 | } 107 | else{ 108 | 109 | } 110 | } 111 | } 112 | 113 | - (void)dwq_payWithOrderMessage:(id)orderMessage callBack:(DWQCompleteCallBack)callBack{ 114 | NSAssert(orderMessage, DWQTIP_ORDERMESSAGE); 115 | // 缓存block 116 | self.callBack = callBack; 117 | // 发起支付 118 | if ([orderMessage isKindOfClass:[PayReq class]]) { 119 | // 微信 120 | NSAssert(self.appSchemeDict[DWQWECHATURLNAME], DWQTIP_URLTYPE_SCHEME(DWQWECHATURLNAME)); 121 | 122 | [WXApi sendReq:(PayReq *)orderMessage]; 123 | } 124 | else if ([orderMessage isKindOfClass:[NSString class]]){ 125 | // 支付宝 126 | NSAssert(![orderMessage isEqualToString:@""], DWQTIP_ORDERMESSAGE); 127 | NSAssert(self.appSchemeDict[DWQALIPAYURLNAME], DWQTIP_URLTYPE_SCHEME(DWQALIPAYURLNAME)); 128 | [[AlipaySDK defaultService] payOrder:(NSString *)orderMessage fromScheme:self.appSchemeDict[DWQALIPAYURLNAME] callback:^(NSDictionary *resultDic){ 129 | NSString *resultStatus = resultDic[@"resultStatus"]; 130 | NSString *errStr = resultDic[@"memo"]; 131 | DWQErrCode errorCode = DWQErrCodeSuccess; 132 | switch (resultStatus.integerValue) { 133 | case 9000:// 成功 134 | errorCode = DWQErrCodeSuccess; 135 | break; 136 | case 6001:// 取消 137 | errorCode = DWQErrCodeCancel; 138 | break; 139 | default: 140 | errorCode = DWQErrCodeFailure; 141 | break; 142 | } 143 | if ([DWQPayManager shareManager].callBack) { 144 | [DWQPayManager shareManager].callBack(errorCode,errStr); 145 | } 146 | }]; 147 | } 148 | } 149 | 150 | #pragma mark - WXApiDelegate 151 | - (void)onResp:(BaseResp *)resp { 152 | // 判断支付类型 153 | if([resp isKindOfClass:[PayResp class]]){ 154 | //支付回调 155 | DWQErrCode errorCode = DWQErrCodeSuccess; 156 | NSString *errStr = resp.errStr; 157 | switch (resp.errCode) { 158 | case 0: 159 | errorCode = DWQErrCodeSuccess; 160 | errStr = @"订单支付成功"; 161 | break; 162 | case -1: 163 | errorCode = DWQErrCodeFailure; 164 | errStr = resp.errStr; 165 | break; 166 | case -2: 167 | errorCode = DWQErrCodeCancel; 168 | errStr = @"用户中途取消"; 169 | break; 170 | default: 171 | errorCode = DWQErrCodeFailure; 172 | errStr = resp.errStr; 173 | break; 174 | } 175 | if (self.callBack) { 176 | self.callBack(errorCode,errStr); 177 | } 178 | } 179 | } 180 | 181 | #pragma mark -- Setter & Getter 182 | 183 | - (NSMutableDictionary *)appSchemeDict{ 184 | if (_appSchemeDict == nil) { 185 | _appSchemeDict = [NSMutableDictionary dictionary]; 186 | } 187 | return _appSchemeDict; 188 | } 189 | 190 | @end 191 | -------------------------------------------------------------------------------- /DWQPayManager/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 | CFBundleURLTypes 20 | 21 | 22 | CFBundleTypeRole 23 | Editor 24 | CFBundleURLName 25 | zhifubao 26 | CFBundleURLSchemes 27 | 28 | DWQAlipay 29 | 30 | 31 | 32 | CFBundleTypeRole 33 | Editor 34 | CFBundleURLName 35 | weixin 36 | CFBundleURLSchemes 37 | 38 | wxe3ddafa8af43a383 39 | 40 | 41 | 42 | CFBundleVersion 43 | 1 44 | LSRequiresIPhoneOS 45 | 46 | UILaunchStoryboardName 47 | LaunchScreen 48 | UIMainStoryboardFile 49 | Main 50 | UIRequiredDeviceCapabilities 51 | 52 | armv7 53 | 54 | UISupportedInterfaceOrientations 55 | 56 | UIInterfaceOrientationPortrait 57 | UIInterfaceOrientationLandscapeLeft 58 | UIInterfaceOrientationLandscapeRight 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /DWQPayManager/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DWQPayManager 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DWQPayManager/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DWQPayManager 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | #define IOS_VERSION_10 (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_9_x_Max)?(YES):(NO) 9 | 10 | #import "ViewController.h" 11 | #import "DWQPayManager.h" 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | NSLog(@"----->%d",IOS_VERSION_10) ; 21 | 22 | UILabel *titleLB=[[UILabel alloc]initWithFrame:CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, 20)]; 23 | titleLB.text=@"[支付封装]by-iOS高级开发工程师-杜文全"; 24 | titleLB.textAlignment=NSTextAlignmentCenter; 25 | [self.view addSubview:titleLB]; 26 | 27 | 28 | CGFloat width = self.view.bounds.size.width; 29 | 30 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake((width - 100) / 2, 200, 100, 40)]; 31 | [btn setTitle:@"微信支付" forState:UIControlStateNormal]; 32 | btn.backgroundColor = [UIColor redColor]; 33 | [btn addTarget:self action:@selector(wechatPay) forControlEvents:UIControlEventTouchUpInside]; 34 | [self.view addSubview:btn]; 35 | 36 | UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake((width - 100) / 2, 400, 100, 40)]; 37 | [btn1 setTitle:@"支付宝支付" forState:UIControlStateNormal]; 38 | btn1.backgroundColor = [UIColor greenColor]; 39 | [btn1 addTarget:self action:@selector(aliPay) forControlEvents:UIControlEventTouchUpInside]; 40 | [self.view addSubview:btn1]; 41 | } 42 | 43 | 44 | - (void)wechatPay { 45 | // NSLog(@"%@",[self jumpToBizPay]); 46 | PayReq* req = [[PayReq alloc] init]; 47 | // req.partnerId = [dict objectForKey:@"partnerid"]; 48 | // req.prepayId = [dict objectForKey:@"prepayid"]; 49 | // req.nonceStr = [dict objectForKey:@"noncestr"]; 50 | // req.timeStamp = stamp.intValue; 51 | // req.package = [dict objectForKey:@"package"]; 52 | // req.sign = [dict objectForKey:@"sign"]; 53 | 54 | req.partnerId = @"10000100"; 55 | req.prepayId= @"1101000000140415649af9fc314aa427"; 56 | req.package = @"Sign=WXPay"; 57 | req.nonceStr= @"a462b76e7436e98e0ed6e13c64b4fd1c"; 58 | req.timeStamp= @"1397527777".intValue; 59 | req.sign= @"582282D72DD2B03AD892830965F428CB16E7A256"; 60 | 61 | [DWQPAYMANAGER dwq_payWithOrderMessage:req callBack:^(DWQErrCode errCode, NSString *errStr) { 62 | NSLog(@"errCode = %zd,errStr = %@",errCode,errStr); 63 | }]; 64 | 65 | } 66 | 67 | - (void)aliPay{ 68 | /** 69 | * @author DevelopmentEngineer-DWQ 70 | * 71 | * 来自支付宝文档数据 72 | */ 73 | NSString *orderMessage = @"app_id=2015052600090779&biz_content=%7B%22timeout_express%22%3A%2230m%22%2C%22seller_id%22%3A%22%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%2C%22total_amount%22%3A%220.02%22%2C%22subject%22%3A%221%22%2C%22body%22%3A%22%E6%88%91%E6%98%AF%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE%22%2C%22out_trade_no%22%3A%22314VYGIAGG7ZOYY%22%7D&charset=utf-8&method=alipay.trade.app.pay&sign_type=RSA×tamp=2016-08-15%2012%3A12%3A15&version=1.0&sign=MsbylYkCzlfYLy9PeRwUUIg9nZPeN9SfXPNavUCroGKR5Kqvx0nEnd3eRmKxJuthNUx4ERCXe552EV9PfwexqW%2B1wbKOdYtDIb4%2B7PL3Pc94RZL0zKaWcaY3tSL89%2FuAVUsQuFqEJdhIukuKygrXucvejOUgTCfoUdwTi7z%2BZzQ%3D"; 74 | [DWQPAYMANAGER dwq_payWithOrderMessage:orderMessage callBack:^(DWQErrCode errCode, NSString *errStr) { 75 | NSLog(@"errCode = %zd,errStr = %@",errCode,errStr); 76 | }]; 77 | } 78 | 79 | 80 | - (NSString *)jumpToBizPay { 81 | 82 | 83 | 84 | //============================================================ 85 | /** 86 | * @author Clarence 87 | * 88 | * 来自微信文档数据 89 | */ 90 | //============================================================ 91 | NSString *urlString = @"http://wxpay.weixin.qq.com/pub_v2/app/app_pay.php?plat=ios"; 92 | //解析服务端返回json数据 93 | NSError *error; 94 | //加载一个NSURL对象 95 | NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]; 96 | //将请求的url数据放到NSData对象中 97 | NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; 98 | NSURLSession *session = [NSURLSession sharedSession]; 99 | NSURLSessionDataTask *task = [session dataTaskWithRequest:request]; 100 | //小于ios9系统,因为ios9之后去掉了NSURLConnection 101 | if (IOS_VERSION_10==0) { 102 | if ( response != nil) { 103 | NSMutableDictionary *dict = NULL; 104 | //IOS5自带解析类NSJSONSerialization从response中解析出数据放到字典中 105 | dict = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableLeaves error:&error]; 106 | 107 | NSLog(@"url:%@",urlString); 108 | if(dict != nil){ 109 | NSMutableString *retcode = [dict objectForKey:@"retcode"]; 110 | if (retcode.intValue == 0){ 111 | NSMutableString *stamp = [dict objectForKey:@"timestamp"]; 112 | 113 | //调起微信支付 114 | PayReq* req = [[PayReq alloc] init]; 115 | req.partnerId = [dict objectForKey:@"partnerid"]; 116 | req.prepayId = [dict objectForKey:@"prepayid"]; 117 | req.nonceStr = [dict objectForKey:@"noncestr"]; 118 | req.timeStamp = stamp.intValue; 119 | req.package = [dict objectForKey:@"package"]; 120 | req.sign = [dict objectForKey:@"sign"]; 121 | 122 | 123 | [DWQPAYMANAGER dwq_payWithOrderMessage:req callBack:^(DWQErrCode errCode, NSString *errStr) { 124 | NSLog(@"errCode = %zd,errStr = %@",errCode,errStr); 125 | }]; 126 | 127 | //日志输出 128 | NSLog(@"appid=%@\npartid=%@\nprepayid=%@\nnoncestr=%@\ntimestamp=%ld\npackage=%@\nsign=%@",[dict objectForKey:@"appid"],req.partnerId,req.prepayId,req.nonceStr,(long)req.timeStamp,req.package,req.sign ); 129 | return @""; 130 | }else{ 131 | return [dict objectForKey:@"retmsg"]; 132 | } 133 | }else{ 134 | return @"服务器返回错误,未获取到json对象"; 135 | } 136 | }else{ 137 | return @"服务器返回错误"; 138 | } 139 | }else{ 140 | 141 | 142 | if ( task != nil) { 143 | NSMutableDictionary *dict = NULL; 144 | //IOS5自带解析类NSJSONSerialization从response中解析出数据放到字典中 145 | dict = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableLeaves error:&error]; 146 | 147 | NSLog(@"url:%@",urlString); 148 | if(dict != nil){ 149 | NSMutableString *retcode = [dict objectForKey:@"retcode"]; 150 | if (retcode.intValue == 0){ 151 | NSMutableString *stamp = [dict objectForKey:@"timestamp"]; 152 | 153 | //调起微信支付 154 | PayReq* req = [[PayReq alloc] init]; 155 | req.partnerId = [dict objectForKey:@"partnerid"]; 156 | req.prepayId = [dict objectForKey:@"prepayid"]; 157 | req.nonceStr = [dict objectForKey:@"noncestr"]; 158 | req.timeStamp = stamp.intValue; 159 | req.package = [dict objectForKey:@"package"]; 160 | req.sign = [dict objectForKey:@"sign"]; 161 | 162 | 163 | [DWQPAYMANAGER dwq_payWithOrderMessage:req callBack:^(DWQErrCode errCode, NSString *errStr) { 164 | NSLog(@"errCode = %zd,errStr = %@",errCode,errStr); 165 | }]; 166 | 167 | //日志输出 168 | NSLog(@"appid=%@\npartid=%@\nprepayid=%@\nnoncestr=%@\ntimestamp=%ld\npackage=%@\nsign=%@",[dict objectForKey:@"appid"],req.partnerId,req.prepayId,req.nonceStr,(long)req.timeStamp,req.package,req.sign ); 169 | return @""; 170 | }else{ 171 | return [dict objectForKey:@"retmsg"]; 172 | } 173 | }else{ 174 | return @"服务器返回错误,未获取到json对象"; 175 | } 176 | }else{ 177 | return @"服务器返回错误"; 178 | } 179 | 180 | } 181 | 182 | 183 | } 184 | 185 | - (void)didReceiveMemoryWarning { 186 | [super didReceiveMemoryWarning]; 187 | // Dispose of any resources that can be recreated. 188 | } 189 | 190 | 191 | @end 192 | -------------------------------------------------------------------------------- /DWQPayManager/WechatPay/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 | #import 12 | 13 | #pragma mark - WXApiDelegate 14 | /*! @brief 接收并处理来自微信终端程序的事件消息 15 | * 16 | * 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。 17 | * WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。 18 | */ 19 | @protocol WXApiDelegate 20 | @optional 21 | 22 | /*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果 23 | * 24 | * 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。 25 | * 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。 26 | * @param req 具体请求内容,是自动释放的 27 | */ 28 | -(void) onReq:(BaseReq*)req; 29 | 30 | 31 | 32 | /*! @brief 发送一个sendReq后,收到微信的回应 33 | * 34 | * 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。 35 | * 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。 36 | * @param resp具体的回应内容,是自动释放的 37 | */ 38 | -(void) onResp:(BaseResp*)resp; 39 | 40 | @end 41 | 42 | 43 | 44 | #pragma mark - WXApi 45 | 46 | /*! @brief 微信Api接口函数类 47 | * 48 | * 该类封装了微信终端SDK的所有接口 49 | */ 50 | @interface WXApi : NSObject 51 | 52 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 53 | * 54 | * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。 55 | * iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。 56 | * @attention 请保证在主线程中调用此函数 57 | * @param appid 微信开发者ID 58 | * @param typeFlag 应用支持打开的文件类型 59 | * @return 成功返回YES,失败返回NO。 60 | */ 61 | +(BOOL) registerApp:(NSString *)appid; 62 | 63 | 64 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 65 | * 66 | * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。 67 | * @see registerApp 68 | * @param appid 微信开发者ID 69 | * @param appdesc 应用附加信息,长度不超过1024字节 70 | * @return 成功返回YES,失败返回NO。 71 | */ 72 | +(BOOL) registerApp:(NSString *)appid withDescription:(NSString *)appdesc; 73 | 74 | 75 | /*! @brief WXApi的成员函数,向微信终端程序注册应用支持打开的文件类型。 76 | * 77 | * 需要在每次启动第三方应用程序时调用。调用后并第一次成功分享数据到微信后,会在微信的可用应用列表中出现。 78 | * @see registerApp 79 | * @param typeFlag 应用支持打开的数据类型, enAppSupportContentFlag枚举类型 “|” 操作后结果 80 | */ 81 | +(void) registerAppSupportContentFlag:(UInt64)typeFlag; 82 | 83 | 84 | 85 | /*! @brief 处理微信通过URL启动App时传递的数据 86 | * 87 | * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 88 | * @param url 微信启动第三方应用时传递过来的URL 89 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 90 | * @return 成功返回YES,失败返回NO。 91 | */ 92 | +(BOOL) handleOpenURL:(NSURL *) url delegate:(id) delegate; 93 | 94 | 95 | 96 | /*! @brief 检查微信是否已被用户安装 97 | * 98 | * @return 微信已安装返回YES,未安装返回NO。 99 | */ 100 | +(BOOL) isWXAppInstalled; 101 | 102 | 103 | 104 | /*! @brief 判断当前微信的版本是否支持OpenApi 105 | * 106 | * @return 支持返回YES,不支持返回NO。 107 | */ 108 | +(BOOL) isWXAppSupportApi; 109 | 110 | 111 | 112 | /*! @brief 获取微信的itunes安装地址 113 | * 114 | * @return 微信的安装地址字符串。 115 | */ 116 | +(NSString *) getWXAppInstallUrl; 117 | 118 | 119 | 120 | /*! @brief 获取当前微信SDK的版本号 121 | * 122 | * @return 返回当前微信SDK的版本号 123 | */ 124 | +(NSString *) getApiVersion; 125 | 126 | 127 | 128 | /*! @brief 打开微信 129 | * 130 | * @return 成功返回YES,失败返回NO。 131 | */ 132 | +(BOOL) openWXApp; 133 | 134 | 135 | 136 | /*! @brief 发送请求到微信,等待微信返回onResp 137 | * 138 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型 139 | * SendAuthReq、SendMessageToWXReq、PayReq等。 140 | * @param req 具体的发送请求,在调用函数后,请自己释放。 141 | * @return 成功返回YES,失败返回NO。 142 | */ 143 | +(BOOL) sendReq:(BaseReq*)req; 144 | 145 | /*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp 146 | * 147 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。 148 | * @param req 具体的发送请求,在调用函数后,请自己释放。 149 | * @param viewController 当前界面对象。 150 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 151 | * @return 成功返回YES,失败返回NO。 152 | */ 153 | +(BOOL) sendAuthReq:(SendAuthReq*)req viewController:(UIViewController*)viewController delegate:(id)delegate; 154 | 155 | 156 | /*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面 157 | * 158 | * 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有 159 | * GetMessageFromWXResp、ShowMessageFromWXResp等。 160 | * @param resp 具体的应答内容,调用函数后,请自己释放 161 | * @return 成功返回YES,失败返回NO。 162 | */ 163 | +(BOOL) sendResp:(BaseResp*)resp; 164 | 165 | 166 | @end 167 | -------------------------------------------------------------------------------- /DWQPayManager/WechatPay/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 | /*! @brief 错误码 12 | * 13 | */ 14 | enum WXErrCode { 15 | WXSuccess = 0, /**< 成功 */ 16 | WXErrCodeCommon = -1, /**< 普通错误类型 */ 17 | WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */ 18 | WXErrCodeSentFail = -3, /**< 发送失败 */ 19 | WXErrCodeAuthDeny = -4, /**< 授权失败 */ 20 | WXErrCodeUnsupport = -5, /**< 微信不支持 */ 21 | }; 22 | 23 | 24 | 25 | /*! @brief 请求发送场景 26 | * 27 | */ 28 | enum WXScene { 29 | WXSceneSession = 0, /**< 聊天界面 */ 30 | WXSceneTimeline = 1, /**< 朋友圈 */ 31 | WXSceneFavorite = 2, /**< 收藏 */ 32 | }; 33 | 34 | 35 | 36 | enum WXAPISupport { 37 | WXAPISupportSession = 0, 38 | }; 39 | 40 | 41 | 42 | /*! @brief 跳转profile类型 43 | * 44 | */ 45 | enum WXBizProfileType{ 46 | WXBizProfileType_Normal = 0, //**< 普通公众号 */ 47 | WXBizProfileType_Device = 1, //**< 硬件公众号 */ 48 | }; 49 | 50 | 51 | 52 | /*! @brief 跳转mp网页类型 53 | * 54 | */ 55 | enum WXMPWebviewType { 56 | WXMPWebviewType_Ad = 0, /**< 广告网页 **/ 57 | }; 58 | 59 | 60 | /*! @brief 应用支持接收微信的文件类型 61 | * 62 | */ 63 | typedef NS_ENUM(UInt64, enAppSupportContentFlag) 64 | { 65 | MMAPP_SUPPORT_NOCONTENT = 0x0, 66 | MMAPP_SUPPORT_TEXT = 0x1, 67 | MMAPP_SUPPORT_PICTURE = 0x2, 68 | MMAPP_SUPPORT_LOCATION = 0x4, 69 | MMAPP_SUPPORT_VIDEO = 0x8, 70 | MMAPP_SUPPORT_AUDIO = 0x10, 71 | MMAPP_SUPPORT_WEBPAGE = 0x20, 72 | 73 | // Suport File Type 74 | MMAPP_SUPPORT_DOC = 0x40, // doc 75 | MMAPP_SUPPORT_DOCX = 0x80, // docx 76 | MMAPP_SUPPORT_PPT = 0x100, // ppt 77 | MMAPP_SUPPORT_PPTX = 0x200, // pptx 78 | MMAPP_SUPPORT_XLS = 0x400, // xls 79 | MMAPP_SUPPORT_XLSX = 0x800, // xlsx 80 | MMAPP_SUPPORT_PDF = 0x1000, // pdf 81 | }; 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, retain) 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, retain) NSString *errStr; 107 | /** 响应类型 */ 108 | @property (nonatomic, assign) int type; 109 | 110 | @end 111 | 112 | 113 | 114 | #pragma mark - WXMediaMessage 115 | @class WXMediaMessage; 116 | 117 | /*! @brief 第三方向微信终端发起支付的消息结构体 118 | * 119 | * 第三方向微信终端发起支付的消息结构体,微信终端处理后会向第三方返回处理结果 120 | * @see PayResp 121 | */ 122 | @interface PayReq : BaseReq 123 | 124 | /** 商家向财付通申请的商家id */ 125 | @property (nonatomic, retain) NSString *partnerId; 126 | /** 预支付订单 */ 127 | @property (nonatomic, retain) NSString *prepayId; 128 | /** 随机串,防重发 */ 129 | @property (nonatomic, retain) NSString *nonceStr; 130 | /** 时间戳,防重发 */ 131 | @property (nonatomic, assign) UInt32 timeStamp; 132 | /** 商家根据财付通文档填写的数据和签名 */ 133 | @property (nonatomic, retain) NSString *package; 134 | /** 商家根据微信开放平台文档对数据做的签名 */ 135 | @property (nonatomic, retain) NSString *sign; 136 | 137 | @end 138 | 139 | 140 | 141 | #pragma mark - PayResp 142 | /*! @brief 微信终端返回给第三方的关于支付结果的结构体 143 | * 144 | * 微信终端返回给第三方的关于支付结果的结构体 145 | */ 146 | @interface PayResp : BaseResp 147 | 148 | /** 财付通返回给商家的信息 */ 149 | @property (nonatomic, retain) NSString *returnKey; 150 | 151 | @end 152 | 153 | 154 | 155 | /*! @brief 第三方向微信终端发起拆企业红包的消息结构体 156 | * 157 | * 第三方向微信终端发起拆企业红包的消息结构体,微信终端处理后会向第三方返回处理结果 158 | * @see HBReq 159 | */ 160 | @interface HBReq : BaseReq 161 | 162 | /** 随机串,防重发 */ 163 | @property (nonatomic, retain) NSString *nonceStr; 164 | /** 时间戳,防重发 */ 165 | @property (nonatomic, assign) UInt32 timeStamp; 166 | /** 商家根据微信企业红包开发文档填写的数据和签名 */ 167 | @property (nonatomic, retain) NSString *package; 168 | /** 商家根据微信企业红包开发文档对数据做的签名 */ 169 | @property (nonatomic, retain) NSString *sign; 170 | 171 | @end 172 | 173 | 174 | 175 | #pragma mark - HBResp 176 | /*! @brief 微信终端返回给第三方的关于拆企业红包结果的结构体 177 | * 178 | * 微信终端返回给第三方的关于拆企业红包结果的结构体 179 | */ 180 | @interface HBResp : BaseResp 181 | 182 | @end 183 | 184 | 185 | 186 | 187 | #pragma mark - SendAuthReq 188 | /*! @brief 第三方程序向微信终端请求认证的消息结构 189 | * 190 | * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数, 191 | * 向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。 192 | * @see SendAuthResp 193 | */ 194 | @interface SendAuthReq : BaseReq 195 | /** 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。 196 | * @see SendAuthResp 197 | * @note scope字符串长度不能超过1K 198 | */ 199 | @property (nonatomic, retain) NSString* scope; 200 | /** 第三方程序本身用来标识其请求的唯一性,最后跳转回第三方程序时,由微信终端回传。 201 | * @note state字符串长度不能超过1K 202 | */ 203 | @property (nonatomic, retain) NSString* state; 204 | @end 205 | 206 | 207 | 208 | #pragma mark - SendAuthResp 209 | /*! @brief 微信处理完第三方程序的认证和权限申请后向第三方程序回送的处理结果。 210 | * 211 | * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。 212 | * 微信终端处理完后会向第三方程序发送一个SendAuthResp。 213 | * @see onResp 214 | */ 215 | @interface SendAuthResp : BaseResp 216 | @property (nonatomic, retain) NSString* code; 217 | /** 第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传 218 | * @note state字符串长度不能超过1K 219 | */ 220 | @property (nonatomic, retain) NSString* state; 221 | @property (nonatomic, retain) NSString* lang; 222 | @property (nonatomic, retain) NSString* country; 223 | @end 224 | 225 | 226 | 227 | #pragma mark - SendMessageToWXReq 228 | /*! @brief 第三方程序发送消息至微信终端程序的消息结构体 229 | * 230 | * 第三方程序向微信发送信息需要传入SendMessageToWXReq结构体,信息类型包括文本消息和多媒体消息, 231 | * 分别对应于text和message成员。调用该方法后,微信处理完信息会向第三方程序发送一个处理结果。 232 | * @see SendMessageToWXResp 233 | */ 234 | @interface SendMessageToWXReq : BaseReq 235 | /** 发送消息的文本内容 236 | * @note 文本长度必须大于0且小于10K 237 | */ 238 | @property (nonatomic, retain) NSString* text; 239 | /** 发送消息的多媒体内容 240 | * @see WXMediaMessage 241 | */ 242 | @property (nonatomic, retain) WXMediaMessage* message; 243 | /** 发送消息的类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */ 244 | @property (nonatomic, assign) BOOL bText; 245 | /** 发送的目标场景,可以选择发送到会话(WXSceneSession)或者朋友圈(WXSceneTimeline)。 默认发送到会话。 246 | * @see WXScene 247 | */ 248 | @property (nonatomic, assign) int scene; 249 | 250 | @end 251 | 252 | 253 | 254 | #pragma mark - SendMessageToWXResp 255 | /*! @brief 微信终端向第三方程序返回的SendMessageToWXReq处理结果。 256 | * 257 | * 第三方程序向微信终端发送SendMessageToWXReq后,微信发送回来的处理结果,该结果用SendMessageToWXResp表示。 258 | */ 259 | @interface SendMessageToWXResp : BaseResp 260 | @property(nonatomic, retain) NSString* lang; 261 | @property(nonatomic, retain) NSString* country; 262 | @end 263 | 264 | 265 | 266 | #pragma mark - GetMessageFromWXReq 267 | /*! @brief 微信终端向第三方程序请求提供内容的消息结构体。 268 | * 269 | * 微信终端向第三方程序请求提供内容,微信终端会向第三方程序发送GetMessageFromWXReq消息结构体, 270 | * 需要第三方程序调用sendResp返回一个GetMessageFromWXResp消息结构体。 271 | */ 272 | @interface GetMessageFromWXReq : BaseReq 273 | @property (nonatomic, retain) NSString* lang; 274 | @property (nonatomic, retain) NSString* country; 275 | @end 276 | 277 | 278 | 279 | #pragma mark - GetMessageFromWXResp 280 | /*! @brief 微信终端向第三方程序请求提供内容,第三方程序向微信终端返回的消息结构体。 281 | * 282 | * 微信终端向第三方程序请求提供内容,第三方程序调用sendResp向微信终端返回一个GetMessageFromWXResp消息结构体。 283 | */ 284 | @interface GetMessageFromWXResp : BaseResp 285 | /** 向微信终端提供的文本内容 286 | @note 文本长度必须大于0且小于10K 287 | */ 288 | @property (nonatomic, retain) NSString* text; 289 | /** 向微信终端提供的多媒体内容。 290 | * @see WXMediaMessage 291 | */ 292 | @property (nonatomic, retain) WXMediaMessage* message; 293 | /** 向微信终端提供内容的消息类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */ 294 | @property (nonatomic, assign) BOOL bText; 295 | @end 296 | 297 | 298 | 299 | #pragma mark - ShowMessageFromWXReq 300 | /*! @brief 微信通知第三方程序,要求第三方程序显示的消息结构体。 301 | * 302 | * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。 303 | * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。 304 | */ 305 | @interface ShowMessageFromWXReq : BaseReq 306 | /** 微信终端向第三方程序发送的要求第三方程序处理的多媒体内容 307 | * @see WXMediaMessage 308 | */ 309 | @property (nonatomic, retain) WXMediaMessage* message; 310 | @property (nonatomic, retain) NSString* lang; 311 | @property (nonatomic, retain) NSString* country; 312 | @end 313 | 314 | 315 | 316 | #pragma mark - ShowMessageFromWXResp 317 | /*! @brief 微信通知第三方程序,要求第三方程序显示或处理某些消息,第三方程序处理完后向微信终端发送的处理结果。 318 | * 319 | * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。 320 | * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。 321 | */ 322 | @interface ShowMessageFromWXResp : BaseResp 323 | @end 324 | 325 | 326 | 327 | #pragma mark - LaunchFromWXReq 328 | /*! @brief 微信终端打开第三方程序携带的消息结构体 329 | * 330 | * 微信向第三方发送的结构体,第三方不需要返回 331 | */ 332 | @interface LaunchFromWXReq : BaseReq 333 | @property (nonatomic, retain) WXMediaMessage* message; 334 | @property (nonatomic, retain) NSString* lang; 335 | @property (nonatomic, retain) NSString* country; 336 | @end 337 | 338 | #pragma mark - OpenTempSessionReq 339 | /* ! @brief 第三方通知微信,打开临时会话 340 | * 341 | * 第三方通知微信,打开临时会话 342 | */ 343 | @interface OpenTempSessionReq : BaseReq 344 | /** 需要打开的用户名 345 | * @attention 长度不能超过512字节 346 | */ 347 | @property (nonatomic, retain) NSString* username; 348 | /** 开发者自定义参数,拉起临时会话后会发给开发者后台,可以用于识别场景 349 | * @attention 长度不能超过32位 350 | */ 351 | @property (nonatomic, retain) NSString* sessionFrom; 352 | @end 353 | 354 | #pragma mark - OpenWebviewReq 355 | /* ! @brief 第三方通知微信启动内部浏览器,打开指定网页 356 | * 357 | * 第三方通知微信启动内部浏览器,打开指定Url对应的网页 358 | */ 359 | @interface OpenWebviewReq : BaseReq 360 | /** 需要打开的网页对应的Url 361 | * @attention 长度不能超过1024 362 | */ 363 | @property(nonatomic,retain)NSString* url; 364 | 365 | @end 366 | 367 | #pragma mark - OpenWebviewResp 368 | /*! @brief 微信终端向第三方程序返回的OpenWebviewReq处理结果 369 | * 370 | * 第三方程序向微信终端发送OpenWebviewReq后,微信发送回来的处理结果,该结果用OpenWebviewResp表示 371 | */ 372 | @interface OpenWebviewResp : BaseResp 373 | 374 | @end 375 | 376 | 377 | #pragma mark - OpenTempSessionResp 378 | /*! @brief 微信终端向第三方程序返回的OpenTempSessionReq处理结果。 379 | * 380 | * 第三方程序向微信终端发送OpenTempSessionReq后,微信发送回来的处理结果,该结果用OpenTempSessionResp表示。 381 | */ 382 | @interface OpenTempSessionResp : BaseResp 383 | 384 | @end 385 | 386 | #pragma mark - OpenRankListReq 387 | /* ! @brief 第三方通知微信,打开硬件排行榜 388 | * 389 | * 第三方通知微信,打开硬件排行榜 390 | */ 391 | @interface OpenRankListReq : BaseReq 392 | 393 | @end 394 | 395 | #pragma mark - OpenRanklistResp 396 | /*! @brief 微信终端向第三方程序返回的OpenRankListReq处理结果。 397 | * 398 | * 第三方程序向微信终端发送OpenRankListReq后,微信发送回来的处理结果,该结果用OpenRankListResp表示。 399 | */ 400 | @interface OpenRankListResp : BaseResp 401 | 402 | @end 403 | 404 | #pragma mark - JumpToBizProfileReq 405 | /* ! @brief 第三方通知微信,打开指定微信号profile页面 406 | * 407 | * 第三方通知微信,打开指定微信号profile页面 408 | */ 409 | @interface JumpToBizProfileReq : BaseReq 410 | /** 跳转到该公众号的profile 411 | * @attention 长度不能超过512字节 412 | */ 413 | @property (nonatomic, retain) NSString* username; 414 | /** 如果用户加了该公众号为好友,extMsg会上传到服务器 415 | * @attention 长度不能超过1024字节 416 | */ 417 | @property (nonatomic, retain) NSString* extMsg; 418 | /** 419 | * 跳转的公众号类型 420 | * @see WXBizProfileType 421 | */ 422 | @property (nonatomic, assign) int profileType; 423 | @end 424 | 425 | 426 | 427 | #pragma mark - JumpToBizWebviewReq 428 | /* ! @brief 第三方通知微信,打开指定usrname的profile网页版 429 | * 430 | */ 431 | @interface JumpToBizWebviewReq : BaseReq 432 | /** 跳转的网页类型,目前只支持广告页 433 | * @see WXMPWebviewType 434 | */ 435 | @property(nonatomic, assign) int webType; 436 | /** 跳转到该公众号的profile网页版 437 | * @attention 长度不能超过512字节 438 | */ 439 | @property(nonatomic, retain) NSString* tousrname; 440 | /** 如果用户加了该公众号为好友,extMsg会上传到服务器 441 | * @attention 长度不能超过1024字节 442 | */ 443 | @property(nonatomic, retain) NSString* extMsg; 444 | 445 | @end 446 | 447 | #pragma mark - WXCardItem 448 | 449 | @interface WXCardItem : NSObject 450 | /** 卡id 451 | * @attention 长度不能超过1024字节 452 | */ 453 | @property (nonatomic,retain) NSString* cardId; 454 | /** ext信息 455 | * @attention 长度不能超过2024字节 456 | */ 457 | @property (nonatomic,retain) NSString* extMsg; 458 | /** 459 | * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。 460 | */ 461 | @property (nonatomic,assign) UInt32 cardState; 462 | /** 463 | * @attention req不需要填,chooseCard返回的。 464 | */ 465 | @property (nonatomic,retain) NSString* encryptCode; 466 | /** 467 | * @attention req不需要填,chooseCard返回的。 468 | */ 469 | @property (nonatomic,retain) NSString* appID; 470 | @end; 471 | 472 | #pragma mark - AddCardToWXCardPackageReq 473 | /* ! @brief 请求添加卡券至微信卡包 474 | * 475 | */ 476 | 477 | @interface AddCardToWXCardPackageReq : BaseReq 478 | /** 卡列表 479 | * @attention 个数不能超过40个 类型WXCardItem 480 | */ 481 | @property (nonatomic,retain) NSArray* cardAry; 482 | 483 | @end 484 | 485 | 486 | #pragma mark - AddCardToWXCardPackageResp 487 | /** ! @brief 微信返回第三方添加卡券结果 488 | * 489 | */ 490 | 491 | @interface AddCardToWXCardPackageResp : BaseResp 492 | /** 卡列表 493 | * @attention 个数不能超过40个 类型WXCardItem 494 | */ 495 | @property (nonatomic,retain) NSArray* cardAry; 496 | @end 497 | 498 | #pragma mark - WXChooseCardReq 499 | /* ! @brief 请求从微信选取卡券 500 | * 501 | */ 502 | 503 | @interface WXChooseCardReq : BaseReq 504 | @property(nonatomic, strong) NSString *appID; 505 | @property(nonatomic, assign) UInt32 shopID; 506 | @property(nonatomic, assign) UInt32 canMultiSelect; 507 | @property(nonatomic, strong) NSString *cardType; 508 | @property(nonatomic, strong) NSString *cardTpID; 509 | @property(nonatomic, strong) NSString *signType; 510 | @property(nonatomic, strong) NSString *cardSign; 511 | @property(nonatomic, assign) UInt32 timeStamp; 512 | @property(nonatomic, strong) NSString *nonceStr; 513 | @end 514 | 515 | 516 | #pragma mark - WXChooseCardResp 517 | /** ! @brief 微信返回第三方请求选择卡券结果 518 | * 519 | */ 520 | 521 | @interface WXChooseCardResp : BaseResp 522 | @property (nonatomic,retain) NSArray* cardAry; 523 | @end 524 | 525 | #pragma mark - WXMediaMessage 526 | 527 | /*! @brief 多媒体消息结构体 528 | * 529 | * 用于微信终端和第三方程序之间传递消息的多媒体消息内容 530 | */ 531 | @interface WXMediaMessage : NSObject 532 | 533 | +(WXMediaMessage *) message; 534 | 535 | /** 标题 536 | * @note 长度不能超过512字节 537 | */ 538 | @property (nonatomic, retain) NSString *title; 539 | /** 描述内容 540 | * @note 长度不能超过1K 541 | */ 542 | @property (nonatomic, retain) NSString *description; 543 | /** 缩略图数据 544 | * @note 大小不能超过32K 545 | */ 546 | @property (nonatomic, retain) NSData *thumbData; 547 | /** 548 | * @note 长度不能超过64字节 549 | */ 550 | @property (nonatomic, retain) NSString *mediaTagName; 551 | /** 552 | * 553 | */ 554 | @property (nonatomic, retain) NSString *messageExt; 555 | @property (nonatomic, retain) NSString *messageAction; 556 | /** 557 | * 多媒体数据对象,可以为WXImageObject,WXMusicObject,WXVideoObject,WXWebpageObject等。 558 | */ 559 | @property (nonatomic, retain) id mediaObject; 560 | 561 | /*! @brief 设置消息缩略图的方法 562 | * 563 | * @param image 缩略图 564 | * @note 大小不能超过32K 565 | */ 566 | - (void) setThumbImage:(UIImage *)image; 567 | 568 | @end 569 | 570 | 571 | 572 | #pragma mark - WXImageObject 573 | /*! @brief 多媒体消息中包含的图片数据对象 574 | * 575 | * 微信终端和第三方程序之间传递消息中包含的图片数据对象。 576 | * @note imageData成员不能为空 577 | * @see WXMediaMessage 578 | */ 579 | @interface WXImageObject : NSObject 580 | /*! @brief 返回一个WXImageObject对象 581 | * 582 | * @note 返回的WXImageObject对象是自动释放的 583 | */ 584 | +(WXImageObject *) object; 585 | 586 | /** 图片真实数据内容 587 | * @note 大小不能超过10M 588 | */ 589 | @property (nonatomic, retain) NSData *imageData; 590 | 591 | @end 592 | 593 | 594 | #pragma mark - WXMusicObject 595 | /*! @brief 多媒体消息中包含的音乐数据对象 596 | * 597 | * 微信终端和第三方程序之间传递消息中包含的音乐数据对象。 598 | * @note musicUrl和musicLowBandUrl成员不能同时为空。 599 | * @see WXMediaMessage 600 | */ 601 | @interface WXMusicObject : NSObject 602 | /*! @brief 返回一个WXMusicObject对象 603 | * 604 | * @note 返回的WXMusicObject对象是自动释放的 605 | */ 606 | +(WXMusicObject *) object; 607 | 608 | /** 音乐网页的url地址 609 | * @note 长度不能超过10K 610 | */ 611 | @property (nonatomic, retain) NSString *musicUrl; 612 | /** 音乐lowband网页的url地址 613 | * @note 长度不能超过10K 614 | */ 615 | @property (nonatomic, retain) NSString *musicLowBandUrl; 616 | /** 音乐数据url地址 617 | * @note 长度不能超过10K 618 | */ 619 | @property (nonatomic, retain) NSString *musicDataUrl; 620 | 621 | /**音乐lowband数据url地址 622 | * @note 长度不能超过10K 623 | */ 624 | @property (nonatomic, retain) NSString *musicLowBandDataUrl; 625 | 626 | @end 627 | 628 | 629 | 630 | #pragma mark - WXVideoObject 631 | /*! @brief 多媒体消息中包含的视频数据对象 632 | * 633 | * 微信终端和第三方程序之间传递消息中包含的视频数据对象。 634 | * @note videoUrl和videoLowBandUrl不能同时为空。 635 | * @see WXMediaMessage 636 | */ 637 | @interface WXVideoObject : NSObject 638 | /*! @brief 返回一个WXVideoObject对象 639 | * 640 | * @note 返回的WXVideoObject对象是自动释放的 641 | */ 642 | +(WXVideoObject *) object; 643 | 644 | /** 视频网页的url地址 645 | * @note 长度不能超过10K 646 | */ 647 | @property (nonatomic, retain) NSString *videoUrl; 648 | /** 视频lowband网页的url地址 649 | * @note 长度不能超过10K 650 | */ 651 | @property (nonatomic, retain) NSString *videoLowBandUrl; 652 | 653 | @end 654 | 655 | 656 | 657 | #pragma mark - WXWebpageObject 658 | /*! @brief 多媒体消息中包含的网页数据对象 659 | * 660 | * 微信终端和第三方程序之间传递消息中包含的网页数据对象。 661 | * @see WXMediaMessage 662 | */ 663 | @interface WXWebpageObject : NSObject 664 | /*! @brief 返回一个WXWebpageObject对象 665 | * 666 | * @note 返回的WXWebpageObject对象是自动释放的 667 | */ 668 | +(WXWebpageObject *) object; 669 | 670 | /** 网页的url地址 671 | * @note 不能为空且长度不能超过10K 672 | */ 673 | @property (nonatomic, retain) NSString *webpageUrl; 674 | 675 | @end 676 | 677 | 678 | 679 | #pragma mark - WXAppExtendObject 680 | /*! @brief 多媒体消息中包含的App扩展数据对象 681 | * 682 | * 第三方程序向微信终端发送包含WXAppExtendObject的多媒体消息, 683 | * 微信需要处理该消息时,会调用该第三方程序来处理多媒体消息内容。 684 | * @note url,extInfo和fileData不能同时为空 685 | * @see WXMediaMessage 686 | */ 687 | @interface WXAppExtendObject : NSObject 688 | /*! @brief 返回一个WXAppExtendObject对象 689 | * 690 | * @note 返回的WXAppExtendObject对象是自动释放的 691 | */ 692 | +(WXAppExtendObject *) object; 693 | 694 | /** 若第三方程序不存在,微信终端会打开该url所指的App下载地址 695 | * @note 长度不能超过10K 696 | */ 697 | @property (nonatomic, retain) NSString *url; 698 | /** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理 699 | * @note 长度不能超过2K 700 | */ 701 | @property (nonatomic, retain) NSString *extInfo; 702 | /** App文件数据,该数据发送给微信好友,微信好友需要点击后下载数据,微信终端会回传给第三方程序处理 703 | * @note 大小不能超过10M 704 | */ 705 | @property (nonatomic, retain) NSData *fileData; 706 | 707 | @end 708 | 709 | 710 | 711 | #pragma mark - WXEmoticonObject 712 | /*! @brief 多媒体消息中包含的表情数据对象 713 | * 714 | * 微信终端和第三方程序之间传递消息中包含的表情数据对象。 715 | * @see WXMediaMessage 716 | */ 717 | @interface WXEmoticonObject : NSObject 718 | 719 | /*! @brief 返回一个WXEmoticonObject对象 720 | * 721 | * @note 返回的WXEmoticonObject对象是自动释放的 722 | */ 723 | +(WXEmoticonObject *) object; 724 | 725 | /** 表情真实数据内容 726 | * @note 大小不能超过10M 727 | */ 728 | @property (nonatomic, retain) NSData *emoticonData; 729 | 730 | @end 731 | 732 | 733 | 734 | #pragma mark - WXFileObject 735 | /*! @brief 多媒体消息中包含的文件数据对象 736 | * 737 | * @see WXMediaMessage 738 | */ 739 | @interface WXFileObject : NSObject 740 | 741 | /*! @brief 返回一个WXFileObject对象 742 | * 743 | * @note 返回的WXFileObject对象是自动释放的 744 | */ 745 | +(WXFileObject *) object; 746 | 747 | /** 文件后缀名 748 | * @note 长度不超过64字节 749 | */ 750 | @property (nonatomic, retain) NSString *fileExtension; 751 | 752 | /** 文件真实数据内容 753 | * @note 大小不能超过10M 754 | */ 755 | @property (nonatomic, retain) NSData *fileData; 756 | 757 | @end 758 | 759 | 760 | #pragma mark - WXLocationObject 761 | /*! @brief 多媒体消息中包含的地理位置数据对象 762 | * 763 | * 微信终端和第三方程序之间传递消息中包含的地理位置数据对象。 764 | * @see WXMediaMessage 765 | */ 766 | @interface WXLocationObject : NSObject 767 | 768 | /*! @brief 返回一个WXLocationObject对象 769 | * 770 | * @note 返回的WXLocationObject对象是自动释放的 771 | */ 772 | +(WXLocationObject *) object; 773 | 774 | /** 地理位置信息 775 | * @note 经纬度 776 | */ 777 | @property (nonatomic, assign) double lng; //经度 778 | @property (nonatomic, assign) double lat; //纬度 779 | 780 | @end 781 | 782 | 783 | #pragma mark - WXTextObject 784 | /*! @brief 多媒体消息中包含的文本数据对象 785 | * 786 | * 微信终端和第三方程序之间传递消息中包含的文本数据对象。 787 | * @see WXMediaMessage 788 | */ 789 | @interface WXTextObject : NSObject 790 | 791 | /*! @brief 返回一个WXTextObject对象 792 | * 793 | * @note 返回的WXTextObject对象是自动释放的 794 | */ 795 | +(WXTextObject *) object; 796 | 797 | /** 地理位置信息 798 | * @note 文本内容 799 | */ 800 | @property (nonatomic, retain) NSString *contentText; 801 | 802 | @end 803 | 804 | -------------------------------------------------------------------------------- /DWQPayManager/WechatPay/WechatAuthSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // WechatAuthSDK.h 3 | // WechatAuthSDK 4 | // 5 | // Created by 李凯 on 13-11-29. 6 | // Copyright (c) 2013年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | enum AuthErrCode { 13 | WechatAuth_Err_Ok = 0, //Auth成功 14 | WechatAuth_Err_NormalErr = -1, //普通错误 15 | WechatAuth_Err_NetworkErr = -2, //网络错误 16 | WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败 17 | WechatAuth_Err_Cancel = -4, //用户取消授权 18 | WechatAuth_Err_Timeout = -5, //超时 19 | }; 20 | 21 | @protocol WechatAuthAPIDelegate 22 | @optional 23 | 24 | - (void)onAuthGotQrcode:(UIImage *)image; //得到二维码 25 | - (void)onQrcodeScanned; //二维码被扫描 26 | - (void)onAuthFinish:(int)errCode AuthCode:(NSString *)authCode; //成功登录 27 | 28 | @end 29 | 30 | @interface WechatAuthSDK : NSObject{ 31 | NSString *_sdkVersion; 32 | __weak id _delegate; 33 | } 34 | 35 | @property(nonatomic, weak) id delegate; 36 | @property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号 37 | 38 | /*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调 39 | * 40 | * @param appId 微信开发者ID 41 | * @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同 42 | * @param timeStamp 时间戳 43 | * @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔 44 | * @param signature 签名 45 | * @param schemeData 会在扫码后拼在scheme后 46 | * @return 成功返回YES,失败返回NO 47 | 注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。 48 | */ 49 | 50 | - (BOOL)Auth:(NSString *)appId 51 | nonceStr:(NSString *)nonceStr 52 | timeStamp:(NSString*)timeStamp 53 | scope:(NSString *)scope 54 | signature:(NSString *)signature 55 | schemeData:(NSString *)schemeData; 56 | 57 | 58 | /*! @brief 暂停登录请求 59 | * 60 | * @return 成功返回YES,失败返回NO。 61 | */ 62 | - (BOOL)StopAuth; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /DWQPayManager/WechatPay/libWeChatSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopmentEngineer-DWQ/DWQPayManager/417a94b2d38b50fe3be3be949dc50f141d08462c/DWQPayManager/WechatPay/libWeChatSDK.a -------------------------------------------------------------------------------- /DWQPayManager/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DWQPayManager 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DWQPayManagerTests/DWQPayManagerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWQPayManagerTests.m 3 | // DWQPayManagerTests 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DWQPayManagerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DWQPayManagerTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DWQPayManagerTests/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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /DWQPayManagerUITests/DWQPayManagerUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWQPayManagerUITests.m 3 | // DWQPayManagerUITests 4 | // 5 | // Created by 杜文全 on 15/6/16. 6 | // Copyright © 2015年 com.sdzw.duwenquan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DWQPayManagerUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DWQPayManagerUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DWQPayManagerUITests/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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 iOS高级攻城狮-杜文全 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DWQPayManager 2 | 针对微信支付/支付宝支付的封装,方便使用。 3 | #一、引述 4 | 5 | - 1、上一篇文章我们讲的是[规格属性选择](http://www.jianshu.com/p/a8433e2227ce);通常情况下,在电商平台购物的下一步操作就是立即购买或者添加到购物车了,今天,我们先讲立即购买,那么,肯定涉及到的就是支付。如今这个移动支付火爆的年代,如果你的APP不能够实现移动支付,那是不是已经被时代潮流远远的甩在了后面。 6 | 7 | - 2、移动支付常用的是支付宝和微信,统一管理岂不是很方便!所以本篇主要讲解统一管理的支付工具封装说实话,银联支付比较鸡肋,用的人特别少,所以就没再将其封装。 8 | 9 | #二、支付宝和微信API分析 10 | - 作者在此对比了支付宝和微信的支付API,分析一下它们接口的异同点:[支付宝官方文档](https://doc.open.alipay.com/doc2/detail.htm?treeId=204&articleId=105302&docType=1) [微信官方文档](https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=8_5) 11 | - (1)支付宝是不需要在`didFinishLaunchingWithOptions` 中注册,而微信则需要调用`registerApp` 注册 12 | 13 | - (2)支付宝有web回调,而微信没有,当然这个对整合没影响(因为最终都要统一成一个回调) 14 | 15 | - (3)支付宝发起支付是传入订单信息(字符串类型),而微信则传入一个`BaseReq` 类或者其子类(支付的是`PayReq` 类),此时根据这点差异性可以通过传入id 类型,然后内部做判断,进行跳转不同的支付方式,来看看他们的接口 16 | 17 | >**支付宝发起支付** 18 | 19 | ``` 20 | /** 21 |   *  支付接口 22 |  * 23 |   *  @param orderStr       订单信息 24 |  *  @param schemeStr      调用支付的app注册在info.plist中的scheme 25 |   *  @param completionBlock 支付结果回调Block,用于wap支付结果回调(非跳转钱包支付) 26 |  */ 27 | - (void)payOrder:(NSString *)orderStr 28 |       fromScheme:(NSString *)schemeStr 29 |         callback:(CompletionBlock)completionBlock; 30 | ``` 31 | >**微信发起支付** 32 | 33 | ``` 34 | /*! @brief 发送请求到微信,等待微信返回onResp 35 |  * 36 |  * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型 37 |  * SendAuthReq、SendMessageToWXReq、PayReq等。 38 |  * @param req 具体的发送请求,在调用函数后,请自己释放。 39 |  * @return 成功返回YES,失败返回NO。 40 |  */ 41 | +(BOOL) sendReq:(BaseReq*)req; 42 | ``` 43 | - (4)支付宝发起支付不单单传入订单信息,还需要传入appSchemes(就是在Info - URL Types 中配置的 App Schemes),而微信 发起支付只需要传入订单信息,它的appSchemes 在 `didFinishLaunchingWithOptions` 注册的时候已经传入了,因此可以考虑 我也在`didFinishLaunchingWithOptions` 中给支付宝绑定一个 appSchemes ,类似微信,然后在发起支付的时候就不需要传入,只需要在内部获取就行,当然,由于Url Scheme 是存储在`Info.plist` 文件中,因此可以用代码获取,就不需要调用者传入了,只需要按照本工具的规定就搞定 44 | 45 | - (5)支付宝的支付返回状态不是以枚举类型返回,是用过回调中返回的字典中的 resultStatus 字段,而微信是通过枚举返回,此时可以统一为枚举,可参考微信 46 | ![支付宝支付返回状态码-DWQ](http://upload-images.jianshu.io/upload_images/1085031-b8bca4159e811852.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 47 | 48 | ![微信支付返回状态码-DWQ](http://upload-images.jianshu.io/upload_images/1085031-fdb7932ac4d290db.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 49 | 50 | - (6)支付宝每一个状态码都对应一个状态信息,而微信则只有错误的时候(errCode = -1)才有对应状态信息,可参考支付宝,手动给微信添加返回状态信息 51 | 52 | #三、集成 53 | - **1、支付宝支付集成 (三个步骤)** 54 | - (1)由于支付宝不支持Pod,那么[下载最新的SDK](https://doc.open.alipay.com/doc2/detail.htm?treeId=54&articleId=104509&docType=1),拖到项目中 55 | 56 | ![SDK包含资源](http://upload-images.jianshu.io/upload_images/1085031-2ba9f31933ca4de0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 57 | - (2)按照官方文档指示,导入所需库 58 | 59 | 60 | ![支付宝依赖库.png](http://upload-images.jianshu.io/upload_images/2231137-8891a5433f072761.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 61 | 62 | 63 | 64 | - (3)配置 `Info.plist` 中的 `Url Types` 添加支付宝跳转 Url Scheme 65 | 66 | ![添加Url Scheme](http://upload-images.jianshu.io/upload_images/1085031-d81ba0ffc1931385.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 67 | 68 | 69 | - **2、微信支付集成(五个步骤)** 70 | - (1)同样微信也不支持Pod,[下载最新的SDK](https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=11_1),拖到项目中 71 | 72 | ![有四个文件](http://upload-images.jianshu.io/upload_images/1085031-9db84ae06b2075fb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 73 | - (2)按照微信官方文档,导入所需库:文档比较老,可参考Demo中的依赖库 74 | 75 | 76 | ![微信官方平台.png](http://upload-images.jianshu.io/upload_images/2231137-91abec4aada12f8b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 77 | 78 | 79 | 80 | 81 | - (3)在 `build settings` 下面的 `Other Linker Flags` 添加 `-ObjC` , 82 | 83 | ![添加-all_load](http://upload-images.jianshu.io/upload_images/1085031-4208755cadb0e2ba.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 84 | 85 | - (4)配置 `Info.plist` 中的 `Url Types` 添加微信跳转 Url Scheme,此时就集成完毕了 86 | 87 | 88 | ![微信Schemes.png](http://upload-images.jianshu.io/upload_images/2231137-371854f90cf0458e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 89 | 90 | 91 | - (5)添加UIKit框架。这样,微信支付就完美的集成上去了。 92 | 93 | 94 | #四、封装 API 95 | 96 | - 1、单例模式,项目中唯一,方便统一管理 97 | 98 | ``` 99 | /** 100 |  *  @author 杜文全 101 |  * 102 |  *  单例管理 103 |  */ 104 | + (instancetype)shareManager; 105 | ``` 106 | 107 | - 2、处理回调url,需要在AppDelegate中实现 108 | 109 | ``` 110 | /** 111 |  *  @author 杜文全 112 |  * 113 |  *  处理跳转url,回到应用,需要在delegate中实现 114 |  */ 115 | - (BOOL)dwq_handleUrl:(NSURL *)url; 116 | ``` 117 | 118 | - 3、注册app,需要在 didFinishLaunchingWithOptions 中调用,绑定URL Scheme 119 | 120 | ``` 121 | /** 122 |  *  @author 杜文全 123 |  * 124 |  *  注册App,需要在 didFinishLaunchingWithOptions 中调用 125 |  */ 126 | - (void)dwq_registerApp; 127 | ``` 128 | 129 | - 4、发起支付,传入订单参数类型是id,传入如果是字符串,则对应是跳转支付宝支付;如果传入PayReq 对象,这跳转微信支付,注意,不能传入空字符串或者nil,内部有对应断言;统一了回调,不管是支付宝的wap 还是 app,或者是微信支付,都是通过这个block回调,回调状态码都有对应的状态信息 130 | 131 | ``` 132 | /** 133 |  *  @author 杜文全 134 |  * 135 |  *  发起支付 136 |  * 137 |  * @param orderMessage 传入订单信息,如果是字符串,则对应是跳转支付宝支付;如果传入PayReq 对象,这跳转微信支付,注意,不能传入空字符串或者nil 138 |  * @param callBack     回调,有返回状态信息 139 |  */ 140 | - (void)dwq_payWithOrderMessage:(id)orderMessage callBack:(DWQCompleteCallBack)callBack; 141 | ``` 142 | 143 | 144 | #五、用法(基于SDK集成后) 145 | 146 | - **1、在`AppDelegate`处理回调,一般只需要实现后面两个方法即可,为了避免不必要的麻烦,最好三个都写上** 147 | 148 | ``` 149 | /** 150 |  *  @author 杜文全 151 |  * 152 |  *  最老的版本,最好也写上 153 |  */ 154 | - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { 155 |      156 |     return [DWQPAYMANAGER dwq_handleUrl:url]; 157 | } 158 | 159 | /** 160 |  *  @author 杜文全 161 |  * 162 |  *  iOS 9.0 之前 会调用 163 |  */ 164 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { 165 |      166 |     return [DWQPAYMANAGER dwq_handleUrl:url]; 167 | } 168 | 169 | /** 170 |  *  @author 杜文全 171 |  * 172 |  *  iOS 9.0 以上(包括iOS9.0) 173 |  */ 174 | - (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary *)options{ 175 |      176 |     return [DWQPAYMANAGER fl_handleUrl:url]; 177 | } 178 | ``` 179 | 180 | - **2、在`didFinishLaunchingWithOptions`中注册 app,内部绑定根据Info中对应的Url Types 绑定 `URL Scheme`** 181 | 182 | ``` 183 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 184 |     // Override point for customization after application launch. 185 | // 注册app 186 |     [DWQPAYMANAGER dwq_registerApp]; 187 |     return YES; 188 | } 189 | ``` 190 | 191 | - 3、**发起支付** 192 | 193 | - 3.1 支付宝支付 194 | 195 | ``` 196 | NSString *orderMessage = @"Demo 中 有 可测试的 订单信息"; 197 | [DWQPAYMANAGER dwq_payWithOrderMessage:orderMessage callBack:^(FLErrCode errCode, NSString *errStr) { 198 | NSLog(@"errCode = %zd,errStr = %@",errCode,errStr); 199 | }]; 200 | ``` 201 | 202 | - 3.2 微信支付 203 | 204 | ``` 205 | //调起微信支付 206 | PayReq* req             = [[PayReq alloc] init]; 207 | req.partnerId           = [dict objectForKey:@"partnerid"]; 208 | req.prepayId            = [dict objectForKey:@"prepayid"]; 209 | req.nonceStr            = [dict objectForKey:@"noncestr"]; 210 | req.timeStamp           = stamp.intValue; 211 | req.package             = [dict objectForKey:@"package"]; 212 | req.sign                = [dict objectForKey:@"sign"]; 213 |                  214 | [DWQPAYMANAGER dwq_payWithOrderMessage:req callBack:^(FLErrCode errCode, NSString *errStr) { 215 |      NSLog(@"errCode = %zd,errStr = %@",errCode,errStr); 216 | }]; 217 | ``` 218 | 219 | #六、封装特点 220 | - 1、分离框架,统一进行操作和管理,方便维护 221 | 222 | - 2、支付封装,使用更加简单便捷。 223 | 224 | - 3、融合支付宝 和 微信 接口的优点,完善微信返回状态码对应的状态信息 225 | 226 | - 4、对支付宝和微信的 回调处理都统一 成一个 block回调 227 | 228 | - 5、封装中添加了比较完善的断言 229 | 230 | 231 | ```objective-c 232 | // 回调url地址为空 233 | #define DWQTIP_CALLBACKURL @"url地址不能为空!" 234 | // 订单信息为空字符串或者nil 235 | #define DWQTIP_ORDERMESSAGE @"订单信息不能为空!" 236 | // 没添加 URL Types 237 | #define DWQTIP_URLTYPE @"请先在Info.plist 添加 URL Type" 238 | // 添加了 URL Types 但信息不全 239 | #define DWQTIP_URLTYPE_SCHEME(name) [NSString stringWithFormat:@"请先在Info.plist 的 URL Type 添加 %@ 对应的 URL Scheme",name] 240 | 241 | ``` 242 | 243 | 244 | #七、提醒和Demo下载地址: 245 | - 1、`Info.plist` 配置 `Url Types` 的 `Identifier` 必须 保证 和 工具中的对应,默认微信的 `Identifier` 是 `weixin` ,支付宝的 `Identifier` 是 `zhifubao`,可修改 246 | 247 | ``` 248 | /** 249 |  *  @author 杜文全 250 |  * 251 |  *  此处必须保证在Info.plist 中的 URL Types 的 Identifier 对应一致 252 |  */ 253 | #define DWQWECHATURLNAME @"weixin" 254 | #define DWQALIPAYURLNAME @"zhifubao" 255 | ``` 256 | 257 | - 2、因为工具中添加了比较完善的断言,配置不完整或者是传参不正确,程序都会不可避免的崩溃 258 | --------------------------------------------------------------------------------