Skip to content

Commit cca6379

Browse files
Prepare main for Release 1.2.0 (#21)
* chore: Include swiftlint * feat: Plugin init + Setup Configurations (#1) Initialise plugin with required structure. Create structure to deal with Apple Pay. Despite being ready to deal with any kind of dictionary, provide an accelerator to read the configuration from the main bundle. Add Nimble and Quick through Cocoapods to use BDD for unit testing. * feat: Check Wallet and Payment Availability (#2) Add verification for wallet and payment availability. Payment verification is enhanced by also checking it against the configured payment networks and supported capabilities. * feat: Set Details and Trigger Payment (#3) Configure the missing payment details and, by mixing it with the configuration info, trigger the payment request. * refactor: Add DocC documentation and minor fixes. (#4) Add DocC documentation. Add empty value check and mandatory fields when fetching configuration properties. * fix: Payment Setup Verification Failed on Invalid Configuration (#5) Fix error when verifying payment setup on ReadyToPay method. If some payment network or merchant capabilities are missing, return the associated error. * fix: Errors and Contact Management (#6) Clean errors and its codes and messages accordingly. New OSPMTContact struct that allows the management of the correct shipping and billing information to use on a payment request. This is required due to a limitation on OutSystems related with nullable lists. Change the OSPMTConfigurationDelegate to OSPMTConfigurationModel, in order to comply with the new OutSystems structure. Clean code (privatise local methods and make OSPMTPayment's delegate property weak, in order to avoid possible retain cycles). * fix: Check if GivenName and FamilyName are empty (#7) * chore: Add Unreleased Section * Chore: Add Podspec (#9) * refactor: Simply Generic Method * chore: Add public podspec Add public podspec. This implies also updating the readme.md file to something more descriptive and user-friendly. * feat: Add Stripe as First Payment Gateway (#11) Add all necessary logic and changes to make payment processing using Stripe including Protocols, Factories and Models to deal with the StripePayments pod. Unit tests are included. * Feat: Add Gateway property to OSPMTDetailsModel (#12) Add `gateway` property to `OSPMTDetailsModel` struct. When authorising payment, confirm that this property corresponds to a configured gateway (on plist). * feat: Add AccessToken to Full Payment Process (#13) Add the optional parameter `accessToken` to the `OSPMTActionDelegate`'s `set` method and the `OSPMTStripeWrapper`'s `processPaymentWithDetails` method. Apply consequent changes to it. In case of a full payment is triggered but no access token is passed, a `tokenIssue` is returned. * chore: Set Release Tag Set release tag on the repo's CHANGELOG file. * Merge Development Into Main (#10) * chore: Include swiftlint * feat: Plugin init + Setup Configurations (#1) Initialise plugin with required structure. Create structure to deal with Apple Pay. Despite being ready to deal with any kind of dictionary, provide an accelerator to read the configuration from the main bundle. Add Nimble and Quick through Cocoapods to use BDD for unit testing. * feat: Check Wallet and Payment Availability (#2) Add verification for wallet and payment availability. Payment verification is enhanced by also checking it against the configured payment networks and supported capabilities. * feat: Set Details and Trigger Payment (#3) Configure the missing payment details and, by mixing it with the configuration info, trigger the payment request. * refactor: Add DocC documentation and minor fixes. (#4) Add DocC documentation. Add empty value check and mandatory fields when fetching configuration properties. * fix: Payment Setup Verification Failed on Invalid Configuration (#5) Fix error when verifying payment setup on ReadyToPay method. If some payment network or merchant capabilities are missing, return the associated error. * fix: Errors and Contact Management (#6) Clean errors and its codes and messages accordingly. New OSPMTContact struct that allows the management of the correct shipping and billing information to use on a payment request. This is required due to a limitation on OutSystems related with nullable lists. Change the OSPMTConfigurationDelegate to OSPMTConfigurationModel, in order to comply with the new OutSystems structure. Clean code (privatise local methods and make OSPMTPayment's delegate property weak, in order to avoid possible retain cycles). * fix: Check if GivenName and FamilyName are empty (#7) * chore: Add Unreleased Section * Chore: Add Podspec (#9) * refactor: Simply Generic Method * chore: Add public podspec Add public podspec. This implies also updating the readme.md file to something more descriptive and user-friendly. * feat: Make library available as xcframework (#15) Add the necessary script (script.sh) to make the library available as a xcframework. Remove podspec file as the CocoaPods approach was discarded. Exchange Stripe pod for a Swift Package Manager. * chore: Set Release Tag * Prepare Release 1.1.0 (#14) * chore: Include swiftlint * feat: Plugin init + Setup Configurations (#1) Initialise plugin with required structure. Create structure to deal with Apple Pay. Despite being ready to deal with any kind of dictionary, provide an accelerator to read the configuration from the main bundle. Add Nimble and Quick through Cocoapods to use BDD for unit testing. * feat: Check Wallet and Payment Availability (#2) Add verification for wallet and payment availability. Payment verification is enhanced by also checking it against the configured payment networks and supported capabilities. * feat: Set Details and Trigger Payment (#3) Configure the missing payment details and, by mixing it with the configuration info, trigger the payment request. * refactor: Add DocC documentation and minor fixes. (#4) Add DocC documentation. Add empty value check and mandatory fields when fetching configuration properties. * fix: Payment Setup Verification Failed on Invalid Configuration (#5) Fix error when verifying payment setup on ReadyToPay method. If some payment network or merchant capabilities are missing, return the associated error. * fix: Errors and Contact Management (#6) Clean errors and its codes and messages accordingly. New OSPMTContact struct that allows the management of the correct shipping and billing information to use on a payment request. This is required due to a limitation on OutSystems related with nullable lists. Change the OSPMTConfigurationDelegate to OSPMTConfigurationModel, in order to comply with the new OutSystems structure. Clean code (privatise local methods and make OSPMTPayment's delegate property weak, in order to avoid possible retain cycles). * fix: Check if GivenName and FamilyName are empty (#7) * chore: Add Unreleased Section * Chore: Add Podspec (#9) * refactor: Simply Generic Method * chore: Add public podspec Add public podspec. This implies also updating the readme.md file to something more descriptive and user-friendly. * feat: Add Stripe as First Payment Gateway (#11) Add all necessary logic and changes to make payment processing using Stripe including Protocols, Factories and Models to deal with the StripePayments pod. Unit tests are included. * Feat: Add Gateway property to OSPMTDetailsModel (#12) Add `gateway` property to `OSPMTDetailsModel` struct. When authorising payment, confirm that this property corresponds to a configured gateway (on plist). * feat: Add AccessToken to Full Payment Process (#13) Add the optional parameter `accessToken` to the `OSPMTActionDelegate`'s `set` method and the `OSPMTStripeWrapper`'s `processPaymentWithDetails` method. Apply consequent changes to it. In case of a full payment is triggered but no access token is passed, a `tokenIssue` is returned. * chore: Set Release Tag Set release tag on the repo's CHANGELOG file. * Prepare Release 1.1.1 (#16) * chore: Include swiftlint * feat: Plugin init + Setup Configurations (#1) Initialise plugin with required structure. Create structure to deal with Apple Pay. Despite being ready to deal with any kind of dictionary, provide an accelerator to read the configuration from the main bundle. Add Nimble and Quick through Cocoapods to use BDD for unit testing. * feat: Check Wallet and Payment Availability (#2) Add verification for wallet and payment availability. Payment verification is enhanced by also checking it against the configured payment networks and supported capabilities. * feat: Set Details and Trigger Payment (#3) Configure the missing payment details and, by mixing it with the configuration info, trigger the payment request. * refactor: Add DocC documentation and minor fixes. (#4) Add DocC documentation. Add empty value check and mandatory fields when fetching configuration properties. * fix: Payment Setup Verification Failed on Invalid Configuration (#5) Fix error when verifying payment setup on ReadyToPay method. If some payment network or merchant capabilities are missing, return the associated error. * fix: Errors and Contact Management (#6) Clean errors and its codes and messages accordingly. New OSPMTContact struct that allows the management of the correct shipping and billing information to use on a payment request. This is required due to a limitation on OutSystems related with nullable lists. Change the OSPMTConfigurationDelegate to OSPMTConfigurationModel, in order to comply with the new OutSystems structure. Clean code (privatise local methods and make OSPMTPayment's delegate property weak, in order to avoid possible retain cycles). * fix: Check if GivenName and FamilyName are empty (#7) * chore: Add Unreleased Section * Chore: Add Podspec (#9) * refactor: Simply Generic Method * chore: Add public podspec Add public podspec. This implies also updating the readme.md file to something more descriptive and user-friendly. * feat: Add Stripe as First Payment Gateway (#11) Add all necessary logic and changes to make payment processing using Stripe including Protocols, Factories and Models to deal with the StripePayments pod. Unit tests are included. * Feat: Add Gateway property to OSPMTDetailsModel (#12) Add `gateway` property to `OSPMTDetailsModel` struct. When authorising payment, confirm that this property corresponds to a configured gateway (on plist). * feat: Add AccessToken to Full Payment Process (#13) Add the optional parameter `accessToken` to the `OSPMTActionDelegate`'s `set` method and the `OSPMTStripeWrapper`'s `processPaymentWithDetails` method. Apply consequent changes to it. In case of a full payment is triggered but no access token is passed, a `tokenIssue` is returned. * chore: Set Release Tag Set release tag on the repo's CHANGELOG file. * feat: Make library available as xcframework (#15) Add the necessary script (script.sh) to make the library available as a xcframework. Remove podspec file as the CocoaPods approach was discarded. Exchange Stripe pod for a Swift Package Manager. * chore: Set Release Tag * fix: Update GitHub Actions (#17) Update `github_actions.yml` file steps versions. References: https://outsystemsrd.atlassian.net/browse/RMET-2568 * RMET-3283 ::: Add Privacy Manifest (#19) * chore: add CODEOWNERS (#18) Signed-off-by: IT-MikeS <20338451+IT-MikeS@users.noreply.github.com> * chore: Update Stripe to `23.26.0` Considering that this new version doesn't work with Xcode 14, we update the minimum versions to: - xCode 15; - iOS 14. These updates require updating `Quick` and `Nimble` to the latest versions: `7.5.0` and `13.2.1` respectively. This requires updating the test cases, to make them pass successfully. The update to iOS 14 also requires the insertion of the `presentationWindow(for:)` method for `OSPMTApplePayRequestBehaviour`. Add `Podfile.lock` to the `gitignore` file. References: https://outsystemsrd.atlassian.net/browse/RMET-3283 * chore: Update scripts Update `github_actions.yml` file to allow the correct execution of the unit tests. Update the `build.sh` script by including: - the Xcode version to run; - the `sdk`s to run; - code signing. * feat: Add Privacy Manifest References: https://outsystemsrd.atlassian.net/browse/RMET-3283 * chore: Use `macos-14` for GitHub Actions Replace `macos-latest` with `macos-14`. This is required as we aim to use Xcode 15 to run the unit tests. Add `Gemfile.lock` file to `gitignore`. References: https://outsystemsrd.atlassian.net/browse/RMET-3283 * chore: Add CHANGELOG entry References: https://outsystemsrd.atlassian.net/browse/RMET-3283 --------- Signed-off-by: IT-MikeS <20338451+IT-MikeS@users.noreply.github.com> Co-authored-by: Mike Summerfeldt <20338451+IT-MikeS@users.noreply.github.com> * RMET-3340 ::: Prepare Release `1.2.0` (#20) * chore: Set Release Version Raise version to `1.2.0`. References: https://outsystemsrd.atlassian.net/browse/RMET-3340 * fix: Typo References: https://outsystemsrd.atlassian.net/browse/RMET-3340 * chore: Add missing configurations --------- Signed-off-by: IT-MikeS <20338451+IT-MikeS@users.noreply.github.com> Co-authored-by: Mike Summerfeldt <20338451+IT-MikeS@users.noreply.github.com>
1 parent ee57cd8 commit cca6379

File tree

208 files changed

+12445
-3234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+12445
-3234
lines changed

.github/workflows/github_actions.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,45 @@ on:
1010
jobs:
1111
test:
1212
name: Unit-Tests
13-
runs-on: macos-latest
14-
13+
runs-on: macos-14
1514
steps:
1615
- name: Checkout
17-
uses: actions/checkout@v1
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Java 17
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: 'zulu'
22+
java-version: '17'
23+
24+
- name: Set up XCode
25+
run: sudo xcode-select --switch /Applications/Xcode_15.1.app
26+
1827
- name: Bundle Install
1928
run: bundle install
29+
30+
- name: Install Cocoapods
31+
run: bundle exec pod install
32+
33+
- name: Link SwiftLint or install it
34+
run: brew link --overwrite swiftlint || brew install swiftlint || brew link --overwrite swiftlint
35+
2036
- name: Unit tests
2137
run: bundle exec fastlane unit_tests
2238
env:
2339
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
40+
2441
- name: Code Coverage
2542
run: bundle exec fastlane coverage
43+
2644
- name: Lint
2745
run: bundle exec fastlane lint
46+
2847
- name: Setup sonarqube
29-
uses: warchant/setup-sonar-scanner@v3
48+
uses: warchant/setup-sonar-scanner@v8
49+
3050
- name: Send to Sonarcloud
3151
run: bundle exec fastlane sonarqube
3252
env:
3353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
SONAR_TOKEN: ${{ secrets.SONARCLOUD_KEY }}
54+
SONAR_TOKEN: ${{ secrets.SONARCLOUD_KEY }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,5 @@ fastlane/test_output
8888
# https://github.com/johnno1962/injectionforxcode
8989

9090
iOSInjectionProject/
91+
Podfile.lock
92+
Gemfile.lock

Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
source "https://rubygems.org"
22

3-
gem "fastlane"
4-
gem "slather"
3+
gem 'cocoapods', '1.14.3'
4+
gem 'fastlane'
5+
gem 'slather'

OSPaymentsLib.xcodeproj/project.pbxproj

Lines changed: 74 additions & 45 deletions
Large diffs are not rendered by default.

OSPaymentsLib.xcodeproj/xcshareddata/xcschemes/OSPaymentsLib.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1340"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -45,7 +45,7 @@
4545
buildConfiguration = "Debug"
4646
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4747
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48-
launchStyle = "0"
48+
launchStyle = "1"
4949
useCustomWorkingDirectory = "NO"
5050
ignoresPersistentStateOnLaunch = "NO"
5151
debugDocumentVersioning = "YES"

OSPaymentsLib.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyTracking</key>
6+
<false/>
7+
8+
<key>NSPrivacyTrackingDomains</key>
9+
<array/>
10+
11+
<key>NSPrivacyCollectedDataTypes</key>
12+
<array>
13+
<dict>
14+
<key>NSPrivacyCollectedDataType</key>
15+
<string>NSPrivacyCollectedDataTypeName</string>
16+
17+
<key>NSPrivacyCollectedDataTypeLinked</key>
18+
<true/>
19+
20+
<key>NSPrivacyCollectedDataTypeTracking</key>
21+
<false/>
22+
23+
<key>NSPrivacyCollectedDataTypePurposes</key>
24+
<array>
25+
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
26+
</array>
27+
</dict>
28+
29+
<dict>
30+
<key>NSPrivacyCollectedDataType</key>
31+
<string>NSPrivacyCollectedDataTypeEmailAddress</string>
32+
33+
<key>NSPrivacyCollectedDataTypeLinked</key>
34+
<true/>
35+
36+
<key>NSPrivacyCollectedDataTypeTracking</key>
37+
<false/>
38+
39+
<key>NSPrivacyCollectedDataTypePurposes</key>
40+
<array>
41+
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
42+
</array>
43+
</dict>
44+
45+
<dict>
46+
<key>NSPrivacyCollectedDataType</key>
47+
<string>NSPrivacyCollectedDataTypePhoneNumber</string>
48+
49+
<key>NSPrivacyCollectedDataTypeLinked</key>
50+
<true/>
51+
52+
<key>NSPrivacyCollectedDataTypeTracking</key>
53+
<false/>
54+
55+
<key>NSPrivacyCollectedDataTypePurposes</key>
56+
<array>
57+
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
58+
</array>
59+
</dict>
60+
61+
<dict>
62+
<key>NSPrivacyCollectedDataType</key>
63+
<string>NSPrivacyCollectedDataTypePhysicalAddress</string>
64+
65+
<key>NSPrivacyCollectedDataTypeLinked</key>
66+
<true/>
67+
68+
<key>NSPrivacyCollectedDataTypeTracking</key>
69+
<false/>
70+
71+
<key>NSPrivacyCollectedDataTypePurposes</key>
72+
<array>
73+
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
74+
</array>
75+
</dict>
76+
77+
<dict>
78+
<key>NSPrivacyCollectedDataType</key>
79+
<string>NSPrivacyCollectedDataTypePaymentInfo</string>
80+
81+
<key>NSPrivacyCollectedDataTypeLinked</key>
82+
<true/>
83+
84+
<key>NSPrivacyCollectedDataTypeTracking</key>
85+
<false/>
86+
87+
<key>NSPrivacyCollectedDataTypePurposes</key>
88+
<array>
89+
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
90+
</array>
91+
</dict>
92+
</array>
93+
94+
<key>NSPrivacyAccessedAPITypes</key>
95+
<array/>
96+
</dict>
97+
</plist>

OSPaymentsLib/Protocols/OSPMTRequestDelegate.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ extension OSPMTApplePayRequestBehaviour {
110110

111111
// MARK: - Set up PKPaymentAuthorizationControllerDelegate conformance
112112
extension OSPMTApplePayRequestBehaviour: PKPaymentAuthorizationControllerDelegate {
113-
/// Tells the delegate that payment authorization finished.
114-
/// - Parameter controller: The payment authorization view controller.
115113
func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) {
116114
controller.dismiss()
117115
// The payment sheet doesn't automatically dismiss once it has finished. Dismiss the payment sheet.
@@ -124,11 +122,6 @@ extension OSPMTApplePayRequestBehaviour: PKPaymentAuthorizationControllerDelegat
124122
}
125123
}
126124

127-
/// Tells the delegate that the user authorized the payment request, and asks for a result.
128-
/// - Parameters:
129-
/// - controller: The payment authorization view controller.
130-
/// - payment: The authorized payment. This object contains the payment token you need to submit to your payment processor, as well as the billing and shipping information required by the payment request.
131-
/// - completion: The completion handler to call with the result of authorizing the payment.
132125
func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) {
133126
func setPaymentResults(with errorArray: [OSPMTError], and scopeModel: OSPMTScopeModel?, _ completion: @escaping (PKPaymentAuthorizationResult) -> Void) {
134127
if errorArray.isEmpty, let scopeModel = scopeModel {
@@ -172,4 +165,10 @@ extension OSPMTApplePayRequestBehaviour: PKPaymentAuthorizationControllerDelegat
172165
setPaymentResults(with: [], and: payment.createScopeModel(), completion)
173166
}
174167
}
168+
169+
/**
170+
Despite the need to implement the method, this is not required by app's functionality.
171+
For that reason, we're returning `nil` as the presentation window.
172+
*/
173+
func presentationWindow(for controller: PKPaymentAuthorizationController) -> UIWindow? { nil }
175174
}

OSPaymentsLibTests/ModelSpecs/OSPMTAddressModelSpec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class OSPMTAddressModelSpec: QuickSpec {
8080
)
8181
}
8282

83-
override func spec() {
83+
override class func spec() {
8484
describe("Given a full configuration") {
8585
context("When decoding the Address Model") {
8686
it("Should return a filled object") {

OSPaymentsLibTests/ModelSpecs/OSPMTContactInfoModelSpec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class OSPMTContactInfoModelSpec: QuickSpec {
6060
)
6161
}
6262

63-
override func spec() {
63+
override class func spec() {
6464
describe("Given a full configuration") {
6565
context("When decoding the Contact Info Model") {
6666
it("Should return a filled object") {

0 commit comments

Comments
 (0)