Applies to: Mobile Payments SDK - iOS
Learn how to resolve errors in the Mobile Payments SDK for iOS.
Errors might be returned when using the AuthorizationManager
. These errors are surfaced by the AuthorizeCompletionHandler
as part of AuthorizationManager.authorize()
.
Error | Description |
---|---|
alreadyAuthorized | This device is already authorized with a Square account. |
alreadyInProgress | An authorization is already in progress. Wait for this action to complete and try again. |
authorizationCodeAlreadyRedeemed | The authorization code for this session was already used. Have the seller reauthorize their Square account with your application. |
deauthorizationInProgress | A deauthorization is already in progress. Wait for this action to complete and try again. |
deviceTimeDoesNotMatchServerTime | The local device time is out of sync with the server time. Check your device's time and attempt authorization again. |
emptyAccessToken | No access token was provided to the AuthorizationManager . |
emptyLocationID | No location ID was provided to the AuthorizationManager . |
expiredAuthorizationCode | The authorization code for this session has expired. Have the seller reauthorize their Square account with your application. |
invalidAccessToken | The access token provided to the AuthorizationManager is invalid. |
invalidAuthorizationCode | The authorization code provided to the AuthorizationManager is invalid. |
invalidLocationID | The location ID provided to the AuthorizationManager is invalid. |
locationNotActivatedForCardProcessing | The seller's location isn't activated for credit card processing. Request the seller to reauthorize with another location ID. |
notAuthorized | The Mobile Payments SDK isn't currently authorized with a Square seller account. Use the AuthorizationManager to authorize a Square account. |
noNetwork | The Mobile Payments SDK couldn't connect to the network. |
unexpected | An unexpected error occurred. Check your application's local logs for further information and contact Square developer support if the issue persists. |
unsupportedCountry | The seller using your application is in a country unsupported by the Mobile Payments SDK. |
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 |
---|---|
bluetoothDisabled | Bluetooth was disabled by the user. Prompt them to enable Bluetooth and try again. |
bluetoothNotReady | The Bluetooth connection isn't ready. Wait and try again. |
bluetoothNotSupported | The device doesn't support Bluetooth. |
bluetoothPermissionDenied | Bluetooth access has been denied by the user. You should check for Bluetooth permission before trying to pair a reader. |
bluetoothPermissionNotDetermined | The Mobile Payments SDK couldn't determine your application's Bluetooth permission. You should check for Bluetooth permission before trying to pair a reader. |
bluetoothPermissionRestricted | Your application's Bluetooth access has been restricted in settings. You should check for Bluetooth permission before trying to pair a reader. |
bluetoothPermissionUnknownCase | The Mobile Payments SDK couldn't determine your application's Bluetooth permission. You should check for Bluetooth permission before trying to pair a reader. |
bluetoothResetting | Bluetooth is resetting. Try pairing again. |
bluetoothUnknownError | An unknown Bluetooth error occurred. |
bondingRemoved | An 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. |
failedToConnect | The Mobile Payments SDK failed to connect to the reader. Try pairing the reader again. |
notSupported | Your application is currently authorized in a Square Sandbox account, where reader pairing isn't supported. Reauthorize with a production account. |
readerAlreadyPairing | There is already a reader pairing in progress. Wait for the pairing to complete and try again. |
sandboxNotSupported | Bluetooth reader pairing isn't supported in the Square Sandbox. Use a production account to authorize and test reader pairing. |
simulationNotSupported | Bluetooth 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. |
timedOut | The Mobile Payments SDK timed out while trying to pair with nearby readers. Try the pairing again. |
updateRequired | This version of the Mobile Payments SDK isn't compatible with the reader. Update the SDK or use a compatible reader. |
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 |
---|---|
deniedByServer | The connection was denied by the Square server. |
genericError | A generic error occurred. |
maxReadersConnected | The maximum number of readers are connected to your application. Unpair some readers and try again. |
networkTimeout | The network timed out before the reader could connect. Try your action again. |
networkTransportError | There was a network error while connecting to Square. |
notConnectedToInternet | There is no Internet connection and the reader couldn't establish a connection to Square. |
readerTimeout | The connection timed out while updating the reader firmware. |
revokedByDevice | A device error occurred while attempting to establish a connection to Square. |
serverError | There was a server error while connecting to Square. |
unknown | An unknown error occurred. |
Errors related to reader firmware updates occurred. These errors are surfaced within ReaderInfo.firmwareInfo.failureReason
.
Error | Description |
---|---|
connectionTimeout | The connection timed out while updating the reader firmware. |
firmwareFailure | The reader firmware failed during an update. |
serverCallFailure | The Mobile Payments SDK failed to connect to the server while updating the reader firmware. |
unknownError | An unknown error occurred while updating the reader firmware. |
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 |
---|---|
deviceTimeDoesNotMatchServerTime | The 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. |
invalidPaymentParameters | The PaymentParameters provided were invalid. Check the request details and try the payment again. |
invalidPaymentSource | The payment source provided didn't match the AlternatePaymentMethod given. Check the request details and try the payment again. |
locationPermissionNeeded | Location permission hasn't been granted to your application. Prompt the user for location access and try the payment again. |
idempotencyKeyReused | The 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. |
merchantNotOptedIntoOfflineProcessing | The seller using your application isn't part of the Offline Payments feature and cannot take offline payments with the Mobile Payments SDK. |
noNetwork | The Mobile Payments SDK couldn't connect to the network and the payment couldn't be completed. |
notAuthorized | The Mobile Payments SDK isn't currently authorized with a Square seller account. Use the AuthorizationManager to authorize a Square account. |
offlineStoredAmountExceeded | Your 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. |
offlineTransactionAmountExceeded | Your application is attempting an offline payment that exceeds the limit for a single transaction. Try again with a lower payment amount. |
sandboxUnsupportedForOfflineProcessing | Your 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. |
paymentAlreadyInProgress | A payment is already in progress. Cancel the current payment or wait for it to complete. Then try the new payment again. |
timedOut | The Mobile Payments SDK timed out while awaiting a payment. Try the payment again. |
unsupportedMode | The 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. |
unexpected | PaymentManager.startPayment was used in an unexpected or unsupported way. Check your local logs and try the payment again. |
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 |
---|---|
notAuthorized | The Mobile Payments SDK isn't currently authorized with a Square seller account. Use the AuthorizationManager to authorize a Square account. |
unsupportedSandboxEnvironment | Your 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. |
unexpected | An unexpected error occurred. Check your application's local logs for further information and contact Square developer support if the issue persists. |