Skip to content

Commit 20a0bfc

Browse files
Merge branch 'trunk' into issue/14419-jetpack-setup-account-creation-1
# Conflicts: # Experiments/Experiments/DefaultFeatureFlagService.swift # Experiments/Experiments/FeatureFlag.swift
2 parents 99ad008 + 09e8f0e commit 20a0bfc

File tree

119 files changed

+2090
-1535
lines changed

Some content is hidden

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

119 files changed

+2090
-1535
lines changed

.buildkite/commands/checkout-release-branch.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
#!/bin/bash -eu
22

3-
echo "--- :git: Checkout Release Branch"
4-
5-
# Note: `BUILDKITE_RELEASE_VERSION` is the legacy environment variable passed to Buildkite by ReleaseV2.
6-
# It used the `BUILDKITE_` prefix so it was not filtered out when passed to the MacOS VMs, due to how `hostmgr` works.
7-
# This is considered legacy: we should eventually remove all use of custom `BUILDKITE_` variables, and instead
8-
# resolve the value of those sooner (i.e. in the YML pipeline) then pass it as parameter to the `.sh` calls instead.
3+
RELEASE_VERSION="${1:?RELEASE_VERSION parameter missing}"
94

10-
# Use the provided argument if there's one, otherwise fall back to the legacy BUILDKITE_RELEASE_VERSION
11-
RELEASE_VERSION=${1:-$BUILDKITE_RELEASE_VERSION}
12-
13-
if [[ -z "${RELEASE_VERSION}" ]]; then
14-
echo "RELEASE_VERSION is not set and BUILDKITE_RELEASE_VERSION is not available."
15-
exit 1
16-
fi
5+
echo "--- :git: Checkout Release Branch"
176

187
# Buildkite, by default, checks out a specific commit. For many release actions, we need to be
198
# on a release branch instead.

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
5252
return true
5353
case .giftCardInOrderForm:
5454
return true
55-
case .wooPaymentsDepositsOverviewInPaymentsMenu:
55+
case .wooPaymentsPayoutsOverviewInPaymentsMenu:
5656
return true
5757
case .tapToPayOnIPhoneInUK:
5858
return true
@@ -91,8 +91,8 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
9191
return buildConfig == .localDeveloper || buildConfig == .alpha
9292
case .paymentsOnboardingInPointOfSale:
9393
return buildConfig == .localDeveloper
94-
case .displayInfiniteScrollingUIDetailsInPointOfSale:
95-
return buildConfig == .localDeveloper || buildConfig == .alpha
94+
case .sendReceiptAfterPayment:
95+
return false
9696
case .jetpackSetupWPComAccountCreation:
9797
return buildConfig == .localDeveloper || buildConfig == .alpha
9898
default:

Experiments/Experiments/FeatureFlag.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ public enum FeatureFlag: Int {
120120
///
121121
case giftCardInOrderForm
122122

123-
/// Enables the Woo Payments Deposits item in the Payments menu
123+
/// Enables the Woo Payments Payouts item in the Payments menu
124124
///
125-
case wooPaymentsDepositsOverviewInPaymentsMenu
125+
case wooPaymentsPayoutsOverviewInPaymentsMenu
126126

127127
/// Enables Tap to Pay for UK Woo Payments stores
128128
///
@@ -197,9 +197,8 @@ public enum FeatureFlag: Int {
197197
///
198198
case paymentsOnboardingInPointOfSale
199199

200-
/// Enables UI-related aspects of infinite scrolling in POS. It does not affect the actual infinite scrolling behaviour.
201-
///
202-
case displayInfiniteScrollingUIDetailsInPointOfSale
200+
/// Enables sending receipt after the payment via the API
201+
case sendReceiptAfterPayment
203202

204203
/// Enables WPCom account creation during Jetpack setup
205204
///

Fakes/Fakes/Networking.generated.swift

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,14 +2637,14 @@ extension Networking.WCPayPaymentMethodType {
26372637
.card
26382638
}
26392639
}
2640-
extension Networking.WooPaymentsAccountDepositSummary {
2640+
extension Networking.WooPaymentsAccountPayoutSummary {
26412641
/// Returns a "ready to use" type filled with fake values.
26422642
///
2643-
public static func fake() -> Networking.WooPaymentsAccountDepositSummary {
2643+
public static func fake() -> Networking.WooPaymentsAccountPayoutSummary {
26442644
.init(
2645-
depositsEnabled: .fake(),
2646-
depositsBlocked: .fake(),
2647-
depositsSchedule: .fake(),
2645+
payoutsEnabled: .fake(),
2646+
payoutsBlocked: .fake(),
2647+
payoutsSchedule: .fake(),
26482648
defaultCurrency: .fake()
26492649
)
26502650
}
@@ -2670,20 +2670,30 @@ extension Networking.WooPaymentsCurrencyBalances {
26702670
)
26712671
}
26722672
}
2673-
extension Networking.WooPaymentsCurrencyDeposits {
2673+
extension Networking.WooPaymentsCurrencyPayouts {
26742674
/// Returns a "ready to use" type filled with fake values.
26752675
///
2676-
public static func fake() -> Networking.WooPaymentsCurrencyDeposits {
2676+
public static func fake() -> Networking.WooPaymentsCurrencyPayouts {
26772677
.init(
26782678
lastPaid: .fake(),
2679-
lastManualDeposits: .fake()
2679+
lastManualPayouts: .fake()
26802680
)
26812681
}
26822682
}
2683-
extension Networking.WooPaymentsDeposit {
2683+
extension Networking.WooPaymentsManualPayout {
26842684
/// Returns a "ready to use" type filled with fake values.
26852685
///
2686-
public static func fake() -> Networking.WooPaymentsDeposit {
2686+
public static func fake() -> Networking.WooPaymentsManualPayout {
2687+
.init(
2688+
currency: .fake(),
2689+
date: .fake()
2690+
)
2691+
}
2692+
}
2693+
extension Networking.WooPaymentsPayout {
2694+
/// Returns a "ready to use" type filled with fake values.
2695+
///
2696+
public static func fake() -> Networking.WooPaymentsPayout {
26872697
.init(
26882698
id: .fake(),
26892699
date: .fake(),
@@ -2699,58 +2709,48 @@ extension Networking.WooPaymentsDeposit {
26992709
)
27002710
}
27012711
}
2702-
extension Networking.WooPaymentsDepositInterval {
2712+
extension Networking.WooPaymentsPayoutInterval {
27032713
/// Returns a "ready to use" type filled with fake values.
27042714
///
2705-
public static func fake() -> Networking.WooPaymentsDepositInterval {
2715+
public static func fake() -> Networking.WooPaymentsPayoutInterval {
27062716
.daily
27072717
}
27082718
}
2709-
extension Networking.WooPaymentsDepositStatus {
2719+
extension Networking.WooPaymentsPayoutStatus {
27102720
/// Returns a "ready to use" type filled with fake values.
27112721
///
2712-
public static func fake() -> Networking.WooPaymentsDepositStatus {
2722+
public static func fake() -> Networking.WooPaymentsPayoutStatus {
27132723
.estimated
27142724
}
27152725
}
2716-
extension Networking.WooPaymentsDepositType {
2726+
extension Networking.WooPaymentsPayoutType {
27172727
/// Returns a "ready to use" type filled with fake values.
27182728
///
2719-
public static func fake() -> Networking.WooPaymentsDepositType {
2729+
public static func fake() -> Networking.WooPaymentsPayoutType {
27202730
.withdrawal
27212731
}
27222732
}
2723-
extension Networking.WooPaymentsDepositsOverview {
2733+
extension Networking.WooPaymentsPayoutsOverview {
27242734
/// Returns a "ready to use" type filled with fake values.
27252735
///
2726-
public static func fake() -> Networking.WooPaymentsDepositsOverview {
2736+
public static func fake() -> Networking.WooPaymentsPayoutsOverview {
27272737
.init(
27282738
deposit: .fake(),
27292739
balance: .fake(),
27302740
account: .fake()
27312741
)
27322742
}
27332743
}
2734-
extension Networking.WooPaymentsDepositsSchedule {
2744+
extension Networking.WooPaymentsPayoutsSchedule {
27352745
/// Returns a "ready to use" type filled with fake values.
27362746
///
2737-
public static func fake() -> Networking.WooPaymentsDepositsSchedule {
2747+
public static func fake() -> Networking.WooPaymentsPayoutsSchedule {
27382748
.init(
27392749
delayDays: .fake(),
27402750
interval: .fake()
27412751
)
27422752
}
27432753
}
2744-
extension Networking.WooPaymentsManualDeposit {
2745-
/// Returns a "ready to use" type filled with fake values.
2746-
///
2747-
public static func fake() -> Networking.WooPaymentsManualDeposit {
2748-
.init(
2749-
currency: .fake(),
2750-
date: .fake()
2751-
)
2752-
}
2753-
}
27542754
extension Networking.WooShippingCreatePackageResponse {
27552755
/// Returns a "ready to use" type filled with fake values.
27562756
///

Fakes/Fakes/Yosemite.generated.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ extension Yosemite.SystemInformation {
5454
)
5555
}
5656
}
57-
extension Yosemite.WooPaymentsDepositsOverviewByCurrency {
57+
extension Yosemite.WooPaymentsPayoutsOverviewByCurrency {
5858
/// Returns a "ready to use" type filled with fake values.
5959
///
60-
public static func fake() -> Yosemite.WooPaymentsDepositsOverviewByCurrency {
60+
public static func fake() -> Yosemite.WooPaymentsPayoutsOverviewByCurrency {
6161
.init(
6262
currency: .fake(),
63-
automaticDeposits: .fake(),
64-
depositInterval: .fake(),
63+
automaticPayouts: .fake(),
64+
payoutInterval: .fake(),
6565
pendingBalanceAmount: .fake(),
66-
pendingDepositDays: .fake(),
67-
lastDeposit: .fake(),
66+
pendingPayoutDays: .fake(),
67+
lastPayout: .fake(),
6868
availableBalance: .fake()
6969
)
7070
}

Networking/Networking.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
077F39E626A5D15800ABEADC /* SystemPluginMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 077F39DB26A58F4800ABEADC /* SystemPluginMapperTests.swift */; };
182182
09885C8027C3FFD200910A62 /* product-variations-bulk-update.json in Resources */ = {isa = PBXBuildFile; fileRef = 09885C7F27C3FFD200910A62 /* product-variations-bulk-update.json */; };
183183
09EA564B27C75FCE00407D40 /* ProductVariationsBulkUpdateMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09EA564A27C75FCE00407D40 /* ProductVariationsBulkUpdateMapper.swift */; };
184-
209AD3C32AC196E300825D76 /* WooPaymentsDepositsOverview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 209AD3C22AC196E300825D76 /* WooPaymentsDepositsOverview.swift */; };
184+
209AD3C32AC196E300825D76 /* WooPaymentsPayoutsOverview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 209AD3C22AC196E300825D76 /* WooPaymentsPayoutsOverview.swift */; };
185185
209AD3C52AC19E7500825D76 /* WooPaymentsDepositsOverviewMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 209AD3C42AC19E7500825D76 /* WooPaymentsDepositsOverviewMapper.swift */; };
186186
20D210C32B1780CE0099E517 /* deposits-overview-all.json in Resources */ = {isa = PBXBuildFile; fileRef = 20D210C22B1780CE0099E517 /* deposits-overview-all.json */; };
187187
20D210C52B1788E60099E517 /* deposits-overview-all-no-default-currency.json in Resources */ = {isa = PBXBuildFile; fileRef = 20D210C42B1788E60099E517 /* deposits-overview-all-no-default-currency.json */; };
@@ -1452,7 +1452,7 @@
14521452
09885C7F27C3FFD200910A62 /* product-variations-bulk-update.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "product-variations-bulk-update.json"; sourceTree = "<group>"; };
14531453
09EA564A27C75FCE00407D40 /* ProductVariationsBulkUpdateMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductVariationsBulkUpdateMapper.swift; sourceTree = "<group>"; };
14541454
14CE248C7246705417A41DE1 /* Pods-NetworkingWatchOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NetworkingWatchOS.release.xcconfig"; path = "../Pods/Target Support Files/Pods-NetworkingWatchOS/Pods-NetworkingWatchOS.release.xcconfig"; sourceTree = "<group>"; };
1455-
209AD3C22AC196E300825D76 /* WooPaymentsDepositsOverview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WooPaymentsDepositsOverview.swift; sourceTree = "<group>"; };
1455+
209AD3C22AC196E300825D76 /* WooPaymentsPayoutsOverview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WooPaymentsPayoutsOverview.swift; sourceTree = "<group>"; };
14561456
209AD3C42AC19E7500825D76 /* WooPaymentsDepositsOverviewMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WooPaymentsDepositsOverviewMapper.swift; sourceTree = "<group>"; };
14571457
20D210C22B1780CE0099E517 /* deposits-overview-all.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "deposits-overview-all.json"; sourceTree = "<group>"; };
14581458
20D210C42B1788E60099E517 /* deposits-overview-all-no-default-currency.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "deposits-overview-all-no-default-currency.json"; sourceTree = "<group>"; };
@@ -3029,7 +3029,7 @@
30293029
0359EA0C27AAC5F80048DE2D /* WCPayChargeStatus.swift */,
30303030
3105470B262E27F000C5C02B /* WCPayPaymentIntentStatusEnum.swift */,
30313031
0359EA0E27AAC6410048DE2D /* WCPayPaymentMethodDetails.swift */,
3032-
209AD3C22AC196E300825D76 /* WooPaymentsDepositsOverview.swift */,
3032+
209AD3C22AC196E300825D76 /* WooPaymentsPayoutsOverview.swift */,
30333033
E1BAB2C62913FB5800C3982B /* WordPressApiError.swift */,
30343034
DE2E8E9C29530EEF002E4B14 /* WordPressSite.swift */,
30353035
EE2C09C729AF6357009396F9 /* StoreOnboardingTask.swift */,
@@ -4975,7 +4975,7 @@
49754975
74ABA1CD213F1B6B00FFAD30 /* TopEarnerStats.swift in Sources */,
49764976
CCAAD10F2683974000909664 /* ShippingLabelPackagePurchase.swift in Sources */,
49774977
265EFBDC285257950033BD33 /* Order+Fallbacks.swift in Sources */,
4978-
209AD3C32AC196E300825D76 /* WooPaymentsDepositsOverview.swift in Sources */,
4978+
209AD3C32AC196E300825D76 /* WooPaymentsPayoutsOverview.swift in Sources */,
49794979
CEC7D5932CDD0D9900111B79 /* WooShippingPredefinedOption.swift in Sources */,
49804980
021940E2291E3CFD0090354E /* SiteRemote.swift in Sources */,
49814981
B557DA0220975500005962F4 /* JetpackRequest.swift in Sources */,
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import Foundation
22

3-
struct WooPaymentsDepositsOverviewMapper: Mapper {
4-
func map(response: Data) throws -> WooPaymentsDepositsOverview {
3+
struct WooPaymentsPayoutsOverviewMapper: Mapper {
4+
func map(response: Data) throws -> WooPaymentsPayoutsOverview {
55
let decoder = JSONDecoder()
66
decoder.dateDecodingStrategy = .millisecondsSince1970
77

88
if hasDataEnvelope(in: response) {
9-
return try decoder.decode(WooPaymentsDepositsOverviewEnvelope.self, from: response).depositsOverview
9+
return try decoder.decode(WooPaymentsPayoutsOverviewEnvelope.self, from: response).payoutsOverview
1010
} else {
11-
return try decoder.decode(WooPaymentsDepositsOverview.self, from: response)
11+
return try decoder.decode(WooPaymentsPayoutsOverview.self, from: response)
1212
}
1313
}
1414
}
1515

16-
private struct WooPaymentsDepositsOverviewEnvelope: Decodable {
17-
let depositsOverview: WooPaymentsDepositsOverview
16+
private struct WooPaymentsPayoutsOverviewEnvelope: Decodable {
17+
let payoutsOverview: WooPaymentsPayoutsOverview
1818

1919
private enum CodingKeys: String, CodingKey {
20-
case depositsOverview = "data"
20+
case payoutsOverview = "data"
2121
}
2222
}

0 commit comments

Comments
 (0)