Skip to content

Commit

Permalink
feat(POM-280): link Checkout3DS via SPM (#180)
Browse files Browse the repository at this point in the history
Replace vendored Checkout3DS dependency with one linked via SPM
  • Loading branch information
andrii-vysotskyi-cko authored Oct 23, 2023
1 parent 8ed03cf commit 659511e
Show file tree
Hide file tree
Showing 159 changed files with 31 additions and 82,254 deletions.
9 changes: 9 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"pins" : [
{
"identity" : "checkout-3ds-sdk-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/checkout/checkout-3ds-sdk-ios",
"state" : {
"revision" : "b7f3e53150e45105de58b11e683254ee4ec30913",
"version" : "3.2.1"
}
},
{
"identity" : "checkout-event-logger-ios-framework",
"kind" : "remoteSourceControl",
Expand Down
15 changes: 2 additions & 13 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ let package = Package(
.library(name: "ProcessOutCheckout3DS", targets: ["ProcessOutCheckout3DS"])
],
dependencies: [
// todo(andrii-vysotskyi): stop vendoring CKO 3DS SDK and dependencies when SPM support is ready.
.package(url: "https://github.com/checkout/checkout-event-logger-ios-framework", exact: "1.2.4"),
.package(url: "https://github.com/checkout/checkout-3ds-sdk-ios", exact: "3.2.1"),
],
targets: [
.target(
Expand All @@ -31,19 +30,9 @@ let package = Package(
name: "ProcessOutCheckout3DS",
dependencies: [
.target(name: "ProcessOut"),
.product(
name: "CheckoutEventLoggerKit", package: "checkout-event-logger-ios-framework"
),
.target(name: "JOSESwift"),
.target(name: "Checkout3DS")
.product(name: "Checkout3DSPackages", package: "checkout-3ds-sdk-ios")
]
),
.binaryTarget(
name: "Checkout3DS", path: "Vendor/Checkout3DS.xcframework"
),
.binaryTarget(
name: "JOSESwift", path: "Vendor/JOSESwift.xcframework"
),
.binaryTarget(name: "cmark", path: "Vendor/cmark.xcframework")
]
)
2 changes: 1 addition & 1 deletion ProcessOutCheckout3DS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '12.0'
s.source_files = 'Sources/ProcessOutCheckout3DS/**/*.swift'
s.dependency 'ProcessOut', s.version.to_s
s.dependency 'Checkout3DS', '3.1.1'
s.dependency 'Checkout3DS', '3.2.1'
end
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ Get started with our ProcessOut [documentation](https://docs.processout.com/) or
| ProcessOut | Allows to interact with ProcessOut API and provides a UI to handle payments. |
| ProcessOutCheckout3DS | Integration with Checkout.com 3D Secure (3DS) mobile SDK. |

> **Warning**
>
> SPM support for `ProcessOutCheckout3DS` is **experimental**. Module depends on [Checkout3DS SDK](https://github.com/checkout/checkout-3ds-sdk-ios)
> that is not compatible with SPM. As a workaround, we vendor `Checkout3DS` (v3.1.1) and its dependency
> [JOSESwift](https://github.com/airsidemobile/JOSESwift) (v2.4.0).
## Contributing

We welcome contributions of any kind including new features, bug fixes, and general improvements.
Expand Down
22 changes: 14 additions & 8 deletions Scripts/Test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@

set -euo pipefail

SDK='iphonesimulator17.0'
DESTINATION='platform=iOS Simulator,name=iPhone 15'
PROJECT='ProcessOut.xcodeproj'

# Run Tests
for PRODUCT in "ProcessOut" "ProcessOutCheckout3DS" ; do
for PRODUCT in "ProcessOut" ; do
xcodebuild clean test \
-project ProcessOut.xcodeproj \
-scheme "$PRODUCT" \
-sdk "$SDK" \
-destination "$DESTINATION" |
bundle exec xcpretty
-project $PROJECT \
-scheme $PRODUCT \
-sdk 'iphonesimulator17.0' \
-destination 'platform=iOS Simulator,name=iPhone 15'
done

# It is a known issue that Checkout3DS v3.2.1 (framework that ProcessOutCheckout3DS
# depends on) can't be properly tested without host application due to bug.
xcodebuild clean build \
-project $PROJECT \
-scheme ProcessOutCheckout3DS \
-destination "generic/platform=iOS" |
bundle exec xcpretty

# todo(andrii-vysotskyi): run example target tests when POM-144 is resolved
40 changes: 0 additions & 40 deletions Vendor/Checkout3DS.xcframework/Info.plist

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 659511e

Please sign in to comment.