square_pos 0.1.0
square_pos: ^0.1.0 copied to clipboard
Flutter wrapper for the Square POS SDK. With this plugin, your app can easily request payment via the Square POD app on Android and iOS.
square_pos #
A Flutter wrapper to use the Square POS SDK.
With this plugin, your app can easily request payment via the Square POD app on Android and iOS.
Prerequisites #
- Registered for a Square developer account via Square.
- Deployment Target iOS 12.0 or higher.
- Android minSdkVersion 21 or higher.
Add URL schemes (iOS) #
- Add the request URL scheme as a LSApplicationQueriesSchemes key into your Info.plist file to indicate that your application uses the square-commerce-v1 URL scheme to open Square Point of Sale.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>square-commerce-v1</string>
</array>
- Add your custom response URL scheme as CFBundleURLTypes keys in your Info.plist file.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>YOUR_BUNDLE_URL_NAME</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp-url-scheme</string>
</array>
</dict>
</array>
Installing #
Add square_pos to your pubspec.yaml:
dependencies:
square_pos:
Import square_pos:
import 'package:square_pos/square_pos.dart';
Getting Started #
Init SquarePos SDK:
SquarePos.init(applicationID, callbackScheme);
Check if Square POS is installed on device:
SquarePos.canRequest;
Complete a transaction:
var request = SquarePosPaymentRequest(
money: SquarePosMoney(amountCents: 100, currencyCode: "USD"),
supportedTenderTypes: [
SquarePosTenderType.card,
SquarePosTenderType.cardOnFile,
SquarePosTenderType.squareGiftCard
]);
SquarePos.requestPayment(request);
Available APIs #
SquarePos.init(applicationID, callbackScheme);
SquarePos.canRequest;
SquarePos.requestPayment(request);