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.
- package/CapacitorStripeTerminal.podspec +2 -2
- package/README.md +16 -23
- package/android/build.gradle +15 -8
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/io/event1/capacitorstripeterminal/StripeTerminal.java +411 -195
- package/android/src/main/java/io/event1/capacitorstripeterminal/TerminalUtils.java +167 -18
- package/dist/esm/definitions.d.ts +414 -50
- package/dist/esm/definitions.js +156 -7
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/plugin-registration.d.ts +6 -0
- package/dist/esm/plugin-registration.js +9 -0
- package/dist/esm/plugin-registration.js.map +1 -0
- package/dist/esm/plugin.d.ts +42 -9
- package/dist/esm/plugin.js +186 -130
- package/dist/esm/plugin.js.map +1 -1
- package/dist/esm/web.d.ts +20 -15
- package/dist/esm/web.js +311 -225
- package/dist/esm/web.js.map +1 -1
- package/ios/Plugin/Plugin.m +11 -7
- package/ios/Plugin/Plugin.swift +206 -73
- package/ios/Plugin/TerminalUtils.swift +54 -8
- package/ios/Plugin.xcodeproj/project.pbxproj +5 -5
- package/ios/Podfile +2 -2
- package/ios/Podfile.lock +8 -8
- package/package.json +15 -18
- package/android/.npmignore +0 -1
|
@@ -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
|
+
s.ios.deployment_target = '12.0'
|
|
12
12
|
s.dependency 'Capacitor'
|
|
13
|
-
s.dependency 'StripeTerminal', '1.
|
|
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
|
|
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
|
-
.
|
|
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
|
-
.
|
|
138
|
+
.didRequestReaderDisplayMessage()
|
|
148
139
|
.subscribe(displayMessage => {
|
|
149
140
|
console.log('displayMessage', displayMessage)
|
|
150
141
|
})
|
|
151
|
-
const inputSubscription = terminal
|
|
152
|
-
|
|
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')
|
package/android/build.gradle
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
junitVersion =
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
11
|
+
mavenCentral()
|
|
11
12
|
}
|
|
12
13
|
dependencies {
|
|
13
|
-
classpath 'com.android.tools.build:gradle:
|
|
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 :
|
|
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 :
|
|
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:
|
|
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
|
+
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
|
|