Cordova Square Reader SDK
A Cordova plugin to interface with the native Square Reader SDK.
Install
$ cordova plugin add cordova-plugin-square-reader
$ cordova platform ios prepare
Install the Square SDK
Currently we only support iOS.
For more details refer Square Reader SDK Documentation.
Sub Step from Step 3 - "Update your Info.plist" can be skipped. Plugin will auto configure this.
Pair the card reader
NOTE: Square SDK needs to be authorized before initiating the pairing.
window'squarereader';
Authorize and checkout
var retrieveAuthParams = "personalAccessToken": "<YOUR PERSONAL ACCESS TOKEN>" "locationId": "<LOCATION ID OF>";// Authorization code will be fetched from Square if previous authorization code is expired/emptywindow'squarereader';
NOTE:
Make sure that you are passing the amount in checkout as a string and not number.