├── .gitignore ├── .travis.yml ├── Example ├── ICPaySDK.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── ICPaySDK-Example.xcscheme ├── ICPaySDK.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── ICPaySDK │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── ICAppDelegate.h │ ├── ICAppDelegate.m │ ├── ICCircleTestViewController.h │ ├── ICCircleTestViewController.m │ ├── ICCircleTestViewController.xib │ ├── ICPayImp │ │ ├── AliModel.h │ │ ├── AliModel.m │ │ ├── ICPayUtils.h │ │ ├── ICPayUtils.m │ │ ├── WxModel.h │ │ └── WxModel.m │ ├── ICPaySDK-Info.plist │ ├── ICPaySDK-Prefix.pch │ ├── ICPaySDKService.h │ ├── ICPaySDKService.m │ ├── ICViewController.h │ ├── ICViewController.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── ICPaySDK.podspec ├── ICPaySDK ├── Base │ ├── ICBaseParamsModel.h │ ├── ICBaseParamsModel.m │ ├── ICBasePayEntry.h │ ├── ICBasePayEntry.m │ ├── ICMacros.h │ ├── ICPayDesignManager.h │ ├── ICPayDesignManager.m │ ├── ICPaySDK.h │ └── Protocol │ │ ├── ICIAliModel.h │ │ ├── ICIWxModel.h │ │ └── ICPaySDKAutoServiceProtocol.h ├── ICAliPay │ ├── ICAliPayEntry.h │ ├── ICAliPayEntry.m │ ├── ICAliPayModel.h │ └── ICAliPayModel.m └── ICWxPay │ ├── ICWxPayEntry.h │ ├── ICWxPayEntry.m │ ├── ICWxPayModel.h │ └── ICWxPayModel.m ├── LICENSE ├── README.md └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/ICPaySDK.xcworkspace -scheme ICPaySDK-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/ICPaySDK.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 04523E352002FFC800398C33 /* ICPayUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 04523E342002FFC800398C33 /* ICPayUtils.m */; }; 11 | 04FA91881FF63FD400D4920A /* ICCircleTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FA91861FF63FD400D4920A /* ICCircleTestViewController.m */; }; 12 | 04FA91891FF63FD400D4920A /* ICCircleTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04FA91871FF63FD400D4920A /* ICCircleTestViewController.xib */; }; 13 | 04FBC6681FE8E9590079711F /* AliModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FBC6641FE8E9580079711F /* AliModel.m */; }; 14 | 04FBC6691FE8E9590079711F /* WxModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FBC6651FE8E9590079711F /* WxModel.m */; }; 15 | 485E620E20ECFD0000FFB253 /* ICPaySDKService.m in Sources */ = {isa = PBXBuildFile; fileRef = 485E620D20ECFD0000FFB253 /* ICPaySDKService.m */; }; 16 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 17 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 18 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 19 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 20 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 21 | 6003F59E195388D20070C39A /* ICAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* ICAppDelegate.m */; }; 22 | 6003F5A7195388D20070C39A /* ICViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* ICViewController.m */; }; 23 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 24 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 25 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 26 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 27 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 28 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 29 | 6B51E7447E587175813A4675 /* libPods-ICPaySDK_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AB663C6365BF8AFC174DB5C /* libPods-ICPaySDK_Example.a */; }; 30 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 31 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 32 | AC730F2B77B305D20F63D4A5 /* libPods-ICPaySDK_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1035F6ED96829435722AFC0D /* libPods-ICPaySDK_Tests.a */; }; 33 | /* End PBXBuildFile section */ 34 | 35 | /* Begin PBXContainerItemProxy section */ 36 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = 6003F582195388D10070C39A /* Project object */; 39 | proxyType = 1; 40 | remoteGlobalIDString = 6003F589195388D20070C39A; 41 | remoteInfo = ICPaySDK; 42 | }; 43 | /* End PBXContainerItemProxy section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 04523E332002FFC800398C33 /* ICPayUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ICPayUtils.h; sourceTree = ""; }; 47 | 04523E342002FFC800398C33 /* ICPayUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ICPayUtils.m; sourceTree = ""; }; 48 | 04FA91851FF63FD400D4920A /* ICCircleTestViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ICCircleTestViewController.h; sourceTree = ""; }; 49 | 04FA91861FF63FD400D4920A /* ICCircleTestViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ICCircleTestViewController.m; sourceTree = ""; }; 50 | 04FA91871FF63FD400D4920A /* ICCircleTestViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ICCircleTestViewController.xib; sourceTree = ""; }; 51 | 04FBC6641FE8E9580079711F /* AliModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliModel.m; sourceTree = ""; }; 52 | 04FBC6651FE8E9590079711F /* WxModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WxModel.m; sourceTree = ""; }; 53 | 04FBC6661FE8E9590079711F /* AliModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliModel.h; sourceTree = ""; }; 54 | 04FBC6671FE8E9590079711F /* WxModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WxModel.h; sourceTree = ""; }; 55 | 1035F6ED96829435722AFC0D /* libPods-ICPaySDK_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ICPaySDK_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 298A64B28146A5605CBB4259 /* ICPaySDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = ICPaySDK.podspec; path = ../ICPaySDK.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 57 | 485E620C20ECFD0000FFB253 /* ICPaySDKService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ICPaySDKService.h; sourceTree = ""; }; 58 | 485E620D20ECFD0000FFB253 /* ICPaySDKService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ICPaySDKService.m; sourceTree = ""; }; 59 | 4B78A810DF6B70EF614E40F1 /* Pods-ICPaySDK_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ICPaySDK_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ICPaySDK_Tests/Pods-ICPaySDK_Tests.debug.xcconfig"; sourceTree = ""; }; 60 | 52E2A760ECE509D281AD4F75 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 61 | 6003F58A195388D20070C39A /* ICPaySDK_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ICPaySDK_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 63 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 64 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 65 | 6003F595195388D20070C39A /* ICPaySDK-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ICPaySDK-Info.plist"; sourceTree = ""; }; 66 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 67 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 68 | 6003F59B195388D20070C39A /* ICPaySDK-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ICPaySDK-Prefix.pch"; sourceTree = ""; }; 69 | 6003F59C195388D20070C39A /* ICAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ICAppDelegate.h; sourceTree = ""; }; 70 | 6003F59D195388D20070C39A /* ICAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ICAppDelegate.m; sourceTree = ""; }; 71 | 6003F5A5195388D20070C39A /* ICViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ICViewController.h; sourceTree = ""; }; 72 | 6003F5A6195388D20070C39A /* ICViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ICViewController.m; sourceTree = ""; }; 73 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 74 | 6003F5AE195388D20070C39A /* ICPaySDK_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ICPaySDK_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 75 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 76 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 77 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 78 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 79 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 80 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 81 | 85019E0DD0D32D21DACE1972 /* Pods-ICPaySDK_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ICPaySDK_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ICPaySDK_Example/Pods-ICPaySDK_Example.debug.xcconfig"; sourceTree = ""; }; 82 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 83 | 8AB663C6365BF8AFC174DB5C /* libPods-ICPaySDK_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ICPaySDK_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 84 | CB9D53A3C522A6EB5642D65F /* Pods-ICPaySDK_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ICPaySDK_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ICPaySDK_Tests/Pods-ICPaySDK_Tests.release.xcconfig"; sourceTree = ""; }; 85 | D6E895E2F22528B489E2D036 /* Pods-ICPaySDK_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ICPaySDK_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-ICPaySDK_Example/Pods-ICPaySDK_Example.release.xcconfig"; sourceTree = ""; }; 86 | DCC5766964A966535742341A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 87 | /* End PBXFileReference section */ 88 | 89 | /* Begin PBXFrameworksBuildPhase section */ 90 | 6003F587195388D20070C39A /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 95 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 96 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 97 | 6B51E7447E587175813A4675 /* libPods-ICPaySDK_Example.a in Frameworks */, 98 | ); 99 | runOnlyForDeploymentPostprocessing = 0; 100 | }; 101 | 6003F5AB195388D20070C39A /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 106 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 107 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 108 | AC730F2B77B305D20F63D4A5 /* libPods-ICPaySDK_Tests.a in Frameworks */, 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | /* End PBXFrameworksBuildPhase section */ 113 | 114 | /* Begin PBXGroup section */ 115 | 04523E322002FF8700398C33 /* ICPayImp */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 04FBC6661FE8E9590079711F /* AliModel.h */, 119 | 04FBC6641FE8E9580079711F /* AliModel.m */, 120 | 04FBC6671FE8E9590079711F /* WxModel.h */, 121 | 04FBC6651FE8E9590079711F /* WxModel.m */, 122 | 04523E332002FFC800398C33 /* ICPayUtils.h */, 123 | 04523E342002FFC800398C33 /* ICPayUtils.m */, 124 | ); 125 | path = ICPayImp; 126 | sourceTree = ""; 127 | }; 128 | 6003F581195388D10070C39A = { 129 | isa = PBXGroup; 130 | children = ( 131 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 132 | 6003F593195388D20070C39A /* Example for ICPaySDK */, 133 | 6003F5B5195388D20070C39A /* Tests */, 134 | 6003F58C195388D20070C39A /* Frameworks */, 135 | 6003F58B195388D20070C39A /* Products */, 136 | AB630CFE675FB7B603EE1026 /* Pods */, 137 | ); 138 | sourceTree = ""; 139 | }; 140 | 6003F58B195388D20070C39A /* Products */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 6003F58A195388D20070C39A /* ICPaySDK_Example.app */, 144 | 6003F5AE195388D20070C39A /* ICPaySDK_Tests.xctest */, 145 | ); 146 | name = Products; 147 | sourceTree = ""; 148 | }; 149 | 6003F58C195388D20070C39A /* Frameworks */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 6003F58D195388D20070C39A /* Foundation.framework */, 153 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 154 | 6003F591195388D20070C39A /* UIKit.framework */, 155 | 6003F5AF195388D20070C39A /* XCTest.framework */, 156 | 8AB663C6365BF8AFC174DB5C /* libPods-ICPaySDK_Example.a */, 157 | 1035F6ED96829435722AFC0D /* libPods-ICPaySDK_Tests.a */, 158 | ); 159 | name = Frameworks; 160 | sourceTree = ""; 161 | }; 162 | 6003F593195388D20070C39A /* Example for ICPaySDK */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 04523E322002FF8700398C33 /* ICPayImp */, 166 | 6003F59C195388D20070C39A /* ICAppDelegate.h */, 167 | 6003F59D195388D20070C39A /* ICAppDelegate.m */, 168 | 485E620C20ECFD0000FFB253 /* ICPaySDKService.h */, 169 | 485E620D20ECFD0000FFB253 /* ICPaySDKService.m */, 170 | 04FA91851FF63FD400D4920A /* ICCircleTestViewController.h */, 171 | 04FA91861FF63FD400D4920A /* ICCircleTestViewController.m */, 172 | 04FA91871FF63FD400D4920A /* ICCircleTestViewController.xib */, 173 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 174 | 6003F5A5195388D20070C39A /* ICViewController.h */, 175 | 6003F5A6195388D20070C39A /* ICViewController.m */, 176 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 177 | 6003F5A8195388D20070C39A /* Images.xcassets */, 178 | 6003F594195388D20070C39A /* Supporting Files */, 179 | ); 180 | name = "Example for ICPaySDK"; 181 | path = ICPaySDK; 182 | sourceTree = ""; 183 | }; 184 | 6003F594195388D20070C39A /* Supporting Files */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 6003F595195388D20070C39A /* ICPaySDK-Info.plist */, 188 | 6003F596195388D20070C39A /* InfoPlist.strings */, 189 | 6003F599195388D20070C39A /* main.m */, 190 | 6003F59B195388D20070C39A /* ICPaySDK-Prefix.pch */, 191 | ); 192 | name = "Supporting Files"; 193 | sourceTree = ""; 194 | }; 195 | 6003F5B5195388D20070C39A /* Tests */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | 6003F5BB195388D20070C39A /* Tests.m */, 199 | 6003F5B6195388D20070C39A /* Supporting Files */, 200 | ); 201 | path = Tests; 202 | sourceTree = ""; 203 | }; 204 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 208 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 209 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 210 | ); 211 | name = "Supporting Files"; 212 | sourceTree = ""; 213 | }; 214 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 298A64B28146A5605CBB4259 /* ICPaySDK.podspec */, 218 | 52E2A760ECE509D281AD4F75 /* README.md */, 219 | DCC5766964A966535742341A /* LICENSE */, 220 | ); 221 | name = "Podspec Metadata"; 222 | sourceTree = ""; 223 | }; 224 | AB630CFE675FB7B603EE1026 /* Pods */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 85019E0DD0D32D21DACE1972 /* Pods-ICPaySDK_Example.debug.xcconfig */, 228 | D6E895E2F22528B489E2D036 /* Pods-ICPaySDK_Example.release.xcconfig */, 229 | 4B78A810DF6B70EF614E40F1 /* Pods-ICPaySDK_Tests.debug.xcconfig */, 230 | CB9D53A3C522A6EB5642D65F /* Pods-ICPaySDK_Tests.release.xcconfig */, 231 | ); 232 | name = Pods; 233 | sourceTree = ""; 234 | }; 235 | /* End PBXGroup section */ 236 | 237 | /* Begin PBXNativeTarget section */ 238 | 6003F589195388D20070C39A /* ICPaySDK_Example */ = { 239 | isa = PBXNativeTarget; 240 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "ICPaySDK_Example" */; 241 | buildPhases = ( 242 | 88F342DFB4335B8F196BA4F3 /* [CP] Check Pods Manifest.lock */, 243 | 6003F586195388D20070C39A /* Sources */, 244 | 6003F587195388D20070C39A /* Frameworks */, 245 | 6003F588195388D20070C39A /* Resources */, 246 | 8DF405FF0B09517B357A7B30 /* [CP] Copy Pods Resources */, 247 | ); 248 | buildRules = ( 249 | ); 250 | dependencies = ( 251 | ); 252 | name = ICPaySDK_Example; 253 | productName = ICPaySDK; 254 | productReference = 6003F58A195388D20070C39A /* ICPaySDK_Example.app */; 255 | productType = "com.apple.product-type.application"; 256 | }; 257 | 6003F5AD195388D20070C39A /* ICPaySDK_Tests */ = { 258 | isa = PBXNativeTarget; 259 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "ICPaySDK_Tests" */; 260 | buildPhases = ( 261 | 2913EDB0754F369B65DB06D1 /* [CP] Check Pods Manifest.lock */, 262 | 6003F5AA195388D20070C39A /* Sources */, 263 | 6003F5AB195388D20070C39A /* Frameworks */, 264 | 6003F5AC195388D20070C39A /* Resources */, 265 | ); 266 | buildRules = ( 267 | ); 268 | dependencies = ( 269 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 270 | ); 271 | name = ICPaySDK_Tests; 272 | productName = ICPaySDKTests; 273 | productReference = 6003F5AE195388D20070C39A /* ICPaySDK_Tests.xctest */; 274 | productType = "com.apple.product-type.bundle.unit-test"; 275 | }; 276 | /* End PBXNativeTarget section */ 277 | 278 | /* Begin PBXProject section */ 279 | 6003F582195388D10070C39A /* Project object */ = { 280 | isa = PBXProject; 281 | attributes = { 282 | CLASSPREFIX = IC; 283 | LastUpgradeCheck = 1150; 284 | ORGANIZATIONNAME = corkiios; 285 | TargetAttributes = { 286 | 6003F589195388D20070C39A = { 287 | DevelopmentTeam = DNQ2KWVNKT; 288 | }; 289 | 6003F5AD195388D20070C39A = { 290 | TestTargetID = 6003F589195388D20070C39A; 291 | }; 292 | }; 293 | }; 294 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "ICPaySDK" */; 295 | compatibilityVersion = "Xcode 3.2"; 296 | developmentRegion = English; 297 | hasScannedForEncodings = 0; 298 | knownRegions = ( 299 | English, 300 | en, 301 | Base, 302 | ); 303 | mainGroup = 6003F581195388D10070C39A; 304 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 305 | projectDirPath = ""; 306 | projectRoot = ""; 307 | targets = ( 308 | 6003F589195388D20070C39A /* ICPaySDK_Example */, 309 | 6003F5AD195388D20070C39A /* ICPaySDK_Tests */, 310 | ); 311 | }; 312 | /* End PBXProject section */ 313 | 314 | /* Begin PBXResourcesBuildPhase section */ 315 | 6003F588195388D20070C39A /* Resources */ = { 316 | isa = PBXResourcesBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 320 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 321 | 04FA91891FF63FD400D4920A /* ICCircleTestViewController.xib in Resources */, 322 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 323 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 324 | ); 325 | runOnlyForDeploymentPostprocessing = 0; 326 | }; 327 | 6003F5AC195388D20070C39A /* Resources */ = { 328 | isa = PBXResourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | }; 335 | /* End PBXResourcesBuildPhase section */ 336 | 337 | /* Begin PBXShellScriptBuildPhase section */ 338 | 2913EDB0754F369B65DB06D1 /* [CP] Check Pods Manifest.lock */ = { 339 | isa = PBXShellScriptBuildPhase; 340 | buildActionMask = 2147483647; 341 | files = ( 342 | ); 343 | inputPaths = ( 344 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 345 | "${PODS_ROOT}/Manifest.lock", 346 | ); 347 | name = "[CP] Check Pods Manifest.lock"; 348 | outputPaths = ( 349 | "$(DERIVED_FILE_DIR)/Pods-ICPaySDK_Tests-checkManifestLockResult.txt", 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | shellPath = /bin/sh; 353 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 354 | showEnvVarsInLog = 0; 355 | }; 356 | 88F342DFB4335B8F196BA4F3 /* [CP] Check Pods Manifest.lock */ = { 357 | isa = PBXShellScriptBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | ); 361 | inputPaths = ( 362 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 363 | "${PODS_ROOT}/Manifest.lock", 364 | ); 365 | name = "[CP] Check Pods Manifest.lock"; 366 | outputPaths = ( 367 | "$(DERIVED_FILE_DIR)/Pods-ICPaySDK_Example-checkManifestLockResult.txt", 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | shellPath = /bin/sh; 371 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 372 | showEnvVarsInLog = 0; 373 | }; 374 | 8DF405FF0B09517B357A7B30 /* [CP] Copy Pods Resources */ = { 375 | isa = PBXShellScriptBuildPhase; 376 | buildActionMask = 2147483647; 377 | files = ( 378 | ); 379 | inputPaths = ( 380 | "${PODS_ROOT}/Target Support Files/Pods-ICPaySDK_Example/Pods-ICPaySDK_Example-resources.sh", 381 | "${PODS_ROOT}/AlipaySDK-iOS/AlipaySDK.bundle", 382 | ); 383 | name = "[CP] Copy Pods Resources"; 384 | outputPaths = ( 385 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AlipaySDK.bundle", 386 | ); 387 | runOnlyForDeploymentPostprocessing = 0; 388 | shellPath = /bin/sh; 389 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ICPaySDK_Example/Pods-ICPaySDK_Example-resources.sh\"\n"; 390 | showEnvVarsInLog = 0; 391 | }; 392 | /* End PBXShellScriptBuildPhase section */ 393 | 394 | /* Begin PBXSourcesBuildPhase section */ 395 | 6003F586195388D20070C39A /* Sources */ = { 396 | isa = PBXSourcesBuildPhase; 397 | buildActionMask = 2147483647; 398 | files = ( 399 | 04FBC6681FE8E9590079711F /* AliModel.m in Sources */, 400 | 04FA91881FF63FD400D4920A /* ICCircleTestViewController.m in Sources */, 401 | 6003F59E195388D20070C39A /* ICAppDelegate.m in Sources */, 402 | 04FBC6691FE8E9590079711F /* WxModel.m in Sources */, 403 | 6003F5A7195388D20070C39A /* ICViewController.m in Sources */, 404 | 6003F59A195388D20070C39A /* main.m in Sources */, 405 | 485E620E20ECFD0000FFB253 /* ICPaySDKService.m in Sources */, 406 | 04523E352002FFC800398C33 /* ICPayUtils.m in Sources */, 407 | ); 408 | runOnlyForDeploymentPostprocessing = 0; 409 | }; 410 | 6003F5AA195388D20070C39A /* Sources */ = { 411 | isa = PBXSourcesBuildPhase; 412 | buildActionMask = 2147483647; 413 | files = ( 414 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 415 | ); 416 | runOnlyForDeploymentPostprocessing = 0; 417 | }; 418 | /* End PBXSourcesBuildPhase section */ 419 | 420 | /* Begin PBXTargetDependency section */ 421 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 422 | isa = PBXTargetDependency; 423 | target = 6003F589195388D20070C39A /* ICPaySDK_Example */; 424 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 425 | }; 426 | /* End PBXTargetDependency section */ 427 | 428 | /* Begin PBXVariantGroup section */ 429 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 430 | isa = PBXVariantGroup; 431 | children = ( 432 | 6003F597195388D20070C39A /* en */, 433 | ); 434 | name = InfoPlist.strings; 435 | sourceTree = ""; 436 | }; 437 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 438 | isa = PBXVariantGroup; 439 | children = ( 440 | 6003F5B9195388D20070C39A /* en */, 441 | ); 442 | name = InfoPlist.strings; 443 | sourceTree = ""; 444 | }; 445 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { 446 | isa = PBXVariantGroup; 447 | children = ( 448 | 71719F9E1E33DC2100824A3D /* Base */, 449 | ); 450 | name = LaunchScreen.storyboard; 451 | sourceTree = ""; 452 | }; 453 | /* End PBXVariantGroup section */ 454 | 455 | /* Begin XCBuildConfiguration section */ 456 | 6003F5BD195388D20070C39A /* Debug */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | ALWAYS_SEARCH_USER_PATHS = NO; 460 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 461 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 462 | CLANG_CXX_LIBRARY = "libc++"; 463 | CLANG_ENABLE_MODULES = YES; 464 | CLANG_ENABLE_OBJC_ARC = YES; 465 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 466 | CLANG_WARN_BOOL_CONVERSION = YES; 467 | CLANG_WARN_COMMA = YES; 468 | CLANG_WARN_CONSTANT_CONVERSION = YES; 469 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 470 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 471 | CLANG_WARN_EMPTY_BODY = YES; 472 | CLANG_WARN_ENUM_CONVERSION = YES; 473 | CLANG_WARN_INFINITE_RECURSION = YES; 474 | CLANG_WARN_INT_CONVERSION = YES; 475 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 476 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 477 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 478 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 479 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 480 | CLANG_WARN_STRICT_PROTOTYPES = YES; 481 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 482 | CLANG_WARN_UNREACHABLE_CODE = YES; 483 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 484 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 485 | COPY_PHASE_STRIP = NO; 486 | ENABLE_STRICT_OBJC_MSGSEND = YES; 487 | ENABLE_TESTABILITY = YES; 488 | GCC_C_LANGUAGE_STANDARD = gnu99; 489 | GCC_DYNAMIC_NO_PIC = NO; 490 | GCC_NO_COMMON_BLOCKS = YES; 491 | GCC_OPTIMIZATION_LEVEL = 0; 492 | GCC_PREPROCESSOR_DEFINITIONS = ( 493 | "DEBUG=1", 494 | "$(inherited)", 495 | ); 496 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 497 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 498 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 499 | GCC_WARN_UNDECLARED_SELECTOR = YES; 500 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 501 | GCC_WARN_UNUSED_FUNCTION = YES; 502 | GCC_WARN_UNUSED_VARIABLE = YES; 503 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 504 | ONLY_ACTIVE_ARCH = YES; 505 | SDKROOT = iphoneos; 506 | TARGETED_DEVICE_FAMILY = "1,2"; 507 | }; 508 | name = Debug; 509 | }; 510 | 6003F5BE195388D20070C39A /* Release */ = { 511 | isa = XCBuildConfiguration; 512 | buildSettings = { 513 | ALWAYS_SEARCH_USER_PATHS = NO; 514 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 515 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 516 | CLANG_CXX_LIBRARY = "libc++"; 517 | CLANG_ENABLE_MODULES = YES; 518 | CLANG_ENABLE_OBJC_ARC = YES; 519 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 520 | CLANG_WARN_BOOL_CONVERSION = YES; 521 | CLANG_WARN_COMMA = YES; 522 | CLANG_WARN_CONSTANT_CONVERSION = YES; 523 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 524 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 525 | CLANG_WARN_EMPTY_BODY = YES; 526 | CLANG_WARN_ENUM_CONVERSION = YES; 527 | CLANG_WARN_INFINITE_RECURSION = YES; 528 | CLANG_WARN_INT_CONVERSION = YES; 529 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 530 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 531 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 532 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 533 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 534 | CLANG_WARN_STRICT_PROTOTYPES = YES; 535 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 536 | CLANG_WARN_UNREACHABLE_CODE = YES; 537 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 538 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 539 | COPY_PHASE_STRIP = YES; 540 | ENABLE_NS_ASSERTIONS = NO; 541 | ENABLE_STRICT_OBJC_MSGSEND = YES; 542 | GCC_C_LANGUAGE_STANDARD = gnu99; 543 | GCC_NO_COMMON_BLOCKS = YES; 544 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 545 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 546 | GCC_WARN_UNDECLARED_SELECTOR = YES; 547 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 548 | GCC_WARN_UNUSED_FUNCTION = YES; 549 | GCC_WARN_UNUSED_VARIABLE = YES; 550 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 551 | SDKROOT = iphoneos; 552 | TARGETED_DEVICE_FAMILY = "1,2"; 553 | VALIDATE_PRODUCT = YES; 554 | }; 555 | name = Release; 556 | }; 557 | 6003F5C0195388D20070C39A /* Debug */ = { 558 | isa = XCBuildConfiguration; 559 | baseConfigurationReference = 85019E0DD0D32D21DACE1972 /* Pods-ICPaySDK_Example.debug.xcconfig */; 560 | buildSettings = { 561 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 562 | DEBUG_INFORMATION_FORMAT = dwarf; 563 | DEVELOPMENT_TEAM = DNQ2KWVNKT; 564 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 565 | GCC_PREFIX_HEADER = "ICPaySDK/ICPaySDK-Prefix.pch"; 566 | INFOPLIST_FILE = "ICPaySDK/ICPaySDK-Info.plist"; 567 | MODULE_NAME = ExampleApp; 568 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.demo.ICPaySDK; 569 | PRODUCT_NAME = "$(TARGET_NAME)"; 570 | WRAPPER_EXTENSION = app; 571 | }; 572 | name = Debug; 573 | }; 574 | 6003F5C1195388D20070C39A /* Release */ = { 575 | isa = XCBuildConfiguration; 576 | baseConfigurationReference = D6E895E2F22528B489E2D036 /* Pods-ICPaySDK_Example.release.xcconfig */; 577 | buildSettings = { 578 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 579 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 580 | DEVELOPMENT_TEAM = DNQ2KWVNKT; 581 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 582 | GCC_PREFIX_HEADER = "ICPaySDK/ICPaySDK-Prefix.pch"; 583 | INFOPLIST_FILE = "ICPaySDK/ICPaySDK-Info.plist"; 584 | MODULE_NAME = ExampleApp; 585 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.demo.ICPaySDK; 586 | PRODUCT_NAME = "$(TARGET_NAME)"; 587 | WRAPPER_EXTENSION = app; 588 | }; 589 | name = Release; 590 | }; 591 | 6003F5C3195388D20070C39A /* Debug */ = { 592 | isa = XCBuildConfiguration; 593 | baseConfigurationReference = 4B78A810DF6B70EF614E40F1 /* Pods-ICPaySDK_Tests.debug.xcconfig */; 594 | buildSettings = { 595 | BUNDLE_LOADER = "$(TEST_HOST)"; 596 | FRAMEWORK_SEARCH_PATHS = ( 597 | "$(SDKROOT)/Developer/Library/Frameworks", 598 | "$(inherited)", 599 | "$(DEVELOPER_FRAMEWORKS_DIR)", 600 | ); 601 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 602 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 603 | GCC_PREPROCESSOR_DEFINITIONS = ( 604 | "DEBUG=1", 605 | "$(inherited)", 606 | ); 607 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 608 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 609 | PRODUCT_NAME = "$(TARGET_NAME)"; 610 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ICPaySDK_Example.app/ICPaySDK_Example"; 611 | WRAPPER_EXTENSION = xctest; 612 | }; 613 | name = Debug; 614 | }; 615 | 6003F5C4195388D20070C39A /* Release */ = { 616 | isa = XCBuildConfiguration; 617 | baseConfigurationReference = CB9D53A3C522A6EB5642D65F /* Pods-ICPaySDK_Tests.release.xcconfig */; 618 | buildSettings = { 619 | BUNDLE_LOADER = "$(TEST_HOST)"; 620 | FRAMEWORK_SEARCH_PATHS = ( 621 | "$(SDKROOT)/Developer/Library/Frameworks", 622 | "$(inherited)", 623 | "$(DEVELOPER_FRAMEWORKS_DIR)", 624 | ); 625 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 626 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 627 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 628 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 629 | PRODUCT_NAME = "$(TARGET_NAME)"; 630 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ICPaySDK_Example.app/ICPaySDK_Example"; 631 | WRAPPER_EXTENSION = xctest; 632 | }; 633 | name = Release; 634 | }; 635 | /* End XCBuildConfiguration section */ 636 | 637 | /* Begin XCConfigurationList section */ 638 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "ICPaySDK" */ = { 639 | isa = XCConfigurationList; 640 | buildConfigurations = ( 641 | 6003F5BD195388D20070C39A /* Debug */, 642 | 6003F5BE195388D20070C39A /* Release */, 643 | ); 644 | defaultConfigurationIsVisible = 0; 645 | defaultConfigurationName = Release; 646 | }; 647 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "ICPaySDK_Example" */ = { 648 | isa = XCConfigurationList; 649 | buildConfigurations = ( 650 | 6003F5C0195388D20070C39A /* Debug */, 651 | 6003F5C1195388D20070C39A /* Release */, 652 | ); 653 | defaultConfigurationIsVisible = 0; 654 | defaultConfigurationName = Release; 655 | }; 656 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "ICPaySDK_Tests" */ = { 657 | isa = XCConfigurationList; 658 | buildConfigurations = ( 659 | 6003F5C3195388D20070C39A /* Debug */, 660 | 6003F5C4195388D20070C39A /* Release */, 661 | ); 662 | defaultConfigurationIsVisible = 0; 663 | defaultConfigurationName = Release; 664 | }; 665 | /* End XCConfigurationList section */ 666 | }; 667 | rootObject = 6003F582195388D10070C39A /* Project object */; 668 | } 669 | -------------------------------------------------------------------------------- /Example/ICPaySDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/ICPaySDK.xcodeproj/xcshareddata/xcschemes/ICPaySDK-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 42 | 48 | 49 | 50 | 51 | 52 | 62 | 64 | 70 | 71 | 72 | 73 | 79 | 81 | 87 | 88 | 89 | 90 | 92 | 93 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Example/ICPaySDK.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/ICPaySDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/ICPaySDK/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 | -------------------------------------------------------------------------------- /Example/ICPaySDK/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 | 31 | 38 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICAppDelegate.h 3 | // ICPaySDK 4 | // 5 | // Created by corkiios on 12/19/2017. 6 | // Copyright (c) 2017 corkiios. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface ICAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICAppDelegate.m 3 | // ICPaySDK 4 | // 5 | // Created by corkiios on 12/19/2017. 6 | // Copyright (c) 2017 corkiios. All rights reserved. 7 | // 8 | 9 | #import "ICAppDelegate.h" 10 | #import 11 | #import "ICCircleTestViewController.h" 12 | @implementation ICAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | 17 | // 如果使用了微信支付 需要注册 18 | [[ICPayDesignManager shareInstance] registerWx:@"" universalLinks:@""]; 19 | 20 | // 使用的时候 在项目里最好自己做一层封装 如果后续有变动 迁移成本低 21 | 22 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 23 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[ICCircleTestViewController new]]; 24 | [self.window makeKeyAndVisible]; 25 | 26 | // 自定义支付对象 27 | //[[ICPayDesignManager shareInstance] addPayEntry:<#(nonnull ICBasePayEntry *)#>]; 28 | 29 | return YES; 30 | } 31 | 32 | 33 | 34 | /*-------------以下为处理回调------------*/ 35 | - (BOOL)application:(UIApplication *)application 36 | openURL:(NSURL *)url 37 | sourceApplication:(NSString *)sourceApplication 38 | annotation:(id)annotation 39 | { 40 | return [[ICPayDesignManager shareInstance] handleOpenURL:url sourceApplication:sourceApplication]; 41 | 42 | } 43 | 44 | // NOTE: 9.0以后使用新API接口 45 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options 46 | { 47 | return [[ICPayDesignManager shareInstance] handleOpenURL:url sourceApplication:nil]; 48 | } 49 | 50 | - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { 51 | return [[ICPayDesignManager shareInstance] handleOpenUniversalLink:userActivity]; 52 | } 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICCircleTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICCircleTestViewController.h 3 | // ICPaySDK_Example 4 | // 5 | // Created by wangzg on 2017/12/29. 6 | // Copyright © 2017年 corkiios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ICCircleTestViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICCircleTestViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICCircleTestViewController.m 3 | // ICPaySDK_Example 4 | // 5 | // Created by wangzg on 2017/12/29. 6 | // Copyright © 2017年 corkiios. All rights reserved. 7 | // 8 | 9 | #import "ICCircleTestViewController.h" 10 | #import "ICViewController.h" 11 | @interface ICCircleTestViewController () 12 | 13 | @end 14 | 15 | @implementation ICCircleTestViewController 16 | 17 | - (IBAction)test:(id)sender { 18 | UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 19 | ICViewController *controller = [storyboard instantiateInitialViewController]; 20 | [self.navigationController pushViewController:controller animated:YES]; 21 | } 22 | 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | // Do any additional setup after loading the view from its nib. 27 | } 28 | 29 | - (void)didReceiveMemoryWarning { 30 | [super didReceiveMemoryWarning]; 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | /* 35 | #pragma mark - Navigation 36 | 37 | // In a storyboard-based application, you will often want to do a little preparation before navigation 38 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 39 | // Get the new view controller using [segue destinationViewController]. 40 | // Pass the selected object to the new view controller. 41 | } 42 | */ 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICCircleTestViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPayImp/AliModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // AliModel.h 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @interface AliModel : NSObject 12 | @property (nonatomic) NSString *orderString; 13 | @property (nonatomic) NSString *scheme; 14 | @end 15 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPayImp/AliModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // AliModel.m 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import "AliModel.h" 10 | 11 | @implementation AliModel 12 | /** 白名单*/ 13 | - (NSString *)scheme { 14 | return @"AliPayURLScheme.ic"; 15 | } 16 | 17 | - (void)dealloc { 18 | NSLog(@"%s", __func__); 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPayImp/ICPayUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICPayUtils.h 3 | // ICPaySDK_Example 4 | // 5 | // Created by wangzg on 2018/1/8. 6 | // Copyright © 2018年 corkiios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^ICPayBlock)(NSString * _Nullable message); 12 | 13 | @interface ICPayUtils : NSObject 14 | 15 | 16 | /* 按照自己的需求封装 */ 17 | 18 | + (void)aliPayWithURL:(nonnull NSString *)URL 19 | params:(nullable NSDictionary *)params 20 | success:(nonnull ICPayBlock)success 21 | failure:(nonnull ICPayBlock)failure 22 | cancel:(nonnull ICPayBlock)cancel; 23 | 24 | 25 | + (void)wxPayWithURL:(NSString *_Nonnull)URL 26 | params:(NSDictionary *_Nullable)params 27 | success:(ICPayBlock _Nonnull)success 28 | failure:(ICPayBlock _Nonnull)failure 29 | cancel:(ICPayBlock _Nonnull)cancel; 30 | 31 | + (void)unionPayWithURL:(NSString *_Nonnull)URL 32 | params:(NSDictionary *_Nullable)params 33 | controller:(UIViewController *_Nonnull)controller 34 | success:(nonnull ICPayBlock)success 35 | failure:(nonnull ICPayBlock)failure 36 | cancel:(nonnull ICPayBlock)cancel; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPayImp/ICPayUtils.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | // 4 | // ICPayUtils.m 5 | // ICPaySDK_Example 6 | // 7 | // Created by wangzg on 2018/1/8. 8 | // Copyright © 2018年 corkiios. All rights reserved. 9 | // 10 | 11 | #import "ICPayUtils.h" 12 | #import 13 | #import 14 | #import "AliModel.h" 15 | #import "WxModel.h" 16 | 17 | 18 | 19 | @implementation ICPayUtils 20 | 21 | + (void)aliPayWithURL:(NSString *)URL 22 | params:(NSDictionary *)params 23 | success:(ICPayBlock)success 24 | failure:(ICPayBlock)failure 25 | cancel:(ICPayBlock)cancel { 26 | //替换成自己项目中的网络请求 27 | // [[AFHTTPSessionManager manager] POST:URL parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, NSDictionary* _Nullable data) { 28 | // if ([[data objectForKey:@"status"] integerValue] == 200) { 29 | // //拿到后台签名 30 | // NSString *orderString = data[@"data"][@"alipay"]; 31 | // if (orderString) { 32 | // 33 | // //采用自建模型 34 | //// AliModel *model = [AliModel new]; 35 | //// model.orderString = @"签名信息"; 36 | // //采用自动解析方式 37 | // [ICPayUtils _payWithModel:@{@"alipay" : orderString} controller:nil success:success failure:failure cancel:cancel]; 38 | // } 39 | // 40 | // }else { 41 | // failure(@"网络等其他情况"); 42 | // 43 | // } 44 | // 45 | // } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 46 | // failure(@"网络等其他情况"); 47 | // }]; 48 | } 49 | 50 | + (void)wxPayWithURL:(NSString *)URL 51 | params:(NSDictionary *)params 52 | success:(ICPayBlock)success 53 | failure:(ICPayBlock)failure 54 | cancel:(ICPayBlock)cancel { 55 | 56 | //替换成自己项目中的网络请求 57 | // [[AFHTTPSessionManager manager] POST:URL parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, NSDictionary* _Nullable data) { 58 | // if ([[data objectForKey:@"status"] integerValue] == 200) { 59 | // //拿到后台签名 60 | // NSDictionary *dic = data[@"data"][@"weChatPay"]; 61 | // [ICPayUtils _payWithModel:@{@"weChatPay" : dic} controller:nil success:success failure:failure cancel:cancel]; 62 | // 63 | // }else { 64 | // failure(@"网络等其他情况"); 65 | // 66 | // } 67 | // 68 | // } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 69 | // failure(@"网络等其他情况"); 70 | // }]; 71 | } 72 | 73 | + (void)unionPayWithURL:(NSString *)URL 74 | params:(NSDictionary *)params 75 | controller:(UIViewController *)controller 76 | success:(ICPayBlock)success 77 | failure:(ICPayBlock)failure 78 | cancel:(ICPayBlock)cancel { 79 | // AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; 80 | // AFHTTPResponseSerializer *serializer = [AFHTTPResponseSerializer serializer]; 81 | // manager.responseSerializer = serializer; 82 | // 83 | // [manager POST:URL parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, NSData* _Nullable data) { 84 | // 85 | // NSString *tn = [[NSString alloc] initWithData:data encoding:(NSUTF8StringEncoding)]; 86 | // UnionModel *model = [UnionModel new]; 87 | // model.tn = tn; 88 | // /* 89 | // 经过测试 银联SDK会一直引用 self 再调用一次 银联SDK 支付接口 此处self 才dealloc 90 | // 91 | // 92 | // [[UPPaymentControl defaultControl] startPay:unionModel.union_tn fromScheme:unionModel.scheme mode:unionModel.union_tnModel viewController:controller]; 93 | // 94 | // */ 95 | // [ICPayUtils _payWithModel:model controller:controller success:success failure:failure cancel:cancel]; 96 | // 97 | // } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 98 | // 99 | // }]; 100 | } 101 | 102 | + (void)_payWithModel:(id)model 103 | controller:(UIViewController *)controller 104 | success:(nonnull ICPayBlock)success 105 | failure:(nonnull ICPayBlock)failure 106 | cancel:(nonnull ICPayBlock)cancel { 107 | [[ICPayDesignManager shareInstance] payWithModel:model controller:controller completion:^(ICErrorStatusCode status) { 108 | //成功 109 | if (status == ICErrorStatusCodeSuccess) { 110 | 111 | }else if (status == ICErrorStatusCodeUserCancel) { 112 | 113 | }else { 114 | 115 | } 116 | 117 | }]; 118 | } 119 | 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPayImp/WxModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // WxModel.h 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @interface WxModel : NSObject 12 | 13 | @property (nonatomic) NSString *partnerId; 14 | @property (nonatomic) NSString *prepayId; 15 | @property (nonatomic) NSString *nonceStr; 16 | @property (nonatomic) UInt32 timeStamp; 17 | @property (nonatomic) NSString *package; 18 | @property (nonatomic) NSString *sign; 19 | 20 | @property (nonatomic, strong) NSDictionary *data; 21 | 22 | - (void)setData:(NSDictionary *)data; 23 | @end 24 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPayImp/WxModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // WxModel.m 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import "WxModel.h" 10 | @implementation WxModel 11 | - (void)dealloc { 12 | NSLog(@"%s", __func__); 13 | } 14 | 15 | /** 商家向财付通申请的商家id */ 16 | - (NSString *)partnerId { 17 | return _partnerId; 18 | } 19 | 20 | /** 预支付订单 */ 21 | - (NSString *)prepayId { 22 | return _prepayId; 23 | } 24 | 25 | /** 随机串,防重发 */ 26 | - (NSString *)nonceStr { 27 | return _nonceStr; 28 | } 29 | 30 | /** 时间戳,防重发 */ 31 | - (UInt32)timeStamp { 32 | return _timeStamp; 33 | } 34 | 35 | /** 商家根据财付通文档填写的数据和签名 */ 36 | - (NSString *)package { 37 | return _package; 38 | } 39 | 40 | /** 商家根据微信开放平台文档对数据做的签名 */ 41 | - (NSString *)sign { 42 | return _sign; 43 | } 44 | 45 | - (void)setData:(NSDictionary *)data { 46 | _data = data; 47 | _partnerId = data[@"partnerId"]; 48 | _prepayId = data[@"prepayId"]; 49 | _package = @"Sign=WXPay"; 50 | _nonceStr= data[@"noncestr"]; 51 | NSMutableString *stamp = [data objectForKey:@"timestamp"]; 52 | _timeStamp = stamp.intValue; 53 | _sign = data[@"sign"]; 54 | } 55 | @end 56 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPaySDK-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | ${PRODUCT_NAME} 7 | CFBundleIdentifier 8 | $(PRODUCT_BUNDLE_IDENTIFIER) 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | UIMainStoryboardFile 12 | Main 13 | CFBundleVersion 14 | 1.0 15 | UILaunchStoryboardName 16 | LaunchScreen 17 | CFBundleExecutable 18 | ${EXECUTABLE_NAME} 19 | LSRequiresIPhoneOS 20 | 21 | UIRequiredDeviceCapabilities 22 | 23 | armv7 24 | 25 | UISupportedInterfaceOrientations 26 | 27 | UIInterfaceOrientationPortrait 28 | UIInterfaceOrientationLandscapeLeft 29 | UIInterfaceOrientationLandscapeRight 30 | 31 | CFBundleDisplayName 32 | ${PRODUCT_NAME} 33 | NSAppTransportSecurity 34 | 35 | 36 | 37 | NSAllowsArbitraryLoads 38 | 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationPortraitUpsideDown 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | CFBundleURLTypes 48 | 49 | 50 | CFBundleURLSchemes 51 | 52 | 微信支付的appkey 53 | 54 | CFBundleTypeRole 55 | Editor 56 | 57 | 58 | CFBundleURLSchemes 59 | 60 | AliPayURLScheme.ic 61 | 62 | CFBundleTypeRole 63 | Editor 64 | 65 | 66 | CFBundlePackageType 67 | APPL 68 | CFBundleSignature 69 | ???? 70 | CFBundleDevelopmentRegion 71 | en 72 | LSApplicationQueriesSchemes 73 | 74 | alipay 75 | alipayshare 76 | uppaysdk 77 | uppaywallet 78 | uppayx1 79 | uppayx2 80 | uppayx3 81 | wechat 82 | weixin 83 | 84 | ICWxPayChannelKey 85 | ssssssss 86 | CFBundleShortVersionString 87 | 1.0 88 | 89 | 90 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPaySDK-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPaySDKService.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICPaySDKService.h 3 | // ICPaySDK_Example 4 | // 5 | // Created by 王志刚 on 2018/7/4. 6 | // Copyright © 2018年 corkiios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ICPaySDKService : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICPaySDKService.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICPaySDKService.m 3 | // ICPaySDK_Example 4 | // 5 | // Created by 王志刚 on 2018/7/4. 6 | // Copyright © 2018年 corkiios. All rights reserved. 7 | // 8 | 9 | #import "ICPaySDKService.h" 10 | 11 | @implementation ICPaySDKService 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICViewController.h 3 | // ICPaySDK 4 | // 5 | // Created by corkiios on 12/19/2017. 6 | // Copyright (c) 2017 corkiios. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface ICViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/ICPaySDK/ICViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICViewController.m 3 | // ICPaySDK 4 | // 5 | // Created by corkiios on 12/19/2017. 6 | // Copyright (c) 2017 corkiios. All rights reserved. 7 | // 8 | 9 | #import "ICViewController.h" 10 | 11 | #define kURL_TN_Normal @"http://101.231.204.84:8091/sim/getacptn" 12 | 13 | #import "ICPayUtils.h" 14 | 15 | @interface ICViewController () 16 | 17 | @end 18 | 19 | @implementation ICViewController 20 | 21 | - (void)dealloc { 22 | NSLog(@"%s", __FUNCTION__); 23 | } 24 | 25 | - (void)viewDidLoad 26 | { 27 | [super viewDidLoad]; 28 | // demo 后续抽空完善---------------------------------- 29 | } 30 | 31 | - (IBAction)unionPay:(id)sender { 32 | 33 | [ICPayUtils unionPayWithURL:kURL_TN_Normal params:nil controller:self success:^(NSString * _Nullable message) { 34 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 35 | 36 | } failure:^(NSString * _Nullable message) { 37 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 38 | 39 | } cancel:^(NSString * _Nullable message) { 40 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 41 | 42 | }]; 43 | } 44 | 45 | - (IBAction)ali:(id)sender { 46 | #warning 需要自己完善 47 | NSMutableDictionary *params = [NSMutableDictionary dictionary]; 48 | [ICPayUtils aliPayWithURL:@"" params:params success:^(NSString * _Nullable message) { 49 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 50 | } failure:^(NSString * _Nullable message) { 51 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 52 | } cancel:^(NSString * _Nullable message) { 53 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 54 | }]; 55 | } 56 | 57 | - (IBAction)wechat:(id)sender { 58 | 59 | #warning 需要自己完善 60 | NSMutableDictionary *params = [NSMutableDictionary dictionary]; 61 | [ICPayUtils wxPayWithURL:@"" params:params success:^(NSString * _Nullable message) { 62 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 63 | 64 | } failure:^(NSString * _Nullable message) { 65 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 66 | 67 | } cancel:^(NSString * _Nullable message) { 68 | [[[UIAlertView alloc] initWithTitle:@"tips" message:message delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil] show]; 69 | 70 | }]; 71 | } 72 | 73 | 74 | - (void)test { 75 | NSLog(@"%s", __FUNCTION__); 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Example/ICPaySDK/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Example/ICPaySDK/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/ICPaySDK/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ICPaySDK 4 | // 5 | // Created by corkiios on 12/19/2017. 6 | // Copyright (c) 2017 corkiios. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "ICAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([ICAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | #use_frameworks! 2 | inhibit_all_warnings! 3 | target 'ICPaySDK_Example' do 4 | pod 'ICPaySDK', :path => '../' 5 | 6 | pod 'AFNetworking' 7 | 8 | target 'ICPaySDK_Tests' do 9 | inherit! :search_paths 10 | 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICPaySDKTests.m 3 | // ICPaySDKTests 4 | // 5 | // Created by corkiios on 12/19/2017. 6 | // Copyright (c) 2017 corkiios. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ICPaySDK.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = 'ICPaySDK' 4 | s.version = '2.1.1' 5 | s.summary = 'ICPaySDK is an unique sdk to pay' 6 | s.description = "ICPaySDK = wxpay + alipay. the api is unique" 7 | s.homepage = 'https://github.com/CorkiiOS/ICPaySDK' 8 | s.license = { :type => 'MIT', :file => 'LICENSE' } 9 | s.author = { 'corkiios' => '675053587@qq.com' } 10 | s.source = { :git => 'https://github.com/CorkiiOS/ICPaySDK.git', :tag => s.version.to_s } 11 | s.requires_arc = true 12 | s.ios.deployment_target = '8.0' 13 | 14 | 15 | s.subspec 'ICPayManager' do |mgr| 16 | 17 | 18 | mgr.source_files = 'ICPaySDK/Base/**/*.{h,m}' 19 | 20 | end 21 | 22 | s.subspec 'ICAliPay' do |ali| 23 | 24 | ali.dependency 'ICPaySDK/ICPayManager' 25 | ali.dependency 'AlipaySDK-iOS' 26 | ali.source_files = 'ICPaySDK/ICAliPay/*.{h,m}' 27 | 28 | end 29 | 30 | s.subspec 'ICWxPay' do |wx| 31 | 32 | wx.dependency 'ICPaySDK/ICPayManager' 33 | wx.dependency 'WechatOpenSDK' 34 | wx.source_files = 'ICPaySDK/ICWxPay/*.{h,m}' 35 | 36 | end 37 | 38 | end 39 | -------------------------------------------------------------------------------- /ICPaySDK/Base/ICBaseParamsModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICBaseParamsModel.h 3 | // AFNetworking 4 | // 5 | // Created by wangzg on 2018/7/6. 6 | // 7 | 8 | #import 9 | #import "ICPaySDKAutoServiceProtocol.h" 10 | 11 | @interface ICBaseParamsModel : NSObject 12 | 13 | - (void)setData:(NSDictionary *)data service:(id)service; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ICPaySDK/Base/ICBaseParamsModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICBaseParamsModel.m 3 | // AFNetworking 4 | // 5 | // Created by wangzg on 2018/7/6. 6 | // 7 | 8 | #import "ICBaseParamsModel.h" 9 | 10 | @implementation ICBaseParamsModel 11 | 12 | - (void)setData:(NSDictionary *)data service:(id)service{} 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /ICPaySDK/Base/ICBasePayEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICBasePayEntry.h 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/12/19. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ICPayDesignManager.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface ICBasePayEntry : NSObject 15 | 16 | - (void)setAppKey:(NSString *)appKey universalLinks:(NSString *)universalLinks; 17 | 18 | /** 19 | 支付统一规范 20 | */ 21 | 22 | - (void)payWithModel:(id)model 23 | controller:(nullable UIViewController *)controller 24 | completion:(nullable ICCompletion)completion; 25 | /** 26 | 处理支付 27 | */ 28 | - (BOOL)handleOpenURL:(NSURL *)url 29 | sourceApplication:(nullable NSString *)sourceApplication; 30 | 31 | /** 32 | 处理通用链接 33 | */ 34 | - (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | 40 | -------------------------------------------------------------------------------- /ICPaySDK/Base/ICBasePayEntry.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICBasePayEntry.m 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/12/19. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import "ICBasePayEntry.h" 10 | 11 | @implementation ICBasePayEntry 12 | 13 | - (void)setAppKey:(NSString *)appKey universalLinks:(NSString *)universalLinks { 14 | 15 | } 16 | 17 | /** 18 | 支付统一规范 19 | */ 20 | 21 | - (void)payWithModel:(id)model 22 | controller:(nullable UIViewController *)controller 23 | completion:(nullable ICCompletion)completion { 24 | } 25 | /** 26 | 处理支付 27 | */ 28 | - (BOOL)handleOpenURL:(NSURL *)url 29 | sourceApplication:(nullable NSString *)sourceApplication { 30 | return YES; 31 | } 32 | 33 | - (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity { 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ICPaySDK/Base/ICMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICDebugLog.h 3 | // Pods 4 | // 5 | // Created by iCorki on 2017/12/28. 6 | // 7 | 8 | #ifndef ICDebugLog_h 9 | #define ICDebugLog_h 10 | 11 | #if __OBJC__ 12 | 13 | #ifdef DEBUG 14 | #define ICLog(...) NSLog(__VA_ARGS__) 15 | #else 16 | #define ICLog(...) 17 | #endif 18 | 19 | #ifndef ICAssert 20 | #define ICAssert( condition, ... ) NSCAssert( (condition) , ##__VA_ARGS__) 21 | #endif 22 | 23 | #ifndef ICFailAssert 24 | #define ICFailAssert( ... ) ICAssert( (NO) , ##__VA_ARGS__) 25 | #endif 26 | 27 | 28 | #ifndef ICParameterAssert 29 | #define ICParameterAssert( condition ) ICAssert( (condition) , @"Invalid parameter not satisfying: %@", @#condition) 30 | #endif // ICParameterAssert 31 | 32 | #endif 33 | 34 | #endif /* ICDebugLog_h */ 35 | -------------------------------------------------------------------------------- /ICPaySDK/Base/ICPayDesignManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICPayDesignManager.h 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 错误说明 13 | 14 | - PayStatusCodeUnkonwn: 未知 15 | - PayStatusCodeSuccess: 支付成功 16 | - PayStatusCodeFailure: 支付失败 17 | - PayStatusCodeUserCancel: 取消支付 18 | - PayStatusCodeUnsupported: 没有安装客户端 19 | - PayStatusCodeChannelFail: 支付渠道验证失败 20 | 21 | */ 22 | typedef NS_ENUM(NSInteger, ICErrorStatusCode) { 23 | ICErrorStatusCodeUnkonwn, 24 | ICErrorStatusCodeSuccess, 25 | ICErrorStatusCodeFailure, 26 | ICErrorStatusCodeUserCancel, 27 | ICErrorStatusCodeUnsupported, 28 | ICErrorStatusCodeChannelFail 29 | }; 30 | 31 | typedef void(^ICCompletion)(ICErrorStatusCode); 32 | 33 | @class ICBasePayEntry; 34 | @protocol ICPaySDKAutoServiceProtocol, ICPayCompletionProtocol; 35 | 36 | NS_ASSUME_NONNULL_BEGIN 37 | 38 | @interface ICPayDesignManager : NSObject 39 | 40 | + (instancetype)shareInstance; 41 | 42 | /** 43 | 注册微信sdk 44 | */ 45 | - (void)registerWx:(NSString *)appid universalLinks:(NSString *)universalLinks; 46 | 47 | /** 48 | 自动解析支付参数时初始化配置 49 | 50 | @param service 自动解析支付参数必须遵守的规则,详见ICPaySDKAutoServiceProtocol.h 51 | */ 52 | - (void)registerSDKAutoService:(id)service; 53 | 54 | /* 55 | 添加自定义支付对象 56 | */ 57 | - (void)addPayEntry:(ICBasePayEntry *)enrty; 58 | 59 | 60 | /* 61 | 使用自定义的支付方式支付 62 | */ 63 | - (void)payWithEntryClass:(Class)cls 64 | data:(id)data 65 | controller:(UIViewController *)controller 66 | completion:(ICCompletion)completion; 67 | 68 | /** 69 | 支付统一API 70 | 71 | @param model 支付模型 72 | @param controller 银联支付为必要参数,其他为nil 73 | @param completion 完成回调 74 | */ 75 | - (void)payWithModel:(id)model 76 | controller:(nullable UIViewController *)controller 77 | completion:(nullable ICCompletion)completion; 78 | 79 | - (void)payWithModel:(id)model 80 | controller:(nullable UIViewController *)controller 81 | delegate:(id)delegate; 82 | 83 | /** 84 | 支付回调 9.0前后统一调用此方法 85 | */ 86 | - (BOOL)handleOpenURL:(NSURL *)url 87 | sourceApplication:(nullable NSString *)sourceApplication; 88 | 89 | /** 90 | 使用通用链接回调 91 | */ 92 | - (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity; 93 | 94 | @end 95 | 96 | @protocol ICPayCompletionProtocol 97 | 98 | @optional 99 | - (void)payManagerdidCompleteWithError:(ICErrorStatusCode)error; 100 | 101 | @end 102 | 103 | NS_ASSUME_NONNULL_END 104 | 105 | 106 | -------------------------------------------------------------------------------- /ICPaySDK/Base/ICPayDesignManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICPayDesignManager.m 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import "ICPayDesignManager.h" 10 | #import "ICMacros.h" 11 | #import "ICIAliModel.h" 12 | #import "ICIWxModel.h" 13 | #import "ICPaySDKAutoServiceProtocol.h" 14 | #import "ICBasePayEntry.h" 15 | #import "ICBaseParamsModel.h" 16 | 17 | static NSString *const ICALiPayChannelKey = @"ICAliPayEntry"; 18 | static NSString *const ICWxPayChannelKey = @"ICWxPayEntry"; 19 | 20 | @interface ICPayDesignManager() 21 | 22 | @property (nonatomic, strong) NSMutableDictionary *channelMap; 23 | @property (nonatomic, strong) NSString *channel; 24 | @property (nonatomic, weak) iddelegate; 25 | @property (nonatomic, strong) idservice; 26 | 27 | @end 28 | 29 | @implementation ICPayDesignManager 30 | 31 | + (instancetype)shareInstance { 32 | static ICPayDesignManager *manager = nil; 33 | static dispatch_once_t onceToken; 34 | dispatch_once(&onceToken, ^{ 35 | manager = [[self alloc] init]; 36 | }); 37 | 38 | return manager; 39 | } 40 | 41 | - (instancetype)init { 42 | self = [super init]; 43 | if (self) { 44 | [self registerPayEntrys]; 45 | } 46 | return self; 47 | } 48 | 49 | #pragma mark - public 50 | - (void)registerSDKAutoService:(id)service { 51 | if (service.wechatKey && service.universalLinks) { 52 | [self.channelMap[ICWxPayChannelKey] setAppKey:service.wechatKey universalLinks:service.universalLinks]; 53 | }else { 54 | ICLog(@"ICPaySDK 微信支付注册参数缺失**************************"); 55 | } 56 | } 57 | 58 | - (void)registerWx:(NSString *)appid universalLinks:(NSString *)universalLinks { 59 | [self.channelMap[ICWxPayChannelKey] setAppKey:appid universalLinks:universalLinks]; 60 | } 61 | 62 | - (void)addPayEntry:(ICBasePayEntry *)enrty { 63 | self.channelMap[NSStringFromClass([enrty class])] = enrty; 64 | } 65 | 66 | - (void)payWithEntryClass:(Class)cls 67 | data:(id)data 68 | controller:(UIViewController *)controller 69 | completion:(ICCompletion)completion { 70 | self.channel = NSStringFromClass(cls); 71 | ICBasePayEntry *entry = self.channelMap[self.channel]; 72 | if (entry == nil) { 73 | if (completion) { 74 | completion(ICErrorStatusCodeChannelFail); 75 | ICLog(@"创建支付对象失败!!"); 76 | } 77 | return; 78 | } 79 | [entry payWithModel:data controller:controller completion:completion]; 80 | } 81 | 82 | - (void)payWithModel:(id)model 83 | controller:(UIViewController *)controller 84 | completion:(ICCompletion)completion { 85 | if ([model isKindOfClass:[NSString class]]) { 86 | NSError *error = nil; 87 | NSDictionary *data = [NSJSONSerialization JSONObjectWithData:[model dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&error]; 88 | model = [self modelWithData:data]; 89 | 90 | }else if ([model isKindOfClass:[NSDictionary class]]) { 91 | model = [self modelWithData:model]; 92 | }else { 93 | if ([model conformsToProtocol:@protocol(ICIWxModel)]) { 94 | self.channel = ICWxPayChannelKey; 95 | } 96 | 97 | if ([model conformsToProtocol:@protocol(ICIAliModel)]) { 98 | self.channel = ICALiPayChannelKey; 99 | } 100 | } 101 | 102 | if (model == nil) { 103 | ICLog(@"支付参数获取失败失败!!"); 104 | return; 105 | } 106 | 107 | ICBasePayEntry *entry = self.channelMap[self.channel]; 108 | if (entry == nil) { 109 | if (completion) { 110 | completion(ICErrorStatusCodeChannelFail); 111 | ICLog(@"创建支付对象失败!!"); 112 | } 113 | return; 114 | } 115 | 116 | [entry payWithModel:model controller:controller completion:completion]; 117 | } 118 | 119 | 120 | - (void)payWithModel:(id)model 121 | controller:(nullable UIViewController *)controller 122 | delegate:(id)delegate { 123 | self.delegate = delegate; 124 | [self payWithModel:model controller:controller completion:^(ICErrorStatusCode code) { 125 | if ([self.delegate respondsToSelector:@selector(payManagerdidCompleteWithError:)]) { 126 | [self.delegate payManagerdidCompleteWithError:code]; 127 | } 128 | }]; 129 | } 130 | 131 | - (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication { 132 | ICBasePayEntry *entry = self.channelMap[self.channel]; 133 | return [entry handleOpenURL:url 134 | sourceApplication:sourceApplication]; 135 | } 136 | 137 | - (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity { 138 | ICBasePayEntry *entry = self.channelMap[self.channel]; 139 | return [entry handleOpenUniversalLink:userActivity]; 140 | } 141 | 142 | #pragma mark - private 143 | - (void)registerPayEntrys { 144 | ICLog(@"ICPaySDK 创建Entry**************************"); 145 | ICBasePayEntry *aliPay = [NSClassFromString(@"ICAliPayEntry") new]; 146 | ICBasePayEntry *wxPay = [NSClassFromString(@"ICWxPayEntry") new]; 147 | 148 | self.channelMap[ICALiPayChannelKey] = aliPay; 149 | self.channelMap[ICWxPayChannelKey] = wxPay; 150 | } 151 | 152 | - (id)modelWithData:(NSDictionary *)data { 153 | NSString *aliIdentifier = self.service.aliPrimarykey; 154 | NSString *wxIdentifier = self.service.wxPrimaryKey; 155 | 156 | if ([[data allKeys] containsObject:aliIdentifier]) { 157 | self.channel = ICALiPayChannelKey; 158 | ICBaseParamsModel *ali = [NSClassFromString(@"ICAliPayModel") new]; 159 | [ali setData:data service:self.service]; 160 | return ali; 161 | 162 | }else if ([[data allKeys] containsObject:wxIdentifier]) { 163 | self.channel = ICWxPayChannelKey; 164 | ICBaseParamsModel *wx = [NSClassFromString(@"ICWxPayModel") new]; 165 | [wx setData:data service:self.service]; 166 | return wx; 167 | 168 | } 169 | return nil; 170 | } 171 | 172 | #pragma mark - getter 173 | 174 | - (NSMutableDictionary *)channelMap { 175 | if (_channelMap == nil) { 176 | _channelMap = [NSMutableDictionary dictionary]; 177 | } 178 | return _channelMap; 179 | } 180 | 181 | @end 182 | 183 | -------------------------------------------------------------------------------- /ICPaySDK/Base/ICPaySDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICPaySDK.h 3 | // Pods 4 | // 5 | // Created by iCorki on 2017/12/28. 6 | // 7 | 8 | #import "ICPaySDKAutoServiceProtocol.h" 9 | #import "ICPayDesignManager.h" 10 | #import "ICBasePayEntry.h" 11 | #import "ICIWxModel.h" 12 | #import "ICIAliModel.h" 13 | -------------------------------------------------------------------------------- /ICPaySDK/Base/Protocol/ICIAliModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICIAliModel.h 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ICIAliModel 12 | /** 白名单*/ 13 | - (NSString *)scheme; 14 | 15 | /** 16 | 支付宝签名 17 | */ 18 | - (NSString *)orderString; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ICPaySDK/Base/Protocol/ICIWxModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICIWxModel.h 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ICIWxModel 12 | 13 | /** 商家向财付通申请的商家id */ 14 | - (NSString *)partnerId; 15 | 16 | /** 预支付订单 */ 17 | - (NSString *)prepayId; 18 | 19 | /** 随机串,防重发 */ 20 | - (NSString *)nonceStr; 21 | 22 | /** 时间戳,防重发 */ 23 | - (UInt32)timeStamp; 24 | 25 | /** 商家根据财付通文档填写的数据和签名 */ 26 | - (NSString *)package; 27 | 28 | /** 商家根据微信开放平台文档对数据做的签名 */ 29 | - (NSString *)sign; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ICPaySDK/Base/Protocol/ICPaySDKAutoServiceProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICPaySDKServiceProtocol.h 3 | // AFNetworking 4 | // 5 | // Created by 王志刚 on 2018/7/4. 6 | // 7 | 8 | #import 9 | 10 | @protocol ICPaySDKAutoServiceProtocol 11 | 12 | /** 13 | 微信支付的appkey 14 | */ 15 | - (NSString *)wechatKey; 16 | /*支付宝支付的标识*/ 17 | - (NSString *)aliPrimarykey; 18 | /*银联支付的标识*/ 19 | - (NSString *)uniPrimarykey; 20 | /*微信支付的标识*/ 21 | - (NSString *)wxPrimaryKey; 22 | /*Universal Links*/ 23 | - (NSString *)universalLinks; 24 | 25 | 26 | 27 | /** 28 | scheme 29 | */ 30 | - (NSString *)scheme; 31 | 32 | /*微信支付的参数所对应的key 33 | */ 34 | - (NSString *)partnerIdKey; 35 | - (NSString *)prepayIdKey; 36 | - (NSString *)nonceStrKey; 37 | - (NSString *)timeStampKey; 38 | - (NSString *)packageKey; 39 | - (NSString *)signKey; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ICPaySDK/ICAliPay/ICAliPayEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICAliPayEntry.h 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import "ICBasePayEntry.h" 10 | 11 | @interface ICAliPayEntry : ICBasePayEntry 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ICPaySDK/ICAliPay/ICAliPayEntry.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICAliPayEntry.m 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import "ICAliPayEntry.h" 10 | #import 11 | #import "ICPayDesignManager.h" 12 | #import "ICIAliModel.h" 13 | 14 | @interface ICAliPayEntry() 15 | 16 | @property (nonatomic) ICCompletion completion; 17 | 18 | @end 19 | 20 | @implementation ICAliPayEntry 21 | 22 | - (void)payWithModel:(id)model 23 | controller:(UIViewController *)controller 24 | completion:(ICCompletion)completion { 25 | 26 | self.completion = completion; 27 | id aliModel = model; 28 | [[AlipaySDK defaultService] payOrder:aliModel.orderString 29 | fromScheme:aliModel.scheme 30 | callback:^(NSDictionary *resultDic) { 31 | [self handleResult:resultDic]; 32 | }]; 33 | } 34 | 35 | 36 | /** 37 | 处理支付 38 | */ 39 | - (BOOL)handleOpenURL:(NSURL *)url 40 | sourceApplication:(nullable NSString *)sourceApplication { 41 | [[AlipaySDK defaultService] processOrderWithPaymentResult:url 42 | standbyCallback:^(NSDictionary *resultDic) { 43 | [self handleResult:resultDic]; 44 | }]; 45 | return YES; 46 | } 47 | 48 | /** 49 | 处理支付回调 分析/解析 50 | 51 | @param result 结果集 52 | */ 53 | - (void)handleResult:(NSDictionary *)result { 54 | if (!self.completion) { 55 | return; 56 | } 57 | 58 | NSInteger code = [result[@"resultStatus"] integerValue]; 59 | if (code == 9000) { 60 | self.completion(ICErrorStatusCodeSuccess); 61 | }else if (code == 6001) { 62 | self.completion(ICErrorStatusCodeUserCancel); 63 | }else { 64 | self.completion(ICErrorStatusCodeFailure); 65 | } 66 | 67 | self.completion = nil; 68 | } 69 | /* 70 | resultStatus,状态码,SDK里没对应信息,第一个文档里有提到: 71 | 9000 订单支付成功 72 | 8000 正在处理中 73 | 4000 订单支付失败 74 | 6001 用户中途取消 75 | 6002 网络连接出错 76 | memo, 提示信息,比如状态码为6001时,memo就是“用户中途取消”。但千万别完全依赖这个信息,如果未安装支付宝app,采用网页支付时,取消时状态码是6001,但这个memo是空的。。(当我发现这个问题的时候,我就决定,对于这么不靠谱的SDK,还是尽量靠自己吧。。) 77 | result,订单信息,以及签名验证信息。如果你不想做签名验证,那这个字段可以忽略了。。 78 | */ 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /ICPaySDK/ICAliPay/ICAliPayModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICAliPayModel.h 3 | // AFNetworking 4 | // 5 | // Created by iCorki. on 2018/1/20. 6 | // 7 | 8 | #import 9 | #import "ICIAliModel.h" 10 | #import "ICBaseParamsModel.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | @interface ICAliPayModel : ICBaseParamsModel 14 | 15 | @property (nonatomic, strong) NSString *scheme; 16 | 17 | @property (nonatomic, strong) NSString *orderString; 18 | 19 | @end 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /ICPaySDK/ICAliPay/ICAliPayModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICAliPayModel.m 3 | // AFNetworking 4 | // 5 | // Created by iCorki. on 2018/1/20. 6 | // 7 | 8 | #import "ICAliPayModel.h" 9 | 10 | @implementation ICAliPayModel 11 | 12 | - (NSString *)scheme { 13 | return _scheme; 14 | } 15 | 16 | - (NSString *)orderString { 17 | return _orderString; 18 | } 19 | 20 | - (void)setData:(NSDictionary *)data service:(id)service { 21 | self.scheme = service.scheme; 22 | self.orderString = data[service.aliPrimarykey]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ICPaySDK/ICWxPay/ICWxPayEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICWxPayEntry.h 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import "ICBasePayEntry.h" 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface ICWxPayEntry : ICBasePayEntry 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /ICPaySDK/ICWxPay/ICWxPayEntry.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICWxPayEntry.m 3 | // ICPayPlusDesign 4 | // 5 | // Created by wangzg on 2017/7/23. 6 | // Copyright © 2017年 iCorki. All rights reserved. 7 | // 8 | 9 | #import "ICWxPayEntry.h" 10 | #import 11 | #import 12 | #import "ICMacros.h" 13 | 14 | @interface ICWxPayEntry() 15 | 16 | @property (nonatomic) ICCompletion completion; 17 | 18 | @end 19 | 20 | @implementation ICWxPayEntry 21 | 22 | - (void)setAppKey:(NSString *)appKey universalLinks:(nonnull NSString *)universalLinks { 23 | if (appKey) { 24 | BOOL isSuccess = [WXApi registerApp:appKey universalLink:universalLinks]; 25 | if (isSuccess) { 26 | ICLog(@"wechatPay sdk register success"); 27 | }else { 28 | ICLog(@"wechatPay sdk register failure"); 29 | } 30 | } 31 | } 32 | 33 | /** 34 | 微信支付实现 35 | */ 36 | - (void)payWithModel:(id)model 37 | controller:(UIViewController *)controller 38 | completion:(ICCompletion)completion { 39 | self.completion = completion; 40 | if(![WXApi isWXAppInstalled]) { 41 | if (self.completion) { 42 | self.completion(ICErrorStatusCodeUnsupported); 43 | } 44 | return; 45 | } 46 | 47 | id wxModel = model; 48 | PayReq *request = [[PayReq alloc] init]; 49 | request.partnerId = [wxModel partnerId]; 50 | request.prepayId= [wxModel prepayId]; 51 | request.package = [wxModel package];//@"Sign=WXPay" 52 | request.nonceStr= [wxModel nonceStr]; 53 | request.timeStamp = [wxModel timeStamp]; 54 | request.sign= [wxModel sign]; 55 | [WXApi sendReq:request completion:nil]; 56 | } 57 | 58 | - (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication { 59 | return [WXApi handleOpenURL:url delegate:self]; 60 | } 61 | 62 | - (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity { 63 | return [WXApi handleOpenUniversalLink:userActivity delegate:self]; 64 | } 65 | 66 | /** 67 | 微信支付回调 68 | 69 | @param resp 具体的回应内容 70 | 71 | */ 72 | //WXSuccess = 0, /**< 成功 */ 73 | //WXErrCodeCommon = -1, /**< 普通错误类型 */ 74 | //WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */ 75 | //WXErrCodeSentFail = -3, /**< 发送失败 */ 76 | //WXErrCodeAuthDeny = -4, /**< 授权失败 */ 77 | //WXErrCodeUnsupport = -5, /**< 微信不支持 */ 78 | 79 | - (void)onResp:(BaseResp *)resp { 80 | if ([resp isKindOfClass:[PayResp class]] && self.completion) { 81 | PayResp *response = (PayResp *)resp; 82 | switch (response.errCode) { 83 | case WXSuccess: 84 | self.completion(ICErrorStatusCodeSuccess); 85 | break; 86 | 87 | case WXErrCodeUserCancel: 88 | self.completion(ICErrorStatusCodeUserCancel); 89 | break; 90 | 91 | default: 92 | self.completion(ICErrorStatusCodeFailure); 93 | break; 94 | 95 | } 96 | self.completion = nil; 97 | } 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /ICPaySDK/ICWxPay/ICWxPayModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICWxPayModel.h 3 | // AFNetworking 4 | // 5 | // Created by iCorki. on 2018/1/20. 6 | // 7 | 8 | #import 9 | #import "ICIWxModel.h" 10 | #import "ICBaseParamsModel.h" 11 | @interface ICWxPayModel : ICBaseParamsModel 12 | 13 | @property (nonatomic) NSString *partnerId; 14 | @property (nonatomic) NSString *prepayId; 15 | @property (nonatomic) NSString *nonceStr; 16 | @property (nonatomic) UInt32 timeStamp; 17 | @property (nonatomic) NSString *package; 18 | @property (nonatomic) NSString *sign; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ICPaySDK/ICWxPay/ICWxPayModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ICWxPayModel.m 3 | // AFNetworking 4 | // 5 | // Created by iCorki. on 2018/1/20. 6 | // 7 | 8 | #import "ICWxPayModel.h" 9 | 10 | @implementation ICWxPayModel 11 | 12 | /** 商家向财付通申请的商家id */ 13 | - (NSString *)partnerId { 14 | return _partnerId; 15 | } 16 | 17 | /** 预支付订单 */ 18 | - (NSString *)prepayId { 19 | return _prepayId; 20 | } 21 | 22 | /** 随机串,防重发 */ 23 | - (NSString *)nonceStr { 24 | return _nonceStr; 25 | } 26 | 27 | /** 时间戳,防重发 */ 28 | - (UInt32)timeStamp { 29 | return _timeStamp; 30 | } 31 | 32 | /** 商家根据财付通文档填写的数据和签名 */ 33 | - (NSString *)package { 34 | return _package; 35 | } 36 | 37 | /** 商家根据微信开放平台文档对数据做的签名 */ 38 | - (NSString *)sign { 39 | return _sign; 40 | } 41 | 42 | - (void)setData:(NSDictionary *)data service:(id)service { 43 | NSString *partnerId = [service respondsToSelector:@selector(partnerIdKey)]? service.partnerIdKey: @"prepayId"; 44 | NSString *prepayId = [service respondsToSelector:@selector(prepayIdKey)]? service.prepayIdKey: @"noncestr"; 45 | NSString *nonceStr = [service respondsToSelector:@selector(nonceStrKey)]? service.nonceStrKey: @"timestamp"; 46 | NSString *timeStamp = [service respondsToSelector:@selector(timeStampKey)]? service.timeStampKey: @"package"; 47 | NSString *package = [service respondsToSelector:@selector(packageKey)]? service.packageKey: @"package"; 48 | NSString *sign = [service respondsToSelector:@selector(signKey)]? service.signKey: @"sign"; 49 | id pset = data[service.wxPrimaryKey]; 50 | if ([pset isKindOfClass:[NSDictionary class]]) { 51 | }else { 52 | pset = data; 53 | } 54 | 55 | self.partnerId = pset[partnerId]; 56 | self.prepayId = pset[prepayId]; 57 | self.nonceStr = pset[nonceStr]; 58 | self.timeStamp = [pset[timeStamp] intValue]; 59 | self.package = pset[package]; 60 | self.sign = pset[sign]; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 corkiios <675053587@qq.com> 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | * 暂时支持支付宝/微信支付,如果需要其他支付方式可以【自定义支付对象】 3 | 4 | # ICPaySDK 5 | 6 | [![CI Status](http://img.shields.io/travis/corkiios/ICPaySDK.svg?style=flat)](https://travis-ci.org/corkiios/ICPaySDK) 7 | [![Version](https://img.shields.io/cocoapods/v/ICPaySDK.svg?style=flat)](http://cocoapods.org/pods/ICPaySDK) 8 | [![License](https://img.shields.io/cocoapods/l/ICPaySDK.svg?style=flat)](http://cocoapods.org/pods/ICPaySDK) 9 | [![Platform](https://img.shields.io/cocoapods/p/ICPaySDK.svg?style=flat)](http://cocoapods.org/pods/ICPaySDK) 10 | 11 | ### 配置 12 | * 最新版本为 2.1.1 13 | * 使用Pod一键配置,也可以选择性的使用子模块 14 | ```ruby 15 | source 'https://github.com/CocoaPods/Specs.git' 16 | platform :ios, '8.0' 17 | 18 | target 'TargetName' do 19 | pod 'ICPaySDK' 20 | 21 | # pod 'ICPaySDK/ICWxPay' 22 | # pod 'ICPaySDK/ICAliPay' 23 | 24 | end 25 | 26 | ``` 27 | 28 | 29 | ### 初始化SDK 30 | 31 | ``` 32 | // 使用微信支付需要 33 | [[ICPayDesignManager shareInstance] registerWx:@"" universalLinks:@""]; 34 | 35 | ``` 36 | 37 | ### 设置支付回调 38 | 39 | ``` 40 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { 41 | return [[ICPayDesignManager shareInstance] handleOpenURL:url sourceApplication:sourceApplication]; 42 | 43 | } 44 | 45 | // NOTE: 9.0以后使用新API接口 46 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { 47 | return [[ICPayDesignManager shareInstance] handleOpenURL:url sourceApplication:nil]; 48 | } 49 | 50 | // 微信支付通用链接 51 | - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { 52 | return [[ICPayDesignManager shareInstance] handleOpenUniversalLink:userActivity]; 53 | } 54 | 55 | ``` 56 | 57 | ### 实现支付 58 | 59 | * 支付宝(支付宝为例) 60 | 61 | ``` 62 | /*闭包方式*/ 63 | /*自定义数据模型 实现协议 */ 64 | AliModel *model = [[AliModel alloc] init]; 65 | model.orderString = orderString; 66 | [[ICPayDesignManager shareInstance] payWithModel:model controller:nil completion:^(ICError *error) { 67 | /*回调*/ 68 | }]; 69 | 70 | /*代理方式*/ 71 | [[ICPayDesignManager shareInstance] payWithModel:model controller:nil delegate:self]; 72 | /*回调*/ 73 | - (void)payManagerdidCompleteWithError:(ICError *)error {} 74 | 75 | ``` 76 | 77 | ### 自定义支付对象 78 | 79 | ``` 80 | 1. 新建类 继承ICBasePayEntry,实现父类方法, 可以参考 ICAliPayEntry/ICWxPayEntry 81 | 82 | 83 | 支付统一规范 84 | */ 85 | 86 | - (void)payWithModel:(id)model 87 | controller:(nullable UIViewController *)controller 88 | completion:(nullable ICCompletion)completion; 89 | /** 90 | 处理支付 91 | */ 92 | - (BOOL)handleOpenURL:(NSURL *)url 93 | sourceApplication:(nullable NSString *)sourceApplication; 94 | 95 | /** 96 | 处理通用链接 97 | */ 98 | - (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity; 99 | 100 | 2. 添加 支付对象 101 | [[ICPayDesignManager shareInstance] addPayEntry:@"自定义的entry"]; 102 | 103 | 3. 发起支付 104 | [[ICPayDesignManager shareInstance] payWithEntryClass:<#(nonnull Class)#> data:<#(nonnull id)#> controller:<#(nonnull UIViewController *)#> completion:<#^(ICErrorStatusCode)completion#>] 105 | 106 | ``` 107 | 108 | ## Author 109 | 110 | iCorki, 675053587@qq.com 111 | 发现问题或者bug 👏指正! 112 | 113 | ## License 114 | 115 | ICPaySDK is available under the MIT license. See the LICENSE file for more info. 116 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------