Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release V5.0.0 #277

Merged
merged 237 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
187b3b6
Refactor OMSSourceTypeValue. Dropped Objc Prefix in Interface Builder…
Oct 4, 2023
e3a5bdf
Merge OCBC changes
Oct 5, 2023
9881fa6
Removing @objc marked and deprecated code
Oct 5, 2023
b33ae9c
Drop deprecated OMS prefix from SourceTypeValue enum
Oct 5, 2023
d474552
Drop deprecated OMS prefix from sources
Oct 5, 2023
1e67aa1
Remove all deprecated OMS prefixes and deprecated Swift version compa…
Oct 10, 2023
6799944
Fix Credit Card Scene module settings in Interface Builder
Oct 10, 2023
11ab409
Fix all module settings in Interface Builder
Oct 10, 2023
85ff921
Removed remaining Objective-C files
Oct 11, 2023
b5df531
New project ExampleApp was created to test OmiseSDK using Swift Packa…
Oct 11, 2023
ac7fd19
Removed OmiseSDKObjc target from OmiseSDK's Package.swift
Oct 11, 2023
cbe78bf
Clean up project tree
Oct 17, 2023
290136c
Add INTERNAL_TEST flag to Example App to test OmiseSDK internally wit…
Oct 20, 2023
0a1af6d
Set ExampleApp deplyoment target to iOS 12.0 for Xcode 15
Oct 20, 2023
c320e65
Fix swiftlint issues
Oct 20, 2023
2e84506
Fixing SonarCloud issues
Oct 20, 2023
85a9fb4
Example App uses master branch for OmiseSDK by default
Nov 1, 2023
35d1bf5
Fix comment typo
Nov 1, 2023
eb853a4
Sort Currency and CurrencyCode enums for better readability
Nov 8, 2023
02d4bd8
Merge branch 'develop' into feature/MIT-1520
Nov 9, 2023
d1a487f
Resolve conflicts after merging with develop
Dec 6, 2023
115b660
Fix CapabilityOperationFixtureTests.swift swiftlint warnings
Dec 6, 2023
c09dc1c
Remove deprecated Compatibility files
Dec 11, 2023
efcd72c
Merge pull request #230 from omise/feature/MIT-1520
Dec 11, 2023
99c0ec5
Renamed OmiseSDK project file to 'dev'. Remove script for Config.loca…
Dec 28, 2023
ad31998
Remove force loading OmiseSDK bundle from example app
Dec 28, 2023
e418580
Use capabilities in Code mode fixed
Jan 10, 2024
8c9dec2
Update project name in GitHub action
Jan 10, 2024
216f13f
Merge pull request #252 from omise/fix/UseCapabilitiesInCodeMode
Jan 10, 2024
34500f5
Refactor CardBrand and update capabilities parser
Jan 15, 2024
953f6a9
Sort list of Payment Methods
Jan 17, 2024
0714f34
Update PaymentChooserOption's alphabetical sorting and added unit tests
Jan 18, 2024
b4d2e4f
localizedCaseInsensitiveCompare function is explicity used for alphab…
Jan 18, 2024
9089b76
Add Module Name for FPX payment screen in Storyboard
Jan 22, 2024
7e78b17
Refactoring return values
Jan 22, 2024
aa91c32
Add WeChat payment method
Jan 22, 2024
918876d
Renamed WeChat to WeChat Pay
Jan 22, 2024
0dab5c9
Merge pull request #253 from omise/feature/MIT-2225-Capabilities
Jan 22, 2024
fcd1d6f
Merge pull request #255 from omise/feature/MIT-2097-v5
Jan 22, 2024
9a544dc
Merge pull request #257 from omise/fix/FPX_Storyboard
Jan 22, 2024
699ed3e
Resolve conflicts
Jan 23, 2024
059ef04
Add WeChat Pay to unit tests
Jan 23, 2024
b983ebf
Fix TrueMoney Wallet's phonenumberTextView module name in Interface B…
Jan 23, 2024
d9c8721
Merge pull request #260 from omise/fix/TruemoneyWallet_Crash
Jan 23, 2024
731e4d5
Resolve conflicts
Jan 23, 2024
6ff5a91
Merge pull request #258 from omise/feature/MIT-1899-v5
Jan 23, 2024
c417845
Fix FPX's email keyboard type
Jan 25, 2024
787dbd3
Merge pull request #262 from omise/feature/FPX_Keyboard_Fix_v5
Jan 25, 2024
628d1d1
Merge with master
Jan 26, 2024
ebc8231
Example App return url fix to properly close webview on auth success
Jan 26, 2024
e617f18
Remove OCBC Pao
Feb 5, 2024
a951b0a
Remove Installment Citi payment
Feb 5, 2024
fbed7e9
Fixed unittests
Feb 5, 2024
322d6e5
Merge pull request #266 from omise/fix/AuthReturnURL_v5
Feb 5, 2024
9bf9639
Merge branch 'feature/v5.0.1_improvements' into feature/MIT-2203_2119_v5
Feb 5, 2024
afe808a
Add unit tests to PaymentChooserViewController
Feb 5, 2024
c14b1c9
Merge pull request #269 from omise/feature/MIT-1555_v5
Feb 7, 2024
4d54f21
Merge pull request #268 from omise/feature/MIT-2203_2119_v5
Feb 7, 2024
f7ad7d6
Draft Client and URL requests implementation was added
Feb 8, 2024
40fddbb
Add unsupported payment methods name to Capability.PaymentMethod
Feb 8, 2024
0ae8d64
Added properties to Capability and Payment Method.Added Banks to Capa…
Feb 9, 2024
af562f4
Added Token model
Feb 9, 2024
253f854
Refactor CountryInfo model and moved current country to OmiseSDK as a…
Feb 9, 2024
0e16e60
Implement observeChargeStatusUntilChange(tokenID: String)
Feb 10, 2024
f64cb97
Implement createToken API request
Feb 10, 2024
05a0246
PaymentPayload was added
Feb 11, 2024
dcef2bf
Refactor NetworkService and SourcePayments
Feb 11, 2024
c10a74d
Prepared new Source for Unit Testing
Feb 11, 2024
c2d97e1
Add Unit Tests for decoding SourceNew with list of simple sourceTypes
Feb 11, 2024
49f114a
Refactor SourcePayload and adding comments for public properties
Feb 12, 2024
c5f6678
Adding comments to Source Type
Feb 12, 2024
efc3b70
Namespece refactoring. Add unit tests for decoding Source
Feb 12, 2024
45a68ec
Add comments to Source payloads
Feb 12, 2024
e419bc2
Add DuitNowOBW source payment payload and unit tests
Feb 12, 2024
40d1ccc
Add Source json decoder and unit tests for Installment, Truemoney, Mo…
Feb 13, 2024
c8e9d10
Add econtext decode from Json and unit tests
Feb 13, 2024
ccce357
Add unit tests for Source.Payment JSON encoding / decoding
Feb 13, 2024
525d9f2
Refactor namespaces and update unit tests
Feb 13, 2024
ebc6593
Clean tests. Added Client unit tests
Feb 13, 2024
e59f348
Capability tests added
Feb 13, 2024
9867b31
Remove old Data Layer and replaced with new one
Feb 13, 2024
3e58aac
Integrated new Data Model into Example App
Feb 13, 2024
3b19791
Refactor Source.Payload namings
Feb 13, 2024
1d286f0
Rearrange Project tree
Feb 13, 2024
f8e3240
Cleanup warnings
Feb 13, 2024
76b2193
Cleanup warnings
Feb 13, 2024
350df34
Github action checkou@v2 was changed to checkout@v3
Feb 13, 2024
be6cf00
Project tree rearrangements
Feb 14, 2024
4a8a4fb
Fix Custom Credit Card payment request
Feb 14, 2024
6b1fc4d
Remove deprecated test cases
Feb 14, 2024
be43614
Naming refactoring
Feb 14, 2024
a2d769b
Cleanup old code
Feb 14, 2024
4895c3e
Update unit tests
Feb 14, 2024
f626965
Naming refactoring
Feb 14, 2024
f695dc1
Update refactored names in unit tests
Feb 14, 2024
e08e502
Create convenient static initializers to make Source payment code mor…
Feb 14, 2024
10d3d9d
Refactor JSON codable code
Feb 14, 2024
fbcdb3d
Roll back CountryInfo and SourceTypeValue type names to make PR more …
Feb 14, 2024
5f20509
CountryInfo -> Country, SourceTypeValue -> SourceType renamed
Feb 14, 2024
0ec529c
Refactored Card and move Address fields to use Address model
Feb 14, 2024
c324148
Cleanup unit tests
Feb 14, 2024
2d3c324
Clean up namings
Feb 14, 2024
c90fb90
Add comments to Installments
Feb 14, 2024
502df21
Update Readme
Feb 14, 2024
91e9b37
Readme updated
Feb 14, 2024
ced3ba7
Update readme and Playground examples
Feb 14, 2024
34ebee0
Fix Sonarcloud warnings
Feb 14, 2024
b25b21c
Update unit test
Feb 14, 2024
b877399
Update ExampleApp for COnfiguration changes
Feb 15, 2024
258e5fd
Move SourceType extensions to separate files
Feb 15, 2024
a68b9bf
Move OCBC Digital to Mobile Banking section
Feb 15, 2024
2a9cc68
Filter shopeepay and shopeepay_jumpapp
Feb 15, 2024
3147130
Filter shopeepay and shopeepay_jumpapp
Feb 15, 2024
d4f7dd8
Add SHopeepay Jump App to Settings
Feb 15, 2024
f4d8264
Move OCBC Digital out of installment group as it was requested
Feb 15, 2024
e4976d9
Add draft createTableViewCellsClosure
Feb 15, 2024
96d6d60
Make token(tokenID) public
Feb 15, 2024
26a0f60
Merge branch 'fix/MIT-2135_v5' into feature/MIT-2251_v5_AdaptableTabl…
Feb 15, 2024
1667131
Merge branch 'feature/MIT-1554_v5' into feature/MIT-2251_v5_Adaptable…
Feb 15, 2024
8d9b586
PaymentChooserViewController updated
Feb 15, 2024
10db60b
Basic refactoring is done. UI adjustments required
Feb 15, 2024
3c5ee3d
Refactoring PaymentChooserViewController
Feb 15, 2024
826ba67
Updating implementation for ListViewController
Feb 16, 2024
5fffec2
Fix typo
Feb 16, 2024
9abedca
Merge pull request #274 from omise/fix/MIT-2135_v5
Feb 16, 2024
755bfcc
Merge branch 'feature/MIT-1554_v5' into feature/MIT-2251_v5_Adaptable…
Feb 16, 2024
979fccd
Refactor OmiseSDK and Client access level
Feb 16, 2024
bc1b74c
Cleaning up PaymentChooserController
Feb 17, 2024
483a69b
Add PaymentFlow:
Feb 17, 2024
7a2d7d2
Refactor ChoosePaymentMethodViewModel
Feb 17, 2024
4548799
Refactor namings
Feb 17, 2024
4e730d1
Fix tableViewCell for payment method option
Feb 17, 2024
de7e9f7
Rearrange project tree
Feb 17, 2024
4bef101
update results completions
Feb 17, 2024
585ad02
Refactor PaymentMethod screen
Feb 18, 2024
b495de6
add comments to OmiseSDK instance in ExampleApp
Feb 18, 2024
baaf622
Update project tree for views
Feb 18, 2024
07c87ef
ClientTests updated to match new initializer
Feb 18, 2024
a452aea
ChoosePaymentMethodFlow uses tableDelegate and DataSource
Feb 19, 2024
75f4be2
Refactor PaymentFlow.createChoosePaymentMethodController
Feb 19, 2024
e9182e6
Move fields from Address to CardPaymentPayload
Feb 19, 2024
f7035a7
Source items refactored
Feb 19, 2024
42c9edc
Refactor ChoosePaymentMethodViewModel
Feb 19, 2024
15b2c77
Rename Source.PaymentInformation -> Source.Payment
Feb 19, 2024
f4f8a93
Update PaymentFlow to create a Source payment and notify delegate
Feb 20, 2024
f1e0495
PaymentFlow renamed to PaymentFlowCoordinator
Feb 20, 2024
8cab263
Cleaning up
Feb 20, 2024
c50da9e
Added internet banking and mobile banking screens
Feb 20, 2024
af16fd2
Add subtitle to payment method list
Feb 20, 2024
4dd5561
Cleaning up and renaming
Feb 21, 2024
0735559
Rearrange project tree
Feb 21, 2024
0a20440
Cleaning up namings
Feb 21, 2024
e6d27a1
Recreate project groups to arrange files inside subfolders
Feb 21, 2024
bf2e884
Fix building issues after removing obsolete files
Feb 21, 2024
d493570
Update ExampleApp to use current branch for testing
Feb 21, 2024
dea5a8d
Arrange files locations
Feb 21, 2024
c96c807
Update project settings to run ExampleApp from OmiseSDK. Add atome sc…
Feb 21, 2024
6f09d7b
Renamed CCVInfoPopupController
Feb 22, 2024
046874b
Moving Credit Card from Storyboard
Feb 22, 2024
8e663ef
Credit Card ccv popup added
Feb 22, 2024
3ca53a6
Fix CreditCardController
Feb 22, 2024
c0963b1
New base controller for form type payment information screens
Feb 22, 2024
25c4a81
AtomeController subclassed of PaymentFormBuilderController
Feb 22, 2024
0109d3e
Define 2 base classes to build payment form view controllers
Feb 23, 2024
9c546df
PaymentFormController cleanup
Feb 23, 2024
ae79927
PaymentInputsFormController base implementatino added
Feb 23, 2024
b36a74d
move econtext from storyboard to xib
Feb 24, 2024
ccf64eb
Add completion to payment details controllers
Feb 24, 2024
cddb1a1
FPX payment is refactored
Feb 24, 2024
cc44bd5
Storyboard clean up
Feb 24, 2024
4c7ea9d
DuitNowOBW Refactored
Feb 24, 2024
c1e11d7
truemoney wallet refactored
Feb 24, 2024
9c7ae13
cleanup storyboard
Feb 24, 2024
1c9919d
merge
Feb 24, 2024
b384849
Project tree cleanup
Feb 24, 2024
ee6023a
Update eContext payment translations
Mar 4, 2024
4e9b2ff
Move Credit card to OmiseSDK
Mar 4, 2024
b1d51f6
Move AuthorizingPaymentViewController.xib out of Storyboard
Mar 4, 2024
9764e47
Cleanup example app Storyboard
Mar 4, 2024
d5056a8
Clean up warnings
Mar 4, 2024
7e9ddef
Changing Readme
Mar 4, 2024
4f77e62
Clean sonarcloud warning
Mar 4, 2024
10cd9e0
Merge pull request #275 from omise/feature/MIT-2251_v5_AdaptableTable…
Mar 6, 2024
a2b256d
Merge pull request #273 from omise/feature/MIT-1554_v5
Mar 6, 2024
ce5f037
Update ExampleApp testing branch for OmiseSDK
Mar 6, 2024
736fed3
Update ChoosePaymentMethod filter
Mar 12, 2024
4da56b4
Update ExampleApp function name to present Payment Methods list
Mar 12, 2024
953bb19
Update present Credit Card function
Mar 12, 2024
edf5136
Update present Authorizing Payment function
Mar 12, 2024
c3563e0
Remove QuickStart.playground as it's obsolete
Mar 12, 2024
fd2385e
Merge branch 'master' into feature/v5_refactoring
Mar 12, 2024
edafdb1
Readme was updated and some code refactored
Mar 12, 2024
cf29f13
Fix wrong class name
Mar 12, 2024
afd6dad
Fix delegate name
Mar 12, 2024
7974338
Add draft localization for payment methods
Mar 12, 2024
1b1ee31
remove test code
Mar 12, 2024
0b0ef8a
Fix Atome payment
Mar 12, 2024
bf913b4
Update README.md
muthuswamyopn Mar 13, 2024
934aa79
Update README.md
muthuswamyopn Mar 13, 2024
80cd674
Update OmiseSDK comments. Fix Atome description. Fix CreditCardPaymen…
Mar 13, 2024
fcbe769
Update allowedPaymentMethods to be optional to present ChoosePaymentM…
Mar 13, 2024
6d3442b
Merge pull request #279 from omise/feature/MIT-2346-Atome
Mar 13, 2024
b03b87f
Merge pull request #278 from omise/feature/MIT-2260-Readme
Mar 13, 2024
7b19f49
Rename authorizedURL to authorizeURL
Mar 13, 2024
3acee03
Renamed presentAuthorizingPayment
Mar 13, 2024
39da3c3
Fix section
Mar 13, 2024
5446a64
Merge with feature/v5_refactoring
Mar 13, 2024
9dd0ee0
Remove remainings swift file headers. Fix keyboard appearance for scr…
Mar 13, 2024
2a955e2
merging from base branch
Mar 13, 2024
c8de8a8
Add payment method translations
Mar 13, 2024
2d919e2
Expose public protocol ClientProtocol instead of class Client
Mar 13, 2024
4c784fa
Replace Client with ClientProtocol in Readme
Mar 13, 2024
a1187a6
add translations and sort SourceType for better code reading
Mar 14, 2024
9b8475b
Fix localization identifier for SourceType
Mar 14, 2024
9871718
Fix PaymentMethods and Atome submit button background colors
Mar 14, 2024
857277d
Merge changes with base branch
Mar 14, 2024
1ac049b
Add warning for debug code
Mar 14, 2024
7e38e0c
Add missing payments to Localized file. Add error text for empty FPX …
Mar 14, 2024
14d8be6
Copy missing translations from Android SDK
Mar 15, 2024
8df9ac1
Finalize localization
Mar 15, 2024
8a47923
Changed target branch for ExampleApp to be a base branch
Mar 15, 2024
cbae16a
Fix github failed action
Mar 15, 2024
6d54e45
Fix ScrollView extension to pass github action error
Mar 15, 2024
4498f76
Fixed Installments, Mobile Banking and Internet Banking payment metho…
Mar 15, 2024
166914b
Merge pull request #280 from omise/feature/MIT-2316-Translations
Mar 15, 2024
1c6ac53
Fix unit tests
Mar 16, 2024
d6b071f
Merge branch 'feature/v5_refactoring' of github.com:omise/omise-ios i…
Mar 17, 2024
5f270ee
Custom Credit Card form dismiss is fixed
Mar 20, 2024
c3db3fd
Credit Card's address labels dark mode text color is fixed
Mar 20, 2024
2a4ef0e
Fix FPX email text color
Mar 20, 2024
bd49cff
Add debug output to console for Source and Token Id's in ExampleApp
Mar 20, 2024
39ab641
Update Authorized controller interface and add Custom Scheme to Examp…
Mar 20, 2024
83cee97
Change returnURL type from URL to String pattern
Mar 20, 2024
ff4b043
Remove deprecated objc files
Mar 20, 2024
a59269f
Add AppDeeplink to ExampleApp
Mar 20, 2024
98243bc
Cleanup unused files
Mar 21, 2024
4fff96b
Update currentAmount in Settings of ExampleApp. Fix text color for EC…
Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
Expand All @@ -21,10 +21,10 @@ 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 OmiseSDK.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
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

- name: Convert Xcode coverage to SonarCloud format
run: bash xccov-to-sonarqube-generic.sh build/Logs/Test/*.xcresult/ > sonarqube-generic-coverage.xml
Expand All @@ -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.
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Config.local.plist
sonarqube-generic-coverage.xml
!default.mode1v3
!default.mode2v3
Expand Down
453 changes: 453 additions & 0 deletions ExampleApp.xcodeproj/ExampleApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "omise-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/omise/omise-ios.git",
"state" : {
"branch" : "feature/MIT-1520",
"revision" : "11ab4094210feacb4e42ec29e49a8df41528b54e"
}
}
],
"version" : 2
}
475 changes: 475 additions & 0 deletions ExampleApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "omise-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/omise/omise-ios.git",
"state" : {
"branch" : "feature/v5_refactoring",
"revision" : "a59269f3d734ebc17d8e717b5c03b17d5d67a679"
}
}
],
"version" : 2
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
version = "1.3">
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -14,33 +14,23 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8A723A502164D7B100D902F5"
BlueprintIdentifier = "75C2E2242AD712F1008584C0"
BuildableName = "ExampleApp.app"
BlueprintName = "ExampleApp (Objective-C)"
ReferencedContainer = "container:OmiseSDK.xcodeproj">
BlueprintName = "ExampleApp"
ReferencedContainer = "container:ExampleApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug (Staging)"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8A723A502164D7B100D902F5"
BuildableName = "ExampleApp.app"
BlueprintName = "ExampleApp (Objective-C)"
ReferencedContainer = "container:OmiseSDK.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug (Staging)"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand All @@ -53,10 +43,10 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8A723A502164D7B100D902F5"
BlueprintIdentifier = "75C2E2242AD712F1008584C0"
BuildableName = "ExampleApp.app"
BlueprintName = "ExampleApp (Objective-C)"
ReferencedContainer = "container:OmiseSDK.xcodeproj">
BlueprintName = "ExampleApp"
ReferencedContainer = "container:ExampleApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
Expand All @@ -70,15 +60,15 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8A723A502164D7B100D902F5"
BlueprintIdentifier = "75C2E2242AD712F1008584C0"
BuildableName = "ExampleApp.app"
BlueprintName = "ExampleApp (Objective-C)"
ReferencedContainer = "container:OmiseSDK.xcodeproj">
BlueprintName = "ExampleApp"
ReferencedContainer = "container:ExampleApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug (Staging)">
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
Expand Down
17 changes: 17 additions & 0 deletions ExampleApp/AppDeeplink.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Foundation

enum AppDeeplink: String {
case threeDSChallenge = "3ds_challenge"

var scheme: String {
"omiseExampleApp"
}

var urlString: String {
"\(scheme)://\(rawValue)"
}

var url: URL? {
URL(string: urlString)
}
}
29 changes: 29 additions & 0 deletions ExampleApp/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@
import UIKit
import OmiseSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window?.tintColor = UIColor(named: "App Tint") ?? UIColor.blue

return true
}

func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
// Determine who sent the URL.
print("App open url '\(url)'")

let sendingAppID = options[.sourceApplication]
print("source application = \(sendingAppID ?? "Unknown")")

// Process the URL.
guard let components = NSURLComponents(url: url, resolvingAgainstBaseURL: true) else {
print("Invalid url")
return false
}

switch components.host {
case AppDeeplink.threeDSChallenge.rawValue:
print("Omise 3DS Challenge Callback")
let result = OmiseSDK.shared.handleURLCallback(url)
if result {
OmiseSDK.shared.dismiss()
}
return result
default:
print("Unknown deeplink params \(url.host ?? "nil")")
return false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<dict>
<key>publicKey</key>
<string>pkey_</string>
<key>devMode</key>
<false/>
<key>devVaultBaseURL</key>
<string></string>
<key>devApiBaseURL</key>
Expand Down
7 changes: 0 additions & 7 deletions ExampleApp/ExampleApp-Bridging-Header.h

This file was deleted.

13 changes: 13 additions & 0 deletions ExampleApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,18 @@
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>co.omise.ExampleApp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>omiseExampleApp</string>
</array>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
//
// LocalConfig.swift
// ExampleApp (Swift)
//
// Created by Andrei Solovev on 10/5/23.
// Copyright © 2023 Omise. All rights reserved.
//

import Foundation
import OmiseSDK

struct LocalConfig: Codable {
var publicKey: String = "pkey_"
var devMode = false

private let devVaultBaseURL: String?
private let devApiBaseURL: String?

var devMode: Bool {
devVaultBaseURL != nil && devApiBaseURL != nil
}

init() {
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
}
}

Expand Down
75 changes: 75 additions & 0 deletions ExampleApp/Models/Tools.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import UIKit
import OmiseSDK

struct PaymentPreset {
var paymentAmount: Int64
var paymentCurrency: Currency
var allowedPaymentMethods: [SourceType]

static let allPreset = PaymentPreset(
paymentAmount: 3_500_00,
paymentCurrency: .thb,
allowedPaymentMethods: SourceType.allCases
)

static let thailandPreset = PaymentPreset(
paymentAmount: 3_500_00,
paymentCurrency: .thb,
allowedPaymentMethods: SourceType.availableByDefaultInThailand
)

static let japanPreset = PaymentPreset(
paymentAmount: 3_500,
paymentCurrency: .jpy,
allowedPaymentMethods: SourceType.availableByDefaultInJapan
)

static let singaporePreset = PaymentPreset(
paymentAmount: 3_500_00,
paymentCurrency: .sgd,
allowedPaymentMethods: SourceType.availableByDefaultSingapore
)

static let malaysiaPreset = PaymentPreset(
paymentAmount: 3_500_00,
paymentCurrency: .myr,
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: [SourceType] = PaymentPreset.thailandPreset.allowedPaymentMethods

static let japanPaymentAmount: Int64 = PaymentPreset.japanPreset.paymentAmount
static let japanPaymentCurrency: String = PaymentPreset.japanPreset.paymentCurrency.code
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: [SourceType] = PaymentPreset.singaporePreset.allowedPaymentMethods

static let malaysiaPaymentAmount: Int64 = PaymentPreset.malaysiaPreset.paymentAmount
static let malaysiaPaymentCurrency: String = PaymentPreset.malaysiaPreset.paymentCurrency.code
static let malaysiaAllowedPaymentMethods: [SourceType] = PaymentPreset.malaysiaPreset.allowedPaymentMethods

static func imageWith(size: CGSize, color: UIColor) -> UIImage? {
return Tool.imageWith(size: size) { (context) in
context.setFillColor(color.cgColor)
context.fill(CGRect(origin: .zero, size: size))
}
}

static func imageWith(size: CGSize, actions: (CGContext) -> Void) -> UIImage? {
let renderer = UIGraphicsImageRenderer(size: size)
return renderer.image { context in
actions(context.cgContext)
}
}
}
Loading
Loading