Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7010d77
Move PaymentCaptureCelebration to Yosemite
staskus Sep 17, 2025
041f89e
Merge branch 'trunk' into woomob-935-woo-pos-hack-week-pos-modulariza…
staskus Sep 18, 2025
4945b39
Move CountryCode.readableCountry to Yosemite
staskus Sep 18, 2025
53dd19a
Remove the only WooConstants reference from POS
staskus Sep 18, 2025
26be5a6
Type-erase WCSettingsWebView through externalViews
staskus Sep 18, 2025
466ecbd
Move CollectOrderPaymentUseCaseError to Yosemite for reuse
staskus Sep 18, 2025
313f222
Update CollectOrderPaymentUseCaseError.swift
staskus Sep 18, 2025
7d4423f
Move AsyncPaginationTracker to Yosemite
staskus Sep 18, 2025
a26c057
Remove analyticsValue PaymentMethod dependency rom POS
staskus Sep 18, 2025
7c617df
Create PointOfSale module and move files
staskus Sep 18, 2025
f5bc3ea
Move shared extensions of DateFormatter and Decimal to WooFoundation.
jaclync Sep 22, 2025
41c5927
Move SiteAddress to Yosemite while keeping initializer with singleton…
jaclync Sep 22, 2025
1fb9713
Move SafariView and SafariSheet to WooFoundation.
jaclync Sep 22, 2025
5fd437d
FormattableAmountTextField: refactor font override to a Style struct …
jaclync Sep 22, 2025
ace3ecd
Add missing font parameter in POSExternalViewProviding protocol.
jaclync Sep 22, 2025
6d2d682
Merge branch 'trunk' into feat/woomob-935-fix-build-errors
jaclync Sep 24, 2025
3d3e40d
Merge branch 'feat/WOOMOB-935-move-shared-dependencies-to-shared-fram…
jaclync Sep 24, 2025
c34f1fd
Merge branch 'feat/WOOMOB-935-refactor-POSFormattableAmountTextField-…
jaclync Sep 24, 2025
5a44cfa
Refactor `WaitingTimeTracker` to remove `Analytics` dependency so tha…
jaclync Sep 24, 2025
d9b59e9
Merge branch 'feat/WOOMOB-935-refactor-WaitingTimeTracker-and-move-to…
jaclync Sep 24, 2025
67c1b1a
Refactor `PointOfSaleEntryPointView` initializer to minimize the POS …
jaclync Sep 24, 2025
75952ff
Move IPP WooPayments doc url to `POSConstants.URLs`.
jaclync Sep 24, 2025
695b03d
Move all POS tests to PointOfSaleTests test target that is included i…
jaclync Sep 25, 2025
f557153
Move POS assets to POS module and shared assets to WooFoundation.
jaclync Sep 26, 2025
7eefddb
Merge branch 'feat/WOOMOB-935-refactor-pos-entry-point' into feat/woo…
jaclync Sep 26, 2025
784d683
Add PointOfSaleTests to unit tests plan.
jaclync Sep 26, 2025
fbc0408
Remove duplicate `POSEntryPointEligibilityCheckerProtocol` missed fro…
jaclync Sep 26, 2025
903e2f8
Move `POSIneligibleView` to POS module.
jaclync Sep 26, 2025
2ded88a
Remove deleted feature flag in POS module from merge.
jaclync Sep 26, 2025
7b95cc3
Add necessary imports to files in POS module.
jaclync Sep 26, 2025
f405a8a
Missing diffs from merge.
jaclync Sep 26, 2025
9ad914b
Fix `MockPOSAnalytics.swift` in project file.
jaclync Sep 26, 2025
5dda425
Add missing image usage in POS module.
jaclync Sep 26, 2025
274f633
DI currency settings to coupon summary.
jaclync Sep 26, 2025
560e680
Add POS imports to files in the app that access POS code.
jaclync Sep 26, 2025
24b8c11
Fix fatal error accessing POS bundle in POS tests target with a worka…
jaclync Sep 26, 2025
dd99055
Specify POS as a target in the same package.
jaclync Sep 26, 2025
bd21b62
Add missing import in POS module.
jaclync Sep 26, 2025
1234061
Workaround for build errors accessing color with generated symbols in…
jaclync Sep 26, 2025
a51592b
Mark necessary POS code as public for external access.
jaclync Sep 26, 2025
a062a96
Remove unused code in test case.
jaclync Sep 26, 2025
e3936e5
Merge branch 'trunk' into feat/woomob-935-fix-build-errors
jaclync Sep 30, 2025
568171d
Fix SwiftLint errors from duplicate imports.
jaclync Sep 30, 2025
57c0acd
Fix a subset of Periphery warnings that are straightforward.
jaclync Sep 26, 2025
a8ef375
Fix more straightforward Periphery warnings.
jaclync Sep 26, 2025
662c98b
Fix Periphery warnings that might not be the prettiest or require tes…
jaclync Sep 26, 2025
cd70c95
Fix Periphery warnings from unused functions in `ConnectivityObserver…
jaclync Sep 26, 2025
78493e5
Fix build error from accidentally deleted code from merge.
jaclync Sep 30, 2025
2bba7a7
Merge branch 'trunk' into feat/woomob-935-fix-build-errors
jaclync Oct 1, 2025
6683480
Fix another round of straightforward Periphery warnings.
jaclync Oct 1, 2025
8fd09ae
Fix more Periphery warnings. To test: POS search history, shadow.
jaclync Oct 1, 2025
3f0951b
Refactor `POSSearchTextFieldStyle` to a view modifier to avoid using …
jaclync Oct 1, 2025
a708bf3
Merge branch 'feat/WOOMOB-935-periphery-warnings' into feat/woomob-93…
jaclync Oct 1, 2025
167d394
Remove `DynamicHStack` and `DynamicVStack` from POS module.
jaclync Oct 1, 2025
a7d44b6
Merge branch 'trunk' into feat/woomob-935-fix-build-errors
jaclync Oct 2, 2025
e2a619f
Try reverting back to dot syntax color symbols for POS colors to see …
jaclync Oct 2, 2025
5a886f7
Merge branch 'trunk' into feat/woomob-935-fix-build-errors
jaclync Oct 3, 2025
9945a10
Revert "Try reverting back to dot syntax color symbols for POS colors…
jaclync Oct 3, 2025
17fb0c9
Revert enabling simulated Stripe card reader in WooCommerce scheme.
jaclync Oct 3, 2025
db21973
Add release notes entry to release 23.5.
jaclync Oct 3, 2025
840c306
Merge branch 'trunk' into feat/woomob-935-fix-build-errors
staskus Oct 6, 2025
801acb7
Make PointOfSaleTests part of PointOfSale scheme tests
staskus Oct 6, 2025
44729a3
Add PointOfSale Module section to README
staskus Oct 6, 2025
5601061
Play barcode scanning failure sound from the module bundle
staskus Oct 6, 2025
5624fb6
Remove unused code
staskus Oct 6, 2025
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
  •  
  •  
  •  
72 changes: 72 additions & 0 deletions Modules/.swiftpm/xcode/xcshareddata/xcschemes/PointOfSale.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PointOfSale"
BuildableName = "PointOfSale"
BlueprintName = "PointOfSale"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:Tests/PointOfSaleTests/PointOfSale.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PointOfSale"
BuildableName = "PointOfSale"
BlueprintName = "PointOfSale"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion Modules/Package.resolved

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

32 changes: 30 additions & 2 deletions Modules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ let package = Package(
name: "Yosemite",
targets: ["Yosemite"]
),
.library(
name: "PointOfSale",
targets: ["PointOfSale"]
),
],
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire", from: "5.2.0"),
Expand Down Expand Up @@ -182,7 +186,8 @@ let package = Package(
dependencies: [
"WooFoundationCore",
.product(name: "Kingfisher", package: "Kingfisher")
]
],
resources: [.process("Resources")]
),
.target(
name: "WooFoundationCore",
Expand Down Expand Up @@ -230,6 +235,18 @@ let package = Package(
.product(name: "WordPressEditor", package: "AztecEditor-iOS"),
]
),
.target(
name: "PointOfSale",
dependencies: [
"Experiments",
"WooFoundation",
"Yosemite",
.product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"),
.product(name: "Shimmer", package: "SwiftUI-Shimmer"),
.product(name: "Kingfisher", package: "Kingfisher"),
],
resources: [.process("Resources")]
),
.testTarget(
name: "ExperimentsTests",
dependencies: [
Expand Down Expand Up @@ -295,7 +312,17 @@ let package = Package(
.process("Resources"),
.process("../NetworkingTests/Responses")
]
)
),
.testTarget(
name: "PointOfSaleTests",
dependencies: [
.target(name: "PointOfSale"),
"Codegen",
"Fakes",
"TestKit",
"WooFoundation"
]
),
]
)

Expand Down Expand Up @@ -374,6 +401,7 @@ enum XcodeSupport {
"WordPressUI",
"WPMediaPicker",
"Yosemite",
"PointOfSale",
.product(name: "Alamofire", package: "Alamofire"),
.product(name: "Algorithms", package: "swift-algorithms"),
.product(name: "AutomatticAbout", package: "AutomatticAbout-swift"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import Foundation
import Yosemite
import struct WooFoundation.WooAnalyticsEvent

struct POSOrderListFetchAnalytics: POSOrderListFetchAnalyticsTracking {
public struct POSOrderListFetchAnalytics: POSOrderListFetchAnalyticsTracking {
private let analytics: POSAnalyticsProviding

init(analytics: POSAnalyticsProviding) {
public init(analytics: POSAnalyticsProviding) {
self.analytics = analytics
}

func trackOrdersFetchComplete(millisecondsSinceRequestSent: Int) {
public func trackOrdersFetchComplete(millisecondsSinceRequestSent: Int) {
analytics.track(event: WooAnalyticsEvent.PointOfSale.ordersListFetched(
millisecondsSinceRequestSent: millisecondsSinceRequestSent
))
}

func trackOrdersSearchResultsFetchComplete(millisecondsSinceRequestSent: Int) {
public func trackOrdersSearchResultsFetchComplete(millisecondsSinceRequestSent: Int) {
analytics.track(event: WooAnalyticsEvent.PointOfSale.ordersListSearchResultsFetched(
millisecondsSinceRequestSent: millisecondsSinceRequestSent
))
}

func trackOrdersNextPageLoaded(pageNumber: Int) {
public func trackOrdersNextPageLoaded(pageNumber: Int) {
analytics.track(event: WooAnalyticsEvent.PointOfSale.ordersListNextPageLoaded(
pageNumber: pageNumber
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import struct Yosemite.POSSimpleProduct
import struct Yosemite.POSVariation
import enum WooFoundation.CountryCode
import enum Yosemite.PaymentMethod
import struct WooFoundation.WooAnalyticsEvent

extension WooAnalyticsEvent {
enum PointOfSale {
public enum PointOfSale {
/// Event property Key.
private enum Key {
static let paymentsOnboardingState = "onboarding_state"
Expand Down Expand Up @@ -207,11 +208,11 @@ extension WooAnalyticsEvent {
/// Tracks the time elapsed preparing reader for payment, after successful order creation
/// - Parameter waitingTime: Elapsed time from Order creation to card ready for payment
///
static func cardReaderReadyForCardPayment(waitingTime: Double) -> WooAnalyticsEvent {
public static func cardReaderReadyForCardPayment(waitingTime: Double) -> WooAnalyticsEvent {
WooAnalyticsEvent(statName: .pointOfSaleReaderReadyForCardPayment, properties: [Key.waitingTime: "\(waitingTime)"])
}

static func cardPresentCollectPaymentSuccess(forGatewayID: String?,
public static func cardPresentCollectPaymentSuccess(forGatewayID: String?,
countryCode: CountryCode,
paymentMethod: PaymentMethod,
cardReaderModel: String?,
Expand All @@ -224,7 +225,7 @@ extension WooAnalyticsEvent {
Key.cardReaderModel: readerModel(for: cardReaderModel),
Key.countryCode: countryCode.rawValue,
Key.gatewayID: safeGatewayID(for: forGatewayID),
Key.paymentMethodType: paymentMethod.analyticsValue,
Key.paymentMethodType: analyticsValue(for: paymentMethod),
Key.millisecondsSinceCustomerInteractionStarted: "\(millisecondsSinceCustomerIteractionStarted)",
Key.millisecondsSinceOrderSyncSuccess: "\(millisecondsSinceOrderSyncSuccess)",
Key.millisecondsSinceReaderReadyToCollect: "\(millisecondsSinceReaderReadyToCollect)",
Expand All @@ -233,7 +234,18 @@ extension WooAnalyticsEvent {
])
}

static func cashCollectPaymentSuccess(millisecondsSinceCustomerIteractionStarted: Double) -> WooAnalyticsEvent {
static func analyticsValue(for paymentMethod: PaymentMethod) -> String {
switch paymentMethod {
case .card, .cardPresent:
return "card"
case .interacPresent:
return "card_interac"
case .unknown:
return "unknown"
}
}

public static func cashCollectPaymentSuccess(millisecondsSinceCustomerIteractionStarted: Double) -> WooAnalyticsEvent {
WooAnalyticsEvent(statName: .pointOfSaleCashCollectPaymentSuccess, properties: [
Key.millisecondsSinceCustomerInteractionStarted: "\(millisecondsSinceCustomerIteractionStarted)",
])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import struct WooFoundation.WooAnalyticsEvent

extension WooAnalyticsEvent {
enum PointOfSaleIneligibleUI {
/// Event property key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ public struct CardPresentPaymentCardReader: Equatable {
/// The reader's battery level, if available.
/// This is an unformatted percentage as a float, e.g. 0.0-1.0
let batteryLevel: Float?

public init(name: String, batteryLevel: Float?) {
self.name = name
self.batteryLevel = batteryLevel
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

enum CardPresentPaymentOnboardingPresentationEvent {
public enum CardPresentPaymentOnboardingPresentationEvent {
case showOnboarding(factory: CardPresentPaymentOnboardingViewContainer, onCancel: () -> Void)
case onboardingComplete
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public enum CardPresentPaymentReaderConnectionResult {
// This should be internal if/when we move the CardPresentPaymentService to Yosemite or another framework
import enum Yosemite.CardReaderDiscoveryMethod
extension CardReaderConnectionMethod {
var discoveryMethod: CardReaderDiscoveryMethod {
public var discoveryMethod: CardReaderDiscoveryMethod {
switch self {
case .bluetooth:
return .bluetoothScan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public enum CardPresentPaymentRetryApproach {
case tryAgain(retryAction: () -> Void)
case tryAnotherPaymentMethod(retryAction: () -> Void)

init(error: any Error, retryAction: @escaping () -> Void) {
public init(error: any Error, retryAction: @escaping () -> Void) {
guard let serviceError = error as? CardReaderServiceError else {
self = .tryAgain(retryAction: retryAction)
return
Expand Down
52 changes: 52 additions & 0 deletions Modules/Sources/PointOfSale/Colors/Color+POSColorPalette.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// periphery:ignore:all
import SwiftUI

extension Color {
// MARK: - Primary Colors
static var posPrimary: Color { Color("posPrimary", bundle: .module) }
static var posOnPrimary: Color { Color("posOnPrimary", bundle: .module) }
static var posPrimaryContainer: Color { Color("posPrimaryContainer", bundle: .module) }
static var posOnPrimaryContainer: Color { Color("posOnPrimaryContainer", bundle: .module) }

// MARK: - Secondary Container Colors
static var posSecondary: Color { Color("posSecondary", bundle: .module) }
static var posOnSecondary: Color { Color("posOnSecondary", bundle: .module) }
static var posSecondaryContainer: Color { Color("posSecondaryContainer", bundle: .module) }
static var posOnSecondaryContainer: Color { Color("posOnSecondaryContainer", bundle: .module) }

// MARK: - Disabled Container Colors
static var posDisabledContainer: Color { Color("posDisabledContainer", bundle: .module) }
static var posOnDisabledContainer: Color { Color("posOnDisabledContainer", bundle: .module) }

// MARK: - Surface Colors
static var posSurface: Color { Color("posSurface", bundle: .module) }
static var posOnSurface: Color { Color("posOnSurface", bundle: .module) }
static var posSurfaceDim: Color { Color("posSurfaceDim", bundle: .module) }
static var posSurfaceBright: Color { Color("posSurfaceBright", bundle: .module) }
static var posSurfaceContainerLowest: Color { Color("posSurfaceContainerLowest", bundle: .module) }
static var posSurfaceContainerLow: Color { Color("posSurfaceContainerLow", bundle: .module) }
static var posSurfaceContainerHighest: Color { Color("posSurfaceContainerHighest", bundle: .module) }

// MARK: - Surface Variant Colors
static var posOnSurfaceVariantLowest: Color { Color("posOnSurfaceVariantLowest", bundle: .module) }
static var posOnSurfaceVariantHighest: Color { Color("posOnSurfaceVariantHighest", bundle: .module) }

// MARK: - Inverse Surface Colors
static var posInverseSurface: Color { Color("posInverseSurface", bundle: .module) }
static var posOnInverseSurface: Color { Color("posOnInverseSurface", bundle: .module) }

// MARK: - Outline Colors
static var posOutline: Color { Color("posOutline", bundle: .module) }
static var posOutlineVariant: Color { Color("posOutlineVariant", bundle: .module) }

// MARK: - Status Colors
static var posError: Color { Color("posError", bundle: .module) }
static var posOnError: Color { Color("posOnError", bundle: .module) }
static var posSuccess: Color { Color("posSuccess", bundle: .module) }
static var posOnSuccess: Color { Color("posOnSuccess", bundle: .module) }
static var posAlert: Color { Color("posAlert", bundle: .module) }
static var posOnAlert: Color { Color("posOnAlert", bundle: .module) }

// MARK: - Other
static var posShadow: Color { Color("posShadow", bundle: .module) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import struct Yosemite.POSOrder
import struct Yosemite.POSOrderItem
import struct Yosemite.POSOrderRefund
import class Yosemite.Store
import class Yosemite.AsyncPaginationTracker

protocol POSOrderListControllerProtocol {
var ordersViewState: POSOrderListState { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import protocol Yosemite.PointOfSaleCouponFetchStrategyFactoryProtocol
import protocol Yosemite.PointOfSaleCouponServiceProtocol
import struct Yosemite.PointOfSaleCouponFetchStrategyFactory
import protocol Yosemite.PointOfSaleCouponFetchStrategy
import class Yosemite.AsyncPaginationTracker

protocol PointOfSaleCouponsControllerProtocol: PointOfSaleSearchingItemsControllerProtocol {
/// Enables coupons in store settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import enum Yosemite.PointOfSaleItemServiceError
import struct Yosemite.POSVariableParentProduct
import class Yosemite.Store
import enum Yosemite.POSItemType
import class Yosemite.AsyncPaginationTracker

protocol PointOfSaleItemsControllerProtocol {
///
Expand Down
Loading