├── .clang-format ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── SonarCloud.yml │ ├── deploy_to_cocoapods.yml │ └── primary.yml ├── .gitignore ├── .swiftlint.yml ├── .travis.yml ├── BuildConfigurations ├── PaystackOSX-Debug.xcconfig ├── PaystackOSX-Release.xcconfig ├── PaystackOSX-Shared.xcconfig ├── PaystackOSXTests-Debug.xcconfig ├── PaystackOSXTests-Release.xcconfig ├── PaystackOSXTests-Shared.xcconfig ├── PaystackiOS Tests-Debug.xcconfig ├── PaystackiOS Tests-Release.xcconfig ├── PaystackiOS Tests-Shared.xcconfig ├── PaystackiOS-Debug.xcconfig ├── PaystackiOS-Release.xcconfig ├── PaystackiOS-Shared.xcconfig ├── PaystackiOSStatic.xcconfig ├── PaystackiOSStaticFramework.xcconfig ├── Project-Debug.xcconfig ├── Project-Release.xcconfig └── Project-Shared.xcconfig ├── CHANGELOG ├── Dangerfile.swift ├── Example ├── Paystack iOS Application Tests │ ├── Info.plist │ ├── PSTCKPaymentCardTextFieldUITests.m │ └── Paystack iOS Application Tests-Bridging-Header.h ├── Paystack iOS Example.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── Paystack iOS Application Tests.xcscheme │ │ └── Paystack iOS Example (Simple).xcscheme └── Paystack iOS Example │ ├── AppDelegate.swift │ ├── Base.lproj │ └── Main.storyboard │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── LaunchImage.launchimage │ │ └── Contents.json │ └── caps.imageset │ │ ├── Contents.json │ │ ├── article-0-1BE8490500000578-267_964x647-1.png │ │ └── article-0-1BE8490500000578-267_964x647.png │ ├── Info.plist │ ├── Paystack iOS Example.entitlements │ └── ViewController.swift ├── GUIDE.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Paystack.podspec ├── Paystack.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ ├── PaystackOSX Tests.xcscheme │ ├── PaystackOSX.xcscheme │ ├── PaystackiOS Tests.xcscheme │ ├── PaystackiOS.xcscheme │ └── PaystackiOSStaticFramework.xcscheme ├── Paystack.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ └── Paystack.xccheckout ├── Paystack ├── AddressViewController.xib ├── BuildConfigurations │ ├── PaystackOSX-Debug.xcconfig │ ├── PaystackOSX-Release.xcconfig │ ├── PaystackOSX-Shared.xcconfig │ ├── PaystackOSXTests-Debug.xcconfig │ ├── PaystackOSXTests-Release.xcconfig │ ├── PaystackOSXTests-Shared.xcconfig │ ├── PaystackiOS Tests-Debug.xcconfig │ ├── PaystackiOS Tests-Release.xcconfig │ ├── PaystackiOS Tests-Shared.xcconfig │ ├── PaystackiOS-Debug.xcconfig │ ├── PaystackiOS-Release.xcconfig │ ├── PaystackiOS-Shared.xcconfig │ ├── PaystackiOSStatic.xcconfig │ ├── PaystackiOSStaticFramework.xcconfig │ ├── Project-Debug.xcconfig │ ├── Project-Release.xcconfig │ └── Project-Shared.xcconfig ├── ButtonExtension.swift ├── Info.plist ├── KeyboardHandlingVC.swift ├── NSDictionary+Paystack.h ├── NSDictionary+Paystack.m ├── PSTCKAPIClient+Private.h ├── PSTCKAPIClient.m ├── PSTCKAPIClientExtension.swift ├── PSTCKAPIPostRequest.h ├── PSTCKAPIPostRequest.m ├── PSTCKAddressViewController.swift ├── PSTCKCard.m ├── PSTCKCardParams.m ├── PSTCKCardValidator.m ├── PSTCKCategoryLoader.h ├── PSTCKCategoryLoader.m ├── PSTCKFormEncoder.h ├── PSTCKFormEncoder.m ├── PSTCKToken.m ├── PSTCKTransaction.m ├── PSTCKTransactionParams.m ├── PSTCKValidationParams.m ├── PaystackError.m ├── PublicHeaders │ ├── PSTCKAPIClient.h │ ├── PSTCKAPIResponseDecodable.h │ ├── PSTCKCard.h │ ├── PSTCKCardBrand.h │ ├── PSTCKCardParams.h │ ├── PSTCKCardValidationState.h │ ├── PSTCKCardValidator.h │ ├── PSTCKFormEncodable.h │ ├── PSTCKToken.h │ ├── PSTCKTransaction.h │ ├── PSTCKTransactionParams.h │ ├── PSTCKValidationParams.h │ ├── Paystack.h │ ├── PaystackError.h │ └── UI │ │ ├── PSTCKPaymentCardTextField.h │ │ └── UIImage+Paystack.h ├── RSA │ ├── PSTCKRSA.h │ └── PSTCKRSA.m ├── Resources │ └── Images │ │ ├── Cancel.png │ │ ├── Cancel@2x.png │ │ ├── Cancel@3x.png │ │ ├── pstck_card_amex.png │ │ ├── pstck_card_amex@2x.png │ │ ├── pstck_card_amex@3x.png │ │ ├── pstck_card_cvc.png │ │ ├── pstck_card_cvc@2x.png │ │ ├── pstck_card_cvc@3x.png │ │ ├── pstck_card_cvc_amex.png │ │ ├── pstck_card_cvc_amex@2x.png │ │ ├── pstck_card_cvc_amex@3x.png │ │ ├── pstck_card_diners.png │ │ ├── pstck_card_diners@2x.png │ │ ├── pstck_card_diners@3x.png │ │ ├── pstck_card_discover.png │ │ ├── pstck_card_discover@2x.png │ │ ├── pstck_card_discover@3x.png │ │ ├── pstck_card_jcb.png │ │ ├── pstck_card_jcb@2x.png │ │ ├── pstck_card_jcb@3x.png │ │ ├── pstck_card_mastercard.png │ │ ├── pstck_card_mastercard@2x.png │ │ ├── pstck_card_mastercard@3x.png │ │ ├── pstck_card_placeholder.png │ │ ├── pstck_card_placeholder@2x.png │ │ ├── pstck_card_placeholder@3x.png │ │ ├── pstck_card_placeholder_template.png │ │ ├── pstck_card_placeholder_template@2x.png │ │ ├── pstck_card_placeholder_template@3x.png │ │ ├── pstck_card_verve.png │ │ ├── pstck_card_verve@2x.png │ │ ├── pstck_card_verve@3x.png │ │ ├── pstck_card_visa.png │ │ ├── pstck_card_visa@2x.png │ │ └── pstck_card_visa@3x.png ├── UI │ ├── PSTCKAuthViewController.h │ ├── PSTCKAuthViewController.m │ ├── PSTCKFormTextField.h │ ├── PSTCKFormTextField.m │ ├── PSTCKPaymentCardTextField.m │ ├── PSTCKPaymentCardTextFieldViewModel.h │ ├── PSTCKPaymentCardTextFieldViewModel.m │ └── UIImage+Paystack.m └── Validator │ ├── RequiredRule.swift │ ├── Rule.swift │ ├── Validatable.swift │ ├── ValidationDelegate.swift │ ├── ValidationError.swift │ ├── ValidationRule.swift │ ├── Validator.swift │ └── ValidatorDictionary.swift ├── README.md ├── Tests ├── OSX Tests │ └── Info.plist ├── Tests │ ├── Info.plist │ ├── PSTCKAPIClientTest.m │ ├── PSTCKCardValidatorTest.m │ ├── PSTCKPaymentCardTextFieldTest.m │ ├── PSTCKPaymentCardTextFieldViewModelTest.m │ ├── PSTCKTokenTest.m │ └── UIImage+PaystackTest.m ├── iOS Tests │ └── Info.plist └── installation_tests │ ├── carthage │ ├── CarthageTest.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── CarthageTest.xcscheme │ ├── CarthageTest │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.xib │ │ │ └── Main.storyboard │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── ViewController.swift │ ├── CarthageTestTests │ │ ├── CarthageTestTests.swift │ │ └── Info.plist │ └── test.sh │ ├── cocoapods │ ├── with_frameworks │ │ ├── CocoapodsTest.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── CocoapodsTest.xcscheme │ │ ├── CocoapodsTest.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── CocoapodsTest.xccheckout │ │ ├── CocoapodsTest │ │ │ ├── AppDelegate.swift │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.xib │ │ │ │ └── Main.storyboard │ │ │ ├── Images.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ └── ViewController.swift │ │ ├── CocoapodsTestTests │ │ │ ├── CocoapodsTestTests.swift │ │ │ └── Info.plist │ │ ├── Podfile │ │ └── test.sh │ └── without_frameworks │ │ ├── CocoapodsTest.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── CocoapodsTest.xcscheme │ │ ├── CocoapodsTest.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── CocoapodsTest.xccheckout │ │ ├── CocoapodsTest │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.xib │ │ │ └── Main.storyboard │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m │ │ ├── CocoapodsTestTests │ │ ├── CocoapodsTestTests.m │ │ └── Info.plist │ │ ├── Podfile │ │ └── test.sh │ └── manual_installation │ ├── ManualInstallationTest.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── ManualInstallationTest.xcscheme │ ├── ManualInstallationTest │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m │ ├── ManualInstallationTestTests │ ├── Info.plist │ └── ManualInstallationTestTests.m │ └── test.sh ├── VERSION ├── ci_scripts ├── FauxPasConfig │ └── main.fauxpas.json ├── check_fauxpas.sh ├── check_version.rb ├── export_builds.sh └── install_fauxpas.sh ├── fastlane ├── Appfile ├── Fastfile └── README.md └── sonar-project.properties /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | # BasedOnStyle: LLVM 4 | AccessModifierOffset: -2 5 | ConstructorInitializerIndentWidth: 4 6 | AlignEscapedNewlinesLeft: false 7 | AlignTrailingComments: true 8 | AllowAllParametersOfDeclarationOnNextLine: true 9 | AllowShortBlocksOnASingleLine: false 10 | AllowShortIfStatementsOnASingleLine: false 11 | AllowShortLoopsOnASingleLine: false 12 | AllowShortFunctionsOnASingleLine: All 13 | AlwaysBreakTemplateDeclarations: false 14 | AlwaysBreakBeforeMultilineStrings: false 15 | BreakBeforeBinaryOperators: false 16 | BreakBeforeBraces: Attach 17 | BreakBeforeTernaryOperators: false 18 | BreakConstructorInitializersBeforeComma: false 19 | BinPackParameters: false 20 | BinPackParameters: false 21 | ColumnLimit: 160 22 | CommentPragmas: '^ IWYU pragma:' 23 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 24 | ContinuationIndentWidth: 4 25 | Cpp11BracedListStyle: true 26 | DerivePointerAlignment: true 27 | DisableFormat: false 28 | ExperimentalAutoDetectBinPacking: true 29 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] 30 | IndentCaseLabels: false 31 | IndentWidth: 4 32 | IndentWrappedFunctionNames: false 33 | IndentFunctionDeclarationAfterType: false 34 | MaxEmptyLinesToKeep: 1 35 | KeepEmptyLinesAtTheStartOfBlocks: false 36 | NamespaceIndentation: None 37 | ObjCSpaceAfterProperty: true 38 | ObjCSpaceBeforeProtocolList: false 39 | PenaltyBreakBeforeFirstCallParameter: 19 40 | PenaltyBreakComment: 300 41 | PenaltyBreakString: 1000 42 | PenaltyBreakFirstLessLess: 120 43 | PenaltyExcessCharacter: 1000000 44 | PenaltyReturnTypeOnItsOwnLine: 60 45 | PointerAlignment: Right 46 | SpaceBeforeAssignmentOperators: true 47 | SpaceBeforeParens: ControlStatements 48 | SpacesInAngles: false 49 | SpacesInContainerLiterals: false 50 | SpacesInCStyleCastParentheses: false 51 | SpaceInEmptyParentheses: false 52 | SpacesInParentheses: false 53 | SpacesBeforeTrailingComments: 1 54 | Standard: Cpp11 55 | TabWidth: 8 56 | UseTab: Never 57 | ... 58 | 59 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | We accept contributions via Pull Requests. 6 | 7 | 8 | ## Pull Requests 9 | 10 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 11 | 12 | - **Create feature branches** - Don't ask us to pull from your master branch. 13 | 14 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 15 | 16 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 17 | 18 | 19 | ## Running Tests 20 | 21 | TODO: Include Code for runnning tests in this project 22 | ``` bash 23 | ``` 24 | 25 | **Happy coding**! 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Problem/Motivation 2 | (Why the issue was filed, steps to reproduce the problem, etc.) 3 | 4 | ## Proposed resolution 5 | (Description of the proposed solution, the rationale behind it, and workarounds for people who cannot use the patch.) 6 | 7 | ## Repeatable 8 | Always|Sometimes|Specific conditions|Specific times 9 | 10 | (If it is a bug, you are reporting lease specify:) 11 | 12 | ## Steps to repeat: (Describe how the issue can be repeated by someone who is to work on it) 13 | 1. Step 1 14 | 2. Step 2 15 | 3. ... 16 | 17 | ## Expected Results: 18 | (What you expected steps 1, 2 and 3 to give) 19 | 20 | ## Actual Results: 21 | (What is gave including any error messages, memory dump etc that can help) 22 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Fixes #0 (Enter the number for the issue this fixes. If you have not yet created an issue, please do so now or delete this line if you are only submitting a patch) 2 | 3 | ## Changes made by this pull request 4 | - 5 | - 6 | - 7 | 8 | -------------------------------------------------------------------------------- /.github/workflows/SonarCloud.yml: -------------------------------------------------------------------------------- 1 | name: SonarCloud 2 | on: 3 | schedule: 4 | - cron: '0 0 * * *' 5 | pull_request: 6 | types: [opened, synchronize, reopened] 7 | workflow_dispatch: 8 | jobs: 9 | sonarcloud: 10 | name: SonarCloud 11 | runs-on: macos-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | with: 15 | fetch-depth: 0 16 | - name: Setup environment 17 | run: | 18 | bundle install 19 | - name: Build 20 | shell: bash 21 | run: | 22 | curl -L -O https://sonarcloud.io/static/cpp/build-wrapper-macosx-x86.zip 23 | unzip -o build-wrapper-macosx-x86.zip 24 | /Users/runner/work/paystack-ios/paystack-ios/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir DerivedData\compilation-database \ 25 | xcodebuild \ 26 | -scheme "PaystackiOS Tests"\ 27 | -derivedDataPath DerivedData\ 28 | -enableCodeCoverage "YES"\ 29 | -destination 'platform=iOS Simulator,name=iPhone 8,OS=14.4'\ 30 | test 31 | 32 | - name: Set up JDK 17 33 | uses: actions/setup-java@v3.10.0 34 | with: 35 | distribution: 'temurin' 36 | java-version: 17 37 | 38 | - name: SonarCloud Analysis 39 | env: 40 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 41 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 42 | run: | 43 | gem install slather 44 | brew install sonar-scanner 45 | bundle exec fastlane metrics 46 | -------------------------------------------------------------------------------- /.github/workflows/deploy_to_cocoapods.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to Cocoapods Trunk 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: macos-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | - name: Install Cocoapods 15 | run: gem install cocoapods 16 | 17 | - uses: michaelhenry/deploy-to-cocoapods-github-action@1.0.10 18 | env: 19 | COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} 20 | -------------------------------------------------------------------------------- /.github/workflows/primary.yml: -------------------------------------------------------------------------------- 1 | name: Primary 2 | on: 3 | pull_request: 4 | branches: [ master ] 5 | 6 | jobs: 7 | CodeQuality: 8 | runs-on: ubuntu-latest 9 | name: Code quality Checks 10 | 11 | steps: 12 | - uses: actions/checkout@v3 13 | - name: Danger 14 | uses: docker://ghcr.io/danger/danger-swift-with-swiftlint:3.9.1 15 | with: 16 | args: --failOnErrors --no-publish-check 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | 20 | UnitTests: 21 | name: Unit Tests 22 | runs-on: macos-latest 23 | 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v3 27 | 28 | - name: Setup environment 29 | run: | 30 | bundle install 31 | 32 | - name: Select Xcode Version 33 | uses: maxim-lobanov/setup-xcode@v1 34 | with: 35 | xcode-version: latest-stable 36 | 37 | - name: Run tests 38 | run: | 39 | bundle exec fastlane unit_tests 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | Tests/build/* 3 | Tests/installation_tests/cocoapods/**/Podfile.lock 4 | Tests/installation_tests/cocoapods/**/Pods 5 | Tests/installation_tests/manual_installation/build 6 | Tests/installation_tests/manual_installation/ManualInstallationTest/Frameworks/Paystack.framework 7 | Tests/installation_tests/carthage/Cartfile 8 | Tests/installation_tests/carthage/Cartfile.resolved 9 | Tests/installation_tests/carthage/Carthage/* 10 | 11 | *.pbxuser 12 | *.mode1v3 13 | *.mode2v3 14 | *.perspectivev3 15 | *.swp 16 | *.moved-aside 17 | *.xcscmblueprint 18 | .idea 19 | 20 | .DS_Store 21 | profile 22 | DerivedData 23 | 24 | xcuserdata 25 | 26 | project.xcworkspace 27 | 28 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: # rule identifiers turned on by default to exclude from running 2 | - line_length 3 | - force_cast 4 | excluded: # paths to ignore during linting. Takes precedence over `included`. 5 | - Example/Pods 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7 3 | 4 | env: 5 | global: 6 | secure: gZMOaHQIeG7nplBCuH7EKf9o6Ez2rtoSskrv3nOTziSxFfZq322MrxvkidDpEN7AKWYQm27FO+tCzgq0slXb578lQ9P5ySDwEdExKtk/jMtKsBsf3cr4dzSMiqV5D5TbsH2jE9HQlpYUoJeoMBicR2XsTmd7wiu2jAzNBFqGfiY= 7 | 8 | before_install: 9 | - brew install carthage 10 | - gem update cocoapods --no-ri --no-rdoc 11 | - gem install xcpretty --no-ri --no-rdoc 12 | - ./ci_scripts/install_fauxpas.sh 13 | 14 | script: 15 | - "./ci_scripts/check_fauxpas.sh" 16 | - "./ci_scripts/check_version.rb" 17 | - set -o pipefail && xcodebuild test -workspace Paystack.xcworkspace -scheme "PaystackiOS Tests" -configuration Debug -sdk iphonesimulator | xcpretty -c 18 | - set -o pipefail && xcodebuild test -workspace Paystack.xcworkspace -scheme "Paystack iOS Application Tests" -configuration Debug -sdk iphonesimulator -destination "OS=9.0,name=iPhone 6" | xcpretty -c 19 | - set -o pipefail && xcodebuild test -workspace Paystack.xcworkspace -scheme "PaystackOSX Tests" | xcpretty -c 20 | - set -o pipefail && xcodebuild build -workspace Paystack.xcworkspace -scheme "Paystack iOS Example (Simple)" -sdk iphonesimulator | xcpretty -c 21 | - set -o pipefail && xcodebuild build -workspace Paystack.xcworkspace -scheme "Paystack iOS Example (Custom)" -sdk iphonesimulator | xcpretty -c 22 | - "./Tests/installation_tests/cocoapods/with_frameworks/test.sh" 23 | - "./Tests/installation_tests/cocoapods/without_frameworks/test.sh" 24 | - "./Tests/installation_tests/manual_installation/test.sh" 25 | # - "./Tests/installation_tests/carthage/test.sh" 26 | -------------------------------------------------------------------------------- /BuildConfigurations/PaystackOSX-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSX-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackOSX-Shared.xcconfig" 9 | 10 | 11 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) -------------------------------------------------------------------------------- /BuildConfigurations/PaystackOSX-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSX-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackOSX-Shared.xcconfig" 9 | 10 | 11 | // Debug Information Format 12 | // 13 | // This setting controls the format of debug information used by the developer tools. 14 | // 15 | // DWARF - Object files and linked products will use DWARF as the debug information 16 | // format. [dwarf] 17 | // DWARF with dSYM File - Object files and linked products will use DWARF as the debug 18 | // information format, and Xcode will also produce a dSYM file containing the debug 19 | // information from the individual object files (except that a dSYM file is not needed 20 | // and will not be created for static library or object file products). [dwarf-with-dsym] 21 | 22 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym -------------------------------------------------------------------------------- /BuildConfigurations/PaystackOSXTests-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSXTests-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackOSXTests-Shared.xcconfig" 9 | 10 | 11 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) -------------------------------------------------------------------------------- /BuildConfigurations/PaystackOSXTests-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSXTests-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackOSXTests-Shared.xcconfig" 9 | 10 | 11 | // Debug Information Format 12 | // 13 | // This setting controls the format of debug information used by the developer tools. 14 | // 15 | // DWARF - Object files and linked products will use DWARF as the debug information 16 | // format. [dwarf] 17 | // DWARF with dSYM File - Object files and linked products will use DWARF as the debug 18 | // information format, and Xcode will also produce a dSYM file containing the debug 19 | // information from the individual object files (except that a dSYM file is not needed 20 | // and will not be created for static library or object file products). [dwarf-with-dsym] 21 | 22 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 23 | -------------------------------------------------------------------------------- /BuildConfigurations/PaystackOSXTests-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSXTests-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | 9 | CLANG_CXX_LANGUAGE_STANDARD = gnu++0x 10 | 11 | 12 | 13 | CLANG_CXX_LIBRARY = libc++ 14 | 15 | 16 | 17 | CLANG_ENABLE_MODULES = YES 18 | 19 | 20 | 21 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 22 | 23 | 24 | 25 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 26 | 27 | 28 | 29 | // Combine High Resolution Artwork 30 | // 31 | // Combines image files at different resolutions into one multi-page TIFF file that is 32 | // HiDPI compliant for Mac OS X 10.7 and later. Only image files in the same directory 33 | // and with the same base name and extension are combined. The file names must conform to 34 | // the naming convention used in HiDPI. 35 | 36 | COMBINE_HIDPI_IMAGES = YES 37 | 38 | 39 | 40 | // Framework Search Paths 41 | // 42 | // This is a list of paths to folders containing frameworks to be searched by the 43 | // compiler for both included or imported header files when compiling C, Objective-C, 44 | // C++, or Objective-C++, and by the linker for frameworks used by the product. Paths are 45 | // delimited by whitespace, so any paths with spaces in them need to be properly quoted. 46 | // [-F] 47 | 48 | FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_FRAMEWORKS_DIR) $(inherited) 49 | 50 | 51 | 52 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 53 | 54 | 55 | 56 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 57 | 58 | 59 | 60 | GCC_WARN_SHADOW = YES 61 | 62 | 63 | 64 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE 65 | 66 | 67 | 68 | // Info.plist File 69 | // 70 | // This is the project-relative path to the plist file that contains the Info.plist 71 | // information used by bundles. 72 | 73 | INFOPLIST_FILE = Tests/Tests/Info.plist 74 | 75 | 76 | 77 | // Runpath Search Paths 78 | // 79 | // This is a list of paths to be added to the runpath search path list for the image 80 | // being created. At runtime, dyld uses the runpath when searching for dylibs whose load 81 | // path begins with '@rpath/'. [-rpath] 82 | 83 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks 84 | 85 | 86 | 87 | // OS X Deployment Target 88 | // 89 | // Code will load on this and later versions of OS X. Framework APIs that are 90 | // unavailable in earlier versions will be weak-linked; your code should check for null 91 | // function pointers or specific system versions before calling newer APIs. 92 | // 93 | // Compiler Default - Code will load on any Mac OS system that supports the APIs that are 94 | // used. 95 | // OS X 10.4 - Code will not load on systems earlier than 10.4. [10.4] 96 | // OS X 10.5 - Code will not load on systems earlier than 10.5. [10.5] 97 | // OS X 10.6 - Code will not load on systems earlier than 10.6. [10.6] 98 | // OS X 10.7 - Code will not load on systems earlier than 10.7. [10.7] 99 | // OS X 10.8 - Code will not load on systems earlier than 10.8. [10.8] 100 | // OS X 10.9 - Code will not load on systems earlier than 10.9. [10.9] 101 | 102 | MACOSX_DEPLOYMENT_TARGET = 10.10 103 | 104 | 105 | 106 | // Product Name 107 | // 108 | // This is the basename of the product generated. 109 | 110 | PRODUCT_NAME = $(TARGET_NAME) 111 | 112 | 113 | 114 | // Base SDK 115 | // 116 | // The name or path of the base SDK being used during the build. The product will be 117 | // built against the headers and libraries located inside the indicated SDK. This path 118 | // will be prepended to all search paths, and will be passed through the environment to 119 | // the compiler and linker. Additional SDKs can be specified in the ADDITIONAL_SDKS 120 | // setting. 121 | 122 | SDKROOT = macosx -------------------------------------------------------------------------------- /BuildConfigurations/PaystackiOS Tests-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS Tests-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackiOS Tests-Shared.xcconfig" 9 | 10 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) 11 | DEBUG_INFORMATION_FORMAT = dwarf 12 | -------------------------------------------------------------------------------- /BuildConfigurations/PaystackiOS Tests-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS Tests-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackiOS Tests-Shared.xcconfig" 9 | 10 | //********************************************// 11 | //* Currently no build settings in this file *// 12 | //********************************************// 13 | -------------------------------------------------------------------------------- /BuildConfigurations/PaystackiOS Tests-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS Tests-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | 9 | CLANG_CXX_LANGUAGE_STANDARD = gnu++0x 10 | 11 | 12 | CLANG_CXX_LIBRARY = libc++ 13 | 14 | 15 | CLANG_ENABLE_MODULES = YES 16 | 17 | 18 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 19 | 20 | 21 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 22 | 23 | 24 | IPHONEOS_DEPLOYMENT_TARGET = 8.0 25 | 26 | 27 | // Code Signing Identity 28 | // 29 | // The name ("common name") of a valid code-signing certificate in a keychain within your 30 | // keychain path. A missing or invalid certificate will cause a build error. 31 | 32 | CODE_SIGN_IDENTITY = iPhone Developer 33 | 34 | 35 | // Framework Search Paths 36 | // 37 | // This is a list of paths to folders containing frameworks to be searched by the 38 | // compiler for both included or imported header files when compiling C, Objective-C, 39 | // C++, or Objective-C++, and by the linker for frameworks used by the product. Paths are 40 | // delimited by whitespace, so any paths with spaces in them need to be properly quoted. 41 | // [-F] 42 | 43 | FRAMEWORK_SEARCH_PATHS = $(inherited) 44 | 45 | 46 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 47 | 48 | 49 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 50 | 51 | 52 | GCC_WARN_SHADOW = YES 53 | 54 | 55 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE 56 | 57 | 58 | // Header Search Paths 59 | // 60 | // This is a list of paths to folders to be searched by the compiler for included or 61 | // imported header files when compiling C, Objective-C, C++, or Objective-C++. Paths are 62 | // delimited by whitespace, so any paths with spaces in them need to be properly quoted. 63 | // [-I] 64 | 65 | HEADER_SEARCH_PATHS = $(inherited) 66 | 67 | 68 | // Info.plist File 69 | // 70 | // This is the project-relative path to the plist file that contains the Info.plist 71 | // information used by bundles. 72 | 73 | INFOPLIST_FILE = Tests/Tests/Info.plist 74 | 75 | 76 | // Runpath Search Paths 77 | // 78 | // This is a list of paths to be added to the runpath search path list for the image 79 | // being created. At runtime, dyld uses the runpath when searching for dylibs whose load 80 | // path begins with '@rpath/'. [-rpath] 81 | 82 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks 83 | 84 | 85 | OTHER_CFLAGS = 86 | 87 | 88 | // Product Name 89 | // 90 | // This is the basename of the product generated. 91 | 92 | PRODUCT_NAME = $(TARGET_NAME) 93 | -------------------------------------------------------------------------------- /BuildConfigurations/PaystackiOS-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackiOS-Shared.xcconfig" 9 | 10 | 11 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) 12 | -------------------------------------------------------------------------------- /BuildConfigurations/PaystackiOS-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackiOS-Shared.xcconfig" 9 | 10 | ENABLE_NS_ASSERTIONS = YES 11 | -------------------------------------------------------------------------------- /BuildConfigurations/PaystackiOSStatic.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOSStatic-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | // Strip Debug Symbols During Copy 9 | // 10 | // Activating this setting causes binary files which are copied during the build (e.g., 11 | // in a Copy Bundle Resources or Copy Files build phase) to be stripped of debugging 12 | // symbols. It does not cause the linked product of a target to be stripped (use Strip 13 | // Linked Product for that). 14 | 15 | COPY_PHASE_STRIP = NO 16 | 17 | CLANG_CXX_LANGUAGE_STANDARD = gnu++0x 18 | 19 | 20 | CLANG_CXX_LIBRARY = libc++ 21 | 22 | 23 | CLANG_ENABLE_MODULES = YES 24 | 25 | 26 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 27 | 28 | 29 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 30 | 31 | 32 | // Dead Code Stripping 33 | // 34 | // Activating this setting causes the -dead_strip flag to be passed to ld(1) via cc(1) to 35 | // turn on dead code stripping. If this option is selected, -gfull (not -gused) must be 36 | // used to generate debugging symbols in order to have them correctly stripped. 37 | // [-dead_strip] 38 | 39 | DEAD_CODE_STRIPPING = NO 40 | 41 | 42 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 43 | 44 | 45 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 46 | 47 | 48 | GCC_WARN_SHADOW = YES 49 | 50 | 51 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE 52 | 53 | PSTCK_EXTRA_PREPROCESSOR_MACROS = PSTCK_STATIC_LIBRARY_BUILD 54 | 55 | // iOS Deployment Target 56 | // 57 | // Code will load on this and later versions of iOS. Framework APIs that are unavailable 58 | // in earlier versions will be weak-linked; your code should check for null function 59 | // pointers or specific system versions before calling newer APIs. 60 | // 61 | 62 | IPHONEOS_DEPLOYMENT_TARGET = 7.0 63 | 64 | 65 | // Other Linker Flags 66 | // 67 | // Options defined in this setting are passed to invocations of the linker. 68 | 69 | OTHER_LDFLAGS = -ObjC 70 | 71 | 72 | // Product Name 73 | // 74 | // This is the basename of the product generated. 75 | 76 | PRODUCT_NAME = Paystack 77 | 78 | 79 | // Skip Install 80 | // 81 | // Activating this setting when deployment locations are used causes the product to be 82 | // built into an alternative location instead of the install location. 83 | 84 | SKIP_INSTALL = YES 85 | 86 | 87 | // Strip Style 88 | // 89 | // Defines the level of symbol stripping to be performed on the linked product of the 90 | // build. The default value is defined by the target's product type. 91 | // 92 | // All Symbols - Completely strips the binary, removing the symbol table and relocation 93 | // information. [all, -s] 94 | // Non-Global Symbols - Strips non-global symbols, but saves external symbols. 95 | // [non-global, -x] 96 | // Debugging Symbols - Strips debugging symbols, but saves local and global symbols. 97 | // [debugging, -S] 98 | 99 | STRIP_STYLE = non-global 100 | -------------------------------------------------------------------------------- /BuildConfigurations/PaystackiOSStaticFramework.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOSStaticFramework-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | 9 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 10 | 11 | 12 | GCC_WARN_SHADOW = YES 13 | 14 | 15 | // Product Name 16 | // 17 | // This is the basename of the product generated. 18 | 19 | PRODUCT_NAME = $(TARGET_NAME) 20 | -------------------------------------------------------------------------------- /BuildConfigurations/Project-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Project-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "Project-Shared.xcconfig" 9 | 10 | 11 | // Strip Debug Symbols During Copy 12 | // 13 | // Activating this setting causes binary files which are copied during the build (e.g., 14 | // in a Copy Bundle Resources or Copy Files build phase) to be stripped of debugging 15 | // symbols. It does not cause the linked product of a target to be stripped (use Strip 16 | // Linked Product for that). 17 | 18 | COPY_PHASE_STRIP = NO 19 | 20 | 21 | GCC_DYNAMIC_NO_PIC = NO 22 | 23 | 24 | GCC_OPTIMIZATION_LEVEL = 0 25 | 26 | 27 | PSTCK_EXTRA_PREPROCESSOR_MACROS= 28 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) $(PSTCK_EXTRA_PREPROCESSOR_MACROS) 29 | 30 | 31 | GCC_SYMBOLS_PRIVATE_EXTERN = NO 32 | 33 | 34 | // Build Active Architecture Only 35 | // 36 | // When checked, only the active architecture is built for faster debugging turnaround 37 | 38 | ONLY_ACTIVE_ARCH = YES 39 | 40 | // iOS Deployment Target 41 | // 42 | // Code will load on this and later versions of iOS. Framework APIs that are unavailable 43 | // in earlier versions will be weak-linked; your code should check for null function 44 | // pointers or specific system versions before calling newer APIs. 45 | 46 | IPHONEOS_DEPLOYMENT_TARGET = 7.0 47 | 48 | ENABLE_TESTABILITY = YES 49 | -------------------------------------------------------------------------------- /BuildConfigurations/Project-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Project-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "Project-Shared.xcconfig" 9 | 10 | 11 | // Strip Debug Symbols During Copy 12 | // 13 | // Activating this setting causes binary files which are copied during the build (e.g., 14 | // in a Copy Bundle Resources or Copy Files build phase) to be stripped of debugging 15 | // symbols. It does not cause the linked product of a target to be stripped (use Strip 16 | // Linked Product for that). 17 | 18 | COPY_PHASE_STRIP = YES 19 | 20 | 21 | ENABLE_NS_ASSERTIONS = NO 22 | 23 | PSTCK_EXTRA_PREPROCESSOR_MACROS= 24 | GCC_PREPROCESSOR_DEFINITIONS = NDEBUG $(PSTCK_EXTRA_PREPROCESSOR_MACROS) 25 | 26 | 27 | // Validate Built Product 28 | // 29 | // Activating this setting will cause Xcode to perform validation checks on the product 30 | // as part of the build process. 31 | 32 | VALIDATE_PRODUCT = YES 33 | 34 | // iOS Deployment Target 35 | // 36 | // Code will load on this and later versions of iOS. Framework APIs that are unavailable 37 | // in earlier versions will be weak-linked; your code should check for null function 38 | // pointers or specific system versions before calling newer APIs. 39 | // 40 | 41 | IPHONEOS_DEPLOYMENT_TARGET = 8.0 42 | -------------------------------------------------------------------------------- /BuildConfigurations/Project-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Project-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | 9 | // Always Search User Paths 10 | // 11 | // If enabled both #include -style and #include "header.h"-style directives 12 | // will search the paths in "User Header Search Paths" before "Header Search Paths", with 13 | // the consequence that user headers (such as your own String.h header) would have 14 | // precedence over system headers when using #include . This is done using the 15 | // -iquote flag for the paths provided in "User Header Search Paths". If disabled and 16 | // your compiler fully supports separate user paths, user headers will only be accessible 17 | // with #include "header.h"-style preprocessor directives. 18 | // 19 | // For backwards compatibility reasons, this setting is enabled by default, but disabling 20 | // it is strongly recommended. 21 | 22 | ALWAYS_SEARCH_USER_PATHS = NO 23 | 24 | 25 | CLANG_ENABLE_OBJC_ARC = YES 26 | 27 | 28 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 29 | 30 | 31 | CLANG_WARN_BOOL_CONVERSION = YES 32 | 33 | 34 | CLANG_WARN_CONSTANT_CONVERSION = YES 35 | 36 | 37 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES 38 | 39 | 40 | CLANG_WARN_EMPTY_BODY = YES 41 | 42 | 43 | CLANG_WARN_ENUM_CONVERSION = YES 44 | 45 | 46 | CLANG_WARN_INT_CONVERSION = YES 47 | 48 | 49 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 50 | 51 | 52 | CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES 53 | 54 | 55 | CLANG_WARN_UNREACHABLE_CODE = YES 56 | 57 | 58 | ENABLE_STRICT_OBJC_MSGSEND = YES 59 | 60 | 61 | GCC_C_LANGUAGE_STANDARD = gnu99 62 | 63 | 64 | // Compiler for C/C++/Objective-C 65 | // 66 | // The compiler to use for C, C++, and Objective-C. 67 | 68 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0 69 | 70 | 71 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES 72 | 73 | 74 | GCC_WARN_ABOUT_MISSING_NEWLINE = YES 75 | 76 | 77 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES 78 | 79 | 80 | GCC_WARN_ABOUT_RETURN_TYPE = YES 81 | 82 | 83 | GCC_WARN_SIGN_COMPARE = YES 84 | 85 | 86 | GCC_WARN_UNDECLARED_SELECTOR = YES 87 | 88 | 89 | GCC_WARN_UNINITIALIZED_AUTOS = YES 90 | 91 | 92 | GCC_WARN_UNUSED_FUNCTION = YES 93 | 94 | 95 | GCC_WARN_UNUSED_VARIABLE = YES 96 | 97 | 98 | GCC_NO_COMMON_BLOCKS = YES; 99 | 100 | // Precompiled Header Uses Files From Build Directory 101 | // 102 | // This setting allows for better control of sharing precompiled prefix header files 103 | // between projects. By default, Xcode assumes that the prefix header file may include 104 | // header files from the build directory if the build directory is outside of the project 105 | // directory. (Xcode cannot determine this ahead of time since other projects may not 106 | // have been built into the shared build directory at the time the information is 107 | // needed.) 108 | // 109 | // If your prefix file never includes files from the build directory you may set this to 110 | // "NO" to improve sharing of precompiled headers. If the prefix does use files from a 111 | // build directory which is inside your project directory, you may set this to "YES" to 112 | // avoid unintended sharing that may result in build failures. 113 | 114 | PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO 115 | 116 | 117 | // Base SDK 118 | // 119 | // The name or path of the base SDK being used during the build. The product will be 120 | // built against the headers and libraries located inside the indicated SDK. This path 121 | // will be prepended to all search paths, and will be passed through the environment to 122 | // the compiler and linker. Additional SDKs can be specified in the ADDITIONAL_SDKS 123 | // setting. 124 | 125 | SDKROOT = iphoneos 126 | 127 | 128 | WARNING_CFLAGS = -Wall -Wextra -Wundef -Wfloat-equal 129 | 130 | PRODUCT_BUNDLE_IDENTIFIER = com.paystack.$(PRODUCT_NAME:rfc1034identifier) 131 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | === 3.0.13 2019-11-4 2 | 3 | * Updates deprecated class UIWebView to WKWebView 4 | 5 | === 3.0.6 2019-03-29 6 | 7 | * Change title and placeholder of OTP dialog 8 | 9 | === 3.0.5 2018-04-13 10 | 11 | * Allow adding an NSMutableDictionary or an NSMutableArray directly to metadata 12 | 13 | === 3.0.4 2017-05-25 14 | 15 | * Hotfix Ensure we notify caller when showing or dismissing our dialogs 16 | 17 | === 3.0.3 2017-05-24 18 | 19 | * Hotfix Ensure we notify caller when showing or dismissing our dialogs 20 | 21 | === 2.1.1 2016-12-08 22 | 23 | * Hotfix Add TransactionParams to PaystackIOSStatic's headers 24 | 25 | === 2.1.1 2016-11-13 26 | 27 | * Add plan and currency 28 | 29 | Add plan and currency support 30 | 31 | === 2.1.0 2016-11-13 32 | 33 | * Add Metadata 34 | 35 | Add Metadata support 36 | 37 | === 2.0.0 2016-10-22 38 | 39 | * Charge Cards 40 | 41 | Add Charge Cards functionality 42 | 43 | === 1.0.0 2016-03-03 44 | 45 | * Initial release 46 | 47 | Special thanks to: the Stripe iOS team. This was built based on their library at http://github.com/stripe/stripe-ios . 48 | -------------------------------------------------------------------------------- /Dangerfile.swift: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | import Danger 3 | 4 | fileprivate extension Danger.File { 5 | var isInTests: Bool { hasPrefix("PaystackTests/") } 6 | 7 | var isSourceFile: Bool { 8 | hasSuffix(".swift") || hasSuffix(".h") || hasSuffix(".m") 9 | } 10 | } 11 | 12 | let danger = Danger() 13 | 14 | let hasSourceChanges = (danger.git.modifiedFiles + danger.git.createdFiles).contains { $0.isSourceFile } 15 | //SwiftLint 16 | SwiftLint.lint(configFile: ".swiftlint.yml") 17 | 18 | // Encourage smaller PRs 19 | let bigPRThreshold = 50 20 | if (danger.github.pullRequest.additions! + danger.github.pullRequest.deletions! > bigPRThreshold) { 21 | warn("Pull Request size seems relatively large. If this Pull Request contains multiple changes, please split each into separate PR will helps faster, easier review."); 22 | } 23 | 24 | // Make it more obvious that a PR is a work in progress and shouldn't be merged yet 25 | if danger.github?.pullRequest.title.contains("WIP") == true { 26 | warn("PR is marked as Work in Progress") 27 | } 28 | 29 | // Warn when files has been updated but not tests. 30 | if hasSourceChanges && !danger.git.modifiedFiles.contains(where: { $0.isInTests }) { 31 | warn("The source files were changed, but the tests remain unmodified. Consider updating or adding to the tests to match the source changes.") 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Example/Paystack iOS Application 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 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Paystack iOS Application Tests/Paystack iOS Application Tests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /Example/Paystack iOS Example.xcodeproj/xcshareddata/xcschemes/Paystack iOS Application Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Paystack iOS Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Paystack iOS Exampe (Simple) 4 | // 5 | 6 | import UIKit 7 | 8 | extension String { 9 | var isEmail: Bool { 10 | let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}" 11 | let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) 12 | return emailTest.evaluate(with: self) 13 | } 14 | } 15 | 16 | @UIApplicationMain 17 | class AppDelegate: UIResponder, UIApplicationDelegate { 18 | 19 | var window: UIWindow? 20 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 21 | return true 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Example/Paystack iOS Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/Paystack iOS Example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Paystack iOS Example/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Paystack iOS Example/Images.xcassets/caps.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "filename" : "article-0-1BE8490500000578-267_964x647-1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "filename" : "article-0-1BE8490500000578-267_964x647.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "3x" 16 | }, 17 | { 18 | "idiom" : "ipad", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "idiom" : "ipad", 23 | "scale" : "2x" 24 | } 25 | ], 26 | "info" : { 27 | "version" : 1, 28 | "author" : "xcode" 29 | }, 30 | "properties" : { 31 | "template-rendering-intent" : "original" 32 | } 33 | } -------------------------------------------------------------------------------- /Example/Paystack iOS Example/Images.xcassets/caps.imageset/article-0-1BE8490500000578-267_964x647-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Example/Paystack iOS Example/Images.xcassets/caps.imageset/article-0-1BE8490500000578-267_964x647-1.png -------------------------------------------------------------------------------- /Example/Paystack iOS Example/Images.xcassets/caps.imageset/article-0-1BE8490500000578-267_964x647.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Example/Paystack iOS Example/Images.xcassets/caps.imageset/article-0-1BE8490500000578-267_964x647.png -------------------------------------------------------------------------------- /Example/Paystack iOS Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/Paystack iOS Example/Paystack iOS Example.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | keychain-access-groups 6 | 7 | $(AppIdentifierPrefix)com.paystack.Paystack-iOS-Example 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "fastlane" 4 | gem "slather" 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017 Paystack, Inc. (https://paystack.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /Paystack.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'Paystack' 3 | s.version = '3.0.17' 4 | s.summary = 'Paystack is a web-based API helping African Businesses accept payments online.' 5 | s.description = <<-DESC 6 | Paystack makes it easy for African Businesses to accept Mastercard, Visa and Verve cards from anyone, anywhere in the world. 7 | DESC 8 | 9 | s.license = { :type => 'MIT', :file => 'LICENSE' } 10 | s.homepage = 'https://paystack.com' 11 | s.authors = { 'Jubril Olambiwonnu' => 'jubril@paystack.com', 'Ibrahim Lawal' => 'ibrahim@paystack.com', 'Paystack' => 'support@paystack.com' } 12 | s.source = { :git => 'https://github.com/paystackhq/paystack-ios.git', :tag => "v#{s.version}" } 13 | s.ios.frameworks = 'Foundation', 'Security' 14 | s.ios.weak_frameworks = 'PassKit', 'AddressBook' 15 | s.requires_arc = true 16 | s.default_subspecs = 'Core' 17 | s.ios.deployment_target = '11.0' 18 | s.swift_versions = '5.0' 19 | 20 | 21 | s.subspec 'Core' do |ss| 22 | ss.public_header_files = 'Paystack/PublicHeaders/*.h', 'Paystack/RSA/*.h' 23 | ss.ios.public_header_files = 'Paystack/PublicHeaders/UI/*.h' 24 | ss.source_files = 'Paystack/PublicHeaders/*.h', 'Paystack/RSA/*.{h,m}', 'Paystack/*.{h,m}' 25 | ss.ios.source_files = 'Paystack/PublicHeaders/UI/*.h', 'Paystack/UI/*.{h,m}', 'Paystack/**/*.{swift}' 26 | ss.resources = 'Paystack/Resources/**/*' 27 | end 28 | 29 | end 30 | -------------------------------------------------------------------------------- /Paystack.xcodeproj/xcshareddata/xcschemes/PaystackiOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 44 | 45 | 51 | 52 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Paystack.xcodeproj/xcshareddata/xcschemes/PaystackiOSStaticFramework.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Paystack.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Paystack.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Paystack.xcworkspace/xcshareddata/Paystack.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 1610AC64-BC46-4B78-8270-41A398C514B7 9 | IDESourceControlProjectName 10 | Paystack 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 14 | ssh://github.com/stripe/stripe-ios.git 15 | D0DC6CE0350266C4AFFCC35DA49B75AE57E8D73E 16 | github.com:stripe/PaymentKit.git 17 | 18 | IDESourceControlProjectPath 19 | Paystack.xcworkspace 20 | IDESourceControlProjectRelativeInstallPathDictionary 21 | 22 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 23 | .. 24 | D0DC6CE0350266C4AFFCC35DA49B75AE57E8D73E 25 | ../Example/PaymentKit 26 | 27 | IDESourceControlProjectURL 28 | ssh://github.com/stripe/stripe-ios.git 29 | IDESourceControlProjectVersion 30 | 111 31 | IDESourceControlProjectWCCIdentifier 32 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 33 | IDESourceControlProjectWCConfigurations 34 | 35 | 36 | IDESourceControlRepositoryExtensionIdentifierKey 37 | public.vcs.git 38 | IDESourceControlWCCIdentifierKey 39 | D0DC6CE0350266C4AFFCC35DA49B75AE57E8D73E 40 | IDESourceControlWCCName 41 | PaymentKit 42 | 43 | 44 | IDESourceControlRepositoryExtensionIdentifierKey 45 | public.vcs.git 46 | IDESourceControlWCCIdentifierKey 47 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 48 | IDESourceControlWCCName 49 | stripe-ios 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackOSX-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSX-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackOSX-Shared.xcconfig" 9 | 10 | 11 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackOSX-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSX-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackOSX-Shared.xcconfig" 9 | 10 | 11 | // Debug Information Format 12 | // 13 | // This setting controls the format of debug information used by the developer tools. 14 | // 15 | // DWARF - Object files and linked products will use DWARF as the debug information 16 | // format. [dwarf] 17 | // DWARF with dSYM File - Object files and linked products will use DWARF as the debug 18 | // information format, and Xcode will also produce a dSYM file containing the debug 19 | // information from the individual object files (except that a dSYM file is not needed 20 | // and will not be created for static library or object file products). [dwarf-with-dsym] 21 | 22 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackOSXTests-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSXTests-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackOSXTests-Shared.xcconfig" 9 | 10 | 11 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackOSXTests-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSXTests-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackOSXTests-Shared.xcconfig" 9 | 10 | 11 | // Debug Information Format 12 | // 13 | // This setting controls the format of debug information used by the developer tools. 14 | // 15 | // DWARF - Object files and linked products will use DWARF as the debug information 16 | // format. [dwarf] 17 | // DWARF with dSYM File - Object files and linked products will use DWARF as the debug 18 | // information format, and Xcode will also produce a dSYM file containing the debug 19 | // information from the individual object files (except that a dSYM file is not needed 20 | // and will not be created for static library or object file products). [dwarf-with-dsym] 21 | 22 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 23 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackOSXTests-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackOSXTests-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | 9 | CLANG_CXX_LANGUAGE_STANDARD = gnu++0x 10 | 11 | 12 | 13 | CLANG_CXX_LIBRARY = libc++ 14 | 15 | 16 | 17 | CLANG_ENABLE_MODULES = YES 18 | 19 | 20 | 21 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 22 | 23 | 24 | 25 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 26 | 27 | 28 | 29 | // Combine High Resolution Artwork 30 | // 31 | // Combines image files at different resolutions into one multi-page TIFF file that is 32 | // HiDPI compliant for Mac OS X 10.7 and later. Only image files in the same directory 33 | // and with the same base name and extension are combined. The file names must conform to 34 | // the naming convention used in HiDPI. 35 | 36 | COMBINE_HIDPI_IMAGES = YES 37 | 38 | 39 | 40 | // Framework Search Paths 41 | // 42 | // This is a list of paths to folders containing frameworks to be searched by the 43 | // compiler for both included or imported header files when compiling C, Objective-C, 44 | // C++, or Objective-C++, and by the linker for frameworks used by the product. Paths are 45 | // delimited by whitespace, so any paths with spaces in them need to be properly quoted. 46 | // [-F] 47 | 48 | FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_FRAMEWORKS_DIR) $(inherited) 49 | 50 | 51 | 52 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 53 | 54 | 55 | 56 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 57 | 58 | 59 | 60 | GCC_WARN_SHADOW = YES 61 | 62 | 63 | 64 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE 65 | 66 | 67 | 68 | // Info.plist File 69 | // 70 | // This is the project-relative path to the plist file that contains the Info.plist 71 | // information used by bundles. 72 | 73 | INFOPLIST_FILE = Tests/Tests/Info.plist 74 | 75 | 76 | 77 | // Runpath Search Paths 78 | // 79 | // This is a list of paths to be added to the runpath search path list for the image 80 | // being created. At runtime, dyld uses the runpath when searching for dylibs whose load 81 | // path begins with '@rpath/'. [-rpath] 82 | 83 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks 84 | 85 | 86 | 87 | // OS X Deployment Target 88 | // 89 | // Code will load on this and later versions of OS X. Framework APIs that are 90 | // unavailable in earlier versions will be weak-linked; your code should check for null 91 | // function pointers or specific system versions before calling newer APIs. 92 | // 93 | // Compiler Default - Code will load on any Mac OS system that supports the APIs that are 94 | // used. 95 | // OS X 10.4 - Code will not load on systems earlier than 10.4. [10.4] 96 | // OS X 10.5 - Code will not load on systems earlier than 10.5. [10.5] 97 | // OS X 10.6 - Code will not load on systems earlier than 10.6. [10.6] 98 | // OS X 10.7 - Code will not load on systems earlier than 10.7. [10.7] 99 | // OS X 10.8 - Code will not load on systems earlier than 10.8. [10.8] 100 | // OS X 10.9 - Code will not load on systems earlier than 10.9. [10.9] 101 | 102 | MACOSX_DEPLOYMENT_TARGET = 10.10 103 | 104 | 105 | 106 | // Product Name 107 | // 108 | // This is the basename of the product generated. 109 | 110 | PRODUCT_NAME = $(TARGET_NAME) 111 | 112 | 113 | 114 | // Base SDK 115 | // 116 | // The name or path of the base SDK being used during the build. The product will be 117 | // built against the headers and libraries located inside the indicated SDK. This path 118 | // will be prepended to all search paths, and will be passed through the environment to 119 | // the compiler and linker. Additional SDKs can be specified in the ADDITIONAL_SDKS 120 | // setting. 121 | 122 | SDKROOT = macosx -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackiOS Tests-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS Tests-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackiOS Tests-Shared.xcconfig" 9 | 10 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) 11 | DEBUG_INFORMATION_FORMAT = dwarf 12 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackiOS Tests-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS Tests-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackiOS Tests-Shared.xcconfig" 9 | 10 | //********************************************// 11 | //* Currently no build settings in this file *// 12 | //********************************************// 13 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackiOS Tests-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS Tests-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | 9 | CLANG_CXX_LANGUAGE_STANDARD = gnu++0x 10 | 11 | 12 | CLANG_CXX_LIBRARY = libc++ 13 | 14 | 15 | CLANG_ENABLE_MODULES = YES 16 | 17 | 18 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 19 | 20 | 21 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 22 | 23 | 24 | IPHONEOS_DEPLOYMENT_TARGET = 8.0 25 | 26 | 27 | // Code Signing Identity 28 | // 29 | // The name ("common name") of a valid code-signing certificate in a keychain within your 30 | // keychain path. A missing or invalid certificate will cause a build error. 31 | 32 | CODE_SIGN_IDENTITY = iPhone Developer 33 | 34 | 35 | // Framework Search Paths 36 | // 37 | // This is a list of paths to folders containing frameworks to be searched by the 38 | // compiler for both included or imported header files when compiling C, Objective-C, 39 | // C++, or Objective-C++, and by the linker for frameworks used by the product. Paths are 40 | // delimited by whitespace, so any paths with spaces in them need to be properly quoted. 41 | // [-F] 42 | 43 | FRAMEWORK_SEARCH_PATHS = $(inherited) 44 | 45 | 46 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 47 | 48 | 49 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 50 | 51 | 52 | GCC_WARN_SHADOW = YES 53 | 54 | 55 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE 56 | 57 | 58 | // Header Search Paths 59 | // 60 | // This is a list of paths to folders to be searched by the compiler for included or 61 | // imported header files when compiling C, Objective-C, C++, or Objective-C++. Paths are 62 | // delimited by whitespace, so any paths with spaces in them need to be properly quoted. 63 | // [-I] 64 | 65 | HEADER_SEARCH_PATHS = $(inherited) 66 | 67 | 68 | // Info.plist File 69 | // 70 | // This is the project-relative path to the plist file that contains the Info.plist 71 | // information used by bundles. 72 | 73 | INFOPLIST_FILE = Tests/Tests/Info.plist 74 | 75 | 76 | // Runpath Search Paths 77 | // 78 | // This is a list of paths to be added to the runpath search path list for the image 79 | // being created. At runtime, dyld uses the runpath when searching for dylibs whose load 80 | // path begins with '@rpath/'. [-rpath] 81 | 82 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks 83 | 84 | 85 | OTHER_CFLAGS = 86 | 87 | 88 | // Product Name 89 | // 90 | // This is the basename of the product generated. 91 | 92 | PRODUCT_NAME = $(TARGET_NAME) 93 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackiOS-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackiOS-Shared.xcconfig" 9 | 10 | 11 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) 12 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackiOS-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOS-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "PaystackiOS-Shared.xcconfig" 9 | 10 | ENABLE_NS_ASSERTIONS = YES 11 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackiOSStatic.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOSStatic-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | // Strip Debug Symbols During Copy 9 | // 10 | // Activating this setting causes binary files which are copied during the build (e.g., 11 | // in a Copy Bundle Resources or Copy Files build phase) to be stripped of debugging 12 | // symbols. It does not cause the linked product of a target to be stripped (use Strip 13 | // Linked Product for that). 14 | 15 | COPY_PHASE_STRIP = NO 16 | 17 | CLANG_CXX_LANGUAGE_STANDARD = gnu++0x 18 | 19 | 20 | CLANG_CXX_LIBRARY = libc++ 21 | 22 | 23 | CLANG_ENABLE_MODULES = YES 24 | 25 | 26 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 27 | 28 | 29 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 30 | 31 | 32 | // Dead Code Stripping 33 | // 34 | // Activating this setting causes the -dead_strip flag to be passed to ld(1) via cc(1) to 35 | // turn on dead code stripping. If this option is selected, -gfull (not -gused) must be 36 | // used to generate debugging symbols in order to have them correctly stripped. 37 | // [-dead_strip] 38 | 39 | DEAD_CODE_STRIPPING = NO 40 | 41 | 42 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 43 | 44 | 45 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 46 | 47 | 48 | GCC_WARN_SHADOW = YES 49 | 50 | 51 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE 52 | 53 | PSTCK_EXTRA_PREPROCESSOR_MACROS = PSTCK_STATIC_LIBRARY_BUILD 54 | 55 | // iOS Deployment Target 56 | // 57 | // Code will load on this and later versions of iOS. Framework APIs that are unavailable 58 | // in earlier versions will be weak-linked; your code should check for null function 59 | // pointers or specific system versions before calling newer APIs. 60 | // 61 | 62 | IPHONEOS_DEPLOYMENT_TARGET = 7.0 63 | 64 | 65 | // Other Linker Flags 66 | // 67 | // Options defined in this setting are passed to invocations of the linker. 68 | 69 | OTHER_LDFLAGS = -ObjC 70 | 71 | 72 | // Product Name 73 | // 74 | // This is the basename of the product generated. 75 | 76 | PRODUCT_NAME = Paystack 77 | 78 | 79 | // Skip Install 80 | // 81 | // Activating this setting when deployment locations are used causes the product to be 82 | // built into an alternative location instead of the install location. 83 | 84 | SKIP_INSTALL = YES 85 | 86 | 87 | // Strip Style 88 | // 89 | // Defines the level of symbol stripping to be performed on the linked product of the 90 | // build. The default value is defined by the target's product type. 91 | // 92 | // All Symbols - Completely strips the binary, removing the symbol table and relocation 93 | // information. [all, -s] 94 | // Non-Global Symbols - Strips non-global symbols, but saves external symbols. 95 | // [non-global, -x] 96 | // Debugging Symbols - Strips debugging symbols, but saves local and global symbols. 97 | // [debugging, -S] 98 | 99 | STRIP_STYLE = non-global 100 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/PaystackiOSStaticFramework.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PaystackiOSStaticFramework-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | 9 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 10 | 11 | 12 | GCC_WARN_SHADOW = YES 13 | 14 | 15 | // Product Name 16 | // 17 | // This is the basename of the product generated. 18 | 19 | PRODUCT_NAME = $(TARGET_NAME) 20 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/Project-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Project-Debug.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "Project-Shared.xcconfig" 9 | 10 | 11 | // Strip Debug Symbols During Copy 12 | // 13 | // Activating this setting causes binary files which are copied during the build (e.g., 14 | // in a Copy Bundle Resources or Copy Files build phase) to be stripped of debugging 15 | // symbols. It does not cause the linked product of a target to be stripped (use Strip 16 | // Linked Product for that). 17 | 18 | COPY_PHASE_STRIP = NO 19 | 20 | 21 | GCC_DYNAMIC_NO_PIC = NO 22 | 23 | 24 | GCC_OPTIMIZATION_LEVEL = 0 25 | 26 | 27 | PSTCK_EXTRA_PREPROCESSOR_MACROS= 28 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) $(PSTCK_EXTRA_PREPROCESSOR_MACROS) 29 | 30 | 31 | GCC_SYMBOLS_PRIVATE_EXTERN = NO 32 | 33 | 34 | // Build Active Architecture Only 35 | // 36 | // When checked, only the active architecture is built for faster debugging turnaround 37 | 38 | ONLY_ACTIVE_ARCH = YES 39 | 40 | // iOS Deployment Target 41 | // 42 | // Code will load on this and later versions of iOS. Framework APIs that are unavailable 43 | // in earlier versions will be weak-linked; your code should check for null function 44 | // pointers or specific system versions before calling newer APIs. 45 | 46 | IPHONEOS_DEPLOYMENT_TARGET = 7.0 47 | 48 | ENABLE_TESTABILITY = YES 49 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/Project-Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Project-Release.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | #include "Project-Shared.xcconfig" 9 | 10 | 11 | // Strip Debug Symbols During Copy 12 | // 13 | // Activating this setting causes binary files which are copied during the build (e.g., 14 | // in a Copy Bundle Resources or Copy Files build phase) to be stripped of debugging 15 | // symbols. It does not cause the linked product of a target to be stripped (use Strip 16 | // Linked Product for that). 17 | 18 | COPY_PHASE_STRIP = YES 19 | 20 | 21 | ENABLE_NS_ASSERTIONS = NO 22 | 23 | PSTCK_EXTRA_PREPROCESSOR_MACROS= 24 | GCC_PREPROCESSOR_DEFINITIONS = NDEBUG $(PSTCK_EXTRA_PREPROCESSOR_MACROS) 25 | 26 | 27 | // Validate Built Product 28 | // 29 | // Activating this setting will cause Xcode to perform validation checks on the product 30 | // as part of the build process. 31 | 32 | VALIDATE_PRODUCT = YES 33 | 34 | // iOS Deployment Target 35 | // 36 | // Code will load on this and later versions of iOS. Framework APIs that are unavailable 37 | // in earlier versions will be weak-linked; your code should check for null function 38 | // pointers or specific system versions before calling newer APIs. 39 | // 40 | 41 | IPHONEOS_DEPLOYMENT_TARGET = 8.0 42 | -------------------------------------------------------------------------------- /Paystack/BuildConfigurations/Project-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Project-Shared.xcconfig 3 | // 4 | // Generated by BuildSettingExtractor on 4/27/15 5 | // https://github.com/dempseyatgithub/BuildSettingExtractor 6 | // 7 | 8 | 9 | // Always Search User Paths 10 | // 11 | // If enabled both #include -style and #include "header.h"-style directives 12 | // will search the paths in "User Header Search Paths" before "Header Search Paths", with 13 | // the consequence that user headers (such as your own String.h header) would have 14 | // precedence over system headers when using #include . This is done using the 15 | // -iquote flag for the paths provided in "User Header Search Paths". If disabled and 16 | // your compiler fully supports separate user paths, user headers will only be accessible 17 | // with #include "header.h"-style preprocessor directives. 18 | // 19 | // For backwards compatibility reasons, this setting is enabled by default, but disabling 20 | // it is strongly recommended. 21 | 22 | ALWAYS_SEARCH_USER_PATHS = NO 23 | 24 | 25 | CLANG_ENABLE_OBJC_ARC = YES 26 | 27 | 28 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 29 | 30 | 31 | CLANG_WARN_BOOL_CONVERSION = YES 32 | 33 | 34 | CLANG_WARN_CONSTANT_CONVERSION = YES 35 | 36 | 37 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES 38 | 39 | 40 | CLANG_WARN_EMPTY_BODY = YES 41 | 42 | 43 | CLANG_WARN_ENUM_CONVERSION = YES 44 | 45 | 46 | CLANG_WARN_INT_CONVERSION = YES 47 | 48 | 49 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 50 | 51 | 52 | CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES 53 | 54 | 55 | CLANG_WARN_UNREACHABLE_CODE = YES 56 | 57 | 58 | ENABLE_STRICT_OBJC_MSGSEND = YES 59 | 60 | 61 | GCC_C_LANGUAGE_STANDARD = gnu99 62 | 63 | 64 | // Compiler for C/C++/Objective-C 65 | // 66 | // The compiler to use for C, C++, and Objective-C. 67 | 68 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0 69 | 70 | 71 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES 72 | 73 | 74 | GCC_WARN_ABOUT_MISSING_NEWLINE = YES 75 | 76 | 77 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES 78 | 79 | 80 | GCC_WARN_ABOUT_RETURN_TYPE = YES 81 | 82 | 83 | GCC_WARN_SIGN_COMPARE = YES 84 | 85 | 86 | GCC_WARN_UNDECLARED_SELECTOR = YES 87 | 88 | 89 | GCC_WARN_UNINITIALIZED_AUTOS = YES 90 | 91 | 92 | GCC_WARN_UNUSED_FUNCTION = YES 93 | 94 | 95 | GCC_WARN_UNUSED_VARIABLE = YES 96 | 97 | 98 | GCC_NO_COMMON_BLOCKS = YES; 99 | 100 | // Precompiled Header Uses Files From Build Directory 101 | // 102 | // This setting allows for better control of sharing precompiled prefix header files 103 | // between projects. By default, Xcode assumes that the prefix header file may include 104 | // header files from the build directory if the build directory is outside of the project 105 | // directory. (Xcode cannot determine this ahead of time since other projects may not 106 | // have been built into the shared build directory at the time the information is 107 | // needed.) 108 | // 109 | // If your prefix file never includes files from the build directory you may set this to 110 | // "NO" to improve sharing of precompiled headers. If the prefix does use files from a 111 | // build directory which is inside your project directory, you may set this to "YES" to 112 | // avoid unintended sharing that may result in build failures. 113 | 114 | PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO 115 | 116 | 117 | // Base SDK 118 | // 119 | // The name or path of the base SDK being used during the build. The product will be 120 | // built against the headers and libraries located inside the indicated SDK. This path 121 | // will be prepended to all search paths, and will be passed through the environment to 122 | // the compiler and linker. Additional SDKs can be specified in the ADDITIONAL_SDKS 123 | // setting. 124 | 125 | SDKROOT = iphoneos 126 | 127 | 128 | WARNING_CFLAGS = -Wall -Wextra -Wundef -Wfloat-equal 129 | 130 | PRODUCT_BUNDLE_IDENTIFIER = com.paystack.$(PRODUCT_NAME:rfc1034identifier) 131 | -------------------------------------------------------------------------------- /Paystack/ButtonExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ButtonExtension.swift 3 | // PaystackiOS 4 | // 5 | // Created by Jubril Olambiwonnu on 7/9/20. 6 | // Copyright © 2020 Paystack, Inc. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | import ObjectiveC 12 | // Declare a global var to produce a unique address as the assoc object handle 13 | var disabledColorHandle: UInt8 = 0 14 | var highlightedColorHandle: UInt8 = 0 15 | var selectedColorHandle: UInt8 = 0 16 | 17 | extension UIButton { 18 | private func image(withColor color: UIColor) -> UIImage? { 19 | let rect = CGRect(x: 0.0, y: 0.0, width: 1.0, height: 1.0) 20 | UIGraphicsBeginImageContext(rect.size) 21 | let context = UIGraphicsGetCurrentContext() 22 | 23 | context?.setFillColor(color.cgColor) 24 | context?.fill(rect) 25 | 26 | let image = UIGraphicsGetImageFromCurrentImageContext() 27 | UIGraphicsEndImageContext() 28 | 29 | return image 30 | } 31 | 32 | func setBackgroundColor(_ color: UIColor, for state: UIControl.State) { 33 | self.setBackgroundImage(image(withColor: color), for: state) 34 | } 35 | 36 | @IBInspectable 37 | var disabledColor: UIColor? { 38 | get { 39 | if let color = objc_getAssociatedObject(self, &disabledColorHandle) as? UIColor { 40 | return color 41 | } 42 | return nil 43 | } 44 | set { 45 | if let color = newValue { 46 | self.setBackgroundColor(color, for: .disabled) 47 | objc_setAssociatedObject(self, &disabledColorHandle, color, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 48 | } else { 49 | self.setBackgroundImage(nil, for: .disabled) 50 | objc_setAssociatedObject(self, &disabledColorHandle, nil, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 51 | } 52 | } 53 | } 54 | 55 | @IBInspectable 56 | var highlightedColor: UIColor? { 57 | get { 58 | if let color = objc_getAssociatedObject(self, &highlightedColorHandle) as? UIColor { 59 | return color 60 | } 61 | return nil 62 | } 63 | set { 64 | if let color = newValue { 65 | self.setBackgroundColor(color, for: .highlighted) 66 | objc_setAssociatedObject(self, &highlightedColorHandle, color, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 67 | } else { 68 | self.setBackgroundImage(nil, for: .highlighted) 69 | objc_setAssociatedObject(self, &highlightedColorHandle, nil, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 70 | } 71 | } 72 | } 73 | 74 | @IBInspectable 75 | var selectedColor: UIColor? { 76 | get { 77 | if let color = objc_getAssociatedObject(self, &selectedColorHandle) as? UIColor { 78 | return color 79 | } 80 | return nil 81 | } 82 | set { 83 | if let color = newValue { 84 | self.setBackgroundColor(color, for: .selected) 85 | objc_setAssociatedObject(self, &selectedColorHandle, color, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 86 | } else { 87 | self.setBackgroundImage(nil, for: .selected) 88 | objc_setAssociatedObject(self, &selectedColorHandle, nil, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) 89 | } 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Paystack/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | PaystackiOS 9 | CFBundleExecutable 10 | Paystack 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Paystack/KeyboardHandlingVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardHandlingVC.swift 3 | // PaystackiOS 4 | // 5 | // Created by Jubril Olambiwonnu on 7/9/20. 6 | // Copyright © 2020 Paystack, Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class PSTCKKeyboardHandlingBaseVC: UIViewController { 12 | 13 | @IBOutlet weak var backgroundSV: UIScrollView! 14 | 15 | public override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | subscribeToNotification(UIResponder.keyboardWillShowNotification, selector: #selector(keyboardWillShowOrHide)) 19 | subscribeToNotification(UIResponder.keyboardWillHideNotification, selector: #selector(keyboardWillShowOrHide)) 20 | 21 | initializeHideKeyboard() 22 | 23 | } 24 | 25 | public override func viewWillDisappear(_ animated: Bool) { 26 | super.viewWillDisappear(animated) 27 | unsubscribeFromAllNotifications() 28 | } 29 | 30 | } 31 | 32 | // MARK : Keyboard Dismissal Handling on Tap 33 | private extension PSTCKKeyboardHandlingBaseVC { 34 | 35 | func initializeHideKeyboard(){ 36 | let tap: UITapGestureRecognizer = UITapGestureRecognizer( 37 | target: self, 38 | action: #selector(dismissMyKeyboard)) 39 | 40 | view.addGestureRecognizer(tap) 41 | } 42 | 43 | @objc func dismissMyKeyboard(){ 44 | view.endEditing(true) 45 | } 46 | } 47 | 48 | // MARK : Textfield Visibility Handling with Scroll 49 | private extension PSTCKKeyboardHandlingBaseVC { 50 | 51 | func subscribeToNotification(_ notification: NSNotification.Name, selector: Selector) { 52 | NotificationCenter.default.addObserver(self, selector: selector, name: notification, object: nil) 53 | } 54 | 55 | func unsubscribeFromAllNotifications() { 56 | NotificationCenter.default.removeObserver(self) 57 | } 58 | 59 | @objc func keyboardWillShowOrHide(notification: NSNotification) { 60 | 61 | // Pull a bunch of info out of the notification 62 | if let scrollView = backgroundSV, let userInfo = notification.userInfo, let endValue = userInfo[UIResponder.keyboardFrameEndUserInfoKey], let durationValue = userInfo[UIResponder.keyboardAnimationDurationUserInfoKey], let curveValue = userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] { 63 | 64 | // Transform the keyboard's frame into our view's coordinate system 65 | let endRect = view.convert((endValue as AnyObject).cgRectValue, from: view.window) 66 | 67 | // Find out how much the keyboard overlaps the scroll userInfoview 68 | // We can do this because our scroll view's frame is already in our view's coordinate system 69 | let keyboardOverlap = scrollView.frame.maxY - endRect.origin.y 70 | 71 | // Set the scroll view's content inset to avoid the keyboard 72 | // Don't forget the scroll indicator too! 73 | scrollView.contentInset.bottom = keyboardOverlap 74 | scrollView.scrollIndicatorInsets.bottom = keyboardOverlap 75 | 76 | let duration = (durationValue as AnyObject).doubleValue 77 | let options = UIView.AnimationOptions(rawValue: UInt((curveValue as AnyObject).integerValue << 16)) 78 | UIView.animate(withDuration: duration!, delay: 0, options: options, animations: { 79 | self.view.layoutIfNeeded() 80 | }, completion: nil) 81 | } 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /Paystack/NSDictionary+Paystack.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Paystack.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | 8 | @interface NSDictionary (Paystack) 9 | 10 | - (nullable NSDictionary *)pstck_dictionaryByRemovingNullsValidatingRequiredFields:(nonnull NSArray *)requiredFields; 11 | 12 | @end 13 | 14 | void linkDictionaryCategory(void); 15 | -------------------------------------------------------------------------------- /Paystack/NSDictionary+Paystack.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Paystack.m 3 | // Paystack 4 | // 5 | 6 | #import "NSDictionary+Paystack.h" 7 | 8 | @implementation NSDictionary (Paystack) 9 | 10 | - (nullable NSDictionary *)pstck_dictionaryByRemovingNullsValidatingRequiredFields:(nonnull NSArray *)requiredFields { 11 | NSMutableDictionary *dict = [NSMutableDictionary dictionary]; 12 | [self enumerateKeysAndObjectsUsingBlock:^(id key, id obj, __unused BOOL *stop) { 13 | if (obj != [NSNull null]) { 14 | dict[key] = obj; 15 | } 16 | }]; 17 | for (NSString *key in requiredFields) { 18 | if (![[dict allKeys] containsObject:key]) { 19 | return nil; 20 | } 21 | } 22 | return [dict copy]; 23 | } 24 | 25 | @end 26 | 27 | void linkDictionaryCategory(void){} 28 | -------------------------------------------------------------------------------- /Paystack/PSTCKAPIClient+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKAPIClient+Private.h 3 | // Paystack 4 | // 5 | // Copyright © 2016 Paystack, Inc. 6 | // 7 | 8 | #import 9 | 10 | @interface PSTCKAPIClient () 11 | 12 | @property (nonatomic, readwrite, nonnull) NSURL *apiURL; 13 | @property (nonatomic, readwrite, nonnull) NSURLSession *urlSession; 14 | @end 15 | -------------------------------------------------------------------------------- /Paystack/PSTCKAPIClientExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKAPIClientExtension.swift 3 | // PaystackiOS 4 | // 5 | // Created by Jubril Olambiwonnu on 6/19/20. 6 | // Copyright © 2020 Paystack, Inc. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | @objc extension PSTCKAPIClient { 12 | 13 | public func fetchStates(country: String, completion: @escaping ([PSTCKState], Error?) -> Void) { 14 | let url = URL(string: "https://api.paystack.co/address_verification/states?country=\(country)")! 15 | var request = URLRequest(url: url) 16 | request.httpMethod = "GET" 17 | URLSession.shared.dataTask(with: request, completionHandler: { data, response, error in 18 | guard let data = data, error == nil else { 19 | completion([PSTCKState](), error) 20 | return 21 | } 22 | let responseJSON = try? JSONSerialization.jsonObject(with: data, options: []) 23 | if let responseJSON = responseJSON as? [String: Any] { 24 | guard responseJSON["status"] as? Bool == true else { 25 | completion([PSTCKState](), StringError(responseJSON["message"] as? String ?? "Could not fetch issuing country states")) 26 | return 27 | } 28 | if let data = responseJSON["data"] as? [[String : Any]] { 29 | let states = data.compactMap{PSTCKState(dict: $0)} 30 | completion(states, nil) 31 | } 32 | } 33 | }).resume() 34 | } 35 | } 36 | 37 | 38 | @objc public class PSTCKState: NSObject { 39 | public var name: String 40 | public var abbreviation: String 41 | 42 | init(name: String, abb: String) { 43 | self.name = name 44 | self.abbreviation = abb 45 | } 46 | 47 | init?(dict: [String : Any]) { 48 | if let name = dict["name"] as? String, let abb = dict["abbreviation"] as? String { 49 | self.name = name 50 | self.abbreviation = abb 51 | return 52 | } 53 | return nil 54 | } 55 | } 56 | 57 | struct StringError : LocalizedError { 58 | var errorDescription: String? { return errorMessage } 59 | var failureReason: String? { return errorMessage } 60 | var recoverySuggestion: String? { return "" } 61 | var helpAnchor: String? { return "" } 62 | 63 | private var errorMessage : String 64 | 65 | init(_ description: String) 66 | { 67 | errorMessage = description 68 | } 69 | } 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Paystack/PSTCKAPIPostRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKAPIPostRequest.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import "PSTCKAPIResponseDecodable.h" 8 | @class PSTCKAPIClient; 9 | 10 | @interface PSTCKAPIPostRequest<__covariant ResponseType:id> : NSObject 11 | 12 | + (void)startWithAPIClient:(PSTCKAPIClient *)apiClient 13 | endpoint:(NSString *)endpoint 14 | method:(NSString *)httpMethod 15 | postData:(NSData *)postData 16 | serializer:(ResponseType)serializer 17 | completion:(void (^)(ResponseType object, NSError *error))completion; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Paystack/PSTCKAPIPostRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKAPIPostRequest.m 3 | // Paystack 4 | // 5 | 6 | #import "PSTCKAPIPostRequest.h" 7 | #import "PSTCKAPIClient.h" 8 | #import "PSTCKAPIClient+Private.h" 9 | #import "PaystackError.h" 10 | 11 | @implementation PSTCKAPIPostRequest 12 | 13 | + (void)startWithAPIClient:(PSTCKAPIClient *)apiClient 14 | endpoint:(NSString *)endpoint 15 | method:(NSString *)httpMethod 16 | postData:(NSData *)postData 17 | serializer:(id)serializer 18 | completion:(void (^)(id, NSError *))completion { 19 | 20 | NSURL *url = [apiClient.apiURL URLByAppendingPathComponent:endpoint]; 21 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url]; 22 | request.HTTPMethod = httpMethod; // @"POST" 23 | request.HTTPBody = postData; 24 | // NSLog(@"%@",postData); 25 | 26 | [[apiClient.urlSession dataTaskWithRequest:request completionHandler:^(NSData * _Nullable body, __unused NSURLResponse * _Nullable response, NSError * _Nullable error) { 27 | NSError *someerror; 28 | NSDictionary *jsonDictionary = body ? [NSJSONSerialization JSONObjectWithData:body options:NSJSONReadingAllowFragments error:&someerror] : nil; 29 | NSString *bodyString = [[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding]; 30 | id responseObject = [[serializer class] decodedObjectFromAPIResponse:jsonDictionary]; 31 | NSError *returnedError = error; 32 | if (!responseObject && !returnedError) { 33 | NSDictionary *userInfo = @{ 34 | NSLocalizedDescriptionKey: @"The response from Paystack failed to get parsed into valid JSON", 35 | PSTCKErrorMessageKey: [@"The response from Paystack failed to get parsed into valid JSON. Response was: " stringByAppendingString:bodyString] 36 | }; 37 | returnedError = [[NSError alloc] initWithDomain:PaystackDomain code:PSTCKAPIError userInfo:userInfo]; 38 | } 39 | // We're using the api client's operation queue instead of relying on the url session's operation queue 40 | // because the api client's queue is mutable and may have changed after initialization (not ideal) 41 | if (returnedError) { 42 | [apiClient.operationQueue addOperationWithBlock:^{ 43 | completion(nil, returnedError); 44 | }]; 45 | return; 46 | } 47 | [apiClient.operationQueue addOperationWithBlock:^{ 48 | completion(responseObject, nil); 49 | }]; 50 | }] resume]; 51 | 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Paystack/PSTCKCategoryLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKCategoryLoader.h 3 | // Paystack 4 | // 5 | 6 | #ifdef PSTCK_STATIC_LIBRARY_BUILD 7 | 8 | #import 9 | 10 | @interface PSTCKCategoryLoader : NSObject 11 | 12 | + (void)loadCategories; 13 | 14 | @end 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Paystack/PSTCKCategoryLoader.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKCategoryLoader.m 3 | // Paystack 4 | // 5 | 6 | #ifdef PSTCK_STATIC_LIBRARY_BUILD 7 | 8 | #import "PSTCKCategoryLoader.h" 9 | #import "NSDictionary+Paystack.h" 10 | #import "UIImage+Paystack.h" 11 | 12 | @implementation PSTCKCategoryLoader 13 | 14 | + (void)loadCategories { 15 | linkDictionaryCategory(); 16 | linkUIImageCategory(); 17 | } 18 | 19 | @end 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Paystack/PSTCKFormEncoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKFormEncoder.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | 8 | @class PSTCKCardParams; 9 | @class PSTCKTransactionParams; 10 | @protocol PSTCKFormEncodable; 11 | 12 | @interface PSTCKFormEncoder : NSObject 13 | 14 | + (nonnull NSData *)formEncodedDataForObject:(nonnull NSObject *)object 15 | usePublicKey:(nonnull NSString *)public_key 16 | onThisDevice:(nonnull NSString *)device_id; 17 | 18 | + (nonnull NSData *)formEncryptedDataForCard:(nonnull PSTCKCardParams *)card 19 | andTransaction:(nonnull PSTCKTransactionParams *)transaction 20 | usePublicKey:(nonnull NSString *)public_key 21 | onThisDevice:(nonnull NSString *)device_id; 22 | 23 | + (nonnull NSData *)formEncryptedDataForCard:(nonnull PSTCKCardParams *)card 24 | andTransaction:(nonnull PSTCKTransactionParams *)transaction 25 | andHandle:(nonnull NSString *)handle 26 | usePublicKey:(nonnull NSString *)public_key 27 | onThisDevice:(nonnull NSString *)device_id; 28 | 29 | + (nonnull NSData *)formEncryptedDataForDict:(nonnull NSDictionary *)dict 30 | usePublicKey:(nonnull NSString *)public_key 31 | onThisDevice:(nonnull NSString *)device_id; 32 | 33 | + (nonnull NSString *)stringByURLEncoding:(nonnull NSString *)string; 34 | 35 | + (nonnull NSString *)stringByReplacingSnakeCaseWithCamelCase:(nonnull NSString *)input; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Paystack/PSTCKToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKToken.m 3 | // Paystack 4 | // 5 | 6 | #import "PSTCKToken.h" 7 | #import "PSTCKCard.h" 8 | #import "NSDictionary+Paystack.h" 9 | 10 | @interface PSTCKToken() 11 | @property (nonatomic, nonnull) NSString *tokenId; 12 | @property (nonatomic) NSString *last4; 13 | @property (nonatomic) NSString *message; 14 | //@property (nonatomic) BOOL livemode; 15 | @property (nonatomic, nullable) PSTCKCard *card; 16 | @property (nonatomic, nullable) NSDate *created; 17 | @property (nonatomic, readwrite, nonnull, copy) NSDictionary *allResponseFields; 18 | @end 19 | 20 | @implementation PSTCKToken 21 | 22 | - (NSString *)description { 23 | return self.tokenId ?: @"Unknown token"; 24 | } 25 | 26 | - (NSString *)debugDescription { 27 | NSString *token = self.tokenId ?: @"Unknown token"; 28 | NSString *last4 = self.last4 ?: @"Unknown last 4"; 29 | NSString *message = self.message ?: @"Unknown Message"; 30 | return [NSString stringWithFormat:@"%@ (%@)ending with %@", token, message, last4]; 31 | } 32 | 33 | - (BOOL)isEqual:(id)object { 34 | return [self isEqualToToken:object]; 35 | } 36 | 37 | - (NSUInteger)hash { 38 | return [self.tokenId hash]; 39 | } 40 | 41 | - (BOOL)isEqualToToken:(PSTCKToken *)object { 42 | if (self == object) { 43 | return YES; 44 | } 45 | 46 | if (!object || ![object isKindOfClass:self.class]) { 47 | return NO; 48 | } 49 | 50 | if ((self.card || object.card) && (![self.card isEqual:object.card])) { 51 | return NO; 52 | } 53 | 54 | // return self.livemode == object.livemode && [self.tokenId isEqualToString:object.tokenId] && [self.created isEqualToDate:object.created] && 55 | // [self.card isEqual:object.card] && [self.tokenId isEqualToString:object.tokenId] && [self.created isEqualToDate:object.created]; 56 | return [self.tokenId isEqualToString:object.tokenId] &&[self.message isEqualToString:object.message] && 57 | [self.last4 isEqualToString:object.last4] ; 58 | 59 | } 60 | 61 | #pragma mark PSTCKAPIResponseDecodable 62 | 63 | + (NSArray *)requiredFields { 64 | //return @[@"id", @"livemode", @"created"]; 65 | return @[@"status", @"message"]; 66 | } 67 | 68 | + (instancetype)decodedObjectFromAPIResponse:(NSDictionary *)response { 69 | NSDictionary *dict = [response pstck_dictionaryByRemovingNullsValidatingRequiredFields:[self requiredFields]]; 70 | if (!dict) { 71 | return nil; 72 | } 73 | 74 | // only status 0 is an error 75 | if ([[dict[@"status"] description] isEqual: @"0"]) { 76 | return nil; 77 | } 78 | 79 | PSTCKToken *token = [self new]; 80 | token.tokenId = dict[@"token"]; 81 | token.message = dict[@"message"]; 82 | token.last4 = dict[@"last4"]; 83 | // token.livemode = [dict[@"livemode"] boolValue]; 84 | // token.created = [NSDate dateWithTimeIntervalSince1970:[dict[@"created"] doubleValue]]; 85 | 86 | // NSDictionary *cardDictionary = dict[@"card"]; 87 | // if (cardDictionary) { 88 | // token.card = [PSTCKCard decodedObjectFromAPIResponse:cardDictionary]; 89 | // } 90 | 91 | token.allResponseFields = dict; 92 | return token; 93 | } 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /Paystack/PSTCKTransaction.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKTransaction.m 3 | // Paystack 4 | // 5 | 6 | #import "PSTCKTransaction.h" 7 | #import "PSTCKCard.h" 8 | #import "NSDictionary+Paystack.h" 9 | 10 | @interface PSTCKTransaction() 11 | @property (nonatomic) NSString *reference; 12 | @property (nonatomic) NSString *message; 13 | @property (nonatomic) NSString *trans; 14 | @property (nonatomic) NSString *redirecturl; 15 | @property (nonatomic) NSString *status; 16 | @property (nonatomic) NSString *auth; 17 | @property (nonatomic) NSString *otpmessage; 18 | @property (nonatomic) NSString *errors; 19 | @property (nonatomic) NSString *countrycode; 20 | @property (nonatomic, readwrite, nonnull, copy) NSDictionary *allResponseFields; 21 | @end 22 | 23 | @implementation PSTCKTransaction 24 | 25 | - (instancetype)init 26 | { 27 | self = [super init]; 28 | if (self) { 29 | 30 | } 31 | return self; 32 | } 33 | 34 | - (NSString *)description { 35 | return self.reference ?: self.message ?: @"Unknown reference"; 36 | } 37 | 38 | - (NSString *)debugDescription { 39 | NSString *reference = self.reference ?: @"Unknown Reference"; 40 | NSString *message = self.message ?: @"Unknown Message"; 41 | return [NSString stringWithFormat:@"%@ (%@)", reference, message]; 42 | } 43 | 44 | - (BOOL)isEqual:(id)object { 45 | return [self isEqualToTransaction:object]; 46 | } 47 | 48 | - (NSUInteger)hash { 49 | return [self.reference hash]; 50 | } 51 | 52 | - (BOOL)isEqualToTransaction:(PSTCKTransaction *)object { 53 | if (self == object) { 54 | return YES; 55 | } 56 | 57 | if (!object || ![object isKindOfClass:self.class]) { 58 | return NO; 59 | } 60 | 61 | return [self.reference isEqualToString:object.reference] &&[self.message isEqualToString:object.message] && 62 | [self.trans isEqualToString:object.trans] ; 63 | 64 | } 65 | 66 | #pragma mark PSTCKAPIResponseDecodable 67 | 68 | + (NSArray *)requiredFields { 69 | //return @[@"id", @"livemode", @"created"]; 70 | return @[@"message"]; 71 | } 72 | 73 | + (instancetype)decodedObjectFromAPIResponse:(NSDictionary *)response { 74 | NSDictionary *dict = [response pstck_dictionaryByRemovingNullsValidatingRequiredFields:[self requiredFields]]; 75 | if (!dict) { 76 | return nil; 77 | } 78 | 79 | PSTCKTransaction *transaction = [self new]; 80 | transaction.reference = dict[@"reference"]; 81 | transaction.trans = dict[@"trans"]; 82 | transaction.auth = dict[@"auth"]; 83 | transaction.otpmessage = dict[@"otpmessage"]; 84 | transaction.redirecturl = dict[@"redirecturl"]; 85 | transaction.message = dict[@"message"]; 86 | transaction.status = dict[@"status"]; 87 | transaction.errors = dict[@"errors"]; 88 | transaction.countrycode = dict[@"countryCode"]; 89 | transaction.allResponseFields = dict; 90 | return transaction; 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /Paystack/PSTCKValidationParams.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKCardParams.m 3 | // Paystack 4 | // 5 | 6 | #import "PSTCKValidationParams.h" 7 | 8 | @implementation PSTCKValidationParams 9 | 10 | @synthesize additionalAPIParameters = _additionalAPIParameters; 11 | 12 | - (instancetype)init { 13 | self = [super init]; 14 | if (self) { 15 | _additionalAPIParameters = @{}; 16 | } 17 | return self; 18 | } 19 | 20 | 21 | #pragma mark - 22 | 23 | #pragma mark - PSTCKFormEncodable 24 | 25 | + (NSString *)rootObjectName { 26 | return @""; 27 | } 28 | 29 | + (NSDictionary *)propertyNamesToFormFieldNamesMapping { 30 | return @{ 31 | @"trans": @"trans", 32 | @"token": @"token" 33 | }; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKAPIResponseDecodable.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKAPIResponseDecodable.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | 8 | @protocol PSTCKAPIResponseDecodable 9 | 10 | /** 11 | * These fields are required to be present in the API response. If any of them are nil, decodedObjectFromAPIResponse should also return nil. 12 | */ 13 | + (nonnull NSArray *)requiredFields; 14 | 15 | /** 16 | * Parses an response from the Paystack API (in JSON format; represented as an NSDictionary) into an instance of the class. Returns nil if the object could not be decoded (i.e. if one of its `requiredFields` is nil). 17 | */ 18 | + (nullable instancetype)decodedObjectFromAPIResponse:(nonnull NSDictionary *)response; 19 | 20 | /** 21 | * The raw JSON response used to create the object. This can be useful for using beta features that haven't yet been made into properties in the SDK. 22 | */ 23 | @property(nonatomic, readonly, nonnull, copy)NSDictionary *allResponseFields; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKCardBrand.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKCardBrand.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | 8 | /** 9 | * The various card brands to which a payment card can belong. 10 | */ 11 | typedef NS_ENUM(NSInteger, PSTCKCardBrand) { 12 | PSTCKCardBrandVisa, 13 | PSTCKCardBrandAmex, 14 | PSTCKCardBrandMasterCard, 15 | PSTCKCardBrandDiscover, 16 | PSTCKCardBrandJCB, 17 | PSTCKCardBrandDinersClub, 18 | PSTCKCardBrandUnknown, 19 | PSTCKCardBrandVerve, 20 | }; 21 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKCardParams.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKCardParams.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import "PSTCKFormEncodable.h" 8 | /** 9 | * Representation of a user's credit card details. You can assemble these with information that your user enters and 10 | * then create Paystack tokens with them using an PSTCKAPIClient. @see https://paystack.com/docs/api#cards 11 | */ 12 | @interface PSTCKCardParams : NSObject 13 | 14 | /** 15 | * The card's number. 16 | */ 17 | @property (nonatomic, copy, nullable) NSString *number; 18 | 19 | /** 20 | * The last 4 digits of the card's number, if it's been set, otherwise nil. 21 | */ 22 | - (nullable NSString *)last4; 23 | 24 | /** 25 | * The clientdata to send to api. 26 | */ 27 | - (nullable NSString *)clientdata; 28 | 29 | /** 30 | * The card's expiration month. 31 | */ 32 | @property (nonatomic) NSUInteger expMonth; 33 | 34 | /** 35 | * The card's expiration year. 36 | */ 37 | @property (nonatomic) NSUInteger expYear; 38 | 39 | /** 40 | * The card's security code, found on the back. 41 | */ 42 | @property (nonatomic, copy, nullable) NSString *cvc; 43 | 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKCardValidationState.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKCardValidationState.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | 8 | /** 9 | * These fields indicate whether a card field represents a valid value, invalid value, or incomplete value. 10 | */ 11 | typedef NS_ENUM(NSInteger, PSTCKCardValidationState) { 12 | PSTCKCardValidationStateValid, // The field's contents are valid. For example, a valid, 16-digit card number. 13 | PSTCKCardValidationStateInvalid, // The field's contents are invalid. For example, an expiration date of "13/42". 14 | PSTCKCardValidationStateIncomplete, // The field's contents are not yet valid, but could be by typing additional characters. For example, a CVC of "1". 15 | }; 16 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKFormEncodable.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKFormEncodable.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | 8 | /** 9 | * Objects conforming to PSTCKFormEncodable can be automatically converted to a form-encoded string, which can then be used when making requests to the Paystack API. 10 | */ 11 | @protocol PSTCKFormEncodable 12 | 13 | /** 14 | * The root object name to be used when converting this object to a form-encoded string. For example, if this returns @"card", then the form-encoded output will resemble @"card[foo]=bar" (where 'foo' and 'bar' are specified by `propertyNamesToFormFieldNamesMapping` below. 15 | */ 16 | + (nonnull NSString *)rootObjectName; 17 | 18 | /** 19 | * This maps properties on an object that is being form-encoded into parameter names in the Paystack API. For example, PSTCKCardParams has a field called `expMonth`, but the Paystack API expects a field called `exp_month`. This dictionary represents a mapping from the former to the latter (in other words, [PSTCKCardParams propertyNamesToFormFieldNamesMapping][@"expMonth"] == @"exp_month".) 20 | */ 21 | + (nonnull NSDictionary *)propertyNamesToFormFieldNamesMapping; 22 | 23 | /** 24 | * You can use this property to add additional fields to an API request that are not explicitly defined by the object's interface. This can be useful when using beta features that haven't been added to the Paystack SDK yet. For example, if the /v1/tokens API began to accept a beta field called "test_field", you might do the following: 25 | PSTCKCardParams *cardParams = [PSTCKCardParams new]; 26 | // add card values 27 | cardParams.additionalAPIParameters = @{@"test_field": @"example_value"}; 28 | [[PSTCKAPIClient sharedClient] createTokenWithCard:cardParams completion:...]; 29 | */ 30 | @property(nonatomic, readwrite, nonnull, copy)NSDictionary *additionalAPIParameters; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKToken.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import "PSTCKAPIResponseDecodable.h" 8 | 9 | 10 | /** 11 | * A token returned from submitting payment details to the Paystack API. You should not have to instantiate one of these directly. 12 | */ 13 | @interface PSTCKToken : NSObject 14 | 15 | /** 16 | * You cannot directly instantiate an PSTCKToken. You should only use one that has been returned from an PSTCKAPIClient callback. 17 | */ 18 | - (nonnull instancetype) init __attribute__((unavailable("You cannot directly instantiate an PSTCKToken. You should only use one that has been returned from an PSTCKAPIClient callback."))); 19 | 20 | /** 21 | * The value of the token. You can store this value on your server and use it to make charges and customers. @see 22 | * https://paystack.com/docs/mobile/ios#sending-tokens 23 | */ 24 | @property (nonatomic, readonly, nonnull) NSString *tokenId; 25 | @property (nonatomic, readonly, nonnull) NSString *message; 26 | @property (nonatomic, readonly, nonnull) NSString *last4; 27 | 28 | 29 | /** 30 | * When the token was created. 31 | */ 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKTransaction.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKTransaction.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import "PSTCKAPIResponseDecodable.h" 8 | 9 | 10 | /** 11 | * A transaction returned from submitting payment details to the Paystack API. You should not have to instantiate one of these directly. 12 | */ 13 | @interface PSTCKTransaction : NSObject 14 | 15 | /** 16 | * You cannot directly instantiate an PSTCKTransaction. You should only use one that has been returned from an PSTCKAPIClient callback. 17 | */ 18 | - (nonnull instancetype) init; 19 | 20 | @property (nonatomic, readonly, nonnull) NSString *reference; 21 | @property (nonatomic, readonly, nonnull) NSString *message; 22 | @property (nonatomic, readonly, nonnull) NSString *status; 23 | @property (nonatomic, readonly, nonnull) NSString *trans; 24 | @property (nonatomic, readonly, nonnull) NSString *redirecturl; 25 | @property (nonatomic, readonly, nonnull) NSString *auth; 26 | @property (nonatomic, readonly, nonnull) NSString *otpmessage; 27 | @property (nonatomic, readonly, nonnull) NSString *countrycode; 28 | @property (nonatomic, readonly, nonnull) NSString *errors; 29 | 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKTransactionParams.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKTransactionParams.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import "PSTCKFormEncodable.h" 8 | /** 9 | * Representation of the transaction to perform on a card 10 | */ 11 | @interface PSTCKTransactionParams : NSObject 12 | 13 | @property (nonatomic, copy, nonnull) NSString *access_code; 14 | 15 | @property (nonatomic, copy, nonnull) NSString *email; 16 | @property (nonatomic) NSUInteger amount; 17 | @property (nonatomic, copy, nullable) NSString *reference; 18 | @property (nonatomic, copy, nullable) NSString *subaccount; 19 | @property (nonatomic) NSInteger transaction_charge; 20 | @property (nonatomic, copy, nullable) NSString *bearer; 21 | @property (nonatomic, readonly, nullable) NSString *metadata; 22 | @property (nonatomic, nullable) NSString *plan; 23 | @property (nonatomic, nullable) NSString *currency; 24 | 25 | - (nullable PSTCKTransactionParams *) setMetadataValue:(nonnull NSString*)value 26 | forKey:(nonnull NSString*)key 27 | error:(NSError * _Nullable __autoreleasing * _Nonnull) error 28 | __attribute__((deprecated("This SDK has been deprecated, Please refer to our new SDK: https://github.com/PaystackHQ/paystack-sdk-ios"))); 29 | 30 | - (nullable PSTCKTransactionParams *) setMetadataValueDict:(nonnull NSMutableDictionary*)dict 31 | forKey:(nonnull NSString*)key 32 | error:(NSError * _Nullable __autoreleasing * _Nonnull) error 33 | __attribute__((deprecated("This SDK has been deprecated, Please refer to our new SDK: https://github.com/PaystackHQ/paystack-sdk-ios"))); 34 | 35 | - (nullable PSTCKTransactionParams *) setMetadataValueArray:(nonnull NSMutableArray*)arr 36 | forKey:(nonnull NSString*)key 37 | error:(NSError * _Nullable __autoreleasing * _Nonnull) error 38 | __attribute__((deprecated("This SDK has been deprecated, Please refer to our new SDK: https://github.com/PaystackHQ/paystack-sdk-ios"))); 39 | 40 | - (nullable PSTCKTransactionParams *) setCustomFieldValue:(nonnull NSString*)value 41 | displayedAs:(nonnull NSString*)display_name 42 | error:(NSError * _Nullable __autoreleasing * _Nonnull) error 43 | __attribute__((deprecated("This SDK has been deprecated, Please refer to our new SDK: https://github.com/PaystackHQ/paystack-sdk-ios"))); 44 | @end 45 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/PSTCKValidationParams.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKValidationParams.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import "PSTCKFormEncodable.h" 8 | /** 9 | * Representation of a user's credit card details. You can assemble these with information that your user enters and 10 | * then create Paystack tokens with them using an PSTCKAPIClient. @see https://paystack.com/docs/api#cards 11 | */ 12 | @interface PSTCKValidationParams : NSObject 13 | 14 | @property (nonatomic, copy, nonnull) NSString *trans; 15 | @property (nonatomic, copy, nonnull) NSString *token; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/Paystack.h: -------------------------------------------------------------------------------- 1 | // 2 | // Paystack.h 3 | // Paystack 4 | // 5 | // Created by Ibrahim Lawal on 02/02/16. 6 | // Copyright (c) 2016 Paystack. All rights reserved. 7 | // 8 | // The code in this workspace was adapted from https://github.com/stripe/stripe-ios. 9 | // Stripe was replaced with Paystack - and STP with PSTCK - to avoid collisions within 10 | // apps that are using both Paystack and Stripe. 11 | 12 | #import "PSTCKAPIClient.h" 13 | #import "PaystackError.h" 14 | #import "PSTCKCardBrand.h" 15 | #import "PSTCKCardParams.h" 16 | #import "PSTCKTransactionParams.h" 17 | #import "PSTCKCard.h" 18 | #import "PSTCKCardValidationState.h" 19 | #import "PSTCKCardValidator.h" 20 | #import "PSTCKToken.h" 21 | #import "PSTCKRSA.h" 22 | 23 | #if TARGET_OS_IPHONE 24 | #import "PSTCKPaymentCardTextField.h" 25 | #endif 26 | -------------------------------------------------------------------------------- /Paystack/PublicHeaders/UI/UIImage+Paystack.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Paystack.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import "PSTCKCardBrand.h" 8 | 9 | @interface UIImage (Paystack) 10 | 11 | + (nonnull UIImage *)pstck_amexCardImage; 12 | + (nonnull UIImage *)pstck_dinersClubCardImage; 13 | + (nonnull UIImage *)pstck_discoverCardImage; 14 | + (nonnull UIImage *)pstck_jcbCardImage; 15 | + (nonnull UIImage *)pstck_masterCardCardImage; 16 | + (nonnull UIImage *)pstck_visaCardImage; 17 | + (nonnull UIImage *)pstck_unknownCardCardImage; 18 | 19 | + (nullable UIImage *)pstck_brandImageForCardBrand:(PSTCKCardBrand)brand; 20 | + (nullable UIImage *)pstck_cvcImageForCardBrand:(PSTCKCardBrand)brand; 21 | + (nullable UIImage *)pstck_safeImageNamed:(nonnull NSString *)imageName; 22 | 23 | @end 24 | 25 | void linkUIImageCategory(void); 26 | -------------------------------------------------------------------------------- /Paystack/RSA/PSTCKRSA.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKRSA.h 3 | // Paystack 4 | // 5 | // Created by Ibrahim Lawal on Feb/27/2016. 6 | // Copyright © 2016 Paystack, Inc. All rights reserved. 7 | // 8 | #import 9 | 10 | 11 | @interface PSTCKRSA : NSObject 12 | + (nullable NSString *)encryptRSA:(nonnull NSString *)plainTextString; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /Paystack/Resources/Images/Cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/Cancel.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/Cancel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/Cancel@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/Cancel@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/Cancel@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_amex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_amex.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_amex@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_amex@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_amex@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_amex@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_cvc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_cvc.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_cvc@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_cvc@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_cvc@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_cvc@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_cvc_amex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_cvc_amex.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_cvc_amex@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_cvc_amex@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_cvc_amex@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_cvc_amex@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_diners.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_diners.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_diners@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_diners@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_diners@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_diners@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_discover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_discover.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_discover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_discover@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_discover@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_discover@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_jcb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_jcb.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_jcb@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_jcb@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_jcb@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_jcb@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_mastercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_mastercard.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_mastercard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_mastercard@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_mastercard@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_mastercard@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_placeholder.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_placeholder@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_placeholder@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_placeholder@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_placeholder@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_placeholder_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_placeholder_template.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_placeholder_template@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_placeholder_template@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_placeholder_template@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_placeholder_template@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_verve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_verve.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_verve@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_verve@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_verve@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_verve@3x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_visa.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_visa@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_visa@2x.png -------------------------------------------------------------------------------- /Paystack/Resources/Images/pstck_card_visa@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaystackHQ/paystack-ios/84e9c56bfb33b64ef58e633e8f1402819fe05212/Paystack/Resources/Images/pstck_card_visa@3x.png -------------------------------------------------------------------------------- /Paystack/UI/PSTCKAuthViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // EBAEventbritePurchaseViewController.h 3 | // InEvent 4 | // 5 | // Created by Pedro Góes on 12/16/15. 6 | // Copyright © 2015 InEvent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | typedef void(^PSTCKAuthCallback)(void); 13 | 14 | /** 15 | * View Controller subclass containing a `UIWebView` which will be used to display the Paystack web UI to perform the authorization. 16 | **/ 17 | @interface PSTCKAuthViewController : UIViewController 18 | 19 | /** ************************************************************************************************ ** 20 | * @name Initializers 21 | ** ************************************************************************************************ **/ 22 | 23 | /** 24 | * Default initializer. 25 | * @param authURL the authorization url from Paystack. 26 | * @param completion A standard block. 27 | * @returns An initialized instance 28 | **/ 29 | - (id)initWithURL:(NSURL *)authURL handler:(PSTCKAuthCallback)completion; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Paystack/UI/PSTCKFormTextField.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKFormTextField.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | 8 | @class PSTCKFormTextField; 9 | 10 | @protocol PSTCKFormTextFieldDelegate 11 | 12 | - (void)formTextFieldDidBackspaceOnEmpty:(nonnull PSTCKFormTextField *)formTextField; 13 | 14 | @end 15 | 16 | @interface PSTCKFormTextField : UITextField 17 | 18 | @property(nonatomic, readwrite, nullable) UIColor *defaultColor; 19 | @property(nonatomic, readwrite, nullable) UIColor *errorColor; 20 | @property(nonatomic, readwrite, nullable) UIColor *placeholderColor; 21 | 22 | @property(nonatomic, readwrite, assign)BOOL formatsCardNumbers; 23 | @property(nonatomic, readwrite, assign)BOOL validText; 24 | @property(nonatomic, readwrite, weak, nullable)idformDelegate; 25 | 26 | - (CGSize)measureTextSize; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Paystack/UI/PSTCKPaymentCardTextFieldViewModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKPaymentCardTextFieldViewModel.h 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import 8 | 9 | #import "PSTCKCard.h" 10 | #import "PSTCKCardValidator.h" 11 | 12 | typedef NS_ENUM(NSInteger, PSTCKCardFieldType) { 13 | PSTCKCardFieldTypeNumber, 14 | PSTCKCardFieldTypeExpiration, 15 | PSTCKCardFieldTypeCVC, 16 | }; 17 | 18 | @interface PSTCKPaymentCardTextFieldViewModel : NSObject 19 | 20 | @property(nonatomic, readwrite, copy, nullable)NSString *cardNumber; 21 | @property(nonatomic, readwrite, copy, nullable)NSString *rawExpiration; 22 | @property(nonatomic, readonly, nullable)NSString *expirationMonth; 23 | @property(nonatomic, readonly, nullable)NSString *expirationYear; 24 | @property(nonatomic, readwrite, copy, nullable)NSString *cvc; 25 | @property(nonatomic, readonly) PSTCKCardBrand brand; 26 | 27 | - (nonnull NSString *)defaultPlaceholder; 28 | - (nullable NSString *)numberWithoutLastDigits; 29 | 30 | - (BOOL)isValid; 31 | 32 | - (PSTCKCardValidationState)validationStateForField:(PSTCKCardFieldType)fieldType; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Paystack/UI/UIImage+Paystack.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Paystack.m 3 | // Paystack 4 | // 5 | 6 | #import "UIImage+Paystack.h" 7 | 8 | #define FAUXPAS_IGNORED_IN_METHOD(...) 9 | 10 | // Dummy class for locating the framework bundle 11 | @interface PSTCKBundleLocator : NSObject 12 | @end 13 | @implementation PSTCKBundleLocator 14 | @end 15 | 16 | @implementation UIImage (Paystack) 17 | 18 | + (UIImage *)pstck_amexCardImage { 19 | return [UIImage pstck_brandImageForCardBrand:PSTCKCardBrandAmex]; 20 | } 21 | 22 | + (UIImage *)pstck_dinersClubCardImage { 23 | return [UIImage pstck_brandImageForCardBrand:PSTCKCardBrandDinersClub]; 24 | } 25 | 26 | + (UIImage *)pstck_discoverCardImage { 27 | return [UIImage pstck_brandImageForCardBrand:PSTCKCardBrandDiscover]; 28 | } 29 | 30 | + (UIImage *)pstck_jcbCardImage { 31 | return [UIImage pstck_brandImageForCardBrand:PSTCKCardBrandJCB]; 32 | } 33 | 34 | + (UIImage *)pstck_masterCardCardImage { 35 | return [UIImage pstck_brandImageForCardBrand:PSTCKCardBrandMasterCard]; 36 | } 37 | 38 | + (UIImage *)pstck_visaCardImage { 39 | return [UIImage pstck_brandImageForCardBrand:PSTCKCardBrandVisa]; 40 | } 41 | 42 | + (UIImage *)pstck_unknownCardCardImage { 43 | return [UIImage pstck_brandImageForCardBrand:PSTCKCardBrandUnknown]; 44 | } 45 | 46 | + (UIImage *)pstck_brandImageForCardBrand:(PSTCKCardBrand)brand { 47 | FAUXPAS_IGNORED_IN_METHOD(APIAvailability); 48 | NSString *imageName; 49 | BOOL templateSupported = [[UIImage new] respondsToSelector:@selector(imageWithRenderingMode:)]; 50 | switch (brand) { 51 | case PSTCKCardBrandAmex: 52 | imageName = @"pstck_card_amex"; 53 | break; 54 | case PSTCKCardBrandDinersClub: 55 | imageName = @"pstck_card_diners"; 56 | break; 57 | case PSTCKCardBrandDiscover: 58 | imageName = @"pstck_card_discover"; 59 | break; 60 | case PSTCKCardBrandJCB: 61 | imageName = @"pstck_card_jcb"; 62 | break; 63 | case PSTCKCardBrandMasterCard: 64 | imageName = @"pstck_card_mastercard"; 65 | break; 66 | case PSTCKCardBrandVerve: 67 | imageName = @"pstck_card_verve"; 68 | break; 69 | case PSTCKCardBrandUnknown: 70 | imageName = templateSupported ? @"pstck_card_placeholder_template" : @"pstck_card_placeholder"; 71 | break; 72 | case PSTCKCardBrandVisa: 73 | imageName = @"pstck_card_visa"; 74 | } 75 | UIImage *image = [UIImage pstck_safeImageNamed:imageName]; 76 | if (brand == PSTCKCardBrandUnknown && templateSupported) { 77 | image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 78 | } 79 | return image; 80 | } 81 | 82 | + (UIImage *)pstck_cvcImageForCardBrand:(PSTCKCardBrand)brand { 83 | NSString *imageName = brand == PSTCKCardBrandAmex ? @"pstck_card_cvc_amex" : @"pstck_card_cvc"; 84 | return [UIImage pstck_safeImageNamed:imageName]; 85 | } 86 | 87 | + (UIImage *)pstck_safeImageNamed:(NSString *)imageName { 88 | if ([[UIImage class] respondsToSelector:@selector(imageNamed:inBundle:compatibleWithTraitCollection:)]) { 89 | return [UIImage imageNamed:imageName inBundle:[NSBundle bundleForClass:[PSTCKBundleLocator class]] compatibleWithTraitCollection:nil]; 90 | } 91 | return [UIImage imageNamed:imageName]; 92 | } 93 | 94 | @end 95 | 96 | void linkUIImageCategory(void){} 97 | -------------------------------------------------------------------------------- /Paystack/Validator/RequiredRule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Required.swift 3 | // pyur-ios 4 | // 5 | // Created by Jeff Potter on 12/22/14. 6 | // Copyright (c) 2015 jpotts18. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | `RequiredRule` is a subclass of Rule that defines how a required field is validated. 13 | */ 14 | open class RequiredRule: Rule { 15 | /// String that holds error message. 16 | private var message : String 17 | 18 | /** 19 | Initializes `RequiredRule` object with error message. Used to validate a field that requires text. 20 | 21 | - parameter message: String of error message. 22 | - returns: An initialized `RequiredRule` object, or nil if an object could not be created for some reason that would not result in an exception. 23 | */ 24 | public init(message : String = "This field is required"){ 25 | self.message = message 26 | } 27 | 28 | /** 29 | Validates a field. 30 | 31 | - parameter value: String to check for validation. 32 | - returns: Boolean value. True if validation is successful; False if validation fails. 33 | */ 34 | open func validate(_ value: String) -> Bool { 35 | return !value.isEmpty 36 | } 37 | 38 | /** 39 | Used to display error message when validation fails. 40 | 41 | - returns: String of error message. 42 | */ 43 | open func errorMessage() -> String { 44 | return message 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Paystack/Validator/Rule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Validation.swift 3 | // 4 | // Created by Jeff Potter on 11/11/14. 5 | // Copyright (c) 2015 jpotts18. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | /** 11 | The `Rule` protocol declares the required methods for all objects that subscribe to it. 12 | */ 13 | public protocol Rule { 14 | /** 15 | Validates text of a field. 16 | 17 | - parameter value: String of text to be validated. 18 | - returns: Boolean value. True if validation is successful; False if validation fails. 19 | */ 20 | func validate(_ value: String) -> Bool 21 | /** 22 | Displays error message of a field that has failed validation. 23 | 24 | - returns: String of error message. 25 | */ 26 | func errorMessage() -> String 27 | } 28 | -------------------------------------------------------------------------------- /Paystack/Validator/Validatable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Validatable.swift 3 | // Validator 4 | // 5 | // Created by Deniz Adalar on 28/04/16. 6 | // Copyright © 2016 jpotts18. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public typealias ValidatableField = AnyObject & Validatable 12 | 13 | public protocol Validatable { 14 | 15 | var validationText: String { 16 | get 17 | } 18 | } 19 | 20 | extension UITextField: Validatable { 21 | 22 | open var validationText: String { 23 | return text ?? "" 24 | } 25 | } 26 | 27 | extension UITextView: Validatable { 28 | 29 | public var validationText: String { 30 | return text ?? "" 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Paystack/Validator/ValidationDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ValidationDelegate.swift 3 | // Validator 4 | // 5 | // Created by David Patterson on 1/2/16. 6 | // Copyright © 2016 jpotts18. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | /** 12 | Protocol for `ValidationDelegate` adherents, which comes with two required methods that are called depending on whether validation succeeded or failed. 13 | */ 14 | public protocol ValidationDelegate { 15 | /** 16 | This method will be called on delegate object when validation is successful. 17 | 18 | - returns: No return value. 19 | */ 20 | func validationSuccessful() 21 | /** 22 | This method will be called on delegate object when validation fails. 23 | 24 | - returns: No return value. 25 | */ 26 | func validationFailed(_ errors: [(Validatable, ValidationError)]) 27 | } 28 | -------------------------------------------------------------------------------- /Paystack/Validator/ValidationError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jeff Potter on 11/11/14. 3 | // Copyright (c) 2015 jpotts18. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | import UIKit 8 | 9 | /** 10 | The `ValidationError` class is used for representing errors of a failed validation. It contains the field, error label, and error message of a failed validation. 11 | */ 12 | public class ValidationError: NSObject { 13 | /// the Validatable field of the field 14 | public let field:ValidatableField 15 | /// the error label of the field 16 | public var errorLabel:UILabel? 17 | /// the error message of the field 18 | public let errorMessage:String 19 | 20 | /** 21 | Initializes `ValidationError` object with a field, errorLabel, and errorMessage. 22 | 23 | - parameter field: Validatable field that holds field. 24 | - parameter errorLabel: UILabel that holds error label. 25 | - parameter errorMessage: String that holds error message. 26 | - returns: An initialized object, or nil if an object could not be created for some reason that would not result in an exception. 27 | */ 28 | public init(field:ValidatableField, errorLabel:UILabel?, error:String){ 29 | self.field = field 30 | self.errorLabel = errorLabel 31 | self.errorMessage = error 32 | } 33 | } -------------------------------------------------------------------------------- /Paystack/Validator/ValidationRule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ValidationRule.swift 3 | // 4 | // Created by Jeff Potter on 11/11/14. 5 | // Copyright (c) 2015 jpotts18. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | /** 12 | `ValidationRule` is a class that creates an object which holds validation info of a field. 13 | */ 14 | public class ValidationRule { 15 | /// the field of the field 16 | public var field:ValidatableField 17 | /// the errorLabel of the field 18 | public var errorLabel:UILabel? 19 | /// the rules of the field 20 | public var rules:[Rule] = [] 21 | 22 | /** 23 | Initializes `ValidationRule` instance with field, rules, and errorLabel. 24 | 25 | - parameter field: field that holds actual text in field. 26 | - parameter errorLabel: label that holds error label of field. 27 | - parameter rules: array of Rule objects, which field will be validated against. 28 | - returns: An initialized `ValidationRule` object, or nil if an object could not be created for some reason that would not result in an exception. 29 | */ 30 | public init(field: ValidatableField, rules:[Rule], errorLabel:UILabel?){ 31 | self.field = field 32 | self.errorLabel = errorLabel 33 | self.rules = rules 34 | } 35 | 36 | /** 37 | Used to validate field against its validation rules. 38 | - returns: `ValidationError` object if at least one error is found. Nil is returned if there are no validation errors. 39 | */ 40 | public func validateField() -> ValidationError? { 41 | return rules.filter{ 42 | return !$0.validate(field.validationText) 43 | }.map{ rule -> ValidationError in return ValidationError(field: self.field, errorLabel:self.errorLabel, error: rule.errorMessage()) }.first 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Paystack/Validator/ValidatorDictionary.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ValidatorDictionary.swift 3 | // Validator 4 | // 5 | // Created by Deniz Adalar on 04/05/16. 6 | // Copyright © 2016 jpotts18. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public struct ValidatorDictionary : Sequence { 12 | 13 | private var innerDictionary: [ObjectIdentifier: T] = [:]; 14 | 15 | public subscript(key: ValidatableField?) -> T? { 16 | get { 17 | if let key = key { 18 | return innerDictionary[ObjectIdentifier(key)]; 19 | } else { 20 | return nil; 21 | } 22 | } 23 | set(newValue) { 24 | if let key = key { 25 | innerDictionary[ObjectIdentifier(key)] = newValue; 26 | } 27 | } 28 | } 29 | 30 | public mutating func removeAll() { 31 | innerDictionary.removeAll() 32 | } 33 | 34 | public mutating func removeValueForKey(_ key: ValidatableField) { 35 | innerDictionary.removeValue(forKey: ObjectIdentifier(key)) 36 | } 37 | 38 | public var isEmpty: Bool { 39 | return innerDictionary.isEmpty 40 | } 41 | 42 | public func makeIterator() -> DictionaryIterator { 43 | return innerDictionary.makeIterator() 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Tests/OSX Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.paystack.Paystack-OSX-Tests 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /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 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/Tests/PSTCKAPIClientTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKAPIClientTest.m 3 | // Paystack 4 | // 5 | 6 | @import XCTest; 7 | 8 | #import "PSTCKAPIClient.h" 9 | 10 | @interface PSTCKAPIClientTest : XCTestCase 11 | @end 12 | 13 | @implementation PSTCKAPIClientTest 14 | 15 | - (void)testSharedClient { 16 | XCTAssertEqualObjects([PSTCKAPIClient sharedClient], [PSTCKAPIClient sharedClient]); 17 | } 18 | 19 | - (void)testPublicKey { 20 | [Paystack setDefaultPublicKey:@"test"]; 21 | PSTCKAPIClient *client = [PSTCKAPIClient sharedClient]; 22 | XCTAssertEqualObjects(client.publicKey, @"test"); 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Tests/Tests/PSTCKTokenTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // PSTCKTokenTest.m 3 | // Paystack 4 | // 5 | 6 | @import XCTest; 7 | 8 | #import "PSTCKToken.h" 9 | #import "PSTCKCard.h" 10 | 11 | @interface PSTCKTokenTest : XCTestCase 12 | @end 13 | 14 | @implementation PSTCKTokenTest 15 | 16 | - (NSDictionary *)buildTestTokenResponse { 17 | NSDictionary *tokenDict = @{ @"token": @"pstk_3uohiu3", @"message": @"Success", @"status": @1, @"created": @1353025450.0, @"last4": @"1234" }; 18 | return tokenDict; 19 | } 20 | 21 | - (void)testCreatingTokenWithAttributeDictionarySetsAttributes { 22 | PSTCKToken *token = [PSTCKToken decodedObjectFromAPIResponse:[self buildTestTokenResponse]]; 23 | XCTAssertEqualObjects([token tokenId], @"pstk_3uohiu3", @"Generated token has the correct id"); 24 | // XCTAssertEqual([token livemode], NO, @"Generated token has the correct livemode"); 25 | 26 | // XCTAssertEqualWithAccuracy([[token created] timeIntervalSince1970], 1353025450.0, 1.0, @"Generated token has the correct created time"); 27 | } 28 | 29 | - (void)testCreatingTokenSetsAdditionalResponseFields { 30 | NSMutableDictionary *tokenResponse = [[self buildTestTokenResponse] mutableCopy]; 31 | tokenResponse[@"foo"] = @"bar"; 32 | PSTCKToken *token = [PSTCKToken decodedObjectFromAPIResponse:tokenResponse]; 33 | NSDictionary *allResponseFields = token.allResponseFields; 34 | XCTAssertEqualObjects(allResponseFields[@"foo"], @"bar"); 35 | XCTAssertEqualObjects(allResponseFields[@"last4"], @"1234"); 36 | XCTAssertNil(allResponseFields[@"baz"]); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Tests/Tests/UIImage+PaystackTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+PaystackTest.m 3 | // Paystack 4 | // 5 | 6 | #import 7 | #import "UIImage+Paystack.h" 8 | 9 | @interface UIImage_PaystackTest : XCTestCase 10 | @property NSArray *cardBrands; 11 | @end 12 | 13 | @implementation UIImage_PaystackTest 14 | 15 | - (void)setUp { 16 | self.cardBrands = @[ 17 | @(PSTCKCardBrandAmex), 18 | @(PSTCKCardBrandDinersClub), 19 | @(PSTCKCardBrandDiscover), 20 | @(PSTCKCardBrandJCB), 21 | @(PSTCKCardBrandMasterCard), 22 | @(PSTCKCardBrandUnknown), 23 | @(PSTCKCardBrandVisa), 24 | ]; 25 | } 26 | 27 | - (void)testCardIconMethods { 28 | UIImage *image = nil; 29 | image = [UIImage pstck_amexCardImage]; 30 | XCTAssertNotNil(image); 31 | image = [UIImage pstck_dinersClubCardImage]; 32 | XCTAssertNotNil(image); 33 | image = [UIImage pstck_discoverCardImage]; 34 | XCTAssertNotNil(image); 35 | image = [UIImage pstck_jcbCardImage]; 36 | XCTAssertNotNil(image); 37 | image = [UIImage pstck_masterCardCardImage]; 38 | XCTAssertNotNil(image); 39 | image = [UIImage pstck_visaCardImage]; 40 | XCTAssertNotNil(image); 41 | image = [UIImage pstck_unknownCardCardImage]; 42 | XCTAssertNotNil(image); 43 | } 44 | 45 | - (void)testBrandImageForCardBrand { 46 | for (NSNumber *brand in self.cardBrands) { 47 | UIImage *image = [UIImage pstck_brandImageForCardBrand:[brand integerValue]]; 48 | XCTAssertNotNil(image); 49 | } 50 | } 51 | 52 | - (void)testCVCImageForCardBrand { 53 | for (NSNumber *brand in self.cardBrands) { 54 | UIImage *image = [UIImage pstck_cvcImageForCardBrand:[brand integerValue]]; 55 | XCTAssertNotNil(image); 56 | } 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Tests/iOS Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.paystack.Paystack-iOS-Tests 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/CarthageTest/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CarthageTest 4 | // 5 | 6 | import UIKit 7 | 8 | @UIApplicationMain 9 | class AppDelegate: UIResponder, UIApplicationDelegate { 10 | 11 | var window: UIWindow? 12 | 13 | 14 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 15 | // Override point for customization after application launch. 16 | return true 17 | } 18 | 19 | func applicationWillResignActive(application: UIApplication) { 20 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 21 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 22 | } 23 | 24 | func applicationDidEnterBackground(application: UIApplication) { 25 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 26 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 27 | } 28 | 29 | func applicationWillEnterForeground(application: UIApplication) { 30 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 31 | } 32 | 33 | func applicationDidBecomeActive(application: UIApplication) { 34 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 35 | } 36 | 37 | func applicationWillTerminate(application: UIApplication) { 38 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 39 | } 40 | 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/CarthageTest/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/CarthageTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/CarthageTest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/CarthageTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jflinter.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/CarthageTest/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // CarthageTest 4 | // 5 | 6 | import UIKit 7 | import Paystack 8 | 9 | class ViewController: UIViewController { 10 | 11 | override func viewDidLoad() { 12 | super.viewDidLoad() 13 | Paystack.setDefaultPublishableKey("test") 14 | Paystack.paymentRequestWithMerchantIdentifier("test") 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/CarthageTestTests/CarthageTestTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CarthageTestTests.swift 3 | // CarthageTestTests 4 | // 5 | 6 | import UIKit 7 | import XCTest 8 | 9 | class CarthageTestTests: XCTestCase { 10 | 11 | override func setUp() { 12 | super.setUp() 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | } 15 | 16 | override func tearDown() { 17 | // Put teardown code here. This method is called after the invocation of each test method in the class. 18 | super.tearDown() 19 | } 20 | 21 | func testExample() { 22 | // This is an example of a functional test case. 23 | XCTAssert(true, "Pass") 24 | } 25 | 26 | func testPerformanceExample() { 27 | // This is an example of a performance test case. 28 | self.measureBlock() { 29 | // Put the code you want to measure the time of here. 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/CarthageTestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jflinter.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/installation_tests/carthage/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Checking test Carthage app (with frameworks)..." 4 | 5 | TESTDIR="$(cd $(dirname $0); pwd)" 6 | echo $TESTDIR 7 | cd $TESTDIR 8 | 9 | GIT_REPO=`cd "../../.."; pwd` 10 | cd $TESTDIR 11 | 12 | GIT_BRANCH=${TRAVIS_COMMIT-`git branch | sed -n '/\* /s///p'`} 13 | 14 | rm -f "$TESTDIR/Cartfile*" 15 | echo "git \"$GIT_REPO\" \"$GIT_BRANCH\"" > "$TESTDIR/Cartfile" 16 | 17 | carthage update 18 | 19 | xctool build -project "$TESTDIR/CarthageTest.xcodeproj" -scheme CarthageTest -sdk iphonesimulator 20 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest.xcworkspace/xcshareddata/CocoapodsTest.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | A59515FF-C773-43C0-8586-3E2283D58A47 9 | IDESourceControlProjectName 10 | CocoapodsTest 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 14 | github.com:stripe/stripe-ios.git 15 | 16 | IDESourceControlProjectPath 17 | Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 21 | ../../../../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:stripe/stripe-ios.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 36 | IDESourceControlWCCName 37 | stripe-ios 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CocoapodsTest 4 | // 5 | 6 | import UIKit 7 | 8 | @UIApplicationMain 9 | class AppDelegate: UIResponder, UIApplicationDelegate { 10 | 11 | var window: UIWindow? 12 | 13 | 14 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 15 | // Override point for customization after application launch. 16 | return true 17 | } 18 | 19 | func applicationWillResignActive(application: UIApplication) { 20 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 21 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 22 | } 23 | 24 | func applicationDidEnterBackground(application: UIApplication) { 25 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 26 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 27 | } 28 | 29 | func applicationWillEnterForeground(application: UIApplication) { 30 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 31 | } 32 | 33 | func applicationDidBecomeActive(application: UIApplication) { 34 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 35 | } 36 | 37 | func applicationWillTerminate(application: UIApplication) { 38 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 39 | } 40 | 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jflinter.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTest/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // CocoapodsTest 4 | // 5 | 6 | import UIKit 7 | import Paystack 8 | 9 | class ViewController: UIViewController { 10 | 11 | override func viewDidLoad() { 12 | super.viewDidLoad() 13 | Paystack.setDefaultPublishableKey("test") 14 | // Do any additional setup after loading the view, typically from a nib. 15 | } 16 | 17 | override func didReceiveMemoryWarning() { 18 | super.didReceiveMemoryWarning() 19 | // Dispose of any resources that can be recreated. 20 | } 21 | 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTestTests/CocoapodsTestTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CocoapodsTestTests.swift 3 | // CocoapodsTestTests 4 | // 5 | 6 | import UIKit 7 | import XCTest 8 | 9 | class CocoapodsTestTests: XCTestCase { 10 | 11 | override func setUp() { 12 | super.setUp() 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | } 15 | 16 | override func tearDown() { 17 | // Put teardown code here. This method is called after the invocation of each test method in the class. 18 | super.tearDown() 19 | } 20 | 21 | func testExample() { 22 | // This is an example of a functional test case. 23 | XCTAssert(true, "Pass") 24 | } 25 | 26 | func testPerformanceExample() { 27 | // This is an example of a performance test case. 28 | self.measureBlock() { 29 | // Put the code you want to measure the time of here. 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/CocoapodsTestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jflinter.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | pod 'Paystack', path: '../../../..' 3 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/with_frameworks/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Checking test CocoaPods app (with frameworks)..." 4 | cd $(dirname $0) 5 | 6 | rm -rf Pods 7 | rm -f Podfile.lock 8 | pod install --no-repo-update && xctool build -workspace CocoapodsTest.xcworkspace -scheme CocoapodsTest -sdk iphonesimulator 9 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest.xcworkspace/xcshareddata/CocoapodsTest.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 87497C4A-207C-450D-9984-C8AD185AFD7D 9 | IDESourceControlProjectName 10 | CocoapodsTest 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 14 | github.com:stripe/stripe-ios.git 15 | 16 | IDESourceControlProjectPath 17 | Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 21 | ../../../../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:stripe/stripe-ios.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | A5C151FC3F18980DA2906AAA3DE9140767EF2310 36 | IDESourceControlWCCName 37 | stripe-ios 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CocoapodsTest 4 | // 5 | 6 | #import 7 | 8 | @interface AppDelegate : UIResponder 9 | 10 | @property (strong, nonatomic) UIWindow *window; 11 | 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CocoapodsTest 4 | // 5 | 6 | #import "AppDelegate.h" 7 | 8 | @interface AppDelegate () 9 | 10 | @end 11 | 12 | @implementation AppDelegate 13 | 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 16 | // Override point for customization after application launch. 17 | return YES; 18 | } 19 | 20 | - (void)applicationWillResignActive:(UIApplication *)application { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application { 26 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 27 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 28 | } 29 | 30 | - (void)applicationWillEnterForeground:(UIApplication *)application { 31 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 32 | } 33 | 34 | - (void)applicationDidBecomeActive:(UIApplication *)application { 35 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 36 | } 37 | 38 | - (void)applicationWillTerminate:(UIApplication *)application { 39 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jflinter.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CocoapodsTest 4 | // 5 | 6 | #import 7 | 8 | @interface ViewController : UIViewController 9 | 10 | 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CocoapodsTest 4 | // 5 | 6 | #import "ViewController.h" 7 | #import 8 | #import 9 | 10 | @interface ViewController () 11 | 12 | @end 13 | 14 | @implementation ViewController 15 | 16 | - (void)viewDidLoad { 17 | [super viewDidLoad]; 18 | [Paystack setDefaultPublishableKey:@"test"]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CocoapodsTest 4 | // 5 | 6 | #import 7 | #import "AppDelegate.h" 8 | 9 | int main(int argc, char * argv[]) { 10 | @autoreleasepool { 11 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTestTests/CocoapodsTestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // CocoapodsTestTests.m 3 | // CocoapodsTestTests 4 | // 5 | 6 | #import 7 | #import 8 | 9 | @interface CocoapodsTestTests : XCTestCase 10 | 11 | @end 12 | 13 | @implementation CocoapodsTestTests 14 | 15 | - (void)setUp { 16 | [super setUp]; 17 | // Put setup code here. This method is called before the invocation of each test method in the class. 18 | } 19 | 20 | - (void)tearDown { 21 | // Put teardown code here. This method is called after the invocation of each test method in the class. 22 | [super tearDown]; 23 | } 24 | 25 | - (void)testExample { 26 | // This is an example of a functional test case. 27 | XCTAssert(YES, @"Pass"); 28 | } 29 | 30 | - (void)testPerformanceExample { 31 | // This is an example of a performance test case. 32 | [self measureBlock:^{ 33 | // Put the code you want to measure the time of here. 34 | }]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/CocoapodsTestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jflinter.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/Podfile: -------------------------------------------------------------------------------- 1 | pod 'Paystack', path: '../../../..' 2 | 3 | post_install do |installer| 4 | installer.pods_project.build_configurations.each do |config| 5 | config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = "YES" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /Tests/installation_tests/cocoapods/without_frameworks/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Checking test CocoaPods app..." 4 | cd $(dirname $0) 5 | 6 | rm -rf Pods 7 | rm -f Podfile.lock 8 | pod install --no-repo-update && xctool build -workspace CocoapodsTest.xcworkspace -scheme CocoapodsTest -sdk iphonesimulator 9 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ManualInstallationTest 4 | // 5 | 6 | #import 7 | 8 | @interface AppDelegate : UIResponder 9 | 10 | @property (strong, nonatomic) UIWindow *window; 11 | 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ManualInstallationTest 4 | // 5 | 6 | #import "AppDelegate.h" 7 | #import 8 | 9 | @interface AppDelegate () 10 | 11 | @end 12 | 13 | @implementation AppDelegate 14 | 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 17 | // Override point for customization after application launch. 18 | [Paystack setDefaultPublishableKey:@"test"]; 19 | [Paystack paymentRequestWithMerchantIdentifier:@"test"]; 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.paystack.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ManualInstallationTest 4 | // 5 | 6 | #import 7 | 8 | @interface ViewController : UIViewController 9 | 10 | 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ManualInstallationTest 4 | // 5 | 6 | #import "ViewController.h" 7 | 8 | @interface ViewController () 9 | 10 | @end 11 | 12 | @implementation ViewController 13 | 14 | - (void)viewDidLoad { 15 | [super viewDidLoad]; 16 | // Do any additional setup after loading the view, typically from a nib. 17 | } 18 | 19 | - (void)didReceiveMemoryWarning { 20 | [super didReceiveMemoryWarning]; 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ManualInstallationTest 4 | // 5 | 6 | #import 7 | #import "AppDelegate.h" 8 | 9 | int main(int argc, char * argv[]) { 10 | @autoreleasepool { 11 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.paystack.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/ManualInstallationTestTests/ManualInstallationTestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ManualInstallationTestTests.m 3 | // ManualInstallationTestTests 4 | // 5 | 6 | #import 7 | #import 8 | 9 | @interface ManualInstallationTestTests : XCTestCase 10 | 11 | @end 12 | 13 | @implementation ManualInstallationTestTests 14 | 15 | - (void)setUp { 16 | [super setUp]; 17 | // Put setup code here. This method is called before the invocation of each test method in the class. 18 | } 19 | 20 | - (void)tearDown { 21 | // Put teardown code here. This method is called after the invocation of each test method in the class. 22 | [super tearDown]; 23 | } 24 | 25 | - (void)testExample { 26 | // This is an example of a functional test case. 27 | XCTAssert(YES, @"Pass"); 28 | } 29 | 30 | - (void)testPerformanceExample { 31 | // This is an example of a performance test case. 32 | [self measureBlock:^{ 33 | // Put the code you want to measure the time of here. 34 | }]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Tests/installation_tests/manual_installation/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Checking test manual installation app..." 4 | 5 | PROJECTDIR="$(cd $(dirname $0)/../../..; pwd)" 6 | TESTDIR="$(cd $(dirname $0); pwd)" 7 | BUILDDIR="$(cd $(dirname $0); pwd)/build" 8 | 9 | rm -rf $BUILDDIR 10 | mkdir $BUILDDIR 11 | 12 | xcodebuild build -workspace "${PROJECTDIR}/Paystack.xcworkspace" -scheme PaystackiOSStaticFramework -configuration Release OBJROOT=$BUILDDIR SYMROOT=$BUILDDIR -sdk iphonesimulator | xcpretty -c 13 | 14 | rm -rf $TESTDIR/ManualInstallationTest/Frameworks 15 | mkdir $TESTDIR/ManualInstallationTest/Frameworks 16 | mv $BUILDDIR/Release-iphonesimulator/Paystack.framework $TESTDIR/ManualInstallationTest/Frameworks 17 | 18 | xctool build -project "${TESTDIR}/ManualInstallationTest.xcodeproj" -scheme ManualInstallationTest -sdk iphonesimulator 19 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 3.0.13 2 | -------------------------------------------------------------------------------- /ci_scripts/check_fauxpas.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [[ $CI && "$TRAVIS_SECURE_ENV_VARS" != "true" ]]; then 4 | echo "Skipping Faux Pas linting." 5 | exit 0 6 | fi 7 | 8 | echo "Linting with Faux Pas..." 9 | fauxpas check Paystack.xcodeproj/ --target "PaystackiOSStatic" --configFile "./ci_scripts/FauxPasConfig/main.fauxpas.json" --minErrorStatusSeverity Concern && fauxpas check Paystack.xcodeproj/ --target "PaystackOSX" --configFile "./ci_scripts/FauxPasConfig/main.fauxpas.json" --minErrorStatusSeverity Concern 10 | -------------------------------------------------------------------------------- /ci_scripts/check_version.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | puts "Checking that version is set correctly..." 4 | git_version = `git describe`.strip.split("-").first # this is the most recent tag 5 | file_version = File.open('VERSION').first.strip 6 | search_result = `grep #{file_version} ./Paystack/PublicHeaders/PSTCKAPIClient.h` 7 | 8 | if search_result.length == 0 9 | abort("VERSION does not match PSTCKSDKVersion in PSTCKAPIClient.h") 10 | end 11 | 12 | if ENV["TRAVIS_BRANCH"] == "master" 13 | 14 | if git_version > "v#{file_version}" 15 | abort("Current git tag is greater than VERSION, did you forget to increment it?") 16 | end 17 | 18 | end 19 | 20 | puts "Done!" 21 | -------------------------------------------------------------------------------- /ci_scripts/export_builds.sh: -------------------------------------------------------------------------------- 1 | PROJECTDIR="$(cd $(dirname $0)/..; pwd)" 2 | BUILDDIR="${PROJECTDIR}/build" 3 | rm -rf $BUILDDIR 4 | mkdir $BUILDDIR 5 | cd $PROJECTDIR 6 | 7 | xcodebuild build -workspace Paystack.xcworkspace -scheme PaystackOSX -configuration Release OBJROOT=$BUILDDIR SYMROOT=$BUILDDIR | xcpretty -c 8 | cd $BUILDDIR/Release 9 | mkdir PaystackOSX 10 | mv PaystackOSX.framework PaystackOSX 11 | ditto -ck --rsrc --sequesterRsrc --keepParent PaystackOSX PaystackOSX.zip 12 | cp PaystackOSX.zip $BUILDDIR 13 | cd - 14 | 15 | xcodebuild build -workspace Paystack.xcworkspace -scheme PaystackiOSStaticFramework -configuration Release OBJROOT=$BUILDDIR SYMROOT=$BUILDDIR | xcpretty -c 16 | cd $BUILDDIR/Release-iphonesimulator 17 | mkdir PaystackiOS 18 | mv Paystack.framework PaystackiOS 19 | ditto -ck --rsrc --sequesterRsrc --keepParent PaystackiOS PaystackiOS.zip 20 | cp PaystackiOS.zip $BUILDDIR 21 | cd - 22 | -------------------------------------------------------------------------------- /ci_scripts/install_fauxpas.sh: -------------------------------------------------------------------------------- 1 | if [[ $CI && "$TRAVIS_SECURE_ENV_VARS" != "true" ]]; then 2 | echo "Skipping Faux Pas installation." 3 | exit 0 4 | fi 5 | 6 | brew install caskroom/cask/brew-cask 7 | brew cask install fauxpas 8 | $HOME/Applications/FauxPas.app/Contents/Resources/install-cli-tools 9 | fauxpas updatelicense "organization-seat" "Paystack, Inc" $FAUX_PAS_LICENSE 10 | # Enable beta xcode 7 support 11 | defaults write org.hasseg.fauxpas experimentalXcode7SupportEnabled -bool yes 12 | -------------------------------------------------------------------------------- /fastlane/Appfile: -------------------------------------------------------------------------------- 1 | # app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app 2 | # apple_id("[[APPLE_ID]]") # Your Apple email address 3 | 4 | 5 | # For more information about the Appfile, see: 6 | # https://docs.fastlane.tools/advanced/#appfile 7 | -------------------------------------------------------------------------------- /fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | # This file contains the fastlane.tools configuration 2 | # You can find the documentation at https://docs.fastlane.tools 3 | # 4 | # For a list of all available actions, check out 5 | # 6 | # https://docs.fastlane.tools/actions 7 | # 8 | # For a list of all available plugins, check out 9 | # 10 | # https://docs.fastlane.tools/plugins/available-plugins 11 | # 12 | 13 | # Uncomment the line if you want fastlane to automatically update itself 14 | # update_fastlane 15 | 16 | default_platform(:ios) 17 | 18 | platform :ios do 19 | desc "Description of what the lane does" 20 | lane :custom_lane do 21 | # add actions here: https://docs.fastlane.tools/actions 22 | end 23 | 24 | desc "Run unit tests" 25 | lane :unit_tests do 26 | clear_derived_data 27 | scan(scheme: "PaystackiOS Tests", 28 | derived_data_path: "temp", 29 | clean: true 30 | ) 31 | end 32 | 33 | desc "Sonar Cloud Scanner" 34 | lane :metrics do 35 | 36 | scan(scheme: "PaystackiOS Tests", 37 | code_coverage: true, 38 | output_directory: "./sonar-reports", 39 | devices: "iPhone 8") 40 | 41 | slather(sonarqube_xml: true, 42 | scheme: "PaystackiOS", 43 | proj: "./Paystack.xcodeproj", 44 | output_directory: "./code-coverage", 45 | workspace: "./Paystack.xcworkspace") 46 | 47 | swiftlint(output_file: "./sonar-reports/swiftlint.txt", 48 | ignore_exit_status: true) 49 | 50 | sonar( 51 | project_key: "PaystackHQ_paystack-ios", 52 | project_version: "1.0", 53 | project_name: "PaystackiOS", 54 | sources_path: File.expand_path("../Paystack"), 55 | sonar_organization: "paystackhq", 56 | sonar_login: ENV["SONAR_TOKEN"], 57 | sonar_url: "https://sonarcloud.io" 58 | ) 59 | end 60 | end 61 | -------------------------------------------------------------------------------- /fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ================ 3 | # Installation 4 | 5 | Make sure you have the latest version of the Xcode command line tools installed: 6 | 7 | ``` 8 | xcode-select --install 9 | ``` 10 | 11 | Install _fastlane_ using 12 | ``` 13 | [sudo] gem install fastlane -NV 14 | ``` 15 | or alternatively using `brew install fastlane` 16 | 17 | # Available Actions 18 | ## iOS 19 | ### ios custom_lane 20 | ``` 21 | fastlane ios custom_lane 22 | ``` 23 | Description of what the lane does 24 | ### ios unit_tests 25 | ``` 26 | fastlane ios unit_tests 27 | ``` 28 | Run unit tests 29 | ### ios metrics 30 | ``` 31 | fastlane ios metrics 32 | ``` 33 | Sonar Cloud Scanner 34 | 35 | ---- 36 | 37 | This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. 38 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). 39 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 40 | -------------------------------------------------------------------------------- /sonar-project.properties: -------------------------------------------------------------------------------- 1 | sonar.projectKey=PaystackHQ_paystack-ios 2 | sonar.organization=paystackhq 3 | sonar.projectName=paystack-ios 4 | sonar.projectVersion=1.0 5 | sonar.cfamily.build-wrapper-output=DerivedDatacompilation-database 6 | sonar.c.file.suffixes=- 7 | sonar.objc.file.suffixes=.h,.m 8 | sonar.sourceEncoding=UTF-8 9 | sonar.cfamily.threads=1 10 | sonar.cfamily.cache.enabled=false 11 | sonar.sources=\Paystack 12 | sonar.coverageReportPaths=code-coverage/sonarqube-generic-coverage.xml 13 | --------------------------------------------------------------------------------