@capawesome/capacitor-square-mobile-payments 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Unofficial Capacitor plugin for [Square Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk).[^1]
4
4
 
5
+ <div class="capawesome-z29o10a">
6
+ <a href="https://cloud.capawesome.io/" target="_blank">
7
+ <img alt="Deliver Live Updates to your Capacitor app with Capawesome Cloud" src="https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1" />
8
+ </a>
9
+ </div>
10
+
5
11
  ## Features
6
12
 
7
13
  This plugin provides a comprehensive integration with Square's Mobile Payments SDK for in-person payment processing. Here are some of the key features:
@@ -99,13 +105,15 @@ More details can be found in the [Square Mobile Payments SDK iOS setup guide](ht
99
105
 
100
106
  #### Privacy Descriptions
101
107
 
102
- Add the `NSLocationWhenInUseUsageDescription` and `NSBluetoothAlwaysUsageDescription` keys to the `ios/App/App/Info.plist` file, which tells the user why your app is requesting location and Bluetooth permissions:
108
+ Add the `NSLocationWhenInUseUsageDescription`, `NSBluetoothAlwaysUsageDescription`, and `NSMicrophoneUsageDescription` keys to the `ios/App/App/Info.plist` file, which tells the user why your app is requesting location, Bluetooth, and microphone permissions:
103
109
 
104
110
  ```xml
105
111
  <key>NSBluetoothAlwaysUsageDescription</key>
106
112
  <string>We need Bluetooth access to connect to Square card readers.</string>
107
113
  <key>NSLocationWhenInUseUsageDescription</key>
108
114
  <string>We need your location to confirm payments are occurring in a supported Square location.</string>
115
+ <key>NSMicrophoneUsageDescription</key>
116
+ <string>We need microphone access to receive data from magstripe card readers.</string>
109
117
  ```
110
118
 
111
119
  ## Configuration
@@ -216,6 +224,10 @@ const getAvailableMethods = async () => {
216
224
  * [`startPayment(...)`](#startpayment)
217
225
  * [`cancelPayment()`](#cancelpayment)
218
226
  * [`getAvailableCardInputMethods()`](#getavailablecardinputmethods)
227
+ * [`linkAppleAccount()`](#linkappleaccount)
228
+ * [`relinkAppleAccount()`](#relinkappleaccount)
229
+ * [`isAppleAccountLinked()`](#isappleaccountlinked)
230
+ * [`isDeviceCapable()`](#isdevicecapable)
219
231
  * [`checkPermissions()`](#checkpermissions)
220
232
  * [`requestPermissions()`](#requestpermissions)
221
233
  * [`addListener('readerPairingDidBegin', ...)`](#addlistenerreaderpairingdidbegin-)
@@ -541,6 +553,76 @@ Only available on Android and iOS.
541
553
  --------------------
542
554
 
543
555
 
556
+ ### linkAppleAccount()
557
+
558
+ ```typescript
559
+ linkAppleAccount() => Promise<void>
560
+ ```
561
+
562
+ Link a Square seller account with an Apple ID for Tap to Pay on iPhone.
563
+
564
+ Presents an Apple sheet prompting the user to accept the Tap to Pay
565
+ on iPhone terms and conditions.
566
+
567
+ Only available on iOS.
568
+
569
+ **Since:** 0.1.3
570
+
571
+ --------------------
572
+
573
+
574
+ ### relinkAppleAccount()
575
+
576
+ ```typescript
577
+ relinkAppleAccount() => Promise<void>
578
+ ```
579
+
580
+ Re-link a Square seller account with a different Apple ID.
581
+
582
+ Presents an Apple sheet to change the associated Apple ID by
583
+ showing the Tap to Pay terms and conditions again.
584
+
585
+ Only available on iOS.
586
+
587
+ **Since:** 0.1.3
588
+
589
+ --------------------
590
+
591
+
592
+ ### isAppleAccountLinked()
593
+
594
+ ```typescript
595
+ isAppleAccountLinked() => Promise<IsAppleAccountLinkedResult>
596
+ ```
597
+
598
+ Check if an Apple ID is already linked to a Square seller account.
599
+
600
+ Only available on iOS.
601
+
602
+ **Returns:** <code>Promise&lt;<a href="#isappleaccountlinkedresult">IsAppleAccountLinkedResult</a>&gt;</code>
603
+
604
+ **Since:** 0.1.3
605
+
606
+ --------------------
607
+
608
+
609
+ ### isDeviceCapable()
610
+
611
+ ```typescript
612
+ isDeviceCapable() => Promise<IsDeviceCapableResult>
613
+ ```
614
+
615
+ Check if the device is capable of Tap to Pay on iPhone.
616
+
617
+ Only available on iOS.
618
+
619
+ **Returns:** <code>Promise&lt;<a href="#isdevicecapableresult">IsDeviceCapableResult</a>&gt;</code>
620
+
621
+ **Since:** 0.1.3
622
+
623
+ --------------------
624
+
625
+
544
626
  ### checkPermissions()
545
627
 
546
628
  ```typescript
@@ -940,12 +1022,26 @@ Only available on Android and iOS.
940
1022
  | **`cardInputMethods`** | <code>CardInputMethod[]</code> | The available card input methods. | 0.0.1 |
941
1023
 
942
1024
 
1025
+ #### IsAppleAccountLinkedResult
1026
+
1027
+ | Prop | Type | Description | Since |
1028
+ | ------------ | -------------------- | ----------------------------------------------------------- | ----- |
1029
+ | **`linked`** | <code>boolean</code> | Whether an Apple ID is linked to the Square seller account. | 0.1.3 |
1030
+
1031
+
1032
+ #### IsDeviceCapableResult
1033
+
1034
+ | Prop | Type | Description | Since |
1035
+ | ------------- | -------------------- | ------------------------------------------------------ | ----- |
1036
+ | **`capable`** | <code>boolean</code> | Whether the device is capable of Tap to Pay on iPhone. | 0.1.3 |
1037
+
1038
+
943
1039
  #### PermissionStatus
944
1040
 
945
1041
  | Prop | Type | Description | Since |
946
1042
  | ---------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
947
1043
  | **`location`** | <code><a href="#permissionstate">PermissionState</a></code> | Permission state for accessing location. Required to confirm that payments are occurring in a supported Square location. | 0.0.1 |
948
- | **`recordAudio`** | <code><a href="#permissionstate">PermissionState</a></code> | Permission state for recording audio. Required to receive data from magstripe readers. Only available on Android. | 0.0.1 |
1044
+ | **`recordAudio`** | <code><a href="#permissionstate">PermissionState</a></code> | Permission state for recording audio. Required to receive data from magstripe readers. | 0.0.1 |
949
1045
  | **`bluetoothConnect`** | <code><a href="#permissionstate">PermissionState</a></code> | Permission state for Bluetooth connect. Required to receive data from contactless and chip readers. Only available on Android. | 0.0.1 |
950
1046
  | **`bluetoothScan`** | <code><a href="#permissionstate">PermissionState</a></code> | Permission state for Bluetooth scan. Required to store information during checkout. Only available on Android. | 0.0.1 |
951
1047
  | **`readPhoneState`** | <code><a href="#permissionstate">PermissionState</a></code> | Permission state for reading phone state. Required to identify the device sending information to Square servers. Only available on Android. | 0.0.1 |
@@ -1159,6 +1255,7 @@ Callback to receive payment cancellation notifications.
1159
1255
  | **`ContactlessAndChip`** | <code>'CONTACTLESS_AND_CHIP'</code> | Square Reader for contactless and chip. | 0.0.1 |
1160
1256
  | **`Magstripe`** | <code>'MAGSTRIPE'</code> | Square Reader for magstripe. | 0.0.1 |
1161
1257
  | **`Stand`** | <code>'STAND'</code> | Square Stand. | 0.0.1 |
1258
+ | **`TapToPay`** | <code>'TAP_TO_PAY'</code> | Tap to Pay on iPhone. | 0.1.3 |
1162
1259
  | **`Unknown`** | <code>'UNKNOWN'</code> | Unknown reader model. | 0.0.1 |
1163
1260
 
1164
1261
 
@@ -1287,4 +1384,4 @@ See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/mai
1287
1384
 
1288
1385
  See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/square-mobile-payments/LICENSE).
1289
1386
 
1290
- [^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by Square, Inc. or any of their affiliates or subsidiaries.
1387
+ [^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by Square, Inc. or any of their affiliates or subsidiaries.
@@ -431,6 +431,26 @@ public class SquareMobilePaymentsPlugin extends Plugin {
431
431
  }
432
432
  }
433
433
 
434
+ @PluginMethod
435
+ public void linkAppleAccount(PluginCall call) {
436
+ rejectCallAsUnimplemented(call);
437
+ }
438
+
439
+ @PluginMethod
440
+ public void relinkAppleAccount(PluginCall call) {
441
+ rejectCallAsUnimplemented(call);
442
+ }
443
+
444
+ @PluginMethod
445
+ public void isAppleAccountLinked(PluginCall call) {
446
+ rejectCallAsUnimplemented(call);
447
+ }
448
+
449
+ @PluginMethod
450
+ public void isDeviceCapable(PluginCall call) {
451
+ rejectCallAsUnimplemented(call);
452
+ }
453
+
434
454
  @PluginMethod
435
455
  public void checkPermissions(PluginCall call) {
436
456
  super.checkPermissions(call);
@@ -450,6 +470,10 @@ public class SquareMobilePaymentsPlugin extends Plugin {
450
470
  call.reject(message);
451
471
  }
452
472
 
473
+ private void rejectCallAsUnimplemented(@NonNull PluginCall call) {
474
+ call.unimplemented("This method is not available on this platform.");
475
+ }
476
+
453
477
  private void resolveCall(@NonNull PluginCall call) {
454
478
  call.resolve();
455
479
  }
package/dist/docs.json CHANGED
@@ -315,6 +315,70 @@
315
315
  ],
316
316
  "slug": "getavailablecardinputmethods"
317
317
  },
318
+ {
319
+ "name": "linkAppleAccount",
320
+ "signature": "() => Promise<void>",
321
+ "parameters": [],
322
+ "returns": "Promise<void>",
323
+ "tags": [
324
+ {
325
+ "name": "since",
326
+ "text": "0.1.3"
327
+ }
328
+ ],
329
+ "docs": "Link a Square seller account with an Apple ID for Tap to Pay on iPhone.\n\nPresents an Apple sheet prompting the user to accept the Tap to Pay\non iPhone terms and conditions.\n\nOnly available on iOS.",
330
+ "complexTypes": [],
331
+ "slug": "linkappleaccount"
332
+ },
333
+ {
334
+ "name": "relinkAppleAccount",
335
+ "signature": "() => Promise<void>",
336
+ "parameters": [],
337
+ "returns": "Promise<void>",
338
+ "tags": [
339
+ {
340
+ "name": "since",
341
+ "text": "0.1.3"
342
+ }
343
+ ],
344
+ "docs": "Re-link a Square seller account with a different Apple ID.\n\nPresents an Apple sheet to change the associated Apple ID by\nshowing the Tap to Pay terms and conditions again.\n\nOnly available on iOS.",
345
+ "complexTypes": [],
346
+ "slug": "relinkappleaccount"
347
+ },
348
+ {
349
+ "name": "isAppleAccountLinked",
350
+ "signature": "() => Promise<IsAppleAccountLinkedResult>",
351
+ "parameters": [],
352
+ "returns": "Promise<IsAppleAccountLinkedResult>",
353
+ "tags": [
354
+ {
355
+ "name": "since",
356
+ "text": "0.1.3"
357
+ }
358
+ ],
359
+ "docs": "Check if an Apple ID is already linked to a Square seller account.\n\nOnly available on iOS.",
360
+ "complexTypes": [
361
+ "IsAppleAccountLinkedResult"
362
+ ],
363
+ "slug": "isappleaccountlinked"
364
+ },
365
+ {
366
+ "name": "isDeviceCapable",
367
+ "signature": "() => Promise<IsDeviceCapableResult>",
368
+ "parameters": [],
369
+ "returns": "Promise<IsDeviceCapableResult>",
370
+ "tags": [
371
+ {
372
+ "name": "since",
373
+ "text": "0.1.3"
374
+ }
375
+ ],
376
+ "docs": "Check if the device is capable of Tap to Pay on iPhone.\n\nOnly available on iOS.",
377
+ "complexTypes": [
378
+ "IsDeviceCapableResult"
379
+ ],
380
+ "slug": "isdevicecapable"
381
+ },
318
382
  {
319
383
  "name": "checkPermissions",
320
384
  "signature": "() => Promise<PermissionStatus>",
@@ -1428,6 +1492,58 @@
1428
1492
  }
1429
1493
  ]
1430
1494
  },
1495
+ {
1496
+ "name": "IsAppleAccountLinkedResult",
1497
+ "slug": "isappleaccountlinkedresult",
1498
+ "docs": "",
1499
+ "tags": [
1500
+ {
1501
+ "text": "0.1.3",
1502
+ "name": "since"
1503
+ }
1504
+ ],
1505
+ "methods": [],
1506
+ "properties": [
1507
+ {
1508
+ "name": "linked",
1509
+ "tags": [
1510
+ {
1511
+ "text": "0.1.3",
1512
+ "name": "since"
1513
+ }
1514
+ ],
1515
+ "docs": "Whether an Apple ID is linked to the Square seller account.",
1516
+ "complexTypes": [],
1517
+ "type": "boolean"
1518
+ }
1519
+ ]
1520
+ },
1521
+ {
1522
+ "name": "IsDeviceCapableResult",
1523
+ "slug": "isdevicecapableresult",
1524
+ "docs": "",
1525
+ "tags": [
1526
+ {
1527
+ "text": "0.1.3",
1528
+ "name": "since"
1529
+ }
1530
+ ],
1531
+ "methods": [],
1532
+ "properties": [
1533
+ {
1534
+ "name": "capable",
1535
+ "tags": [
1536
+ {
1537
+ "text": "0.1.3",
1538
+ "name": "since"
1539
+ }
1540
+ ],
1541
+ "docs": "Whether the device is capable of Tap to Pay on iPhone.",
1542
+ "complexTypes": [],
1543
+ "type": "boolean"
1544
+ }
1545
+ ]
1546
+ },
1431
1547
  {
1432
1548
  "name": "PermissionStatus",
1433
1549
  "slug": "permissionstatus",
@@ -1462,7 +1578,7 @@
1462
1578
  "name": "since"
1463
1579
  }
1464
1580
  ],
1465
- "docs": "Permission state for recording audio.\n\nRequired to receive data from magstripe readers.\n\nOnly available on Android.",
1581
+ "docs": "Permission state for recording audio.\n\nRequired to receive data from magstripe readers.",
1466
1582
  "complexTypes": [
1467
1583
  "PermissionState"
1468
1584
  ],
@@ -2233,6 +2349,17 @@
2233
2349
  ],
2234
2350
  "docs": "Square Stand."
2235
2351
  },
2352
+ {
2353
+ "name": "TapToPay",
2354
+ "value": "'TAP_TO_PAY'",
2355
+ "tags": [
2356
+ {
2357
+ "text": "0.1.3",
2358
+ "name": "since"
2359
+ }
2360
+ ],
2361
+ "docs": "Tap to Pay on iPhone."
2362
+ },
2236
2363
  {
2237
2364
  "name": "Unknown",
2238
2365
  "value": "'UNKNOWN'",
@@ -157,6 +157,44 @@ export interface SquareMobilePaymentsPlugin {
157
157
  * @since 0.0.1
158
158
  */
159
159
  getAvailableCardInputMethods(): Promise<GetAvailableCardInputMethodsResult>;
160
+ /**
161
+ * Link a Square seller account with an Apple ID for Tap to Pay on iPhone.
162
+ *
163
+ * Presents an Apple sheet prompting the user to accept the Tap to Pay
164
+ * on iPhone terms and conditions.
165
+ *
166
+ * Only available on iOS.
167
+ *
168
+ * @since 0.1.3
169
+ */
170
+ linkAppleAccount(): Promise<void>;
171
+ /**
172
+ * Re-link a Square seller account with a different Apple ID.
173
+ *
174
+ * Presents an Apple sheet to change the associated Apple ID by
175
+ * showing the Tap to Pay terms and conditions again.
176
+ *
177
+ * Only available on iOS.
178
+ *
179
+ * @since 0.1.3
180
+ */
181
+ relinkAppleAccount(): Promise<void>;
182
+ /**
183
+ * Check if an Apple ID is already linked to a Square seller account.
184
+ *
185
+ * Only available on iOS.
186
+ *
187
+ * @since 0.1.3
188
+ */
189
+ isAppleAccountLinked(): Promise<IsAppleAccountLinkedResult>;
190
+ /**
191
+ * Check if the device is capable of Tap to Pay on iPhone.
192
+ *
193
+ * Only available on iOS.
194
+ *
195
+ * @since 0.1.3
196
+ */
197
+ isDeviceCapable(): Promise<IsDeviceCapableResult>;
160
198
  /**
161
199
  * Check the current permission status.
162
200
  *
@@ -515,6 +553,28 @@ export interface GetAvailableCardInputMethodsResult {
515
553
  */
516
554
  cardInputMethods: CardInputMethod[];
517
555
  }
556
+ /**
557
+ * @since 0.1.3
558
+ */
559
+ export interface IsAppleAccountLinkedResult {
560
+ /**
561
+ * Whether an Apple ID is linked to the Square seller account.
562
+ *
563
+ * @since 0.1.3
564
+ */
565
+ linked: boolean;
566
+ }
567
+ /**
568
+ * @since 0.1.3
569
+ */
570
+ export interface IsDeviceCapableResult {
571
+ /**
572
+ * Whether the device is capable of Tap to Pay on iPhone.
573
+ *
574
+ * @since 0.1.3
575
+ */
576
+ capable: boolean;
577
+ }
518
578
  /**
519
579
  * @since 0.0.1
520
580
  */
@@ -1059,6 +1119,12 @@ export declare enum ReaderModel {
1059
1119
  * @since 0.0.1
1060
1120
  */
1061
1121
  Stand = "STAND",
1122
+ /**
1123
+ * Tap to Pay on iPhone.
1124
+ *
1125
+ * @since 0.1.3
1126
+ */
1127
+ TapToPay = "TAP_TO_PAY",
1062
1128
  /**
1063
1129
  * Unknown reader model.
1064
1130
  *
@@ -1361,8 +1427,6 @@ export interface PermissionStatus {
1361
1427
  *
1362
1428
  * Required to receive data from magstripe readers.
1363
1429
  *
1364
- * Only available on Android.
1365
- *
1366
1430
  * @since 0.0.1
1367
1431
  */
1368
1432
  recordAudio?: PermissionState;
@@ -147,6 +147,12 @@ export var ReaderModel;
147
147
  * @since 0.0.1
148
148
  */
149
149
  ReaderModel["Stand"] = "STAND";
150
+ /**
151
+ * Tap to Pay on iPhone.
152
+ *
153
+ * @since 0.1.3
154
+ */
155
+ ReaderModel["TapToPay"] = "TAP_TO_PAY";
150
156
  /**
151
157
  * Unknown reader model.
152
158
  *
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"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","sourcesContent":["import type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\n/**\n * @since 0.0.1\n */\nexport interface SquareMobilePaymentsPlugin {\n /**\n * Initialize the Square Mobile Payments SDK.\n *\n * This method must be called before any other method.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n initialize(options: InitializeOptions): Promise<void>;\n /**\n * Authorize the SDK with a Square access token.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n authorize(options: AuthorizeOptions): Promise<void>;\n /**\n * Check if the SDK is currently authorized.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n isAuthorized(): Promise<IsAuthorizedResult>;\n /**\n * Deauthorize the SDK and clear the current authorization.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n deauthorize(): Promise<void>;\n /**\n * Show the Square settings screen.\n *\n * This displays a pre-built settings UI where merchants can view and manage\n * their paired readers.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n showSettings(): Promise<void>;\n /**\n * Show the Mock Reader UI for testing.\n *\n * This displays a mock reader interface for testing payment flows without\n * physical hardware. This is only for development and testing purposes and\n * is therefore only available in debug builds.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.1\n */\n showMockReader(): Promise<void>;\n /**\n * Hide the Mock Reader UI.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.1\n */\n hideMockReader(): Promise<void>;\n /**\n * Get the current SDK settings.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n getSettings(): Promise<GetSettingsResult>;\n /**\n * Start pairing with a Square reader.\n *\n * This initiates the reader pairing process. The SDK will search for nearby\n * readers and pair with the first one found.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n startPairing(): Promise<void>;\n /**\n * Stop the reader pairing process.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n stopPairing(): Promise<void>;\n /**\n * Check if a pairing process is currently in progress.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n isPairingInProgress(): Promise<IsPairingInProgressResult>;\n /**\n * Get a list of all paired readers.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n getReaders(): Promise<GetReadersResult>;\n /**\n * Forget a paired reader.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n forgetReader(options: ForgetReaderOptions): Promise<void>;\n /**\n * Retry connecting to a reader.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n retryConnection(options: RetryConnectionOptions): Promise<void>;\n /**\n * Start a payment flow.\n *\n * This presents the payment UI and processes the payment using the specified\n * parameters. Only one payment can be active at a time.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n startPayment(options: StartPaymentOptions): Promise<void>;\n /**\n * Cancel an ongoing payment.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n cancelPayment(): Promise<void>;\n /**\n * Get the currently available card input methods.\n *\n * This returns the card entry methods that are available based on the\n * connected readers (e.g., TAP, DIP, SWIPE, KEYED).\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n getAvailableCardInputMethods(): Promise<GetAvailableCardInputMethodsResult>;\n /**\n * Check the current permission status.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n checkPermissions(): Promise<PermissionStatus>;\n /**\n * Request the required permissions.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n requestPermissions(): Promise<PermissionStatus>;\n /**\n * Listen for reader pairing events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerPairingDidBegin',\n listenerFunc: ReaderPairingDidBeginListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for successful reader pairing events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerPairingDidSucceed',\n listenerFunc: ReaderPairingDidSucceedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for failed reader pairing events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerPairingDidFail',\n listenerFunc: ReaderPairingDidFailListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for reader added events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerWasAdded',\n listenerFunc: ReaderWasAddedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for reader removed events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerWasRemoved',\n listenerFunc: ReaderWasRemovedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for reader status and property changes.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerDidChange',\n listenerFunc: ReaderDidChangeListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for available card input method changes.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'availableCardInputMethodsDidChange',\n listenerFunc: AvailableCardInputMethodsDidChangeListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for successful payment completion events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'paymentDidFinish',\n listenerFunc: PaymentDidFinishListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for failed payment events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'paymentDidFail',\n listenerFunc: PaymentDidFailListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for cancelled payment events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'paymentDidCancel',\n listenerFunc: PaymentDidCancelListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface InitializeOptions {\n /**\n * The Square location ID.\n *\n * @since 0.0.1\n * @example 'LOCATION_ID'\n */\n locationId: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface AuthorizeOptions {\n /**\n * The Square access token.\n *\n * @since 0.0.1\n * @example 'EAAAEOuLQPDbLd...'\n */\n accessToken: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface IsAuthorizedResult {\n /**\n * Whether the SDK is currently authorized.\n *\n * @since 0.0.1\n */\n authorized: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface GetSettingsResult {\n /**\n * The SDK version.\n *\n * @since 0.0.1\n * @example '2.0.0'\n */\n version: string;\n /**\n * The current environment.\n *\n * @since 0.0.1\n * @example 'production'\n */\n environment: Environment;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface IsPairingInProgressResult {\n /**\n * Whether a pairing process is currently in progress.\n *\n * @since 0.0.1\n */\n inProgress: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface GetReadersResult {\n /**\n * The list of paired readers.\n *\n * @since 0.0.1\n */\n readers: ReaderInfo[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ForgetReaderOptions {\n /**\n * The serial number of the reader to forget.\n *\n * @since 0.0.1\n * @example 'CRR123456789'\n */\n serialNumber: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface RetryConnectionOptions {\n /**\n * The serial number of the reader to retry connection.\n *\n * @since 0.0.1\n * @example 'CRR123456789'\n */\n serialNumber: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface StartPaymentOptions {\n /**\n * The payment parameters.\n *\n * @since 0.0.1\n */\n paymentParameters: PaymentParameters;\n /**\n * The prompt parameters.\n *\n * @since 0.0.1\n */\n promptParameters: PromptParameters;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface PaymentParameters {\n /**\n * The amount of money to charge.\n *\n * @since 0.0.1\n */\n amountMoney: Money;\n /**\n * A unique identifier for this payment attempt.\n *\n * This is used for idempotent payment requests.\n *\n * @since 0.0.1\n * @example 'a1b2c3d4-e5f6-4a5b-8c9d-1e2f3a4b5c6d'\n */\n paymentAttemptId: string;\n /**\n * The processing mode for this payment.\n *\n * @since 0.0.1\n * @default ProcessingMode.AutoDetect\n */\n processingMode?: ProcessingMode;\n /**\n * A user-defined reference ID to associate with the payment.\n *\n * @since 0.0.1\n * @example 'ORDER-12345'\n */\n referenceId?: string;\n /**\n * An optional note to add to the payment.\n *\n * @since 0.0.1\n * @example 'Birthday gift'\n */\n note?: string;\n /**\n * The Square order ID to associate with this payment.\n *\n * @since 0.0.1\n * @example 'CAISENgvlJ6jLWAzERDzjyHVybY'\n */\n orderId?: string;\n /**\n * The tip amount.\n *\n * @since 0.0.1\n */\n tipMoney?: Money;\n /**\n * The application fee.\n *\n * @since 0.0.1\n */\n applicationFee?: Money;\n /**\n * Whether to automatically complete the payment.\n *\n * If false, the payment will be authorized but not captured, requiring\n * manual completion via the Payments API.\n *\n * @since 0.0.1\n * @default true\n */\n autocomplete?: boolean;\n /**\n * The duration to delay before automatically completing or canceling the payment.\n *\n * Only applicable when autocomplete is false.\n *\n * @since 0.0.1\n * @example 'PT1H'\n */\n delayDuration?: string;\n /**\n * The action to take when the delay duration expires.\n *\n * Only applicable when autocomplete is false.\n *\n * @since 0.0.1\n */\n delayAction?: DelayAction;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface PromptParameters {\n /**\n * The prompt mode.\n *\n * @since 0.0.1\n * @default PromptMode.Default\n */\n mode?: PromptMode;\n /**\n * Additional payment methods to allow.\n *\n * @since 0.0.1\n * @default []\n */\n additionalMethods?: AdditionalPaymentMethod[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface Money {\n /**\n * The amount in the smallest currency unit (e.g., cents for USD).\n *\n * @since 0.0.1\n * @example 100\n */\n amount: number;\n /**\n * The ISO 4217 currency code.\n *\n * @since 0.0.1\n * @example 'USD'\n */\n currency: CurrencyCode;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface GetAvailableCardInputMethodsResult {\n /**\n * The available card input methods.\n *\n * @since 0.0.1\n */\n cardInputMethods: CardInputMethod[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderInfo {\n /**\n * The reader's serial number.\n *\n * @since 0.0.1\n * @example 'CRR123456789'\n */\n serialNumber: string;\n /**\n * The reader's model.\n *\n * @since 0.0.1\n */\n model: ReaderModel;\n /**\n * The reader's current status.\n *\n * @since 0.0.1\n */\n status: ReaderStatus;\n /**\n * The reader's firmware version.\n *\n * @since 0.0.1\n * @example '1.2.3'\n */\n firmwareVersion?: string;\n /**\n * The reader's battery level (0-100).\n *\n * @since 0.0.1\n * @example 85\n */\n batteryLevel?: number;\n /**\n * Whether the reader is currently charging.\n *\n * @since 0.0.1\n */\n isCharging?: boolean;\n /**\n * The card input methods supported by this reader.\n *\n * @since 0.0.1\n */\n supportedCardInputMethods: CardInputMethod[];\n /**\n * Additional information about why the reader is unavailable.\n *\n * Only present when status is ReaderUnavailable.\n *\n * @since 0.0.1\n */\n unavailableReasonInfo?: UnavailableReasonInfo;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface UnavailableReasonInfo {\n /**\n * The reason code why the reader is unavailable.\n *\n * @since 0.0.1\n */\n reason: UnavailableReason;\n /**\n * A human-readable message describing why the reader is unavailable.\n *\n * @since 0.0.1\n */\n message?: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface Payment {\n /**\n * The unique identifier for this payment.\n *\n * For offline payments, this may be null until synced.\n *\n * @since 0.0.1\n * @example 'AbCdEfGhIjKlMnOpQrStUvWxYz'\n */\n id: string | null;\n /**\n * The payment type.\n *\n * @since 0.0.1\n */\n type: PaymentType;\n /**\n * The payment status.\n *\n * @since 0.0.1\n */\n status: PaymentStatus;\n /**\n * The amount paid.\n *\n * @since 0.0.1\n */\n amountMoney: Money;\n /**\n * The tip amount.\n *\n * @since 0.0.1\n */\n tipMoney?: Money;\n /**\n * The application fee.\n *\n * @since 0.0.1\n */\n applicationFee?: Money;\n /**\n * The reference ID provided in the payment parameters.\n *\n * @since 0.0.1\n */\n referenceId?: string;\n /**\n * The order ID associated with this payment.\n *\n * @since 0.0.1\n */\n orderId?: string;\n /**\n * Card payment details.\n *\n * Only present for card payments.\n *\n * @since 0.0.1\n */\n cardDetails?: CardPaymentDetails;\n /**\n * The time the payment was created (ISO 8601 format).\n *\n * @since 0.0.1\n * @example '2024-01-15T10:30:00Z'\n */\n createdAt?: string;\n /**\n * The time the payment was updated (ISO 8601 format).\n *\n * @since 0.0.1\n * @example '2024-01-15T10:30:00Z'\n */\n updatedAt?: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface CardPaymentDetails {\n /**\n * The card information.\n *\n * @since 0.0.1\n */\n card: Card;\n /**\n * The card entry method used.\n *\n * @since 0.0.1\n */\n entryMethod: CardInputMethod;\n /**\n * The authorization code.\n *\n * @since 0.0.1\n * @example '123456'\n */\n authorizationCode?: string;\n /**\n * The EMV application name.\n *\n * @since 0.0.1\n * @example 'VISA CREDIT'\n */\n applicationName?: string;\n /**\n * The EMV application identifier.\n *\n * @since 0.0.1\n * @example 'A0000000031010'\n */\n applicationId?: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface Card {\n /**\n * The card brand.\n *\n * @since 0.0.1\n */\n brand: CardBrand;\n /**\n * The last four digits of the card number.\n *\n * @since 0.0.1\n * @example '1234'\n */\n lastFourDigits: string;\n /**\n * The cardholder name.\n *\n * @since 0.0.1\n * @example 'John Doe'\n */\n cardholderName?: string;\n /**\n * The card expiration month (1-12).\n *\n * @since 0.0.1\n * @example 12\n */\n expirationMonth?: number;\n /**\n * The card expiration year.\n *\n * @since 0.0.1\n * @example 2025\n */\n expirationYear?: number;\n}\n\n/**\n * Callback to receive reader pairing start notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderPairingDidBeginListener = () => void;\n\n/**\n * Callback to receive reader pairing success notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderPairingDidSucceedListener = () => void;\n\n/**\n * Callback to receive reader pairing failure notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderPairingDidFailListener = (\n event: ReaderPairingDidFailEvent,\n) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderPairingDidFailEvent {\n /**\n * The error code.\n *\n * @since 0.0.1\n */\n code?: string;\n /**\n * The error message.\n *\n * @since 0.0.1\n */\n message: string;\n}\n\n/**\n * Callback to receive reader added notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderWasAddedListener = (event: ReaderWasAddedEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderWasAddedEvent {\n /**\n * The reader that was added.\n *\n * @since 0.0.1\n */\n reader: ReaderInfo;\n}\n\n/**\n * Callback to receive reader removed notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderWasRemovedListener = (event: ReaderWasRemovedEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderWasRemovedEvent {\n /**\n * The reader that was removed.\n *\n * @since 0.0.1\n */\n reader: ReaderInfo;\n}\n\n/**\n * Callback to receive reader change notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderDidChangeListener = (event: ReaderDidChangeEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderDidChangeEvent {\n /**\n * The reader that changed.\n *\n * @since 0.0.1\n */\n reader: ReaderInfo;\n /**\n * The type of change that occurred.\n *\n * @since 0.0.1\n */\n change: ReaderChange;\n}\n\n/**\n * Callback to receive available card input method change notifications.\n *\n * @since 0.0.1\n */\nexport type AvailableCardInputMethodsDidChangeListener = (\n event: AvailableCardInputMethodsDidChangeEvent,\n) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface AvailableCardInputMethodsDidChangeEvent {\n /**\n * The available card input methods.\n *\n * @since 0.0.1\n */\n cardInputMethods: CardInputMethod[];\n}\n\n/**\n * Callback to receive payment completion notifications.\n *\n * @since 0.0.1\n */\nexport type PaymentDidFinishListener = (event: PaymentDidFinishEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface PaymentDidFinishEvent {\n /**\n * The completed payment.\n *\n * @since 0.0.1\n */\n payment: Payment;\n}\n\n/**\n * Callback to receive payment failure notifications.\n *\n * @since 0.0.1\n */\nexport type PaymentDidFailListener = (event: PaymentDidFailEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface PaymentDidFailEvent {\n /**\n * The failed payment.\n *\n * @since 0.0.1\n */\n payment?: Payment;\n /**\n * The error code.\n *\n * @since 0.0.1\n */\n code?: string;\n /**\n * The error message.\n *\n * @since 0.0.1\n */\n message: string;\n}\n\n/**\n * Callback to receive payment cancellation notifications.\n *\n * @since 0.0.1\n */\nexport type PaymentDidCancelListener = (event: PaymentDidCancelEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface PaymentDidCancelEvent {\n /**\n * The cancelled payment.\n *\n * @since 0.0.1\n */\n payment?: Payment;\n}\n\n/**\n * @since 0.0.1\n */\nexport enum Environment {\n /**\n * Production environment.\n *\n * @since 0.0.1\n */\n Production = 'production',\n /**\n * Sandbox environment for testing.\n *\n * @since 0.0.1\n */\n Sandbox = 'sandbox',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum CardInputMethod {\n /**\n * Contactless card tap (NFC).\n *\n * @since 0.0.1\n */\n Tap = 'TAP',\n /**\n * EMV chip card insertion.\n *\n * @since 0.0.1\n */\n Dip = 'DIP',\n /**\n * Magnetic stripe swipe.\n *\n * @since 0.0.1\n */\n Swipe = 'SWIPE',\n /**\n * Manually keyed card entry.\n *\n * @since 0.0.1\n */\n Keyed = 'KEYED',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ProcessingMode {\n /**\n * Automatically detect the best processing mode (online or offline).\n *\n * @since 0.0.1\n */\n AutoDetect = 'AUTO_DETECT',\n /**\n * Process the payment online only.\n *\n * @since 0.0.1\n */\n OnlineOnly = 'ONLINE_ONLY',\n /**\n * Allow offline payment processing.\n *\n * @since 0.0.1\n */\n OfflineOnly = 'OFFLINE_ONLY',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum PromptMode {\n /**\n * Use the default Square payment UI.\n *\n * @since 0.0.1\n */\n Default = 'DEFAULT',\n /**\n * Use a custom payment UI.\n *\n * @since 0.0.1\n */\n Custom = 'CUSTOM',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum AdditionalPaymentMethod {\n /**\n * Allow manually keyed card entry.\n *\n * @since 0.0.1\n */\n Keyed = 'KEYED',\n /**\n * Allow cash payments.\n *\n * @since 0.0.1\n */\n Cash = 'CASH',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum DelayAction {\n /**\n * Automatically complete the payment when the delay expires.\n *\n * @since 0.0.1\n */\n Complete = 'COMPLETE',\n /**\n * Automatically cancel the payment when the delay expires.\n *\n * @since 0.0.1\n */\n Cancel = 'CANCEL',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ReaderModel {\n /**\n * Square Reader for contactless and chip.\n *\n * @since 0.0.1\n */\n ContactlessAndChip = 'CONTACTLESS_AND_CHIP',\n /**\n * Square Reader for magstripe.\n *\n * @since 0.0.1\n */\n Magstripe = 'MAGSTRIPE',\n /**\n * Square Stand.\n *\n * @since 0.0.1\n */\n Stand = 'STAND',\n /**\n * Unknown reader model.\n *\n * @since 0.0.1\n */\n Unknown = 'UNKNOWN',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ReaderStatus {\n /**\n * Reader is paired, connected, and ready to accept payments.\n *\n * @since 0.0.1\n */\n Ready = 'READY',\n /**\n * Reader is connecting to Square servers.\n *\n * @since 0.0.1\n */\n ConnectingToSquare = 'CONNECTING_TO_SQUARE',\n /**\n * Reader is connecting to the mobile device.\n *\n * @since 0.0.1\n */\n ConnectingToDevice = 'CONNECTING_TO_DEVICE',\n /**\n * Reader has a hardware or connection error in an unrecoverable state.\n *\n * @since 0.0.1\n */\n Faulty = 'FAULTY',\n /**\n * Reader is connected but unable to process payments.\n *\n * @since 0.0.1\n */\n ReaderUnavailable = 'READER_UNAVAILABLE',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ReaderChange {\n /**\n * Reader battery started charging.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n BatteryDidBeginCharging = 'BATTERY_DID_BEGIN_CHARGING',\n /**\n * Reader battery stopped charging.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n BatteryDidEndCharging = 'BATTERY_DID_END_CHARGING',\n /**\n * Reader battery level changed.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n BatteryLevelDidChange = 'BATTERY_LEVEL_DID_CHANGE',\n /**\n * Reader battery charging status changed.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n BatteryCharging = 'BATTERY_CHARGING',\n /**\n * Reader was added.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n Added = 'ADDED',\n /**\n * Reader was removed.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n Removed = 'REMOVED',\n /**\n * Reader status changed.\n *\n * @since 0.0.1\n */\n StatusDidChange = 'STATUS_DID_CHANGE',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum UnavailableReason {\n /**\n * Bluetooth connection issue.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n BluetoothError = 'BLUETOOTH_ERROR',\n /**\n * Bluetooth failure.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n BluetoothFailure = 'BLUETOOTH_FAILURE',\n /**\n * Bluetooth is disabled.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n BluetoothDisabled = 'BLUETOOTH_DISABLED',\n /**\n * Reader firmware is updating.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n FirmwareUpdate = 'FIRMWARE_UPDATE',\n /**\n * Blocking firmware update.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n BlockingUpdate = 'BLOCKING_UPDATE',\n /**\n * Reader is unavailable offline.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n ReaderUnavailableOffline = 'READER_UNAVAILABLE_OFFLINE',\n /**\n * Device is in developer mode.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n DeviceDeveloperMode = 'DEVICE_DEVELOPER_MODE',\n /**\n * Unknown reason.\n *\n * @since 0.0.1\n */\n Unknown = 'UNKNOWN',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum PaymentType {\n /**\n * Payment processed online.\n *\n * @since 0.0.1\n */\n Online = 'ONLINE',\n /**\n * Payment processed offline.\n *\n * @since 0.0.1\n */\n Offline = 'OFFLINE',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum PaymentStatus {\n /**\n * Payment was completed successfully.\n *\n * @since 0.0.1\n */\n Completed = 'COMPLETED',\n /**\n * Payment was approved but not yet completed.\n *\n * @since 0.0.1\n */\n Approved = 'APPROVED',\n /**\n * Payment was canceled.\n *\n * @since 0.0.1\n */\n Canceled = 'CANCELED',\n /**\n * Payment failed.\n *\n * @since 0.0.1\n */\n Failed = 'FAILED',\n /**\n * Payment is pending.\n *\n * @since 0.0.1\n */\n Pending = 'PENDING',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum CardBrand {\n /**\n * Visa card.\n *\n * @since 0.0.1\n */\n Visa = 'VISA',\n /**\n * Mastercard.\n *\n * @since 0.0.1\n */\n Mastercard = 'MASTERCARD',\n /**\n * American Express card.\n *\n * @since 0.0.1\n */\n AmericanExpress = 'AMERICAN_EXPRESS',\n /**\n * Discover card.\n *\n * @since 0.0.1\n */\n Discover = 'DISCOVER',\n /**\n * Discover Diners card.\n *\n * @since 0.0.1\n */\n DiscoverDiners = 'DISCOVER_DINERS',\n /**\n * JCB card.\n *\n * @since 0.0.1\n */\n Jcb = 'JCB',\n /**\n * UnionPay card.\n *\n * @since 0.0.1\n */\n UnionPay = 'UNION_PAY',\n /**\n * Interac card.\n *\n * @since 0.0.1\n */\n Interac = 'INTERAC',\n /**\n * Eftpos card.\n *\n * @since 0.0.1\n */\n Eftpos = 'EFTPOS',\n /**\n * Other or unknown card brand.\n *\n * @since 0.0.1\n */\n Other = 'OTHER',\n}\n\n/**\n * @since 0.0.1\n */\nexport interface PermissionStatus {\n /**\n * Permission state for accessing location.\n *\n * Required to confirm that payments are occurring in a supported Square location.\n *\n * @since 0.0.1\n */\n location: PermissionState;\n /**\n * Permission state for recording audio.\n *\n * Required to receive data from magstripe readers.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n recordAudio?: PermissionState;\n /**\n * Permission state for Bluetooth connect.\n *\n * Required to receive data from contactless and chip readers.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n bluetoothConnect?: PermissionState;\n /**\n * Permission state for Bluetooth scan.\n *\n * Required to store information during checkout.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n bluetoothScan?: PermissionState;\n /**\n * Permission state for reading phone state.\n *\n * Required to identify the device sending information to Square servers.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n readPhoneState?: PermissionState;\n /**\n * Permission state for using Bluetooth.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n bluetooth?: PermissionState;\n}\n\n/**\n * @since 0.0.1\n */\nexport type CurrencyCode = string;\n\n/**\n * @since 0.0.1\n */\nexport enum ErrorCode {\n /**\n * The location ID is missing.\n *\n * @since 0.0.1\n */\n LocationIdMissing = 'LOCATION_ID_MISSING',\n /**\n * The access token is missing.\n *\n * @since 0.0.1\n */\n AccessTokenMissing = 'ACCESS_TOKEN_MISSING',\n /**\n * The serial number is missing.\n *\n * @since 0.0.1\n */\n SerialNumberMissing = 'SERIAL_NUMBER_MISSING',\n /**\n * The payment parameters are missing.\n *\n * @since 0.0.1\n */\n PaymentParametersMissing = 'PAYMENT_PARAMETERS_MISSING',\n /**\n * The prompt parameters are missing.\n *\n * @since 0.0.1\n */\n PromptParametersMissing = 'PROMPT_PARAMETERS_MISSING',\n /**\n * The amount money is missing.\n *\n * @since 0.0.1\n */\n AmountMoneyMissing = 'AMOUNT_MONEY_MISSING',\n /**\n * The payment attempt ID is missing.\n *\n * @since 0.0.1\n */\n PaymentAttemptIdMissing = 'PAYMENT_ATTEMPT_ID_MISSING',\n /**\n * The SDK is not initialized.\n *\n * @since 0.0.1\n */\n NotInitialized = 'NOT_INITIALIZED',\n /**\n * The SDK is not authorized.\n *\n * @since 0.0.1\n */\n NotAuthorized = 'NOT_AUTHORIZED',\n /**\n * A pairing process is already in progress.\n *\n * @since 0.0.1\n */\n PairingAlreadyInProgress = 'PAIRING_ALREADY_IN_PROGRESS',\n /**\n * No payment is in progress.\n *\n * @since 0.0.1\n */\n NoPaymentInProgress = 'NO_PAYMENT_IN_PROGRESS',\n /**\n * Reader not found.\n *\n * @since 0.0.1\n */\n ReaderNotFound = 'READER_NOT_FOUND',\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA6hCA;;GAEG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB;;;;OAIG;IACH,wCAAyB,CAAA;IACzB;;;;OAIG;IACH,kCAAmB,CAAA;AACrB,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,eAyBX;AAzBD,WAAY,eAAe;IACzB;;;;OAIG;IACH,8BAAW,CAAA;IACX;;;;OAIG;IACH,8BAAW,CAAA;IACX;;;;OAIG;IACH,kCAAe,CAAA;IACf;;;;OAIG;IACH,kCAAe,CAAA;AACjB,CAAC,EAzBW,eAAe,KAAf,eAAe,QAyB1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAmBX;AAnBD,WAAY,cAAc;IACxB;;;;OAIG;IACH,4CAA0B,CAAA;IAC1B;;;;OAIG;IACH,4CAA0B,CAAA;IAC1B;;;;OAIG;IACH,8CAA4B,CAAA;AAC9B,CAAC,EAnBW,cAAc,KAAd,cAAc,QAmBzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,UAaX;AAbD,WAAY,UAAU;IACpB;;;;OAIG;IACH,iCAAmB,CAAA;IACnB;;;;OAIG;IACH,+BAAiB,CAAA;AACnB,CAAC,EAbW,UAAU,KAAV,UAAU,QAarB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,uBAaX;AAbD,WAAY,uBAAuB;IACjC;;;;OAIG;IACH,0CAAe,CAAA;IACf;;;;OAIG;IACH,wCAAa,CAAA;AACf,CAAC,EAbW,uBAAuB,KAAvB,uBAAuB,QAalC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB;;;;OAIG;IACH,oCAAqB,CAAA;IACrB;;;;OAIG;IACH,gCAAiB,CAAA;AACnB,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,WA+BX;AA/BD,WAAY,WAAW;IACrB;;;;OAIG;IACH,0DAA2C,CAAA;IAC3C;;;;OAIG;IACH,sCAAuB,CAAA;IACvB;;;;OAIG;IACH,8BAAe,CAAA;IACf;;;;OAIG;IACH,sCAAuB,CAAA;IACvB;;;;OAIG;IACH,kCAAmB,CAAA;AACrB,CAAC,EA/BW,WAAW,KAAX,WAAW,QA+BtB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YA+BX;AA/BD,WAAY,YAAY;IACtB;;;;OAIG;IACH,+BAAe,CAAA;IACf;;;;OAIG;IACH,2DAA2C,CAAA;IAC3C;;;;OAIG;IACH,2DAA2C,CAAA;IAC3C;;;;OAIG;IACH,iCAAiB,CAAA;IACjB;;;;OAIG;IACH,wDAAwC,CAAA;AAC1C,CAAC,EA/BW,YAAY,KAAZ,YAAY,QA+BvB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAuDX;AAvDD,WAAY,YAAY;IACtB;;;;;;OAMG;IACH,sEAAsD,CAAA;IACtD;;;;;;OAMG;IACH,kEAAkD,CAAA;IAClD;;;;;;OAMG;IACH,kEAAkD,CAAA;IAClD;;;;;;OAMG;IACH,oDAAoC,CAAA;IACpC;;;;;;OAMG;IACH,+BAAe,CAAA;IACf;;;;;;OAMG;IACH,mCAAmB,CAAA;IACnB;;;;OAIG;IACH,qDAAqC,CAAA;AACvC,CAAC,EAvDW,YAAY,KAAZ,YAAY,QAuDvB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,iBA+DX;AA/DD,WAAY,iBAAiB;IAC3B;;;;;;OAMG;IACH,uDAAkC,CAAA;IAClC;;;;;;OAMG;IACH,2DAAsC,CAAA;IACtC;;;;;;OAMG;IACH,6DAAwC,CAAA;IACxC;;;;;;OAMG;IACH,uDAAkC,CAAA;IAClC;;;;;;OAMG;IACH,uDAAkC,CAAA;IAClC;;;;;;OAMG;IACH,4EAAuD,CAAA;IACvD;;;;;;OAMG;IACH,kEAA6C,CAAA;IAC7C;;;;OAIG;IACH,wCAAmB,CAAA;AACrB,CAAC,EA/DW,iBAAiB,KAAjB,iBAAiB,QA+D5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB;;;;OAIG;IACH,gCAAiB,CAAA;IACjB;;;;OAIG;IACH,kCAAmB,CAAA;AACrB,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,aA+BX;AA/BD,WAAY,aAAa;IACvB;;;;OAIG;IACH,wCAAuB,CAAA;IACvB;;;;OAIG;IACH,sCAAqB,CAAA;IACrB;;;;OAIG;IACH,sCAAqB,CAAA;IACrB;;;;OAIG;IACH,kCAAiB,CAAA;IACjB;;;;OAIG;IACH,oCAAmB,CAAA;AACrB,CAAC,EA/BW,aAAa,KAAb,aAAa,QA+BxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SA6DX;AA7DD,WAAY,SAAS;IACnB;;;;OAIG;IACH,0BAAa,CAAA;IACb;;;;OAIG;IACH,sCAAyB,CAAA;IACzB;;;;OAIG;IACH,iDAAoC,CAAA;IACpC;;;;OAIG;IACH,kCAAqB,CAAA;IACrB;;;;OAIG;IACH,+CAAkC,CAAA;IAClC;;;;OAIG;IACH,wBAAW,CAAA;IACX;;;;OAIG;IACH,mCAAsB,CAAA;IACtB;;;;OAIG;IACH,gCAAmB,CAAA;IACnB;;;;OAIG;IACH,8BAAiB,CAAA;IACjB;;;;OAIG;IACH,4BAAe,CAAA;AACjB,CAAC,EA7DW,SAAS,KAAT,SAAS,QA6DpB;AAmED;;GAEG;AACH,MAAM,CAAN,IAAY,SAyEX;AAzED,WAAY,SAAS;IACnB;;;;OAIG;IACH,sDAAyC,CAAA;IACzC;;;;OAIG;IACH,wDAA2C,CAAA;IAC3C;;;;OAIG;IACH,0DAA6C,CAAA;IAC7C;;;;OAIG;IACH,oEAAuD,CAAA;IACvD;;;;OAIG;IACH,kEAAqD,CAAA;IACrD;;;;OAIG;IACH,wDAA2C,CAAA;IAC3C;;;;OAIG;IACH,mEAAsD,CAAA;IACtD;;;;OAIG;IACH,+CAAkC,CAAA;IAClC;;;;OAIG;IACH,6CAAgC,CAAA;IAChC;;;;OAIG;IACH,qEAAwD,CAAA;IACxD;;;;OAIG;IACH,2DAA8C,CAAA;IAC9C;;;;OAIG;IACH,gDAAmC,CAAA;AACrC,CAAC,EAzEW,SAAS,KAAT,SAAS,QAyEpB","sourcesContent":["import type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\n/**\n * @since 0.0.1\n */\nexport interface SquareMobilePaymentsPlugin {\n /**\n * Initialize the Square Mobile Payments SDK.\n *\n * This method must be called before any other method.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n initialize(options: InitializeOptions): Promise<void>;\n /**\n * Authorize the SDK with a Square access token.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n authorize(options: AuthorizeOptions): Promise<void>;\n /**\n * Check if the SDK is currently authorized.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n isAuthorized(): Promise<IsAuthorizedResult>;\n /**\n * Deauthorize the SDK and clear the current authorization.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n deauthorize(): Promise<void>;\n /**\n * Show the Square settings screen.\n *\n * This displays a pre-built settings UI where merchants can view and manage\n * their paired readers.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n showSettings(): Promise<void>;\n /**\n * Show the Mock Reader UI for testing.\n *\n * This displays a mock reader interface for testing payment flows without\n * physical hardware. This is only for development and testing purposes and\n * is therefore only available in debug builds.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.1\n */\n showMockReader(): Promise<void>;\n /**\n * Hide the Mock Reader UI.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.1\n */\n hideMockReader(): Promise<void>;\n /**\n * Get the current SDK settings.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n getSettings(): Promise<GetSettingsResult>;\n /**\n * Start pairing with a Square reader.\n *\n * This initiates the reader pairing process. The SDK will search for nearby\n * readers and pair with the first one found.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n startPairing(): Promise<void>;\n /**\n * Stop the reader pairing process.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n stopPairing(): Promise<void>;\n /**\n * Check if a pairing process is currently in progress.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n isPairingInProgress(): Promise<IsPairingInProgressResult>;\n /**\n * Get a list of all paired readers.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n getReaders(): Promise<GetReadersResult>;\n /**\n * Forget a paired reader.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n forgetReader(options: ForgetReaderOptions): Promise<void>;\n /**\n * Retry connecting to a reader.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n retryConnection(options: RetryConnectionOptions): Promise<void>;\n /**\n * Start a payment flow.\n *\n * This presents the payment UI and processes the payment using the specified\n * parameters. Only one payment can be active at a time.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n startPayment(options: StartPaymentOptions): Promise<void>;\n /**\n * Cancel an ongoing payment.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n cancelPayment(): Promise<void>;\n /**\n * Get the currently available card input methods.\n *\n * This returns the card entry methods that are available based on the\n * connected readers (e.g., TAP, DIP, SWIPE, KEYED).\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n getAvailableCardInputMethods(): Promise<GetAvailableCardInputMethodsResult>;\n /**\n * Link a Square seller account with an Apple ID for Tap to Pay on iPhone.\n *\n * Presents an Apple sheet prompting the user to accept the Tap to Pay\n * on iPhone terms and conditions.\n *\n * Only available on iOS.\n *\n * @since 0.1.3\n */\n linkAppleAccount(): Promise<void>;\n /**\n * Re-link a Square seller account with a different Apple ID.\n *\n * Presents an Apple sheet to change the associated Apple ID by\n * showing the Tap to Pay terms and conditions again.\n *\n * Only available on iOS.\n *\n * @since 0.1.3\n */\n relinkAppleAccount(): Promise<void>;\n /**\n * Check if an Apple ID is already linked to a Square seller account.\n *\n * Only available on iOS.\n *\n * @since 0.1.3\n */\n isAppleAccountLinked(): Promise<IsAppleAccountLinkedResult>;\n /**\n * Check if the device is capable of Tap to Pay on iPhone.\n *\n * Only available on iOS.\n *\n * @since 0.1.3\n */\n isDeviceCapable(): Promise<IsDeviceCapableResult>;\n /**\n * Check the current permission status.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n checkPermissions(): Promise<PermissionStatus>;\n /**\n * Request the required permissions.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n requestPermissions(): Promise<PermissionStatus>;\n /**\n * Listen for reader pairing events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerPairingDidBegin',\n listenerFunc: ReaderPairingDidBeginListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for successful reader pairing events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerPairingDidSucceed',\n listenerFunc: ReaderPairingDidSucceedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for failed reader pairing events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerPairingDidFail',\n listenerFunc: ReaderPairingDidFailListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for reader added events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerWasAdded',\n listenerFunc: ReaderWasAddedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for reader removed events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerWasRemoved',\n listenerFunc: ReaderWasRemovedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for reader status and property changes.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'readerDidChange',\n listenerFunc: ReaderDidChangeListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for available card input method changes.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'availableCardInputMethodsDidChange',\n listenerFunc: AvailableCardInputMethodsDidChangeListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for successful payment completion events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'paymentDidFinish',\n listenerFunc: PaymentDidFinishListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for failed payment events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'paymentDidFail',\n listenerFunc: PaymentDidFailListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for cancelled payment events.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n addListener(\n eventName: 'paymentDidCancel',\n listenerFunc: PaymentDidCancelListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * Only available on Android and iOS.\n *\n * @since 0.0.1\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface InitializeOptions {\n /**\n * The Square location ID.\n *\n * @since 0.0.1\n * @example 'LOCATION_ID'\n */\n locationId: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface AuthorizeOptions {\n /**\n * The Square access token.\n *\n * @since 0.0.1\n * @example 'EAAAEOuLQPDbLd...'\n */\n accessToken: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface IsAuthorizedResult {\n /**\n * Whether the SDK is currently authorized.\n *\n * @since 0.0.1\n */\n authorized: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface GetSettingsResult {\n /**\n * The SDK version.\n *\n * @since 0.0.1\n * @example '2.0.0'\n */\n version: string;\n /**\n * The current environment.\n *\n * @since 0.0.1\n * @example 'production'\n */\n environment: Environment;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface IsPairingInProgressResult {\n /**\n * Whether a pairing process is currently in progress.\n *\n * @since 0.0.1\n */\n inProgress: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface GetReadersResult {\n /**\n * The list of paired readers.\n *\n * @since 0.0.1\n */\n readers: ReaderInfo[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ForgetReaderOptions {\n /**\n * The serial number of the reader to forget.\n *\n * @since 0.0.1\n * @example 'CRR123456789'\n */\n serialNumber: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface RetryConnectionOptions {\n /**\n * The serial number of the reader to retry connection.\n *\n * @since 0.0.1\n * @example 'CRR123456789'\n */\n serialNumber: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface StartPaymentOptions {\n /**\n * The payment parameters.\n *\n * @since 0.0.1\n */\n paymentParameters: PaymentParameters;\n /**\n * The prompt parameters.\n *\n * @since 0.0.1\n */\n promptParameters: PromptParameters;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface PaymentParameters {\n /**\n * The amount of money to charge.\n *\n * @since 0.0.1\n */\n amountMoney: Money;\n /**\n * A unique identifier for this payment attempt.\n *\n * This is used for idempotent payment requests.\n *\n * @since 0.0.1\n * @example 'a1b2c3d4-e5f6-4a5b-8c9d-1e2f3a4b5c6d'\n */\n paymentAttemptId: string;\n /**\n * The processing mode for this payment.\n *\n * @since 0.0.1\n * @default ProcessingMode.AutoDetect\n */\n processingMode?: ProcessingMode;\n /**\n * A user-defined reference ID to associate with the payment.\n *\n * @since 0.0.1\n * @example 'ORDER-12345'\n */\n referenceId?: string;\n /**\n * An optional note to add to the payment.\n *\n * @since 0.0.1\n * @example 'Birthday gift'\n */\n note?: string;\n /**\n * The Square order ID to associate with this payment.\n *\n * @since 0.0.1\n * @example 'CAISENgvlJ6jLWAzERDzjyHVybY'\n */\n orderId?: string;\n /**\n * The tip amount.\n *\n * @since 0.0.1\n */\n tipMoney?: Money;\n /**\n * The application fee.\n *\n * @since 0.0.1\n */\n applicationFee?: Money;\n /**\n * Whether to automatically complete the payment.\n *\n * If false, the payment will be authorized but not captured, requiring\n * manual completion via the Payments API.\n *\n * @since 0.0.1\n * @default true\n */\n autocomplete?: boolean;\n /**\n * The duration to delay before automatically completing or canceling the payment.\n *\n * Only applicable when autocomplete is false.\n *\n * @since 0.0.1\n * @example 'PT1H'\n */\n delayDuration?: string;\n /**\n * The action to take when the delay duration expires.\n *\n * Only applicable when autocomplete is false.\n *\n * @since 0.0.1\n */\n delayAction?: DelayAction;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface PromptParameters {\n /**\n * The prompt mode.\n *\n * @since 0.0.1\n * @default PromptMode.Default\n */\n mode?: PromptMode;\n /**\n * Additional payment methods to allow.\n *\n * @since 0.0.1\n * @default []\n */\n additionalMethods?: AdditionalPaymentMethod[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface Money {\n /**\n * The amount in the smallest currency unit (e.g., cents for USD).\n *\n * @since 0.0.1\n * @example 100\n */\n amount: number;\n /**\n * The ISO 4217 currency code.\n *\n * @since 0.0.1\n * @example 'USD'\n */\n currency: CurrencyCode;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface GetAvailableCardInputMethodsResult {\n /**\n * The available card input methods.\n *\n * @since 0.0.1\n */\n cardInputMethods: CardInputMethod[];\n}\n\n/**\n * @since 0.1.3\n */\nexport interface IsAppleAccountLinkedResult {\n /**\n * Whether an Apple ID is linked to the Square seller account.\n *\n * @since 0.1.3\n */\n linked: boolean;\n}\n\n/**\n * @since 0.1.3\n */\nexport interface IsDeviceCapableResult {\n /**\n * Whether the device is capable of Tap to Pay on iPhone.\n *\n * @since 0.1.3\n */\n capable: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderInfo {\n /**\n * The reader's serial number.\n *\n * @since 0.0.1\n * @example 'CRR123456789'\n */\n serialNumber: string;\n /**\n * The reader's model.\n *\n * @since 0.0.1\n */\n model: ReaderModel;\n /**\n * The reader's current status.\n *\n * @since 0.0.1\n */\n status: ReaderStatus;\n /**\n * The reader's firmware version.\n *\n * @since 0.0.1\n * @example '1.2.3'\n */\n firmwareVersion?: string;\n /**\n * The reader's battery level (0-100).\n *\n * @since 0.0.1\n * @example 85\n */\n batteryLevel?: number;\n /**\n * Whether the reader is currently charging.\n *\n * @since 0.0.1\n */\n isCharging?: boolean;\n /**\n * The card input methods supported by this reader.\n *\n * @since 0.0.1\n */\n supportedCardInputMethods: CardInputMethod[];\n /**\n * Additional information about why the reader is unavailable.\n *\n * Only present when status is ReaderUnavailable.\n *\n * @since 0.0.1\n */\n unavailableReasonInfo?: UnavailableReasonInfo;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface UnavailableReasonInfo {\n /**\n * The reason code why the reader is unavailable.\n *\n * @since 0.0.1\n */\n reason: UnavailableReason;\n /**\n * A human-readable message describing why the reader is unavailable.\n *\n * @since 0.0.1\n */\n message?: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface Payment {\n /**\n * The unique identifier for this payment.\n *\n * For offline payments, this may be null until synced.\n *\n * @since 0.0.1\n * @example 'AbCdEfGhIjKlMnOpQrStUvWxYz'\n */\n id: string | null;\n /**\n * The payment type.\n *\n * @since 0.0.1\n */\n type: PaymentType;\n /**\n * The payment status.\n *\n * @since 0.0.1\n */\n status: PaymentStatus;\n /**\n * The amount paid.\n *\n * @since 0.0.1\n */\n amountMoney: Money;\n /**\n * The tip amount.\n *\n * @since 0.0.1\n */\n tipMoney?: Money;\n /**\n * The application fee.\n *\n * @since 0.0.1\n */\n applicationFee?: Money;\n /**\n * The reference ID provided in the payment parameters.\n *\n * @since 0.0.1\n */\n referenceId?: string;\n /**\n * The order ID associated with this payment.\n *\n * @since 0.0.1\n */\n orderId?: string;\n /**\n * Card payment details.\n *\n * Only present for card payments.\n *\n * @since 0.0.1\n */\n cardDetails?: CardPaymentDetails;\n /**\n * The time the payment was created (ISO 8601 format).\n *\n * @since 0.0.1\n * @example '2024-01-15T10:30:00Z'\n */\n createdAt?: string;\n /**\n * The time the payment was updated (ISO 8601 format).\n *\n * @since 0.0.1\n * @example '2024-01-15T10:30:00Z'\n */\n updatedAt?: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface CardPaymentDetails {\n /**\n * The card information.\n *\n * @since 0.0.1\n */\n card: Card;\n /**\n * The card entry method used.\n *\n * @since 0.0.1\n */\n entryMethod: CardInputMethod;\n /**\n * The authorization code.\n *\n * @since 0.0.1\n * @example '123456'\n */\n authorizationCode?: string;\n /**\n * The EMV application name.\n *\n * @since 0.0.1\n * @example 'VISA CREDIT'\n */\n applicationName?: string;\n /**\n * The EMV application identifier.\n *\n * @since 0.0.1\n * @example 'A0000000031010'\n */\n applicationId?: string;\n}\n\n/**\n * @since 0.0.1\n */\nexport interface Card {\n /**\n * The card brand.\n *\n * @since 0.0.1\n */\n brand: CardBrand;\n /**\n * The last four digits of the card number.\n *\n * @since 0.0.1\n * @example '1234'\n */\n lastFourDigits: string;\n /**\n * The cardholder name.\n *\n * @since 0.0.1\n * @example 'John Doe'\n */\n cardholderName?: string;\n /**\n * The card expiration month (1-12).\n *\n * @since 0.0.1\n * @example 12\n */\n expirationMonth?: number;\n /**\n * The card expiration year.\n *\n * @since 0.0.1\n * @example 2025\n */\n expirationYear?: number;\n}\n\n/**\n * Callback to receive reader pairing start notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderPairingDidBeginListener = () => void;\n\n/**\n * Callback to receive reader pairing success notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderPairingDidSucceedListener = () => void;\n\n/**\n * Callback to receive reader pairing failure notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderPairingDidFailListener = (\n event: ReaderPairingDidFailEvent,\n) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderPairingDidFailEvent {\n /**\n * The error code.\n *\n * @since 0.0.1\n */\n code?: string;\n /**\n * The error message.\n *\n * @since 0.0.1\n */\n message: string;\n}\n\n/**\n * Callback to receive reader added notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderWasAddedListener = (event: ReaderWasAddedEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderWasAddedEvent {\n /**\n * The reader that was added.\n *\n * @since 0.0.1\n */\n reader: ReaderInfo;\n}\n\n/**\n * Callback to receive reader removed notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderWasRemovedListener = (event: ReaderWasRemovedEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderWasRemovedEvent {\n /**\n * The reader that was removed.\n *\n * @since 0.0.1\n */\n reader: ReaderInfo;\n}\n\n/**\n * Callback to receive reader change notifications.\n *\n * @since 0.0.1\n */\nexport type ReaderDidChangeListener = (event: ReaderDidChangeEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface ReaderDidChangeEvent {\n /**\n * The reader that changed.\n *\n * @since 0.0.1\n */\n reader: ReaderInfo;\n /**\n * The type of change that occurred.\n *\n * @since 0.0.1\n */\n change: ReaderChange;\n}\n\n/**\n * Callback to receive available card input method change notifications.\n *\n * @since 0.0.1\n */\nexport type AvailableCardInputMethodsDidChangeListener = (\n event: AvailableCardInputMethodsDidChangeEvent,\n) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface AvailableCardInputMethodsDidChangeEvent {\n /**\n * The available card input methods.\n *\n * @since 0.0.1\n */\n cardInputMethods: CardInputMethod[];\n}\n\n/**\n * Callback to receive payment completion notifications.\n *\n * @since 0.0.1\n */\nexport type PaymentDidFinishListener = (event: PaymentDidFinishEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface PaymentDidFinishEvent {\n /**\n * The completed payment.\n *\n * @since 0.0.1\n */\n payment: Payment;\n}\n\n/**\n * Callback to receive payment failure notifications.\n *\n * @since 0.0.1\n */\nexport type PaymentDidFailListener = (event: PaymentDidFailEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface PaymentDidFailEvent {\n /**\n * The failed payment.\n *\n * @since 0.0.1\n */\n payment?: Payment;\n /**\n * The error code.\n *\n * @since 0.0.1\n */\n code?: string;\n /**\n * The error message.\n *\n * @since 0.0.1\n */\n message: string;\n}\n\n/**\n * Callback to receive payment cancellation notifications.\n *\n * @since 0.0.1\n */\nexport type PaymentDidCancelListener = (event: PaymentDidCancelEvent) => void;\n\n/**\n * @since 0.0.1\n */\nexport interface PaymentDidCancelEvent {\n /**\n * The cancelled payment.\n *\n * @since 0.0.1\n */\n payment?: Payment;\n}\n\n/**\n * @since 0.0.1\n */\nexport enum Environment {\n /**\n * Production environment.\n *\n * @since 0.0.1\n */\n Production = 'production',\n /**\n * Sandbox environment for testing.\n *\n * @since 0.0.1\n */\n Sandbox = 'sandbox',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum CardInputMethod {\n /**\n * Contactless card tap (NFC).\n *\n * @since 0.0.1\n */\n Tap = 'TAP',\n /**\n * EMV chip card insertion.\n *\n * @since 0.0.1\n */\n Dip = 'DIP',\n /**\n * Magnetic stripe swipe.\n *\n * @since 0.0.1\n */\n Swipe = 'SWIPE',\n /**\n * Manually keyed card entry.\n *\n * @since 0.0.1\n */\n Keyed = 'KEYED',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ProcessingMode {\n /**\n * Automatically detect the best processing mode (online or offline).\n *\n * @since 0.0.1\n */\n AutoDetect = 'AUTO_DETECT',\n /**\n * Process the payment online only.\n *\n * @since 0.0.1\n */\n OnlineOnly = 'ONLINE_ONLY',\n /**\n * Allow offline payment processing.\n *\n * @since 0.0.1\n */\n OfflineOnly = 'OFFLINE_ONLY',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum PromptMode {\n /**\n * Use the default Square payment UI.\n *\n * @since 0.0.1\n */\n Default = 'DEFAULT',\n /**\n * Use a custom payment UI.\n *\n * @since 0.0.1\n */\n Custom = 'CUSTOM',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum AdditionalPaymentMethod {\n /**\n * Allow manually keyed card entry.\n *\n * @since 0.0.1\n */\n Keyed = 'KEYED',\n /**\n * Allow cash payments.\n *\n * @since 0.0.1\n */\n Cash = 'CASH',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum DelayAction {\n /**\n * Automatically complete the payment when the delay expires.\n *\n * @since 0.0.1\n */\n Complete = 'COMPLETE',\n /**\n * Automatically cancel the payment when the delay expires.\n *\n * @since 0.0.1\n */\n Cancel = 'CANCEL',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ReaderModel {\n /**\n * Square Reader for contactless and chip.\n *\n * @since 0.0.1\n */\n ContactlessAndChip = 'CONTACTLESS_AND_CHIP',\n /**\n * Square Reader for magstripe.\n *\n * @since 0.0.1\n */\n Magstripe = 'MAGSTRIPE',\n /**\n * Square Stand.\n *\n * @since 0.0.1\n */\n Stand = 'STAND',\n /**\n * Tap to Pay on iPhone.\n *\n * @since 0.1.3\n */\n TapToPay = 'TAP_TO_PAY',\n /**\n * Unknown reader model.\n *\n * @since 0.0.1\n */\n Unknown = 'UNKNOWN',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ReaderStatus {\n /**\n * Reader is paired, connected, and ready to accept payments.\n *\n * @since 0.0.1\n */\n Ready = 'READY',\n /**\n * Reader is connecting to Square servers.\n *\n * @since 0.0.1\n */\n ConnectingToSquare = 'CONNECTING_TO_SQUARE',\n /**\n * Reader is connecting to the mobile device.\n *\n * @since 0.0.1\n */\n ConnectingToDevice = 'CONNECTING_TO_DEVICE',\n /**\n * Reader has a hardware or connection error in an unrecoverable state.\n *\n * @since 0.0.1\n */\n Faulty = 'FAULTY',\n /**\n * Reader is connected but unable to process payments.\n *\n * @since 0.0.1\n */\n ReaderUnavailable = 'READER_UNAVAILABLE',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ReaderChange {\n /**\n * Reader battery started charging.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n BatteryDidBeginCharging = 'BATTERY_DID_BEGIN_CHARGING',\n /**\n * Reader battery stopped charging.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n BatteryDidEndCharging = 'BATTERY_DID_END_CHARGING',\n /**\n * Reader battery level changed.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n BatteryLevelDidChange = 'BATTERY_LEVEL_DID_CHANGE',\n /**\n * Reader battery charging status changed.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n BatteryCharging = 'BATTERY_CHARGING',\n /**\n * Reader was added.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n Added = 'ADDED',\n /**\n * Reader was removed.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n Removed = 'REMOVED',\n /**\n * Reader status changed.\n *\n * @since 0.0.1\n */\n StatusDidChange = 'STATUS_DID_CHANGE',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum UnavailableReason {\n /**\n * Bluetooth connection issue.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n BluetoothError = 'BLUETOOTH_ERROR',\n /**\n * Bluetooth failure.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n BluetoothFailure = 'BLUETOOTH_FAILURE',\n /**\n * Bluetooth is disabled.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n BluetoothDisabled = 'BLUETOOTH_DISABLED',\n /**\n * Reader firmware is updating.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n FirmwareUpdate = 'FIRMWARE_UPDATE',\n /**\n * Blocking firmware update.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n BlockingUpdate = 'BLOCKING_UPDATE',\n /**\n * Reader is unavailable offline.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n ReaderUnavailableOffline = 'READER_UNAVAILABLE_OFFLINE',\n /**\n * Device is in developer mode.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n DeviceDeveloperMode = 'DEVICE_DEVELOPER_MODE',\n /**\n * Unknown reason.\n *\n * @since 0.0.1\n */\n Unknown = 'UNKNOWN',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum PaymentType {\n /**\n * Payment processed online.\n *\n * @since 0.0.1\n */\n Online = 'ONLINE',\n /**\n * Payment processed offline.\n *\n * @since 0.0.1\n */\n Offline = 'OFFLINE',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum PaymentStatus {\n /**\n * Payment was completed successfully.\n *\n * @since 0.0.1\n */\n Completed = 'COMPLETED',\n /**\n * Payment was approved but not yet completed.\n *\n * @since 0.0.1\n */\n Approved = 'APPROVED',\n /**\n * Payment was canceled.\n *\n * @since 0.0.1\n */\n Canceled = 'CANCELED',\n /**\n * Payment failed.\n *\n * @since 0.0.1\n */\n Failed = 'FAILED',\n /**\n * Payment is pending.\n *\n * @since 0.0.1\n */\n Pending = 'PENDING',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum CardBrand {\n /**\n * Visa card.\n *\n * @since 0.0.1\n */\n Visa = 'VISA',\n /**\n * Mastercard.\n *\n * @since 0.0.1\n */\n Mastercard = 'MASTERCARD',\n /**\n * American Express card.\n *\n * @since 0.0.1\n */\n AmericanExpress = 'AMERICAN_EXPRESS',\n /**\n * Discover card.\n *\n * @since 0.0.1\n */\n Discover = 'DISCOVER',\n /**\n * Discover Diners card.\n *\n * @since 0.0.1\n */\n DiscoverDiners = 'DISCOVER_DINERS',\n /**\n * JCB card.\n *\n * @since 0.0.1\n */\n Jcb = 'JCB',\n /**\n * UnionPay card.\n *\n * @since 0.0.1\n */\n UnionPay = 'UNION_PAY',\n /**\n * Interac card.\n *\n * @since 0.0.1\n */\n Interac = 'INTERAC',\n /**\n * Eftpos card.\n *\n * @since 0.0.1\n */\n Eftpos = 'EFTPOS',\n /**\n * Other or unknown card brand.\n *\n * @since 0.0.1\n */\n Other = 'OTHER',\n}\n\n/**\n * @since 0.0.1\n */\nexport interface PermissionStatus {\n /**\n * Permission state for accessing location.\n *\n * Required to confirm that payments are occurring in a supported Square location.\n *\n * @since 0.0.1\n */\n location: PermissionState;\n /**\n * Permission state for recording audio.\n *\n * Required to receive data from magstripe readers.\n *\n * @since 0.0.1\n */\n recordAudio?: PermissionState;\n /**\n * Permission state for Bluetooth connect.\n *\n * Required to receive data from contactless and chip readers.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n bluetoothConnect?: PermissionState;\n /**\n * Permission state for Bluetooth scan.\n *\n * Required to store information during checkout.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n bluetoothScan?: PermissionState;\n /**\n * Permission state for reading phone state.\n *\n * Required to identify the device sending information to Square servers.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n */\n readPhoneState?: PermissionState;\n /**\n * Permission state for using Bluetooth.\n *\n * Only available on iOS.\n *\n * @since 0.0.1\n */\n bluetooth?: PermissionState;\n}\n\n/**\n * @since 0.0.1\n */\nexport type CurrencyCode = string;\n\n/**\n * @since 0.0.1\n */\nexport enum ErrorCode {\n /**\n * The location ID is missing.\n *\n * @since 0.0.1\n */\n LocationIdMissing = 'LOCATION_ID_MISSING',\n /**\n * The access token is missing.\n *\n * @since 0.0.1\n */\n AccessTokenMissing = 'ACCESS_TOKEN_MISSING',\n /**\n * The serial number is missing.\n *\n * @since 0.0.1\n */\n SerialNumberMissing = 'SERIAL_NUMBER_MISSING',\n /**\n * The payment parameters are missing.\n *\n * @since 0.0.1\n */\n PaymentParametersMissing = 'PAYMENT_PARAMETERS_MISSING',\n /**\n * The prompt parameters are missing.\n *\n * @since 0.0.1\n */\n PromptParametersMissing = 'PROMPT_PARAMETERS_MISSING',\n /**\n * The amount money is missing.\n *\n * @since 0.0.1\n */\n AmountMoneyMissing = 'AMOUNT_MONEY_MISSING',\n /**\n * The payment attempt ID is missing.\n *\n * @since 0.0.1\n */\n PaymentAttemptIdMissing = 'PAYMENT_ATTEMPT_ID_MISSING',\n /**\n * The SDK is not initialized.\n *\n * @since 0.0.1\n */\n NotInitialized = 'NOT_INITIALIZED',\n /**\n * The SDK is not authorized.\n *\n * @since 0.0.1\n */\n NotAuthorized = 'NOT_AUTHORIZED',\n /**\n * A pairing process is already in progress.\n *\n * @since 0.0.1\n */\n PairingAlreadyInProgress = 'PAIRING_ALREADY_IN_PROGRESS',\n /**\n * No payment is in progress.\n *\n * @since 0.0.1\n */\n NoPaymentInProgress = 'NO_PAYMENT_IN_PROGRESS',\n /**\n * Reader not found.\n *\n * @since 0.0.1\n */\n ReaderNotFound = 'READER_NOT_FOUND',\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- import type { AuthorizeOptions, ForgetReaderOptions, GetAvailableCardInputMethodsResult, GetReadersResult, GetSettingsResult, InitializeOptions, IsAuthorizedResult, IsPairingInProgressResult, PermissionStatus, RetryConnectionOptions, SquareMobilePaymentsPlugin, StartPaymentOptions } from './definitions';
2
+ import type { AuthorizeOptions, ForgetReaderOptions, GetAvailableCardInputMethodsResult, GetReadersResult, GetSettingsResult, InitializeOptions, IsAppleAccountLinkedResult, IsAuthorizedResult, IsDeviceCapableResult, IsPairingInProgressResult, PermissionStatus, RetryConnectionOptions, SquareMobilePaymentsPlugin, StartPaymentOptions } from './definitions';
3
3
  export declare class SquareMobilePaymentsWeb extends WebPlugin implements SquareMobilePaymentsPlugin {
4
4
  initialize(_options: InitializeOptions): Promise<void>;
5
5
  authorize(_options: AuthorizeOptions): Promise<void>;
@@ -18,6 +18,10 @@ export declare class SquareMobilePaymentsWeb extends WebPlugin implements Square
18
18
  startPayment(_options: StartPaymentOptions): Promise<void>;
19
19
  cancelPayment(): Promise<void>;
20
20
  getAvailableCardInputMethods(): Promise<GetAvailableCardInputMethodsResult>;
21
+ linkAppleAccount(): Promise<void>;
22
+ relinkAppleAccount(): Promise<void>;
23
+ isAppleAccountLinked(): Promise<IsAppleAccountLinkedResult>;
24
+ isDeviceCapable(): Promise<IsDeviceCapableResult>;
21
25
  checkPermissions(): Promise<PermissionStatus>;
22
26
  requestPermissions(): Promise<PermissionStatus>;
23
27
  }