@capacitor-community/stripe-terminal 5.4.1 → 5.4.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.
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '13.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'StripeTerminal', '~> 2.17.1'
16
+ s.dependency 'StripeTerminal', '~> 3.3.1'
17
17
  s.swift_version = '5.1'
18
18
  end
@@ -7,7 +7,7 @@ ext {
7
7
  playServicesWalletVersion = project.hasProperty('playServicesWalletVersion') ? rootProject.ext.playServicesWalletVersion : '19.2.+'
8
8
  volleyVersion = project.hasProperty('volleyVersion') ? rootProject.ext.volleyVersion : '1.2.1'
9
9
  stripeterminalLocalmobileVersion = project.hasProperty('stripeterminalLocalmobileVersion') ? rootProject.ext.stripeterminalLocalmobileVersion : '3.0.+'
10
- stripeterminalCoreVersion = project.hasProperty('stripeterminalCoreVersion') ? rootProject.ext.stripeterminalCoreVersion : '3.1.+'
10
+ stripeterminalCoreVersion = project.hasProperty('stripeterminalCoreVersion') ? rootProject.ext.stripeterminalCoreVersion : '3.3.+'
11
11
  }
12
12
 
13
13
  buildscript {
@@ -27,27 +27,28 @@ public class StripeTerminal: NSObject, DiscoveryDelegate, LocalMobileReaderDeleg
27
27
 
28
28
  func discoverReaders(_ call: CAPPluginCall) throws {
29
29
  let connectType = call.getString("type")
30
+ let config: DiscoveryConfiguration
31
+ self.locationId = call.getString("locationId")
30
32
 
31
33
  if TerminalConnectTypes.TapToPay.rawValue == connectType {
32
34
  self.type = .localMobile
35
+ config = try LocalMobileDiscoveryConfigurationBuilder().setSimulated(self.isTest!).build()
33
36
  } else if TerminalConnectTypes.Internet.rawValue == connectType {
34
37
  self.type = .internet
38
+ config = try InternetDiscoveryConfigurationBuilder()
39
+ .setLocationId(self.locationId)
40
+ .setSimulated(self.isTest!)
41
+ .build()
35
42
  } else if TerminalConnectTypes.Bluetooth.rawValue == connectType {
36
43
  self.type = DiscoveryMethod.bluetoothScan
44
+ config = try BluetoothScanDiscoveryConfigurationBuilder().setSimulated(self.isTest!).build()
37
45
  } else {
38
46
  call.unimplemented(connectType! + " is not support now")
39
47
  return
40
48
  }
41
-
42
49
 
43
- let config = DiscoveryConfiguration(
44
- discoveryMethod: self.type!,
45
- simulated: self.isTest!
46
- )
47
-
50
+
48
51
  self.discoverCall = call
49
- self.locationId = call.getString("locationId")
50
-
51
52
  self.discoverCancelable = Terminal.shared.discoverReaders(config, delegate: self) { error in
52
53
  if let error = error {
53
54
  print("discoverReaders failed: \(error)")
@@ -130,9 +131,10 @@ public class StripeTerminal: NSObject, DiscoveryDelegate, LocalMobileReaderDeleg
130
131
  }
131
132
 
132
133
  private func connectLocalMobileReader(_ call: CAPPluginCall) {
133
- let connectionConfig = LocalMobileConnectionConfiguration(locationId: self.locationId!)
134
+ let connectionConfig = try! LocalMobileConnectionConfigurationBuilder.init(locationId: self.locationId!).build()
134
135
  let reader: JSObject = call.getObject("reader")!
135
136
  let index: Int = reader["index"] as! Int
137
+
136
138
 
137
139
  Terminal.shared.connectLocalMobileReader(self.readers![index], delegate: self, connectionConfig: connectionConfig) { reader, error in
138
140
  if let reader = reader {
@@ -145,7 +147,9 @@ public class StripeTerminal: NSObject, DiscoveryDelegate, LocalMobileReaderDeleg
145
147
  }
146
148
 
147
149
  private func connectInternetReader(_ call: CAPPluginCall) {
148
- let config = InternetConnectionConfiguration(failIfInUse: true)
150
+ let config = try! InternetConnectionConfigurationBuilder()
151
+ .setFailIfInUse(true)
152
+ .build()
149
153
  let reader: JSObject = call.getObject("reader")!
150
154
  let index: Int = reader["index"] as! Int
151
155
 
@@ -160,7 +164,7 @@ public class StripeTerminal: NSObject, DiscoveryDelegate, LocalMobileReaderDeleg
160
164
  }
161
165
 
162
166
  private func connectBluetoothReader(_ call: CAPPluginCall) {
163
- let config = BluetoothConnectionConfiguration(locationId: self.locationId!)
167
+ let config = try! BluetoothConnectionConfigurationBuilder(locationId: "{{LOCATION_ID}}").build()
164
168
  let reader: JSObject = call.getObject("reader")!
165
169
  let index: Int = reader["index"] as! Int
166
170
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor-community/stripe-terminal",
3
- "version": "5.4.1",
3
+ "version": "5.4.3",
4
4
  "description": "Stripe SDK bindings for Capacitor Applications",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",