├── PayTypeDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── byy5983.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── byy5983.xcuserdatad │ └── xcschemes │ ├── PayTypeDemo.xcscheme │ └── xcschememanagement.plist ├── PayTypeDemo.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── byy5983.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── PayTypeDemo ├── AppDelegate.h ├── AppDelegate.m ├── AppPay │ ├── AppPay.h │ └── AppPay.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── ic_selected.imageset │ │ ├── Contents.json │ │ ├── ic_selected@2x.png │ │ └── ic_selected@3x.png │ └── ic_unselected.imageset │ │ ├── Contents.json │ │ ├── ic_unselected@2x.png │ │ └── ic_unselected@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── PrefixHeader.pch ├── ViewController.h ├── ViewController.m ├── WXPayCheckModel.h ├── WXPayCheckModel.m └── main.m ├── Podfile ├── Podfile.lock ├── Pods ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── byy5983.xcuserdatad │ │ └── xcschemes │ │ ├── Pods-PayTypeDemo.xcscheme │ │ └── xcschememanagement.plist └── Target Support Files │ └── Pods-PayTypeDemo │ ├── Pods-PayTypeDemo-acknowledgements.markdown │ ├── Pods-PayTypeDemo-acknowledgements.plist │ ├── Pods-PayTypeDemo-dummy.m │ ├── Pods-PayTypeDemo-frameworks.sh │ ├── Pods-PayTypeDemo-resources.sh │ ├── Pods-PayTypeDemo.debug.xcconfig │ └── Pods-PayTypeDemo.release.xcconfig └── README.md /PayTypeDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E8B98EB4578959FF856F5C1F /* libPods-PayTypeDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EF1C78E7261393D981F632EB /* libPods-PayTypeDemo.a */; }; 11 | F3B780FE1EA889520028F46A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F3B780FD1EA889520028F46A /* main.m */; }; 12 | F3B781011EA889520028F46A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F3B781001EA889520028F46A /* AppDelegate.m */; }; 13 | F3B781041EA889520028F46A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F3B781031EA889520028F46A /* ViewController.m */; }; 14 | F3B781071EA889520028F46A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3B781051EA889520028F46A /* Main.storyboard */; }; 15 | F3B781091EA889520028F46A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3B781081EA889520028F46A /* Assets.xcassets */; }; 16 | F3B7810C1EA889520028F46A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3B7810A1EA889520028F46A /* LaunchScreen.storyboard */; }; 17 | F3B781251EA88D750028F46A /* AppPay.m in Sources */ = {isa = PBXBuildFile; fileRef = F3B7811F1EA88D750028F46A /* AppPay.m */; }; 18 | F3B781291EA88D920028F46A /* WXPayCheckModel.m in Sources */ = {isa = PBXBuildFile; fileRef = F3B781281EA88D920028F46A /* WXPayCheckModel.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 554E23E34E5DC64C387ECB74 /* Pods-PayTypeDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PayTypeDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo.release.xcconfig"; sourceTree = ""; }; 23 | AB77AB509B94F80131DCD928 /* Pods-PayTypeDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PayTypeDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo.debug.xcconfig"; sourceTree = ""; }; 24 | EF1C78E7261393D981F632EB /* libPods-PayTypeDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PayTypeDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | F3B780F91EA889520028F46A /* PayTypeDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PayTypeDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | F3B780FD1EA889520028F46A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 27 | F3B780FF1EA889520028F46A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 28 | F3B781001EA889520028F46A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 29 | F3B781021EA889520028F46A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 30 | F3B781031EA889520028F46A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 31 | F3B781061EA889520028F46A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 32 | F3B781081EA889520028F46A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 33 | F3B7810B1EA889520028F46A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 34 | F3B7810D1EA889520028F46A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | F3B7811E1EA88D750028F46A /* AppPay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppPay.h; sourceTree = ""; }; 36 | F3B7811F1EA88D750028F46A /* AppPay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppPay.m; sourceTree = ""; }; 37 | F3B781271EA88D920028F46A /* WXPayCheckModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXPayCheckModel.h; sourceTree = ""; }; 38 | F3B781281EA88D920028F46A /* WXPayCheckModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXPayCheckModel.m; sourceTree = ""; }; 39 | F3B7812B1EA893340028F46A /* PrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 40 | /* End PBXFileReference section */ 41 | 42 | /* Begin PBXFrameworksBuildPhase section */ 43 | F3B780F61EA889520028F46A /* Frameworks */ = { 44 | isa = PBXFrameworksBuildPhase; 45 | buildActionMask = 2147483647; 46 | files = ( 47 | E8B98EB4578959FF856F5C1F /* libPods-PayTypeDemo.a in Frameworks */, 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | /* End PBXFrameworksBuildPhase section */ 52 | 53 | /* Begin PBXGroup section */ 54 | 0DAF543DAF711AC7C6576751 /* Frameworks */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | EF1C78E7261393D981F632EB /* libPods-PayTypeDemo.a */, 58 | ); 59 | name = Frameworks; 60 | sourceTree = ""; 61 | }; 62 | BAEE8EB079B9C755338E2C02 /* Pods */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | AB77AB509B94F80131DCD928 /* Pods-PayTypeDemo.debug.xcconfig */, 66 | 554E23E34E5DC64C387ECB74 /* Pods-PayTypeDemo.release.xcconfig */, 67 | ); 68 | name = Pods; 69 | sourceTree = ""; 70 | }; 71 | F3B780F01EA889520028F46A = { 72 | isa = PBXGroup; 73 | children = ( 74 | F3B780FB1EA889520028F46A /* PayTypeDemo */, 75 | F3B780FA1EA889520028F46A /* Products */, 76 | BAEE8EB079B9C755338E2C02 /* Pods */, 77 | 0DAF543DAF711AC7C6576751 /* Frameworks */, 78 | ); 79 | sourceTree = ""; 80 | }; 81 | F3B780FA1EA889520028F46A /* Products */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | F3B780F91EA889520028F46A /* PayTypeDemo.app */, 85 | ); 86 | name = Products; 87 | sourceTree = ""; 88 | }; 89 | F3B780FB1EA889520028F46A /* PayTypeDemo */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | F3B780FF1EA889520028F46A /* AppDelegate.h */, 93 | F3B781001EA889520028F46A /* AppDelegate.m */, 94 | F3B781021EA889520028F46A /* ViewController.h */, 95 | F3B781031EA889520028F46A /* ViewController.m */, 96 | F3B7812A1EA88D990028F46A /* Models */, 97 | F3B7811D1EA88D750028F46A /* AppPay */, 98 | F3B781051EA889520028F46A /* Main.storyboard */, 99 | F3B781081EA889520028F46A /* Assets.xcassets */, 100 | F3B7810A1EA889520028F46A /* LaunchScreen.storyboard */, 101 | F3B7810D1EA889520028F46A /* Info.plist */, 102 | F3B780FC1EA889520028F46A /* Supporting Files */, 103 | F3B7812B1EA893340028F46A /* PrefixHeader.pch */, 104 | ); 105 | path = PayTypeDemo; 106 | sourceTree = ""; 107 | }; 108 | F3B780FC1EA889520028F46A /* Supporting Files */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | F3B780FD1EA889520028F46A /* main.m */, 112 | ); 113 | name = "Supporting Files"; 114 | sourceTree = ""; 115 | }; 116 | F3B7811D1EA88D750028F46A /* AppPay */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | F3B7811E1EA88D750028F46A /* AppPay.h */, 120 | F3B7811F1EA88D750028F46A /* AppPay.m */, 121 | ); 122 | path = AppPay; 123 | sourceTree = ""; 124 | }; 125 | F3B7812A1EA88D990028F46A /* Models */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | F3B781271EA88D920028F46A /* WXPayCheckModel.h */, 129 | F3B781281EA88D920028F46A /* WXPayCheckModel.m */, 130 | ); 131 | name = Models; 132 | sourceTree = ""; 133 | }; 134 | /* End PBXGroup section */ 135 | 136 | /* Begin PBXNativeTarget section */ 137 | F3B780F81EA889520028F46A /* PayTypeDemo */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = F3B781101EA889520028F46A /* Build configuration list for PBXNativeTarget "PayTypeDemo" */; 140 | buildPhases = ( 141 | FDB12B4212194D2921312FB5 /* [CP] Check Pods Manifest.lock */, 142 | F3B780F51EA889520028F46A /* Sources */, 143 | F3B780F61EA889520028F46A /* Frameworks */, 144 | F3B780F71EA889520028F46A /* Resources */, 145 | F3D7972EA6E1F96CFC5A92B0 /* [CP] Embed Pods Frameworks */, 146 | 0B6EB0098BAC4E45BA4D47FC /* [CP] Copy Pods Resources */, 147 | ); 148 | buildRules = ( 149 | ); 150 | dependencies = ( 151 | ); 152 | name = PayTypeDemo; 153 | productName = PayTypeDemo; 154 | productReference = F3B780F91EA889520028F46A /* PayTypeDemo.app */; 155 | productType = "com.apple.product-type.application"; 156 | }; 157 | /* End PBXNativeTarget section */ 158 | 159 | /* Begin PBXProject section */ 160 | F3B780F11EA889520028F46A /* Project object */ = { 161 | isa = PBXProject; 162 | attributes = { 163 | LastUpgradeCheck = 0830; 164 | ORGANIZATIONNAME = "北京116科技有限公司"; 165 | TargetAttributes = { 166 | F3B780F81EA889520028F46A = { 167 | CreatedOnToolsVersion = 8.3.1; 168 | DevelopmentTeam = KK59AKUJZC; 169 | ProvisioningStyle = Automatic; 170 | }; 171 | }; 172 | }; 173 | buildConfigurationList = F3B780F41EA889520028F46A /* Build configuration list for PBXProject "PayTypeDemo" */; 174 | compatibilityVersion = "Xcode 3.2"; 175 | developmentRegion = English; 176 | hasScannedForEncodings = 0; 177 | knownRegions = ( 178 | en, 179 | Base, 180 | ); 181 | mainGroup = F3B780F01EA889520028F46A; 182 | productRefGroup = F3B780FA1EA889520028F46A /* Products */; 183 | projectDirPath = ""; 184 | projectRoot = ""; 185 | targets = ( 186 | F3B780F81EA889520028F46A /* PayTypeDemo */, 187 | ); 188 | }; 189 | /* End PBXProject section */ 190 | 191 | /* Begin PBXResourcesBuildPhase section */ 192 | F3B780F71EA889520028F46A /* Resources */ = { 193 | isa = PBXResourcesBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | F3B7810C1EA889520028F46A /* LaunchScreen.storyboard in Resources */, 197 | F3B781091EA889520028F46A /* Assets.xcassets in Resources */, 198 | F3B781071EA889520028F46A /* Main.storyboard in Resources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | /* End PBXResourcesBuildPhase section */ 203 | 204 | /* Begin PBXShellScriptBuildPhase section */ 205 | 0B6EB0098BAC4E45BA4D47FC /* [CP] Copy Pods Resources */ = { 206 | isa = PBXShellScriptBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | ); 210 | inputPaths = ( 211 | ); 212 | name = "[CP] Copy Pods Resources"; 213 | outputPaths = ( 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | shellPath = /bin/sh; 217 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo-resources.sh\"\n"; 218 | showEnvVarsInLog = 0; 219 | }; 220 | F3D7972EA6E1F96CFC5A92B0 /* [CP] Embed Pods Frameworks */ = { 221 | isa = PBXShellScriptBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | ); 225 | inputPaths = ( 226 | ); 227 | name = "[CP] Embed Pods Frameworks"; 228 | outputPaths = ( 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | shellPath = /bin/sh; 232 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo-frameworks.sh\"\n"; 233 | showEnvVarsInLog = 0; 234 | }; 235 | FDB12B4212194D2921312FB5 /* [CP] Check Pods Manifest.lock */ = { 236 | isa = PBXShellScriptBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | ); 240 | inputPaths = ( 241 | ); 242 | name = "[CP] Check Pods Manifest.lock"; 243 | outputPaths = ( 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | shellPath = /bin/sh; 247 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 248 | showEnvVarsInLog = 0; 249 | }; 250 | /* End PBXShellScriptBuildPhase section */ 251 | 252 | /* Begin PBXSourcesBuildPhase section */ 253 | F3B780F51EA889520028F46A /* Sources */ = { 254 | isa = PBXSourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | F3B781041EA889520028F46A /* ViewController.m in Sources */, 258 | F3B781011EA889520028F46A /* AppDelegate.m in Sources */, 259 | F3B781251EA88D750028F46A /* AppPay.m in Sources */, 260 | F3B780FE1EA889520028F46A /* main.m in Sources */, 261 | F3B781291EA88D920028F46A /* WXPayCheckModel.m in Sources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXSourcesBuildPhase section */ 266 | 267 | /* Begin PBXVariantGroup section */ 268 | F3B781051EA889520028F46A /* Main.storyboard */ = { 269 | isa = PBXVariantGroup; 270 | children = ( 271 | F3B781061EA889520028F46A /* Base */, 272 | ); 273 | name = Main.storyboard; 274 | sourceTree = ""; 275 | }; 276 | F3B7810A1EA889520028F46A /* LaunchScreen.storyboard */ = { 277 | isa = PBXVariantGroup; 278 | children = ( 279 | F3B7810B1EA889520028F46A /* Base */, 280 | ); 281 | name = LaunchScreen.storyboard; 282 | sourceTree = ""; 283 | }; 284 | /* End PBXVariantGroup section */ 285 | 286 | /* Begin XCBuildConfiguration section */ 287 | F3B7810E1EA889520028F46A /* Debug */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ALWAYS_SEARCH_USER_PATHS = NO; 291 | CLANG_ANALYZER_NONNULL = YES; 292 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 293 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 294 | CLANG_CXX_LIBRARY = "libc++"; 295 | CLANG_ENABLE_MODULES = YES; 296 | CLANG_ENABLE_OBJC_ARC = YES; 297 | CLANG_WARN_BOOL_CONVERSION = YES; 298 | CLANG_WARN_CONSTANT_CONVERSION = YES; 299 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 300 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 301 | CLANG_WARN_EMPTY_BODY = YES; 302 | CLANG_WARN_ENUM_CONVERSION = YES; 303 | CLANG_WARN_INFINITE_RECURSION = YES; 304 | CLANG_WARN_INT_CONVERSION = YES; 305 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 306 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 307 | CLANG_WARN_UNREACHABLE_CODE = YES; 308 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 309 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 310 | COPY_PHASE_STRIP = NO; 311 | DEBUG_INFORMATION_FORMAT = dwarf; 312 | ENABLE_STRICT_OBJC_MSGSEND = YES; 313 | ENABLE_TESTABILITY = YES; 314 | GCC_C_LANGUAGE_STANDARD = gnu99; 315 | GCC_DYNAMIC_NO_PIC = NO; 316 | GCC_NO_COMMON_BLOCKS = YES; 317 | GCC_OPTIMIZATION_LEVEL = 0; 318 | GCC_PREPROCESSOR_DEFINITIONS = ( 319 | "DEBUG=1", 320 | "$(inherited)", 321 | ); 322 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 323 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 324 | GCC_WARN_UNDECLARED_SELECTOR = YES; 325 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 326 | GCC_WARN_UNUSED_FUNCTION = YES; 327 | GCC_WARN_UNUSED_VARIABLE = YES; 328 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 329 | MTL_ENABLE_DEBUG_INFO = YES; 330 | ONLY_ACTIVE_ARCH = YES; 331 | SDKROOT = iphoneos; 332 | }; 333 | name = Debug; 334 | }; 335 | F3B7810F1EA889520028F46A /* Release */ = { 336 | isa = XCBuildConfiguration; 337 | buildSettings = { 338 | ALWAYS_SEARCH_USER_PATHS = NO; 339 | CLANG_ANALYZER_NONNULL = YES; 340 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 341 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 342 | CLANG_CXX_LIBRARY = "libc++"; 343 | CLANG_ENABLE_MODULES = YES; 344 | CLANG_ENABLE_OBJC_ARC = YES; 345 | CLANG_WARN_BOOL_CONVERSION = YES; 346 | CLANG_WARN_CONSTANT_CONVERSION = YES; 347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 348 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 349 | CLANG_WARN_EMPTY_BODY = YES; 350 | CLANG_WARN_ENUM_CONVERSION = YES; 351 | CLANG_WARN_INFINITE_RECURSION = YES; 352 | CLANG_WARN_INT_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 355 | CLANG_WARN_UNREACHABLE_CODE = YES; 356 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 357 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 358 | COPY_PHASE_STRIP = NO; 359 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 360 | ENABLE_NS_ASSERTIONS = NO; 361 | ENABLE_STRICT_OBJC_MSGSEND = YES; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_NO_COMMON_BLOCKS = YES; 364 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 365 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 366 | GCC_WARN_UNDECLARED_SELECTOR = YES; 367 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 368 | GCC_WARN_UNUSED_FUNCTION = YES; 369 | GCC_WARN_UNUSED_VARIABLE = YES; 370 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 371 | MTL_ENABLE_DEBUG_INFO = NO; 372 | SDKROOT = iphoneos; 373 | VALIDATE_PRODUCT = YES; 374 | }; 375 | name = Release; 376 | }; 377 | F3B781111EA889520028F46A /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | baseConfigurationReference = AB77AB509B94F80131DCD928 /* Pods-PayTypeDemo.debug.xcconfig */; 380 | buildSettings = { 381 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 382 | DEVELOPMENT_TEAM = KK59AKUJZC; 383 | GCC_PREFIX_HEADER = "$(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.pch"; 384 | INFOPLIST_FILE = PayTypeDemo/Info.plist; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 386 | LIBRARY_SEARCH_PATHS = ( 387 | "$(inherited)", 388 | "$(PROJECT_DIR)/PayTypeDemo/WeChat", 389 | ); 390 | PRODUCT_BUNDLE_IDENTIFIER = com.qianmo.PayTypeDemo; 391 | PRODUCT_NAME = "$(TARGET_NAME)"; 392 | }; 393 | name = Debug; 394 | }; 395 | F3B781121EA889520028F46A /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | baseConfigurationReference = 554E23E34E5DC64C387ECB74 /* Pods-PayTypeDemo.release.xcconfig */; 398 | buildSettings = { 399 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 400 | DEVELOPMENT_TEAM = KK59AKUJZC; 401 | GCC_PREFIX_HEADER = "$(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.pch"; 402 | INFOPLIST_FILE = PayTypeDemo/Info.plist; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 404 | LIBRARY_SEARCH_PATHS = ( 405 | "$(inherited)", 406 | "$(PROJECT_DIR)/PayTypeDemo/WeChat", 407 | ); 408 | PRODUCT_BUNDLE_IDENTIFIER = com.qianmo.PayTypeDemo; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | }; 411 | name = Release; 412 | }; 413 | /* End XCBuildConfiguration section */ 414 | 415 | /* Begin XCConfigurationList section */ 416 | F3B780F41EA889520028F46A /* Build configuration list for PBXProject "PayTypeDemo" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | F3B7810E1EA889520028F46A /* Debug */, 420 | F3B7810F1EA889520028F46A /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | F3B781101EA889520028F46A /* Build configuration list for PBXNativeTarget "PayTypeDemo" */ = { 426 | isa = XCConfigurationList; 427 | buildConfigurations = ( 428 | F3B781111EA889520028F46A /* Debug */, 429 | F3B781121EA889520028F46A /* Release */, 430 | ); 431 | defaultConfigurationIsVisible = 0; 432 | defaultConfigurationName = Release; 433 | }; 434 | /* End XCConfigurationList section */ 435 | }; 436 | rootObject = F3B780F11EA889520028F46A /* Project object */; 437 | } 438 | -------------------------------------------------------------------------------- /PayTypeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PayTypeDemo.xcodeproj/project.xcworkspace/xcuserdata/byy5983.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baiyongyu/PayTypeDemo/a8f194af7b24e3fef283d93d96cd512e88855ea1/PayTypeDemo.xcodeproj/project.xcworkspace/xcuserdata/byy5983.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PayTypeDemo.xcodeproj/xcuserdata/byy5983.xcuserdatad/xcschemes/PayTypeDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /PayTypeDemo.xcodeproj/xcuserdata/byy5983.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PayTypeDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F3B780F81EA889520028F46A 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /PayTypeDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PayTypeDemo.xcworkspace/xcuserdata/byy5983.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baiyongyu/PayTypeDemo/a8f194af7b24e3fef283d93d96cd512e88855ea1/PayTypeDemo.xcworkspace/xcuserdata/byy5983.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PayTypeDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PayTypeDemo 4 | // 5 | // Created by 宇玄丶 on 2017/4/20. 6 | // Copyright © 2017年 北京116科技有限公司. 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 | -------------------------------------------------------------------------------- /PayTypeDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PayTypeDemo 4 | // 5 | // Created by 宇玄丶 on 2017/4/20. 6 | // Copyright © 2017年 北京116科技有限公司. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | //#import "WXApi.h" 11 | //#import 12 | //#import "AppPay.h" 13 | 14 | @interface AppDelegate () 15 | 16 | @end 17 | 18 | @implementation AppDelegate 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 22 | // Override point for customization after application launch. 23 | 24 | /** 微信支付 */ 25 | // [WXApi registerApp:@""]; 26 | 27 | 28 | return YES; 29 | } 30 | 31 | 32 | #pragma mark - 处理回调 33 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { 34 | 35 | // if ([url.absoluteString hasPrefix:@"wx"]) { 36 | // [WXApi handleOpenURL:url delegate:[AppPay sharedInstance]]; 37 | // } 38 | // 39 | // if ([url.host isEqualToString:@"safepay"]) { 40 | // // 支付跳转支付宝钱包进行支付,处理支付结果 41 | // [[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) { 42 | // NSLog(@"result = %@",resultDic); 43 | // 44 | // }]; 45 | // 46 | // // 授权跳转支付宝钱包进行支付,处理支付结果 47 | // [[AlipaySDK defaultService] processAuth_V2Result:url standbyCallback:^(NSDictionary *resultDic) { 48 | // NSLog(@"result = %@",resultDic); 49 | // // 解析 auth code 50 | // NSString *result = resultDic[@"result"]; 51 | // NSString *authCode = nil; 52 | // if (result.length>0) { 53 | // NSArray *resultArr = [result componentsSeparatedByString:@"&"]; 54 | // for (NSString *subResult in resultArr) { 55 | // if (subResult.length > 10 && [subResult hasPrefix:@"auth_code="]) { 56 | // authCode = [subResult substringFromIndex:10]; 57 | // break; 58 | // } 59 | // } 60 | // } 61 | // NSLog(@"授权结果 authCode = %@", authCode?:@""); 62 | // }]; 63 | // } 64 | return YES; 65 | } 66 | 67 | - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ 68 | 69 | // if ([url.absoluteString hasPrefix:@"wx"]) { 70 | // [WXApi handleOpenURL:url delegate:[AppPay sharedInstance]]; 71 | // } 72 | 73 | return YES; 74 | } 75 | 76 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { 77 | 78 | // if ([url.absoluteString hasPrefix:@"wx"]) { 79 | // [WXApi handleOpenURL:url delegate:[AppPay sharedInstance]]; 80 | // } 81 | // 82 | // if ([url.host isEqualToString:@"safepay"]) { 83 | // // 支付跳转支付宝钱包进行支付,处理支付结果 84 | // [[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) { 85 | // NSLog(@"result = %@",resultDic); 86 | // 87 | // }]; 88 | // 89 | // // 授权跳转支付宝钱包进行支付,处理支付结果 90 | // [[AlipaySDK defaultService] processAuth_V2Result:url standbyCallback:^(NSDictionary *resultDic) { 91 | // NSLog(@"result = %@",resultDic); 92 | // 93 | // // 解析 auth code 94 | // NSString *result = resultDic[@"result"]; 95 | // NSString *authCode = nil; 96 | // if (result.length>0) { 97 | // NSArray *resultArr = [result componentsSeparatedByString:@"&"]; 98 | // for (NSString *subResult in resultArr) { 99 | // if (subResult.length > 10 && [subResult hasPrefix:@"auth_code="]) { 100 | // authCode = [subResult substringFromIndex:10]; 101 | // break; 102 | // } 103 | // } 104 | // } 105 | // NSLog(@"授权结果 authCode = %@", authCode?:@""); 106 | // }]; 107 | // } 108 | 109 | return YES; 110 | } 111 | 112 | 113 | - (void)applicationWillResignActive:(UIApplication *)application { 114 | // 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. 115 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 116 | } 117 | 118 | 119 | - (void)applicationDidEnterBackground:(UIApplication *)application { 120 | // 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. 121 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 122 | } 123 | 124 | 125 | - (void)applicationWillEnterForeground:(UIApplication *)application { 126 | // 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. 127 | } 128 | 129 | 130 | - (void)applicationDidBecomeActive:(UIApplication *)application { 131 | // 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. 132 | } 133 | 134 | 135 | - (void)applicationWillTerminate:(UIApplication *)application { 136 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 137 | } 138 | 139 | 140 | @end 141 | -------------------------------------------------------------------------------- /PayTypeDemo/AppPay/AppPay.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppPay.h 3 | // LaundrySheet 4 | // 5 | // Created by 宇玄丶 on 2017/3/1. 6 | // Copyright © 2016年 北京116工作室. All rights reserved. 7 | // 8 | 9 | #import 10 | //#import "WXApi.h" 11 | //#import 12 | 13 | @interface AppPay : NSObject 14 | // 15 | + (instancetype)sharedInstance; 16 | - (void)payWithOrderId:(NSString *)orderId type:(NSInteger )type payFinishBlock:(void (^)())payFinishBlock; 17 | @end 18 | -------------------------------------------------------------------------------- /PayTypeDemo/AppPay/AppPay.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppPay.m 3 | // LaundrySheet 4 | // 5 | // Created by 宇玄丶 on 2017/3/1. 6 | // Copyright © 2016年 北京116工作室. All rights reserved. 7 | // 8 | 9 | #import "AppPay.h" 10 | #import "WXPayCheckModel.h" 11 | //#import "OrderPayRequest.h" 12 | //#import "OrderPayViewController.h" 13 | //#import "PayResultViewController.h" 14 | 15 | @interface AppPay () 16 | //发起的支付请求接口,改成自己的 17 | //@property(nonatomic,strong)OrderPayRequest *orderPayRequest; 18 | @property(nonatomic,strong)NSString *orderId; 19 | @property(nonatomic,assign)NSInteger type; 20 | @property(nonatomic,copy)void(^payFinishBlock)(); 21 | @end 22 | 23 | @implementation AppPay 24 | 25 | + (instancetype)sharedInstance { 26 | static AppPay *sharedInstance; 27 | static dispatch_once_t once; 28 | dispatch_once(&once, ^{ 29 | sharedInstance = [[self alloc] init]; 30 | // [[NSNotificationCenter defaultCenter] addObserver:sharedInstance selector:@selector(applicationWillEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil]; 31 | }); 32 | return sharedInstance; 33 | } 34 | 35 | - (void)applicationWillEnterForeground:(NSNotification *)notification { 36 | 37 | } 38 | #pragma mark - 创建支付方式的方法 39 | - (void)payWithOrderId:(NSString *)orderId type:(NSInteger )type payFinishBlock:(void (^)())payFinishBlock { 40 | 41 | if (!orderId.length) { 42 | if (payFinishBlock) { 43 | payFinishBlock(); 44 | } 45 | return; 46 | } 47 | self.orderId = orderId; 48 | self.type = type; 49 | self.payFinishBlock = payFinishBlock; 50 | 51 | // 发起的支付请求接口,改成自己的 52 | // 如果想了解我使用的框架,请点击这里 53 | // 简书: http://www.jianshu.com/p/cef11a65e01a 54 | // Github:https://github.com/Baiyongyu/iOS-AFNetworking-.git 55 | 56 | // [self.orderPayRequest loadDataWithHUDOnView:mainWindow()]; 57 | } 58 | 59 | #pragma mark - 发起请求需要上传的参数 60 | 61 | #pragma mark - APIManagerParamSourceDelegate 62 | //- (NSDictionary *)paramsForApi:(BaseAPIRequest *)request { 63 | // if (request == self.orderPayRequest) { 64 | 65 | // 再Controller里面已经说过:我这个项目的接口需要请求的参数是orderid,还有请求方式type,根据自己的需求修改即可。 66 | // return @{@"order_id":self.orderId, 67 | // @"type":@(self.type)}; 68 | // } 69 | // return nil; 70 | //} 71 | 72 | #pragma mark - 发起请求 成功之后的回调, 因为要调起微信或者支付宝,需要在请求成功之后再做处理 73 | 74 | /* 75 | #pragma mark - APIManagerApiCallBackDelegate 76 | - (void)managerCallAPIDidSuccess:(BaseAPIRequest *)request { 77 | if (request==self.orderPayRequest) { 78 | if (self.type == 1) { 79 | 80 | 81 | // 这是方式1:所以判断当type为1的时候支付方式是支付宝支付 82 | 83 | // 此处为发起请求之后接口返回的数据,(一个对象), 84 | WXPayCheckModel *PayData = [request.responseData valueForKey:@"data"]; 85 | 86 | 87 | // 此处为调起支付宝支付的单例。 88 | 89 | // PayData.sign: 此处为sign签名,就是支付宝那一大堆的参数拼接,因为后台处理好了,就免去了前端的操作,这里这需要写上后台返回好的数据即可。 90 | // fromScheme: 这里就是在info.plist里面设置的URLScheme:随便设置,只要一致就好了。 91 | 92 | 93 | // 注意:如果后台返回的不是拼接好的,那么久需要自己去拼接了,就是文档那一大坨,搬过来就行。 94 | 95 | 96 | [[AlipaySDK defaultService] payOrder:PayData.sign fromScheme:@"alisdkpaywokao" callback:^(NSDictionary *resultDic) { 97 | NSLog(@"reslut = %@",resultDic); 98 | 99 | // 接下来就是对支付成功、失败的操作处理了。 100 | NSInteger orderState = [resultDic[@"resultStatus"] intValue]; 101 | if (orderState == 9000) { 102 | [self handelPayResult:YES desp:nil]; 103 | 104 | }else{ 105 | NSString *returnStr; 106 | switch (orderState) { 107 | case 8000: 108 | returnStr = @"订单正在处理中"; 109 | break; 110 | case 4000: 111 | { 112 | returnStr = @"订单支付失败"; 113 | [self handelPayResult:NO desp:returnStr]; 114 | break; 115 | } 116 | case 6001: 117 | returnStr = @"订单取消"; 118 | break; 119 | case 6002: 120 | returnStr = @"网络连接出错"; 121 | break; 122 | default: 123 | break; 124 | } 125 | // [MBProgressHUD showMsgHUD:returnStr duration:1.0f]; 126 | } 127 | 128 | 129 | }]; 130 | 131 | } 132 | else if (self.type == 2) { 133 | // 此处为发起请求之后接口返回的数据,(一个对象), 134 | WXPayCheckModel *PayData = [request.responseData valueForKey:@"data"]; 135 | 136 | // 将这些数据赋值给微信支付需要传的那几个(143行的方法) 137 | [self wxPay:PayData]; 138 | } 139 | } 140 | } 141 | 142 | */ 143 | 144 | //- (void)managerCallAPIDidFailed:(BaseAPIRequest *)request { 145 | // [MBProgressHUD showMsgHUD:@"支付失败"]; 146 | //发起支付请求失败的操作 147 | // OrderPayViewController *payVC = [[OrderPayViewController alloc] init]; 148 | // [AppCommon pushViewController:payVC animated:NO]; 149 | //} 150 | 151 | 152 | #pragma mark - 微信支付 153 | //- (void)wxPay:(WXPayCheckModel *)prepayData { 154 | // PayReq *request = [[PayReq alloc] init]; 155 | // request.partnerId = prepayData.partnerid; 156 | // request.prepayId = prepayData.prepayid; 157 | // request.package = prepayData.package; 158 | // request.nonceStr = prepayData.noncestr; 159 | // request.timeStamp = (UInt32)[prepayData.timestamp integerValue]; 160 | // request.sign = prepayData.sign; 161 | // 162 | // [WXApi sendReq:request]; 163 | //} 164 | 165 | #pragma mark - 集成微信sdk需要的东西 166 | //- (void)onResp:(BaseResp*)resp { 167 | // if ([resp isKindOfClass:[PayResp class]]) { 168 | // PayResp *response = (PayResp *)resp; 169 | // switch(response.errCode){ 170 | // case WXSuccess: 171 | // //服务器端查询支付通知或查询API返回的结果再提示成功 172 | // NSLog(@"支付成功"); 173 | // [self handelPayResult:YES desp:nil]; 174 | // break; 175 | // case WXErrCodeUserCancel: 176 | //// [MBProgressHUD showMsgHUD:@"取消支付" duration:1.0f]; 177 | // break; 178 | // default: 179 | // NSLog(@"支付失败,retcode=%d",resp.errCode); 180 | // [self handelPayResult:NO desp:resp.errStr]; 181 | // break; 182 | // } 183 | // } 184 | //} 185 | 186 | #pragma mark - 支付成功失败之后弹出的界面 187 | - (void)handelPayResult:(BOOL)success desp:(NSString *)desp { 188 | if (!success) { 189 | // PayResultViewController *resultVC = [[PayResultViewController alloc] initWithPayType:kPayDailed order_id:self.orderId]; 190 | // [AppCommon pushViewController:resultVC animated:YES]; 191 | }else { 192 | // PayResultViewController *resultVC = [[PayResultViewController alloc] initWithPayType:kPaySuccess order_id:self.orderId]; 193 | // [AppCommon pushViewController:resultVC animated:YES]; 194 | } 195 | } 196 | 197 | #pragma mark - 实例化请求方法(这个是个人的网络请求,与demo无关) 198 | //- (OrderPayRequest *)orderPayRequest { 199 | // if (!_orderPayRequest) { 200 | // _orderPayRequest = [[OrderPayRequest alloc] initWithDelegate:self paramSource:self]; 201 | // } 202 | // return _orderPayRequest; 203 | //} 204 | 205 | @end 206 | -------------------------------------------------------------------------------- /PayTypeDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /PayTypeDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /PayTypeDemo/Assets.xcassets/ic_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ic_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ic_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PayTypeDemo/Assets.xcassets/ic_selected.imageset/ic_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baiyongyu/PayTypeDemo/a8f194af7b24e3fef283d93d96cd512e88855ea1/PayTypeDemo/Assets.xcassets/ic_selected.imageset/ic_selected@2x.png -------------------------------------------------------------------------------- /PayTypeDemo/Assets.xcassets/ic_selected.imageset/ic_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baiyongyu/PayTypeDemo/a8f194af7b24e3fef283d93d96cd512e88855ea1/PayTypeDemo/Assets.xcassets/ic_selected.imageset/ic_selected@3x.png -------------------------------------------------------------------------------- /PayTypeDemo/Assets.xcassets/ic_unselected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ic_unselected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ic_unselected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PayTypeDemo/Assets.xcassets/ic_unselected.imageset/ic_unselected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baiyongyu/PayTypeDemo/a8f194af7b24e3fef283d93d96cd512e88855ea1/PayTypeDemo/Assets.xcassets/ic_unselected.imageset/ic_unselected@2x.png -------------------------------------------------------------------------------- /PayTypeDemo/Assets.xcassets/ic_unselected.imageset/ic_unselected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Baiyongyu/PayTypeDemo/a8f194af7b24e3fef283d93d96cd512e88855ea1/PayTypeDemo/Assets.xcassets/ic_unselected.imageset/ic_unselected@3x.png -------------------------------------------------------------------------------- /PayTypeDemo/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 | -------------------------------------------------------------------------------- /PayTypeDemo/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 | -------------------------------------------------------------------------------- /PayTypeDemo/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 | alisdkpay 26 | CFBundleURLSchemes 27 | 28 | alisdkpayfuck 29 | 30 | 31 | 32 | CFBundleVersion 33 | 1 34 | LSRequiresIPhoneOS 35 | 36 | NSAppTransportSecurity 37 | 38 | NSAllowsArbitraryLoads 39 | 40 | 41 | UILaunchStoryboardName 42 | LaunchScreen 43 | UIMainStoryboardFile 44 | Main 45 | UIRequiredDeviceCapabilities 46 | 47 | armv7 48 | 49 | UISupportedInterfaceOrientations 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /PayTypeDemo/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // PayTypeDemo 4 | // 5 | // Created by 宇玄丶 on 2017/4/20. 6 | // Copyright © 2017年 北京116科技有限公司. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | 15 | #import 16 | #import 17 | 18 | #endif /* PrefixHeader_pch */ 19 | -------------------------------------------------------------------------------- /PayTypeDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // PayTypeDemo 4 | // 5 | // Created by 宇玄丶 on 2017/4/20. 6 | // Copyright © 2017年 北京116科技有限公司. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /PayTypeDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // PayTypeDemo 4 | // 5 | // Created by 宇玄丶 on 2017/4/20. 6 | // Copyright © 2017年 北京116科技有限公司. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "AppPay.h" 11 | 12 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 13 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 14 | 15 | @interface ViewController () 16 | @property(nonatomic,strong)UITableView *tableView; 17 | @property(nonatomic,copy)NSArray *titleArray; 18 | @property(nonatomic,assign)NSInteger selectedPaymentIndex; 19 | @property(nonatomic,strong)UIView *bottomBar; 20 | @property(nonatomic,strong)UIButton *confirmPayBtn; 21 | @property(nonatomic,copy)NSString *order_id; 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | // Do any additional setup after loading the view, typically from a nib. 29 | 30 | [self.view addSubview:self.tableView]; 31 | 32 | 33 | UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 80)]; 34 | 35 | UIButton *confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 36 | confirmBtn.frame = CGRectMake(20, 20, SCREEN_WIDTH - 40, 44); 37 | [confirmBtn setTitle:@"确认支付" forState:UIControlStateNormal]; 38 | [confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 39 | confirmBtn.titleLabel.font = [UIFont systemFontOfSize:14]; 40 | confirmBtn.backgroundColor = [UIColor redColor]; 41 | confirmBtn.layer.cornerRadius = 5; 42 | confirmBtn.clipsToBounds = YES; 43 | [confirmBtn addTarget:self action:@selector(confirmPayBtnAction) forControlEvents:UIControlEventTouchUpInside]; 44 | [footerView addSubview:confirmBtn]; 45 | 46 | self.tableView.tableFooterView = footerView; 47 | 48 | 49 | [self loadData]; 50 | 51 | } 52 | 53 | - (void)loadData { 54 | self.titleArray = @[@"支付宝",@"微信"]; 55 | } 56 | 57 | #pragma mark - UITableViewDataSource 58 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 59 | return 2; 60 | } 61 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 62 | if (section==0) { 63 | return 1; 64 | } 65 | return 2; 66 | } 67 | 68 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 69 | NSString *identifier = [NSString stringWithFormat:@"OrderPayCell%ld%ld", indexPath.section,indexPath.row]; 70 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; 71 | 72 | if (indexPath.section==0) { 73 | if (!cell) { 74 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; 75 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 76 | cell.backgroundColor = [UIColor lightGrayColor]; 77 | cell.textLabel.font = [UIFont systemFontOfSize:14]; 78 | } 79 | cell.textLabel.text = @"请选择支付方式:"; 80 | } 81 | else if (indexPath.section==1) { 82 | if (!cell) { 83 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; 84 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 85 | cell.textLabel.font = [UIFont systemFontOfSize:14]; 86 | UIButton *selectedBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 87 | [selectedBtn setImage:[UIImage imageNamed:@"ic_unselected"] forState:UIControlStateNormal]; 88 | [selectedBtn setImage:[UIImage imageNamed:@"ic_selected"] forState:UIControlStateSelected]; 89 | selectedBtn.tag = 100; 90 | selectedBtn.userInteractionEnabled = NO; 91 | [cell.contentView addSubview:selectedBtn]; 92 | selectedBtn.frame = CGRectMake(0, 0, SCREEN_WIDTH - 10, 44); 93 | 94 | } 95 | cell.textLabel.text = self.titleArray[indexPath.row]; 96 | UIButton *selectedBtn = [cell.contentView viewWithTag:100]; 97 | selectedBtn.selected = indexPath.row==self.selectedPaymentIndex; 98 | } 99 | return cell; 100 | } 101 | 102 | #pragma mark - UITableViewDelegate 103 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 104 | if (indexPath.section==0) { 105 | return 44; 106 | } 107 | return 54; 108 | } 109 | 110 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 111 | return 0.01; 112 | } 113 | 114 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { 115 | return 0.01; 116 | } 117 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 118 | if (indexPath.section==1) { 119 | NSLog(@"%ld",(long)self.selectedPaymentIndex); 120 | self.selectedPaymentIndex = indexPath.row; 121 | [tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone]; 122 | } 123 | } 124 | 125 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ 126 | if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { 127 | [cell setSeparatorInset:UIEdgeInsetsZero]; 128 | } 129 | if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { 130 | [cell setLayoutMargins:UIEdgeInsetsZero]; 131 | } 132 | } 133 | 134 | 135 | - (void)confirmPayBtnAction { 136 | /** 137 | order_id : 一般在做支付的情况下都是传一个order_id 138 | type : 如图所示,有两种常用的支付方式,"微信支付"、"支付宝支付",因为接口给的是上传的参数需要type,所以这么写的,根据自己需求改一改即可。 139 | */ 140 | [[AppPay sharedInstance] payWithOrderId:self.order_id type:self.selectedPaymentIndex+1 payFinishBlock:^{ 141 | NSLog(@"%ld",(long)self.selectedPaymentIndex+1); 142 | }]; 143 | } 144 | 145 | - (UITableView *)tableView { 146 | if (!_tableView) { 147 | _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain]; 148 | _tableView.backgroundColor = [UIColor lightGrayColor]; 149 | _tableView.delegate = self; 150 | _tableView.dataSource = self; 151 | _tableView.showsVerticalScrollIndicator = NO; 152 | } 153 | return _tableView; 154 | } 155 | 156 | 157 | 158 | - (void)didReceiveMemoryWarning { 159 | [super didReceiveMemoryWarning]; 160 | // Dispose of any resources that can be recreated. 161 | } 162 | 163 | 164 | @end 165 | -------------------------------------------------------------------------------- /PayTypeDemo/WXPayCheckModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXPayCheckModel.h 3 | // LaundrySheet 4 | // 5 | // Created by 宇玄丶 on 2017/3/1. 6 | // Copyright © 2016年 北京116工作室. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WXPayCheckModel : NSObject 12 | //应用ID 13 | @property(nonatomic,copy)NSString *appid; 14 | //随机字符串 15 | @property(nonatomic,copy)NSString *noncestr; 16 | //扩展字段 17 | @property(nonatomic,copy)NSString *package; 18 | //商户号 19 | @property(nonatomic,copy)NSString *partnerid; 20 | //预支付交易会话ID 21 | @property(nonatomic,copy)NSString *prepayid; 22 | //签名 23 | @property(nonatomic,copy)NSString *sign; 24 | //时间戳 25 | @property(nonatomic,copy)NSString *timestamp; 26 | 27 | //支付方式 28 | @property(nonatomic,copy)NSString *payMothed; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /PayTypeDemo/WXPayCheckModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXPayCheckModel.m 3 | // LaundrySheet 4 | // 5 | // Created by 宇玄丶 on 2017/3/1. 6 | // Copyright © 2016年 北京116工作室. All rights reserved. 7 | // 8 | 9 | #import "WXPayCheckModel.h" 10 | 11 | @implementation WXPayCheckModel 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /PayTypeDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PayTypeDemo 4 | // 5 | // Created by 宇玄丶 on 2017/4/20. 6 | // Copyright © 2017年 北京116科技有限公司. 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 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform:ios,'8.0' 2 | target 'PayTypeDemo' do 3 | 4 | 5 | end 6 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODFILE CHECKSUM: ec57f63f08841d1dbab481a4ef1b4c7fac066ef2 2 | 3 | COCOAPODS: 1.0.1 4 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODFILE CHECKSUM: ec57f63f08841d1dbab481a4ef1b4c7fac066ef2 2 | 3 | COCOAPODS: 1.0.1 4 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | archiveVersion 6 | 1 7 | classes 8 | 9 | objectVersion 10 | 46 11 | objects 12 | 13 | 00CD7696AF4F65A2B060450F428A659B 14 | 15 | children 16 | 17 | A45616755DFA4E8F68C8C516D847477A 18 | 4540325D22B84D306ACAD7388FE6E832 19 | FC4D12081B5F58FE5F51CC07C1D5BF99 20 | 6299671166CFAA91B83DBF9F18A8C47C 21 | B6B5EAE8A839D56CADC4D0C4B13DEAA8 22 | 2D9EB6511A8C4DEA0BBA91640BA26E5E 23 | BCA2AD49F2B8F06F3A9B5B688AC2F3EA 24 | 25 | isa 26 | PBXGroup 27 | name 28 | Pods-PayTypeDemo 29 | path 30 | Target Support Files/Pods-PayTypeDemo 31 | sourceTree 32 | <group> 33 | 34 | 0436F71CD8048D8BFE941553FF97DFCE 35 | 36 | buildConfigurationList 37 | 0CF07C341E8FADACF28A78791C7F65D3 38 | buildPhases 39 | 40 | 08977B4EC2B08228FA36C8C36908FC45 41 | BDED13B26DAB22ADCF664844DE260C65 42 | 43 | buildRules 44 | 45 | dependencies 46 | 47 | isa 48 | PBXNativeTarget 49 | name 50 | Pods-PayTypeDemo 51 | productName 52 | Pods-PayTypeDemo 53 | productReference 54 | 229B1B5ED48B5489CB5D7C5E442A74DD 55 | productType 56 | com.apple.product-type.library.static 57 | 58 | 08977B4EC2B08228FA36C8C36908FC45 59 | 60 | buildActionMask 61 | 2147483647 62 | files 63 | 64 | 31F8923CEA90DB5A9E49F947391B10CB 65 | 66 | isa 67 | PBXSourcesBuildPhase 68 | runOnlyForDeploymentPostprocessing 69 | 0 70 | 71 | 0C5E5570E9184734069931D815D5DD2C 72 | 73 | children 74 | 75 | 229B1B5ED48B5489CB5D7C5E442A74DD 76 | 77 | isa 78 | PBXGroup 79 | name 80 | Products 81 | sourceTree 82 | <group> 83 | 84 | 0CF07C341E8FADACF28A78791C7F65D3 85 | 86 | buildConfigurations 87 | 88 | E0BF0F69B686D5E21D74C62062210A91 89 | 6B305FE8CE042FF1E43E1FE9AB90802D 90 | 91 | defaultConfigurationIsVisible 92 | 0 93 | defaultConfigurationName 94 | Release 95 | isa 96 | XCConfigurationList 97 | 98 | 229B1B5ED48B5489CB5D7C5E442A74DD 99 | 100 | explicitFileType 101 | archive.ar 102 | includeInIndex 103 | 0 104 | isa 105 | PBXFileReference 106 | name 107 | libPods-PayTypeDemo.a 108 | path 109 | libPods-PayTypeDemo.a 110 | sourceTree 111 | BUILT_PRODUCTS_DIR 112 | 113 | 2D8E8EC45A3A1A1D94AE762CB5028504 114 | 115 | buildConfigurations 116 | 117 | 47BEF9D903506B003EA5C2B249729489 118 | AAF678CED40D3499169D10F63CA0719E 119 | 120 | defaultConfigurationIsVisible 121 | 0 122 | defaultConfigurationName 123 | Release 124 | isa 125 | XCConfigurationList 126 | 127 | 2D9EB6511A8C4DEA0BBA91640BA26E5E 128 | 129 | includeInIndex 130 | 1 131 | isa 132 | PBXFileReference 133 | lastKnownFileType 134 | text.xcconfig 135 | path 136 | Pods-PayTypeDemo.debug.xcconfig 137 | sourceTree 138 | <group> 139 | 140 | 31F8923CEA90DB5A9E49F947391B10CB 141 | 142 | fileRef 143 | FC4D12081B5F58FE5F51CC07C1D5BF99 144 | isa 145 | PBXBuildFile 146 | 147 | 3DCAB2B7CDE207B3958B6CB957FCC758 148 | 149 | children 150 | 151 | CEC22C73C1608DFA5D5D78BDCB218219 152 | 153 | isa 154 | PBXGroup 155 | name 156 | iOS 157 | sourceTree 158 | <group> 159 | 160 | 4540325D22B84D306ACAD7388FE6E832 161 | 162 | includeInIndex 163 | 1 164 | isa 165 | PBXFileReference 166 | lastKnownFileType 167 | text.plist.xml 168 | path 169 | Pods-PayTypeDemo-acknowledgements.plist 170 | sourceTree 171 | <group> 172 | 173 | 47BEF9D903506B003EA5C2B249729489 174 | 175 | buildSettings 176 | 177 | ALWAYS_SEARCH_USER_PATHS 178 | NO 179 | CLANG_ANALYZER_NONNULL 180 | YES 181 | CLANG_CXX_LANGUAGE_STANDARD 182 | gnu++0x 183 | CLANG_CXX_LIBRARY 184 | libc++ 185 | CLANG_ENABLE_MODULES 186 | YES 187 | CLANG_ENABLE_OBJC_ARC 188 | YES 189 | CLANG_WARN_BOOL_CONVERSION 190 | YES 191 | CLANG_WARN_CONSTANT_CONVERSION 192 | YES 193 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 194 | YES 195 | CLANG_WARN_EMPTY_BODY 196 | YES 197 | CLANG_WARN_ENUM_CONVERSION 198 | YES 199 | CLANG_WARN_INT_CONVERSION 200 | YES 201 | CLANG_WARN_OBJC_ROOT_CLASS 202 | YES 203 | CLANG_WARN_UNREACHABLE_CODE 204 | YES 205 | CLANG_WARN__DUPLICATE_METHOD_MATCH 206 | YES 207 | COPY_PHASE_STRIP 208 | NO 209 | ENABLE_TESTABILITY 210 | YES 211 | GCC_C_LANGUAGE_STANDARD 212 | gnu99 213 | GCC_DYNAMIC_NO_PIC 214 | NO 215 | GCC_OPTIMIZATION_LEVEL 216 | 0 217 | GCC_PREPROCESSOR_DEFINITIONS 218 | 219 | POD_CONFIGURATION_DEBUG=1 220 | DEBUG=1 221 | $(inherited) 222 | 223 | GCC_SYMBOLS_PRIVATE_EXTERN 224 | NO 225 | GCC_WARN_64_TO_32_BIT_CONVERSION 226 | YES 227 | GCC_WARN_ABOUT_RETURN_TYPE 228 | YES 229 | GCC_WARN_UNDECLARED_SELECTOR 230 | YES 231 | GCC_WARN_UNINITIALIZED_AUTOS 232 | YES 233 | GCC_WARN_UNUSED_FUNCTION 234 | YES 235 | GCC_WARN_UNUSED_VARIABLE 236 | YES 237 | IPHONEOS_DEPLOYMENT_TARGET 238 | 8.0 239 | ONLY_ACTIVE_ARCH 240 | YES 241 | STRIP_INSTALLED_PRODUCT 242 | NO 243 | SYMROOT 244 | ${SRCROOT}/../build 245 | 246 | isa 247 | XCBuildConfiguration 248 | name 249 | Debug 250 | 251 | 6299671166CFAA91B83DBF9F18A8C47C 252 | 253 | includeInIndex 254 | 1 255 | isa 256 | PBXFileReference 257 | lastKnownFileType 258 | text.script.sh 259 | path 260 | Pods-PayTypeDemo-frameworks.sh 261 | sourceTree 262 | <group> 263 | 264 | 6B305FE8CE042FF1E43E1FE9AB90802D 265 | 266 | baseConfigurationReference 267 | BCA2AD49F2B8F06F3A9B5B688AC2F3EA 268 | buildSettings 269 | 270 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 271 | iPhone Developer 272 | DEBUG_INFORMATION_FORMAT 273 | dwarf-with-dsym 274 | ENABLE_STRICT_OBJC_MSGSEND 275 | YES 276 | GCC_NO_COMMON_BLOCKS 277 | YES 278 | IPHONEOS_DEPLOYMENT_TARGET 279 | 8.0 280 | MACH_O_TYPE 281 | staticlib 282 | MTL_ENABLE_DEBUG_INFO 283 | NO 284 | OTHER_LDFLAGS 285 | 286 | OTHER_LIBTOOLFLAGS 287 | 288 | PODS_ROOT 289 | $(SRCROOT) 290 | PRODUCT_BUNDLE_IDENTIFIER 291 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 292 | PRODUCT_NAME 293 | $(TARGET_NAME) 294 | SDKROOT 295 | iphoneos 296 | SKIP_INSTALL 297 | YES 298 | 299 | isa 300 | XCBuildConfiguration 301 | name 302 | Release 303 | 304 | 7DB346D0F39D3F0E887471402A8071AB 305 | 306 | children 307 | 308 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 309 | BC3CA7F9E30CC8F7E2DD044DD34432FC 310 | 0C5E5570E9184734069931D815D5DD2C 311 | DAB3024ED751A7729168D29471915014 312 | 313 | isa 314 | PBXGroup 315 | sourceTree 316 | <group> 317 | 318 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 319 | 320 | explicitFileType 321 | text.script.ruby 322 | includeInIndex 323 | 1 324 | isa 325 | PBXFileReference 326 | lastKnownFileType 327 | text 328 | name 329 | Podfile 330 | path 331 | ../Podfile 332 | sourceTree 333 | SOURCE_ROOT 334 | xcLanguageSpecificationIdentifier 335 | xcode.lang.ruby 336 | 337 | A45616755DFA4E8F68C8C516D847477A 338 | 339 | includeInIndex 340 | 1 341 | isa 342 | PBXFileReference 343 | lastKnownFileType 344 | text 345 | path 346 | Pods-PayTypeDemo-acknowledgements.markdown 347 | sourceTree 348 | <group> 349 | 350 | AAF678CED40D3499169D10F63CA0719E 351 | 352 | buildSettings 353 | 354 | ALWAYS_SEARCH_USER_PATHS 355 | NO 356 | CLANG_ANALYZER_NONNULL 357 | YES 358 | CLANG_CXX_LANGUAGE_STANDARD 359 | gnu++0x 360 | CLANG_CXX_LIBRARY 361 | libc++ 362 | CLANG_ENABLE_MODULES 363 | YES 364 | CLANG_ENABLE_OBJC_ARC 365 | YES 366 | CLANG_WARN_BOOL_CONVERSION 367 | YES 368 | CLANG_WARN_CONSTANT_CONVERSION 369 | YES 370 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 371 | YES 372 | CLANG_WARN_EMPTY_BODY 373 | YES 374 | CLANG_WARN_ENUM_CONVERSION 375 | YES 376 | CLANG_WARN_INT_CONVERSION 377 | YES 378 | CLANG_WARN_OBJC_ROOT_CLASS 379 | YES 380 | CLANG_WARN_UNREACHABLE_CODE 381 | YES 382 | CLANG_WARN__DUPLICATE_METHOD_MATCH 383 | YES 384 | COPY_PHASE_STRIP 385 | YES 386 | ENABLE_NS_ASSERTIONS 387 | NO 388 | GCC_C_LANGUAGE_STANDARD 389 | gnu99 390 | GCC_PREPROCESSOR_DEFINITIONS 391 | 392 | POD_CONFIGURATION_RELEASE=1 393 | $(inherited) 394 | 395 | GCC_WARN_64_TO_32_BIT_CONVERSION 396 | YES 397 | GCC_WARN_ABOUT_RETURN_TYPE 398 | YES 399 | GCC_WARN_UNDECLARED_SELECTOR 400 | YES 401 | GCC_WARN_UNINITIALIZED_AUTOS 402 | YES 403 | GCC_WARN_UNUSED_FUNCTION 404 | YES 405 | GCC_WARN_UNUSED_VARIABLE 406 | YES 407 | IPHONEOS_DEPLOYMENT_TARGET 408 | 8.0 409 | STRIP_INSTALLED_PRODUCT 410 | NO 411 | SYMROOT 412 | ${SRCROOT}/../build 413 | VALIDATE_PRODUCT 414 | YES 415 | 416 | isa 417 | XCBuildConfiguration 418 | name 419 | Release 420 | 421 | B6B5EAE8A839D56CADC4D0C4B13DEAA8 422 | 423 | includeInIndex 424 | 1 425 | isa 426 | PBXFileReference 427 | lastKnownFileType 428 | text.script.sh 429 | path 430 | Pods-PayTypeDemo-resources.sh 431 | sourceTree 432 | <group> 433 | 434 | BC3CA7F9E30CC8F7E2DD044DD34432FC 435 | 436 | children 437 | 438 | 3DCAB2B7CDE207B3958B6CB957FCC758 439 | 440 | isa 441 | PBXGroup 442 | name 443 | Frameworks 444 | sourceTree 445 | <group> 446 | 447 | BCA2AD49F2B8F06F3A9B5B688AC2F3EA 448 | 449 | includeInIndex 450 | 1 451 | isa 452 | PBXFileReference 453 | lastKnownFileType 454 | text.xcconfig 455 | path 456 | Pods-PayTypeDemo.release.xcconfig 457 | sourceTree 458 | <group> 459 | 460 | BDED13B26DAB22ADCF664844DE260C65 461 | 462 | buildActionMask 463 | 2147483647 464 | files 465 | 466 | BE1AE112EEB2A51186571D3464460BC0 467 | 468 | isa 469 | PBXFrameworksBuildPhase 470 | runOnlyForDeploymentPostprocessing 471 | 0 472 | 473 | BE1AE112EEB2A51186571D3464460BC0 474 | 475 | fileRef 476 | CEC22C73C1608DFA5D5D78BDCB218219 477 | isa 478 | PBXBuildFile 479 | 480 | CEC22C73C1608DFA5D5D78BDCB218219 481 | 482 | isa 483 | PBXFileReference 484 | lastKnownFileType 485 | wrapper.framework 486 | name 487 | Foundation.framework 488 | path 489 | Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework 490 | sourceTree 491 | DEVELOPER_DIR 492 | 493 | D41D8CD98F00B204E9800998ECF8427E 494 | 495 | attributes 496 | 497 | LastSwiftUpdateCheck 498 | 0730 499 | LastUpgradeCheck 500 | 0700 501 | 502 | buildConfigurationList 503 | 2D8E8EC45A3A1A1D94AE762CB5028504 504 | compatibilityVersion 505 | Xcode 3.2 506 | developmentRegion 507 | English 508 | hasScannedForEncodings 509 | 0 510 | isa 511 | PBXProject 512 | knownRegions 513 | 514 | en 515 | 516 | mainGroup 517 | 7DB346D0F39D3F0E887471402A8071AB 518 | productRefGroup 519 | 0C5E5570E9184734069931D815D5DD2C 520 | projectDirPath 521 | 522 | projectReferences 523 | 524 | projectRoot 525 | 526 | targets 527 | 528 | 0436F71CD8048D8BFE941553FF97DFCE 529 | 530 | 531 | DAB3024ED751A7729168D29471915014 532 | 533 | children 534 | 535 | 00CD7696AF4F65A2B060450F428A659B 536 | 537 | isa 538 | PBXGroup 539 | name 540 | Targets Support Files 541 | sourceTree 542 | <group> 543 | 544 | E0BF0F69B686D5E21D74C62062210A91 545 | 546 | baseConfigurationReference 547 | 2D9EB6511A8C4DEA0BBA91640BA26E5E 548 | buildSettings 549 | 550 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 551 | iPhone Developer 552 | DEBUG_INFORMATION_FORMAT 553 | dwarf 554 | ENABLE_STRICT_OBJC_MSGSEND 555 | YES 556 | GCC_NO_COMMON_BLOCKS 557 | YES 558 | IPHONEOS_DEPLOYMENT_TARGET 559 | 8.0 560 | MACH_O_TYPE 561 | staticlib 562 | MTL_ENABLE_DEBUG_INFO 563 | YES 564 | OTHER_LDFLAGS 565 | 566 | OTHER_LIBTOOLFLAGS 567 | 568 | PODS_ROOT 569 | $(SRCROOT) 570 | PRODUCT_BUNDLE_IDENTIFIER 571 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 572 | PRODUCT_NAME 573 | $(TARGET_NAME) 574 | SDKROOT 575 | iphoneos 576 | SKIP_INSTALL 577 | YES 578 | 579 | isa 580 | XCBuildConfiguration 581 | name 582 | Debug 583 | 584 | FC4D12081B5F58FE5F51CC07C1D5BF99 585 | 586 | includeInIndex 587 | 1 588 | isa 589 | PBXFileReference 590 | lastKnownFileType 591 | sourcecode.c.objc 592 | path 593 | Pods-PayTypeDemo-dummy.m 594 | sourceTree 595 | <group> 596 | 597 | 598 | rootObject 599 | D41D8CD98F00B204E9800998ECF8427E 600 | 601 | 602 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/byy5983.xcuserdatad/xcschemes/Pods-PayTypeDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/byy5983.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-PayTypeDemo.xcscheme 8 | 9 | isShown 10 | 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 0436F71CD8048D8BFE941553FF97DFCE 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_PayTypeDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_PayTypeDemo 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = $(inherited) -ObjC 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PayTypeDemo/Pods-PayTypeDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = $(inherited) -ObjC 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PayTypeDemo 2 | iOS-集成微信、支付宝支付工具类(使用起来超级简单) 3 | 4 | 在项目中,我们会经常用到微信支付或者支付宝支付,每次集成就显得麻烦了,所以、我封装了一个工具类,每次选择支付方式的时候只需要调用这个类就可以了。 5 | 效果如图所示: 6 | 7 | ![选择支付方式](http://upload-images.jianshu.io/upload_images/5684426-eaf28ad9ea1d6615.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 8 | 9 | 使用工具类的方法: 10 | ``` 11 | /** 12 | order_id : 一般在做支付的情况下都是传一个order_id 13 | type : 如图所示,有两种常用的支付方式,"微信支付"、"支付宝支付",因为接口给的是上传的参数需要type,所以这么写的,根据自己需求改一改即可。 14 | */ 15 | [[AppPay sharedInstance] payWithOrderId:self.order_id type:self.selectedPaymentIndex+1 payFinishBlock:^{ 16 | NSLog(@"%ld",(long)self.selectedPaymentIndex+1); 17 | }]; 18 | ``` 19 | 这样一来,就可以随时拿来用了,很方便。 20 | 21 | 下面来看看我是如何写的这个工具类: 22 | AppPay.h 23 | ``` 24 | #import 25 | // 导入微信、支付宝支付的头文件 26 | #import "WXApi.h" 27 | #import 28 | 29 | @interface AppPay : NSObject 30 | // 创建一个单例 31 | + (instancetype)sharedInstance; 32 | // 调用方法,传入order_id,支付方式type(可以根据自己的需求做改动) 33 | - (void)payWithOrderId:(NSString *)orderId type:(NSInteger )type payFinishBlock:(void (^)())payFinishBlock; 34 | @end 35 | ``` 36 |
37 | AppPay.m 38 | ``` 39 | @interface AppPay () 40 | //发起的支付请求接口,改成自己的 41 | //@property(nonatomic,strong)OrderPayRequest *orderPayRequest; 42 | @property(nonatomic,strong)NSString *orderId; 43 | @property(nonatomic,assign)NSInteger type; 44 | @property(nonatomic,copy)void(^payFinishBlock)(); 45 | @end 46 | ``` 47 | 48 | 单例 49 | ``` 50 | + (instancetype)sharedInstance { 51 | static AppPay *sharedInstance; 52 | static dispatch_once_t once; 53 | dispatch_once(&once, ^{ 54 | sharedInstance = [[self alloc] init]; 55 | // 在这里写了个通知,可以把支付成功、失败写在这里,或者看下文,总之,根据需求做修改。 56 | // [[NSNotificationCenter defaultCenter] addObserver:sharedInstance selector:@selector(applicationWillEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil]; 57 | }); 58 | return sharedInstance; 59 | } 60 | ``` 61 | pragma mark - 创建支付方式的方法 62 | ``` 63 | - (void)payWithOrderId:(NSString *)orderId type:(NSInteger )type payFinishBlock:(void (^)())payFinishBlock { 64 | 65 | if (!orderId.length) { 66 | if (payFinishBlock) { 67 | payFinishBlock(); 68 | } 69 | return; 70 | } 71 | self.orderId = orderId; 72 | self.type = type; 73 | self.payFinishBlock = payFinishBlock; 74 | 75 | // 发起的支付请求接口,改成自己的 76 | // 如果想了解我使用的框架,请点击这里 77 | // 简书: http://www.jianshu.com/p/cef11a65e01a 78 | // Github:[iOS-AFNetworking网络层封装设计方案](https://github.com/Baiyongyu/iOS-AFNetworking-.git) 79 | 80 | // [self.orderPayRequest loadDataWithHUDOnView:mainWindow()]; 81 | } 82 | ``` 83 | pragma mark - 发起请求需要上传的参数 84 | ``` 85 | #pragma mark - APIManagerParamSourceDelegate 86 | //- (NSDictionary *)paramsForApi:(BaseAPIRequest *)request { 87 | // if (request == self.orderPayRequest) { 88 | 89 | // 再Controller里面已经说过:我这个项目的接口需要请求的参数是orderid,还有请求方式type,根据自己的需求修改即可。 90 | // return @{@"order_id":self.orderId, 91 | // @"type":@(self.type)}; 92 | // } 93 | // return nil; 94 | //} 95 | ``` 96 | pragma mark - 发起请求 成功之后的回调, 因为要调起微信或者支付宝,需要在请求成功之后再做处理 97 | ``` 98 | #pragma mark - APIManagerApiCallBackDelegate 99 | - (void)managerCallAPIDidSuccess:(BaseAPIRequest *)request { 100 | if (request==self.orderPayRequest) { 101 | if (self.type == 1) { 102 | 103 | // 这是方式1:所以判断当type为1的时候支付方式是支付宝支付 104 | 105 | // 此处为发起请求之后接口返回的数据,(一个对象), 106 | WXPayCheckModel *PayData = [request.responseData valueForKey:@"data"]; 107 | 108 | 109 | // 此处为调起支付宝支付的单例。 110 | 111 | // PayData.sign: 此处为sign签名,就是支付宝那一大堆的参数拼接,因为后台处理好了,就免去了前端的操作,这里只需要写上后台返回好的数据即可。 112 | // fromScheme: 这里就是在info.plist里面设置的URLScheme:随便设置,只要一致就好了。 113 | 114 | // 注意:如果后台返回的不是拼接好的,那么久需要自己去拼接了,就是文档那一大坨,搬过来就行。 115 | 116 | [[AlipaySDK defaultService] payOrder:PayData.sign fromScheme:@"alisdkpayfuck" callback:^(NSDictionary *resultDic) { 117 | NSLog(@"reslut = %@",resultDic); 118 | 119 | // 接下来就是对支付之后的状态的操作处理了。 120 | NSInteger orderState = [resultDic[@"resultStatus"] intValue]; 121 | if (orderState == 9000) { // 支付成功 122 | [self handelPayResult:YES desp:nil]; 123 | 124 | }else{ 125 | NSString *returnStr; 126 | switch (orderState) { 127 | case 8000: 128 | returnStr = @"订单正在处理中"; 129 | break; 130 | case 4000: 131 | { 132 | returnStr = @"订单支付失败"; 133 | [self handelPayResult:NO desp:returnStr]; 134 | break; 135 | } 136 | case 6001: 137 | returnStr = @"订单取消"; 138 | break; 139 | case 6002: 140 | returnStr = @"网络连接出错"; 141 | break; 142 | default: 143 | break; 144 | } 145 | // [MBProgressHUD showMsgHUD:returnStr duration:1.0f]; 146 | } 147 | }]; 148 | } 149 | else if (self.type == 2) { 150 | // 这是方式2:所以判断当type为2的时候支付方式是微信支付 151 | // 此处为发起请求之后接口返回的数据,(一个对象), 152 | WXPayCheckModel *PayData = [request.responseData valueForKey:@"data"]; 153 | 154 | // 将这些数据赋值给微信支付需要传的那几个(集成微信支付需要的赋值操作) 155 | [self wxPay:PayData]; 156 | } 157 | } 158 | } 159 | ``` 160 | pragma mark - 发起支付请求失败的操作 161 | ``` 162 | - (void)managerCallAPIDidFailed:(BaseAPIRequest *)request { 163 | [MBProgressHUD showMsgHUD:@"支付失败"]; 164 | 165 | OrderPayViewController *payVC = [[OrderPayViewController alloc] init]; 166 | [AppCommon pushViewController:payVC animated:NO]; 167 | } 168 | ``` 169 | #pragma mark - 集成微信SDK需要的东西(也是上文中提到需要赋值的操作) 170 | ``` 171 | #pragma mark - 微信支付 172 | - (void)wxPay:(WXPayCheckModel *)prepayData { 173 | PayReq *request = [[PayReq alloc] init]; 174 | request.partnerId = prepayData.partnerid; 175 | request.prepayId = prepayData.prepayid; 176 | request.package = prepayData.package; 177 | request.nonceStr = prepayData.noncestr; 178 | request.timeStamp = (UInt32)[prepayData.timestamp integerValue]; 179 | request.sign = prepayData.sign; 180 | 181 | [WXApi sendReq:request]; 182 | } 183 | 184 | #pragma mark - 集成微信sdk需要的东西 185 | - (void)onResp:(BaseResp*)resp { 186 | if ([resp isKindOfClass:[PayResp class]]) { 187 | PayResp *response = (PayResp *)resp; 188 | switch(response.errCode){ 189 | case WXSuccess: 190 | //服务器端查询支付通知或查询API返回的结果再提示成功 191 | NSLog(@"支付成功"); 192 | [self handelPayResult:YES desp:nil]; 193 | break; 194 | case WXErrCodeUserCancel: 195 | // [MBProgressHUD showMsgHUD:@"取消支付" duration:1.0f]; 196 | break; 197 | default: 198 | NSLog(@"支付失败,retcode=%d",resp.errCode); 199 | [self handelPayResult:NO desp:resp.errStr]; 200 | break; 201 | } 202 | } 203 | } 204 | ``` 205 | pragma mark - 支付成功失败之后弹出的界面 206 | ``` 207 | - (void)handelPayResult:(BOOL)success desp:(NSString *)desp { 208 | if (!success) { 209 | // PayResultViewController *resultVC = [[PayResultViewController alloc] initWithPayType:kPayDailed order_id:self.orderId]; 210 | // [AppCommon pushViewController:resultVC animated:YES]; 211 | }else { 212 | // PayResultViewController *resultVC = [[PayResultViewController alloc] initWithPayType:kPaySuccess order_id:self.orderId]; 213 | // [AppCommon pushViewController:resultVC animated:YES]; 214 | } 215 | } 216 | ``` 217 | pragma mark - 实例化请求方法(这个是个人的网络请求,与demo无关) 218 | ``` 219 | //- (OrderPayRequest *)orderPayRequest { 220 | // if (!_orderPayRequest) { 221 | // _orderPayRequest = [[OrderPayRequest alloc] initWithDelegate:self paramSource:self]; 222 | // } 223 | // return _orderPayRequest; 224 | //} 225 | ``` 226 | 227 | 到此这个工具类就实现了,没有太难的地方,只是简单的封装了起来,有不对,不好的地方欢迎各位大神提出指正。喜欢的小伙伴记得给个Star啊^_^ 228 | 代码:https://github.com/Baiyongyu/PayTypeDemo.git 229 | --------------------------------------------------------------------------------