capacitor-stripe-terminal 1.1.0 → 2.0.0-beta.4

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.
@@ -8,7 +8,7 @@
8
8
  s.author = 'eventOne Labs <opensource@event1.io>'
9
9
  s.source = { :git => 'https://github.com/eventOneHQ/capacitor-stripe-terminal', :tag => s.version.to_s }
10
10
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
11
- s.ios.deployment_target = '11.0'
11
+ s.ios.deployment_target = '12.0'
12
12
  s.dependency 'Capacitor'
13
- s.dependency 'StripeTerminal', '1.4.0'
13
+ s.dependency 'StripeTerminal', '2.1.1'
14
14
  end
package/README.md CHANGED
@@ -19,6 +19,10 @@
19
19
 
20
20
  **[Current project status](https://github.com/eventOneHQ/capacitor-stripe-terminal/discussions/42)**
21
21
 
22
+ **_WARNING_**
23
+
24
+ _These instructions are for v2 which is currently in beta. See the [`v1-support`](https://github.com/eventOneHQ/capacitor-stripe-terminal/tree/v1-support) branch for v1 instructions._
25
+
22
26
  ## Maintainers
23
27
 
24
28
  | Maintainer | GitHub | Social |
@@ -53,20 +57,7 @@ Follow all Stripe instructions under ["Configure your app"](https://stripe.com/d
53
57
 
54
58
  ### Android
55
59
 
56
- Add the plugin to your `MainActivity.java`:
57
-
58
- ```java
59
- // import it at the top
60
- import io.event1.capacitorstripeterminal.StripeTerminal;
61
-
62
- this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
63
- // Additional plugins you've installed go here
64
- // Ex: add(TotallyAwesomePlugin.class);
65
- add(StripeTerminal.class);
66
- }});
67
- ```
68
-
69
- Add the `ACCESS_FINE_LOCATION`, `BLUETOOTH`, and `BLUETOOTH_ADMIN` permissions to your app's manifest:
60
+ Add the `ACCESS_FINE_LOCATION` permission to your app's manifest:
70
61
 
71
62
  ```xml
72
63
  <?xml version="1.0" encoding="utf-8"?>
@@ -75,8 +66,6 @@ Add the `ACCESS_FINE_LOCATION`, `BLUETOOTH`, and `BLUETOOTH_ADMIN` permissions t
75
66
  package="com.stripe.example.app">
76
67
 
77
68
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
78
- <uses-permission android:name="android.permission.BLUETOOTH" />
79
- <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
80
69
  </manifest>
81
70
  ```
82
71
 
@@ -101,7 +90,6 @@ _Hint: If the user denies Location permission the first time you ask for it, And
101
90
  ```javascript
102
91
  import {
103
92
  StripeTerminalPlugin,
104
- DeviceType,
105
93
  DiscoveryMethod
106
94
  } from 'capacitor-stripe-terminal'
107
95
 
@@ -127,13 +115,16 @@ const terminal = await StripeTerminalPlugin.create({
127
115
  terminal
128
116
  .discoverReaders({
129
117
  simulated: false,
130
- deviceType: DeviceType.Chipper2X,
131
118
  discoveryMethod: DiscoveryMethod.BluetoothProximity
132
119
  })
133
120
  .subscribe(readers => {
134
121
  if (readers.length) {
122
+ const selectedReader = readers[0]
123
+ const connectionConfig = {
124
+ locationId: '{{LOCATION_ID}}'
125
+ }
135
126
  terminal
136
- .connectReader({ serialNumber: readers[0].serialNumber })
127
+ .connectBluetoothReader(selectedReader, connectionConfig)
137
128
  .then(connectedReader => {
138
129
  // the reader is now connected and usable
139
130
  })
@@ -144,13 +135,15 @@ terminal
144
135
 
145
136
  // subscribe to user instructions - these should be displayed to the user
146
137
  const displaySubscription = terminal
147
- .readerDisplayMessage()
138
+ .didRequestReaderDisplayMessage()
148
139
  .subscribe(displayMessage => {
149
140
  console.log('displayMessage', displayMessage)
150
141
  })
151
- const inputSubscription = terminal.readerInput().subscribe(inputOptions => {
152
- console.log('inputOptions', inputOptions)
153
- })
142
+ const inputSubscription = terminal
143
+ .didRequestReaderInput()
144
+ .subscribe(inputOptions => {
145
+ console.log('inputOptions', inputOptions)
146
+ })
154
147
 
155
148
  // retrieve the payment intent
156
149
  await terminal.retrievePaymentIntent('your client secret created server side')
@@ -1,26 +1,27 @@
1
1
  ext {
2
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.12'
3
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.1'
4
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.2.0'
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0'
5
6
  }
6
7
 
7
8
  buildscript {
8
9
  repositories {
9
10
  google()
10
- jcenter()
11
+ mavenCentral()
11
12
  }
12
13
  dependencies {
13
- classpath 'com.android.tools.build:gradle:3.6.1'
14
+ classpath 'com.android.tools.build:gradle:4.2.1'
14
15
  }
15
16
  }
16
17
 
17
18
  apply plugin: 'com.android.library'
18
19
 
19
20
  android {
20
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 29
21
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
21
22
  defaultConfig {
22
23
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
23
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 29
24
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
24
25
  versionCode 1
25
26
  versionName "1.0"
26
27
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -34,6 +35,10 @@ android {
34
35
  lintOptions {
35
36
  abortOnError false
36
37
  }
38
+ compileOptions {
39
+ sourceCompatibility JavaVersion.VERSION_1_8
40
+ targetCompatibility JavaVersion.VERSION_1_8
41
+ }
37
42
  }
38
43
 
39
44
  repositories {
@@ -46,8 +51,10 @@ repositories {
46
51
  dependencies {
47
52
  implementation fileTree(dir: 'libs', include: ['*.jar'])
48
53
  implementation project(':capacitor-android')
54
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
49
55
  testImplementation "junit:junit:$junitVersion"
50
56
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
51
57
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
52
- implementation "com.stripe:stripeterminal:1.0.17"
58
+ implementation "com.stripe:stripeterminal:2.2.0"
59
+ implementation "com.google.code.gson:gson:2.8.8"
53
60
  }
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
3
  zipStoreBase=GRADLE_USER_HOME
4
4
  zipStorePath=wrapper/dists
5
- distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
5
+ distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
@@ -1,5 +1,8 @@
1
1
 
2
2
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
3
  package="io.event1.capacitorstripeterminal.capacitorstripeterminal">
4
+
5
+ <uses-permission android:name="android.permission.BLUETOOTH" />
6
+ <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
4
7
  </manifest>
5
8