square_reader_sdk 1.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new62

Flutter plugin for Reader SDK

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: version 1.0.1
  • Android: 1.0.4

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

  • Android SDK platform: API 27 (Oreo, 8.1).
  • Android SDK build tools: 26.0.3
  • Android Gradle Plugin: 3.0.0 or greater.
  • Support library: 26.0.2
  • Google Play Services: 12.0.1
  • Google APIs Intel x86 Atom_64 System Image

iOS

  • Xcode version: 9.1 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 2018 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

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Changelog

v1.0.3 Dec 5, 2018

  • Documentation update.

v1.0.2 Dec 4, 2018

  • Initial release.

example/README.md

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
     SQUARE_READER_SDK_APPLICATION_ID=YOUR_SQUARE_READER_APP_ID
     SQUARE_READER_SDK_REPOSITORY_PASSWORD=YOUR_SQUARE_READER_REPOSITORY_PASSWORD
    
  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 and READER_SDK_VERSION with the Reader SDK version you are using. You can find the minimum supported Reader SDK version for iOS in the root README for this repo:
     ruby <(curl https://connect.squareup.com/readersdk-installer) install \
     --version READER_SDK_VERSION                                          \
     --app-id YOUR_SQUARE_READER_APP_ID                                    \
     --repo-password YOUR_SQUARE_READER_REPOSITORY_PASSWORD
    
  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:


dependencies:
  square_reader_sdk: ^1.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
1.0.3 Dec 6, 2018 Go to the documentation of square_reader_sdk 1.0.3 Download square_reader_sdk 1.0.3 archive
1.0.2 Dec 4, 2018 Go to the documentation of square_reader_sdk 1.0.2 Download square_reader_sdk 1.0.2 archive
1.0.1 Dec 4, 2018 Go to the documentation of square_reader_sdk 1.0.1 Download square_reader_sdk 1.0.1 archive
1.0.0 Dec 4, 2018 Go to the documentation of square_reader_sdk 1.0.0 Download square_reader_sdk 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
24
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Dec 6, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
built_collection ^4.0.0 4.1.0
built_value ^6.1.4 6.1.6
flutter 0.0.0
Transitive dependencies
collection 1.14.11
fixnum 0.10.9
matcher 0.12.4
meta 1.1.6
path 1.6.2
quiver 2.0.1
sky_engine 0.0.99
stack_trace 1.9.3
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
build any
build_runner any
built_value_generator any
source_gen any