Skip to content

Commit ed25290

Browse files
committed
Remove prints added for debugging
1 parent e3243dd commit ed25290

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

Hardware/Hardware/CardReader/StripeCardReader/StripeCardReaderService.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,8 @@ extension StripeCardReaderService: CardReaderService {
256256
}
257257

258258
public func connect(_ reader: CardReader) -> AnyPublisher<CardReader, Error> {
259-
print("==== in SCRS connect 1")
260259
guard let stripeReader = self.discoveredStripeReadersCache.reader(matching: reader) as? Reader else {
261260
return Future() { promise in
262-
print("==== in SCRS connect 1 - unable to find reader in cache")
263261
promise(.failure(CardReaderServiceError.connection()))
264262
}.eraseToAnyPublisher()
265263
}
@@ -270,7 +268,6 @@ extension StripeCardReaderService: CardReaderService {
270268
}
271269

272270
private func getBluetoothConfiguration(_ reader: StripeTerminal.Reader) -> Future<BluetoothConnectionConfiguration, Error> {
273-
print("==== in SCRS getBluetoothConfiguration")
274271
return Future() { [weak self] promise in
275272
guard let self = self else {
276273
promise(.failure(CardReaderServiceError.connection()))
@@ -282,10 +279,8 @@ extension StripeCardReaderService: CardReaderService {
282279
self.readerLocationProvider?.fetchDefaultLocationID { result in
283280
switch result {
284281
case .success(let locationId):
285-
print("==== in SCRS getBluetoothConfiguration successfully fetched location ID")
286282
return promise(.success(BluetoothConnectionConfiguration(locationId: locationId)))
287283
case .failure(let error):
288-
print("==== in SCRS getBluetoothConfiguration unable to fetch location ID")
289284
let underlyingError = UnderlyingError(with: error)
290285
return promise(.failure(CardReaderServiceError.connection(underlyingError: underlyingError)))
291286
}
@@ -294,7 +289,6 @@ extension StripeCardReaderService: CardReaderService {
294289
}
295290

296291
public func connect(_ reader: StripeTerminal.Reader, configuration: BluetoothConnectionConfiguration) -> Future <CardReader, Error> {
297-
print("==== in SCRS connect 2")
298292
// Keep a copy of the battery level in case the connection fails due to low battery
299293
// If that happens, the reader object won't be accessible anymore, and we want to show
300294
// the current charge percentage if possible
@@ -307,7 +301,6 @@ extension StripeCardReaderService: CardReaderService {
307301
return
308302
}
309303

310-
print("==== in SCRS connect 2 about to call Terminal connectBluetoothReader")
311304
Terminal.shared.connectBluetoothReader(reader, delegate: self, connectionConfig: configuration) { [weak self] (reader, error) in
312305
guard let self = self else {
313306
promise(.failure(CardReaderServiceError.connection()))
@@ -317,7 +310,6 @@ extension StripeCardReaderService: CardReaderService {
317310
self.discoveredStripeReadersCache.clear()
318311

319312
if let error = error {
320-
print("==== in SCRS connect 2 - got an error: \(error)")
321313
let underlyingError = UnderlyingError(with: error)
322314
// Starting with StripeTerminal 2.0, required software updates happen transparently on connection
323315
// Any error related to that will be reported here, but we don't want to treat it as a connection error
@@ -328,7 +320,6 @@ extension StripeCardReaderService: CardReaderService {
328320
}
329321

330322
if let reader = reader {
331-
print("==== in SCRS connect 2 - got a reader :)")
332323
self.connectedReadersSubject.send([CardReader(reader: reader)])
333324
self.switchStatusToIdle()
334325
promise(.success(CardReader(reader: reader)))

WooCommerce/Classes/ViewRelated/Dashboard/Settings/In-Person Payments/CardPresentPaymentsOnboardingUseCase.swift

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@ final class CardPresentPaymentsOnboardingUseCase: CardPresentPaymentsOnboardingU
7979
/// If both plugins are active, don't bother initializing the backend nor fetching
8080
/// accounts. Fall through to updateState so the end user can fix the problem.
8181
guard !bothPluginsInstalledAndActive(wcPay: wcPayPlugin, stripe: stripePlugin) else {
82-
print("==== in updateAccounts - both WCPay and Stripe are active - bailing")
8382
self.updateState()
8483
return
8584
}
8685

8786
if wcPayPlugin?.active ?? false {
88-
print("==== in updateAccounts - WCPay is active on store - informing CPPS")
8987
let useWCPayAction = CardPresentPaymentAction.useWCPay // TODO asynchronicity / ordering of actions?
9088
stores.dispatch(useWCPayAction)
9189
} else {
@@ -97,12 +95,10 @@ final class CardPresentPaymentsOnboardingUseCase: CardPresentPaymentsOnboardingU
9795
}
9896

9997
if stripePlugin?.active ?? false {
100-
print("==== in updateAccounts - Stripe is active on store - informing CPPS")
10198
let useStripeAction = CardPresentPaymentAction.useStripe // TODO asynchronicity / ordering of actions?
10299
stores.dispatch(useStripeAction)
103100
}
104101

105-
print("==== in updateAccounts - asking CPPS to load account")
106102
let paymentGatewayAccountsAction = CardPresentPaymentAction.loadAccounts(siteID: siteID) { [weak self] result in
107103
self?.updateState()
108104
}
@@ -176,107 +172,82 @@ private extension CardPresentPaymentsOnboardingUseCase {
176172
DDLogError("[CardPresentPaymentsOnboarding] Couldn't determine country for store")
177173
return .genericError
178174
}
179-
print("==== was able to obtain country code")
180175

181176
guard isCountrySupported(countryCode: countryCode) else {
182177
return .countryNotSupported(countryCode: countryCode)
183178
}
184-
print("==== country code is supported")
185179

186180
let wcPay = getWCPayPlugin()
187181
guard stripeGatewayIPPEnabled == true else {
188-
print("==== Stripe IPP experiment is NOT enabled - only considering WCPay")
189182
return wcPayOnlyOnboardingState(plugin: wcPay)
190183
}
191184

192-
print("==== Stripe IPP experiment IS enabled")
193185
let stripe = getStripePlugin()
194186

195187
// If both the Stripe plugin and WCPay are installed and activated, the user needs
196188
// to deactivate one: pdfdoF-fW-p2#comment-683
197189
if bothPluginsInstalledAndActive(wcPay: wcPay, stripe: stripe) {
198-
print("==== Both plugins are active - bailing")
199190
return .selectPlugin
200191
}
201192

202193
// If only the Stripe extension is active, skip to checking plugin version
203194
if let stripe = stripe,
204195
onlyStripeIsActive(wcPay: wcPay, stripe: stripe) {
205-
print("==== Only Stripe is active")
206196
return stripeGatewayOnlyOnboardingState(plugin: stripe)
207197
} else {
208-
print("==== Only WCPay is active")
209198
return wcPayOnlyOnboardingState(plugin: wcPay)
210199
}
211200
}
212201

213202
func wcPayOnlyOnboardingState(plugin: SystemPlugin?) -> CardPresentPaymentOnboardingState {
214-
print("==== Checking WCPay plugin version")
215203
// Plugin checks
216204
guard let plugin = plugin else {
217-
print("==== Checking WCPay plugin installation - plugin is NOT installed!")
218205
return .pluginNotInstalled
219206
}
220207
guard isWCPayVersionSupported(plugin: plugin) else {
221-
print("==== Checking WCPay plugin version - plugin version is unsupported")
222208
return .pluginUnsupportedVersion
223209
}
224210
guard plugin.active else {
225-
print("==== Checking WCPay plugin activation - plugin is NOT active!")
226211
return .pluginNotActivated
227212
}
228213

229214
// Account checks
230-
print("==== Checking Stripe plugin version - plugin version is good - proceeding to account check")
231215
return accountChecks()
232216
}
233217

234218
func stripeGatewayOnlyOnboardingState(plugin: SystemPlugin) -> CardPresentPaymentOnboardingState {
235-
print("==== Checking Stripe plugin version")
236219
guard isStripeVersionSupported(plugin: plugin) else {
237-
print("==== Checking Stripe plugin version - plugin version is unsupported")
238220
return .pluginUnsupportedVersion
239221
}
240-
print("==== Checking Stripe plugin version - plugin version is good - proceeding to account check")
241222
return accountChecks()
242223
}
243224

244225
func accountChecks() -> CardPresentPaymentOnboardingState {
245-
print("==== In accountChecks")
246226
guard let account = getPaymentGatewayAccount() else {
247-
print("==== accountChecks genericError")
248227
return .genericError
249228
}
250229
guard isPaymentGatewaySetupCompleted(account: account) else {
251-
print("==== accountChecks pluginSetupNotCompleted")
252230
return .pluginSetupNotCompleted
253231
}
254232
guard !isPluginInTestModeWithLiveStripeAccount(account: account) else {
255-
print("==== accountChecks pluginInTestModeWithLiveStripeAccount")
256233
return .pluginInTestModeWithLiveStripeAccount
257234
}
258235
guard !isStripeAccountUnderReview(account: account) else {
259-
print("==== accountChecks stripeAccountUnderReview")
260236
return .stripeAccountUnderReview
261237
}
262238
guard !isStripeAccountOverdueRequirements(account: account) else {
263-
print("==== accountChecks stripeAccountOverdueRequirement")
264239
return .stripeAccountOverdueRequirement
265240
}
266241
guard !isStripeAccountPendingRequirements(account: account) else {
267-
print("==== accountChecks stripeAccountPendingRequirement")
268242
return .stripeAccountPendingRequirement(deadline: account.currentDeadline)
269243
}
270244
guard !isStripeAccountRejected(account: account) else {
271-
print("==== accountChecks stripeAccountRejected")
272245
return .stripeAccountRejected
273246
}
274247
guard !isInUndefinedState(account: account) else {
275-
print("==== accountChecks genericError 2")
276248
return .genericError
277249
}
278250

279-
print("==== accountChecks completed")
280251
return .completed
281252
}
282253
}

0 commit comments

Comments
 (0)