We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 141dc69 commit 39f0030Copy full SHA for 39f0030
Hardware/Hardware/CardReader/StripeCardReader/StripeCardReaderService.swift
@@ -430,7 +430,13 @@ extension StripeCardReaderService: CardReaderService {
430
}
431
432
paymentCancellable.cancel({ [weak self] error in
433
- if error == nil {
+ // If the action could not be canceled,
434
+ // e.g. it has already completed, the completion block will be called with an
435
+ // error. Otherwise, the completion block will be called with nil.
436
+ if let error {
437
+ let underlyingError = Self.logAndDecodeError(error)
438
+ promise(.failure(CardReaderServiceError.paymentCancellation(underlyingError: underlyingError)))
439
+ } else {
440
self?.paymentCancellable = nil
441
cancelPaymentIntent()
442
0 commit comments