diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd52f01a..b12eb09a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Run linting uses: norio-nomura/action-swiftlint@3.2.1 with: @@ -21,7 +21,7 @@ jobs: env: BUILD_WRAPPER_OUT_DIR: buildwrapper # Directory where build-wrapper output will be placed steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Run xcodebuild with tests run: xcodebuild -project dev.xcodeproj/ -scheme OmiseSDK -derivedDataPath Build/ -destination 'platform=iOS Simulator,name=iPhone 11,OS=16.2' -enableCodeCoverage YES clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO @@ -33,7 +33,7 @@ jobs: run: xattr -w com.apple.xcode.CreatedByBuildSystem true ./build - name: Upload coverage report - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: sonarqube-generic-coverage.xml retention-days: 5 # Artifact will be available only for 5 days. @@ -51,7 +51,7 @@ jobs: needs: test steps: - name: Checkout repository on branch - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ github.HEAD_REF }} fetch-depth: 0 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..5bdb7e50 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.inlayHints.fontSize": 12 +} \ No newline at end of file diff --git a/ExampleApp.xcodeproj/project.pbxproj b/ExampleApp.xcodeproj/project.pbxproj index 1a4bba02..be84f8ad 100644 --- a/ExampleApp.xcodeproj/project.pbxproj +++ b/ExampleApp.xcodeproj/project.pbxproj @@ -453,7 +453,7 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/omise/omise-ios.git"; requirement = { - branch = feature/v5.0.0_improvements; + branch = "feature/MIT-2251_v5_AdaptableTableView"; kind = branch; }; }; diff --git a/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index fbcb06fd..ff610e98 100644 --- a/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/omise/omise-ios.git", "state" : { - "branch" : "feature/v5.0.0_improvements", - "revision" : "6ff5a91c43fb163949ffc0369eb4a471fe0edba6" + "branch" : "feature/MIT-2251_v5_AdaptableTableView", + "revision" : "bf2e8840edf4cd937fdb1daf2d8e1d3a030b96bb" } } ], diff --git a/ExampleApp/AppDelegate.swift b/ExampleApp/AppDelegate.swift index 81918099..6838358f 100644 --- a/ExampleApp/AppDelegate.swift +++ b/ExampleApp/AppDelegate.swift @@ -6,6 +6,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { window?.tintColor = UIColor(named: "App Tint") ?? UIColor.blue + return true } } diff --git a/ExampleApp/Models/LocalConfig.swift b/ExampleApp/Models/LocalConfig.swift index d815c643..d9de56ab 100644 --- a/ExampleApp/Models/LocalConfig.swift +++ b/ExampleApp/Models/LocalConfig.swift @@ -23,16 +23,16 @@ struct LocalConfig: Codable { devVaultBaseURL = nil devApiBaseURL = nil } - - var env: Environment { + + var configuration: Configuration? { if devMode, let vaultBaseURLString = devVaultBaseURL, let vaultBaseURL = URL(string: vaultBaseURLString), let apiBaseURLString = devApiBaseURL, let apiBaseURL = URL(string: apiBaseURLString) { - return .dev(vaultURL: vaultBaseURL, apiURL: apiBaseURL) + return .init(vaultURL: vaultBaseURL, apiURL: apiBaseURL) } else { - return .production + return nil } } diff --git a/ExampleApp/Models/Tools.swift b/ExampleApp/Models/Tools.swift index 601cf8dc..ef4bf806 100644 --- a/ExampleApp/Models/Tools.swift +++ b/ExampleApp/Models/Tools.swift @@ -4,50 +4,60 @@ import OmiseSDK struct PaymentPreset { var paymentAmount: Int64 var paymentCurrency: Currency - var allowedPaymentMethods: [SourceTypeValue] + var allowedPaymentMethods: [SourceType] + static let allPreset = PaymentPreset( + paymentAmount: 5_000_00, + paymentCurrency: .thb, + allowedPaymentMethods: SourceType.allCases + ) + static let thailandPreset = PaymentPreset( paymentAmount: 5_000_00, paymentCurrency: .thb, - allowedPaymentMethods: PaymentCreatorController.thailandDefaultAvailableSourceMethods + allowedPaymentMethods: SourceType.availableByDefaultInThailand ) - + static let japanPreset = PaymentPreset( paymentAmount: 5_000, paymentCurrency: .jpy, - allowedPaymentMethods: PaymentCreatorController.japanDefaultAvailableSourceMethods + allowedPaymentMethods: SourceType.availableByDefaultInJapan ) static let singaporePreset = PaymentPreset( paymentAmount: 5_000_00, paymentCurrency: .sgd, - allowedPaymentMethods: PaymentCreatorController.singaporeDefaultAvailableSourceMethods + allowedPaymentMethods: SourceType.availableByDefaultSingapore ) static let malaysiaPreset = PaymentPreset( paymentAmount: 5_000_00, paymentCurrency: .myr, - allowedPaymentMethods: PaymentCreatorController.malaysiaDefaultAvailableSourceMethods + allowedPaymentMethods: SourceType.availableByDefaultMalaysia ) } class Tool: NSObject { + static let allPaymentAmount: Int64 = PaymentPreset.allPreset.paymentAmount + static let allPaymentCurrency: String = PaymentPreset.allPreset.paymentCurrency.code + static let allAllowedPaymentMethods: [SourceType] = PaymentPreset.allPreset.allowedPaymentMethods + static let thailandPaymentAmount: Int64 = PaymentPreset.thailandPreset.paymentAmount static let thailandPaymentCurrency: String = PaymentPreset.thailandPreset.paymentCurrency.code - static let thailandAllowedPaymentMethods: [SourceTypeValue] = PaymentPreset.thailandPreset.allowedPaymentMethods + static let thailandAllowedPaymentMethods: [SourceType] = PaymentPreset.thailandPreset.allowedPaymentMethods static let japanPaymentAmount: Int64 = PaymentPreset.japanPreset.paymentAmount static let japanPaymentCurrency: String = PaymentPreset.japanPreset.paymentCurrency.code - static let japanAllowedPaymentMethods: [SourceTypeValue] = PaymentPreset.japanPreset.allowedPaymentMethods + static let japanAllowedPaymentMethods: [SourceType] = PaymentPreset.japanPreset.allowedPaymentMethods static let singaporePaymentAmount: Int64 = PaymentPreset.singaporePreset.paymentAmount static let singaporePaymentCurrency: String = PaymentPreset.singaporePreset.paymentCurrency.code - static let singaporeAllowedPaymentMethods: [SourceTypeValue] = PaymentPreset.singaporePreset.allowedPaymentMethods + static let singaporeAllowedPaymentMethods: [SourceType] = PaymentPreset.singaporePreset.allowedPaymentMethods static let malaysiaPaymentAmount: Int64 = PaymentPreset.malaysiaPreset.paymentAmount static let malaysiaPaymentCurrency: String = PaymentPreset.malaysiaPreset.paymentCurrency.code - static let malaysiaAllowedPaymentMethods: [SourceTypeValue] = PaymentPreset.malaysiaPreset.allowedPaymentMethods + static let malaysiaAllowedPaymentMethods: [SourceType] = PaymentPreset.malaysiaPreset.allowedPaymentMethods static func imageWith(size: CGSize, color: UIColor) -> UIImage? { return Tool.imageWith(size: size) { (context) in diff --git a/ExampleApp/Resources/Main.storyboard b/ExampleApp/Resources/Main.storyboard index 18cd0100..c14fb6e6 100644 --- a/ExampleApp/Resources/Main.storyboard +++ b/ExampleApp/Resources/Main.storyboard @@ -30,18 +30,18 @@ - + - + - @@ -121,8 +102,8 @@ You can present via either Storyboard or Code and you can see the code in the Ex - - +