square_reader_sdk 2.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

Flutter plugin for Reader SDK #

Build Status Pub

Square Reader SDK lets developers embed the Square checkout flow and accept in-person payments in custom apps using Square Readers. The SDK supports authorization, transaction processing, and Reader management.

Use Square's official Flutter plugin for Reader SDK to build in-person payment solutions on Android and iOS.

How to use #

The Flutter plugin for Reader SDK acts as a wrapper on the native SDKs and is currently compatible with the following native Reader SDK versions:

  • iOS: 1.3.3 and above
  • Android: 1.3.3 and above

Try the sample app to see the plugin in action or follow the instructions in the getting started guide to build a custom solution from scratch.

Additional documentation #

In addition to this README, the following is available in the flutter plugin GitHub repo:

Build requirements #

Android #

  • minSdkVersion is API 21 (Lollipop 5.0) or higher.
  • Android SDK platform: API 28.
  • Android SDK build tools: 28.0.2
  • Android Gradle Plugin: 3.0.0 or greater.
  • Support library: 26.0.2
  • Google Play Services: 16.0.1
  • Google APIs Intel x86 Atom_64 System Image

iOS #

  • Xcode version: 10.2 or greater.
  • iOS Base SDK: 11.1 or greater.
  • Deployment target: iOS 11.0 or greater.

Reader SDK requirements and limitations #

  • Reader SDK is only available for accounts based in the United States. Authorization requests for accounts based outside the United States return an error.
  • Reader SDK may not be used for unattended terminals. Using Reader SDK to implement payment solutions in unattended terminals or kiosks (for example, vending machines) is strictly prohibited.
  • Reader SDK requires an authorization token from the Mobile Authorization API to connect Square Readers and accept payments.
  • Reader SDK only supports on-screen tipping. Digital receipts and tips can be configured in Reader SDK. Tipping on printed receipts is not supported at this time.
  • Reader SDK cannot issue refunds. Refunds can be issued programmatically using the Transactions API or manually in the Square Dashboard.
  • Reader SDK is not supported in the Square sandbox. See Testing Mobile Apps for testing recommendations.
  • Your version of Reader SDK must adhere to the Square SDK update policy. To limit risk to developers and their users, Square enforces an update policy for Reader SDK that requires developers to keep their version of Reader SDK current.

License #

Copyright 2019 Square Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at


Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Changelog #

v2.1.0 Oct 22, 2019 #

  • Update Square Reader SDK minimum supported version to 1.3.3 in order to support iOS 13
  • Now requires Xcode 10.2+

v2.0.3 Sep 16, 2019 #

  • add support for isAuthorizationInProgress

v2.0.2 Aug 25, 2019 #

  • Update Square Reader SDK minimum supported version to 1.3.1
  • Add delay capture support

v2.0.1 Mar 29, 2019 #

  • Fix the bug on Android default Reader SDK version setting

v2.0.0 Mar 29, 2019 #

  • Support AndroidX.
  • Upgrade to Square Reader SDK 1.2.1 (Android Only)

v1.1.1 Mar 13, 2019 #

  • add store customer card suport.

v1.1.0 Mar 5, 2019 #

  • remove alwaysRequireSignature and add collectSignature to checkout configuration.
  • bump the minimum dependency to Reader SDK 1.1.1(iOS)/1.1.3(Android).
  • this change does NOT include all new features introduced in Reader SDK 1.1.* such as Store customer card, see reader SDK Change Log for details.

v1.0.3 Dec 5, 2018 #

  • Documentation update.

v1.0.2 Dec 4, 2018 #

  • Initial release.


Flutter Plugin for Reader SDK Quick Start #

Assumptions and prerequisites #

This quick start guide makes the following assumptions:

  • You have read the Reader SDK Overview. This quick start focuses on getting the sample app installed and running to demonstrate how the Flutter plugin works.
  • You have a Square account enabled for payment processing. If you have not enabled payment processing on your account (or you are not sure), visit squareup.com/activate.
  • You are familiar with basic Flutter development.

Before you start #

  • Follow the Install instructions in the Flutter Getting Started guide to setup your Flutter development environment.
  • Confirm your environment meets the Reader SDK build requirements listed in the root README for this repo.
  • Clone this repo (if you have not already): git clone https://github.com/square/reader-sdk-flutter-plugin.git

Step 1: Request Reader SDK credentials #

  1. Open the Square Application Dashboard.
  2. Create a new Square application.
  3. Click on the new application to bring up the Square application settings pages.
  4. Open the Reader SDK page and click "Request Credentials" to generate your Reader SDK repository password.
  5. You will need the Application ID and Repository password from the Reader SDK settings page to configure Reader SDK in the next steps.

Step 2: Run the Flutter example app for Android #

  1. Open <YOUR_PROJECT_DIRECTORY>/example/android/gradle.properties.
  2. Set the Reader SDK variables with your Reader SDK credentials:
     # Set the variables below with your Reader SDK credentials
  3. Confirm you have installed the required Android SDK elements. If you are unsure, the Reader SDK build requirements are listed in the root README for this repo.
  4. Configure an Android emulator that runs Android API 27 (Oreo, 8.1), and launch the emulator or connect your dev machine to an Android device running Android API 27 with development mode enabled.
  5. Run the sample app from the example folder:
     cd <YOUR_PROJECT_DIRECTORY>/example
     flutter run
  6. Go to the Reader SDK settings page in your Square Application Dashboard and generate a new mobile authorization code by clicking "Generate Mobile Auth Code".
  7. Copy the mobile authorization code string from the Square application settings page.
  8. Tap "Enter Code Manually" in the sample app and paste the mobile authorization code into the field provided.

You can view the transaction details in Square Dashboard.

Step 3: Run the Flutter example app for iOS #

  1. Change to the ios folder under example.

  2. Install ReaderSDK, replacing YOUR_SQUARE_READER_APP_ID and YOUR_SQUARE_READER_REPOSITORY_PASSWORD with your Reader SDK credentials.

    The command below will download the framework into the current directory. The framework must be in either the ios directory or the ios/Frameworks directory of your Flutter project.

     ruby <(curl https://connect.squareup.com/readersdk-installer) install \
     --app-id YOUR_SQUARE_READER_APP_ID                                    \
  3. Launch the iOS emulator or connect to an iOS device with development mode enabled.

  4. Run the sample app from the example folder:

     cd <YOUR_PROJECT_DIRECTORY>/example
     flutter run
  5. Go to the Reader SDK settings page in your Square Application Dashboard and generate a new mobile authorization code by clicking "Generate Mobile Auth Code".

  6. Copy the mobile authorization code string from the Square application settings page.

  7. Tap "Enter Code Manually" in the sample app and paste the mobile authorization code into the field provided.

You can view the transaction details in Square Dashboard.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  square_reader_sdk: ^2.1.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:square_reader_sdk/models.dart';
import 'package:square_reader_sdk/models.g.dart';
import 'package:square_reader_sdk/reader_sdk.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Format lib/reader_sdk.dart.

Run flutter format to format lib/reader_sdk.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (built_value).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
built_collection ^4.0.0 4.3.2
built_value ^6.1.4 6.8.2 7.0.8
flutter 0.0.0
Transitive dependencies
analyzer 0.38.5 0.39.4
analyzer_plugin 0.2.1
args 1.5.2
async 2.4.0
build_config 0.4.1+1
charcode 1.1.2
checked_yaml 1.0.2
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.3
fixnum 0.10.11
front_end 0.1.27 0.1.29
glob 1.2.0
html 0.14.0+3
js 0.6.1+1
json_annotation 3.0.1
kernel 0.3.27 0.3.29
logging 0.11.4
matcher 0.12.6
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pedantic 1.9.0
pub_semver 1.4.2
pubspec_parse 0.1.5
quiver 2.1.2+1
sky_engine 0.0.99
source_span 1.6.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
watcher 0.9.7+13
yaml 2.2.0
Dev dependencies
build ^1.1.0 1.2.2
build_runner ^1.2.3
built_value_generator ^6.3.0 6.8.2 7.0.8
source_gen ^0.9.4+1 0.9.4+6 0.9.4+7