Handling Errors

Applies to: Mobile Payments SDK - iOS

Learn how to resolve errors in the Mobile Payments SDK for iOS.

Link to section

Authorization errors

Errors might be returned when using the AuthorizationManager. These errors are surfaced by the AuthorizeCompletionHandler as part of AuthorizationManager.authorize().

Error Description
alreadyAuthorizedThis device is already authorized with a Square account.
alreadyInProgressAn authorization is already in progress. Wait for this action to complete and try again.
authorizationCodeAlreadyRedeemedThe authorization code for this session was already used. Have the seller reauthorize their Square account with your application.
deauthorizationInProgressA deauthorization is already in progress. Wait for this action to complete and try again.
deviceTimeDoesNotMatchServerTimeThe local device time is out of sync with the server time. Check your device's time and attempt authorization again.
emptyAccessTokenNo access token was provided to the AuthorizationManager.
emptyLocationIDNo location ID was provided to the AuthorizationManager.
expiredAuthorizationCodeThe authorization code for this session has expired. Have the seller reauthorize their Square account with your application.
invalidAccessTokenThe access token provided to the AuthorizationManager is invalid.
invalidAuthorizationCodeThe authorization code provided to the AuthorizationManager is invalid.
invalidLocationIDThe location ID provided to the AuthorizationManager is invalid.
locationNotActivatedForCardProcessingThe seller's location isn't activated for credit card processing. Request the seller to reauthorize with another location ID.
notAuthorizedThe Mobile Payments SDK isn't currently authorized with a Square seller account. Use the AuthorizationManager to authorize a Square account.
noNetworkThe Mobile Payments SDK couldn't connect to the network.
unexpectedAn unexpected error occurred. Check your application's local logs for further information and contact Square developer support if the issue persists.
unsupportedCountryThe seller using your application is in a country unsupported by the Mobile Payments SDK.
Link to section

Bluetooth and pairing errors

Errors might be returned when pairing readers using the ReaderManager. These errors are surfaced by the ReaderPairingDelegate as part of ReaderPairingDidFail(withError error: Error).

Error Description
bluetoothDisabledBluetooth was disabled by the user. Prompt them to enable Bluetooth and try again.
bluetoothNotReadyThe Bluetooth connection isn't ready. Wait and try again.
bluetoothNotSupportedThe device doesn't support Bluetooth.
bluetoothPermissionDeniedBluetooth access has been denied by the user. You should check for Bluetooth permission before trying to pair a reader.
bluetoothPermissionNotDeterminedThe Mobile Payments SDK couldn't determine your application's Bluetooth permission. You should check for Bluetooth permission before trying to pair a reader.
bluetoothPermissionRestrictedYour application's Bluetooth access has been restricted in settings. You should check for Bluetooth permission before trying to pair a reader.
bluetoothPermissionUnknownCaseThe Mobile Payments SDK couldn't determine your application's Bluetooth permission. You should check for Bluetooth permission before trying to pair a reader.
bluetoothResettingBluetooth is resetting. Try pairing again.
bluetoothUnknownErrorAn unknown Bluetooth error occurred.
bondingRemovedAn unknown Bluetooth error occurred. Prompt the user to go to the Bluetooth settings on their device and "forget" the reader they're attempting to pair. Then reopen your application and try pairing again.
failedToConnectThe Mobile Payments SDK failed to connect to the reader. Try pairing the reader again.
notSupportedYour application is currently authorized in a Square Sandbox account, where reader pairing isn't supported. Reauthorize with a production account.
readerAlreadyPairingThere is already a reader pairing in progress. Wait for the pairing to complete and try again.
sandboxNotSupportedBluetooth reader pairing isn't supported in the Square Sandbox. Use a production account to authorize and test reader pairing.
simulationNotSupportedBluetooth reader pairing isn't supported on iOS simulators. Test on a physical device with Square hardware or use a mock reader with a Square Sandbox account in the simulator.
timedOutThe Mobile Payments SDK timed out while trying to pair with nearby readers. Try the pairing again.
updateRequiredThis version of the Mobile Payments SDK isn't compatible with the reader. Update the SDK or use a compatible reader.
Link to section

Reader connection errors

Errors might be returned if readers are unable to connect to Square servers. These errors are surfaced within ReaderInfo.connectionInfo and the ReaderConnectionFailureInfo.failureReason. If you receive one of these errors, you can check the Square status page or contact Square developer support if the issue persists.

Error Description
deniedByServerThe connection was denied by the Square server.
genericErrorA generic error occurred.
maxReadersConnectedThe maximum number of readers are connected to your application. Unpair some readers and try again.
networkTimeoutThe network timed out before the reader could connect. Try your action again.
networkTransportErrorThere was a network error while connecting to Square.
notConnectedToInternetThere is no Internet connection and the reader couldn't establish a connection to Square.
readerTimeoutThe connection timed out while updating the reader firmware.
revokedByDeviceA device error occurred while attempting to establish a connection to Square.
serverErrorThere was a server error while connecting to Square.
unknownAn unknown error occurred.
Link to section

Reader update errors

Errors related to reader firmware updates occurred. These errors are surfaced within ReaderInfo.firmwareInfo.failureReason.

Error Description
connectionTimeoutThe connection timed out while updating the reader firmware.
firmwareFailureThe reader firmware failed during an update.
serverCallFailureThe Mobile Payments SDK failed to connect to the server while updating the reader firmware.
unknownErrorAn unknown error occurred while updating the reader firmware.
Link to section

Payment errors

Errors might be returned when taking a payment with the PaymentManager. These errors are surfaced by the PaymentManagerDelegate as part of paymentManager(_ paymentManager: PaymentManager, didFail payment: Payment, withError error: Error).

Error Description
deviceTimeDoesNotMatchServerTimeThe local device time is out of sync with the server time, which could lead to inaccurate payment reporting. Check your device's time and attempt your action again.
invalidPaymentParametersThe PaymentParameters provided were invalid. Check the request details and try the payment again.
invalidPaymentSourceThe payment source provided didn't match the AlternatePaymentMethod given. Check the request details and try the payment again.
locationPermissionNeededLocation permission hasn't been granted to your application. Prompt the user for location access and try the payment again.
idempotencyKeyReusedThe idempotency key used for this payment has already been used. Review previous payments to ensure you're not processing a duplicate payment and then try again with a new idempotency key.
merchantNotOptedIntoOfflineProcessingThe seller using your application isn't part of the Offline Payments feature and cannot take offline payments with the Mobile Payments SDK.
noNetworkThe Mobile Payments SDK couldn't connect to the network and the payment couldn't be completed.
notAuthorizedThe Mobile Payments SDK isn't currently authorized with a Square seller account. Use the AuthorizationManager to authorize a Square account.
offlineStoredAmountExceededYour application has exceeded the total amount available to be stored on the device. Wait until connection is restored and stored payments have processed before taking more offline payments.
offlineTransactionAmountExceededYour application is attempting an offline payment that exceeds the limit for a single transaction. Try again with a lower payment amount.
sandboxUnsupportedForOfflineProcessingYour application is attempting to take an offline payment while authorized with a Square Sandbox account. Offline payments aren't supported in the Square Sandbox. Reauthorize with a production account to take offline payments.
paymentAlreadyInProgressA payment is already in progress. Cancel the current payment or wait for it to complete. Then try the new payment again.
timedOutThe Mobile Payments SDK timed out while awaiting a payment. Try the payment again.
unsupportedModeThe user entered an unsupported mode while a payment was in process (for example, split screen mode isn't supported in the Mobile Payments SDK). Try the payment again.
unexpectedPaymentManager.startPayment was used in an unexpected or unsupported way. Check your local logs and try the payment again.
Link to section

Offline payment queue errors

Errors might be returned when working with offline payments. These errors are surfaced as part of the OfflinePaymentQueue's getTotalStoredPaymentsAmount(completion: TotalStoredPaymentsAmountCompletionHandler) and getPayments(completion: GetOfflinePaymentsCompletionHandler).

Error Description
notAuthorizedThe Mobile Payments SDK isn't currently authorized with a Square seller account. Use the AuthorizationManager to authorize a Square account.
unsupportedSandboxEnvironmentYour application is attempting to take an offline payment while authorized with a Square Sandbox account. Offline payments aren't supported in the Square Sandbox. Reauthorize with a production account to take offline payments.
unexpectedAn unexpected error occurred. Check your application's local logs for further information and contact Square developer support if the issue persists.