@capgo/capacitor-stripe-identity 8.0.1

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.
Files changed (34) hide show
  1. package/CapgoCapacitorStripeIdentity.podspec +18 -0
  2. package/LICENSE +373 -0
  3. package/Package.swift +30 -0
  4. package/README.md +267 -0
  5. package/android/build.gradle +75 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/java/app/capgo/stripe/identity/IdentityVerificationSheetEvent.kt +11 -0
  8. package/android/src/main/java/app/capgo/stripe/identity/StripeIdentity.kt +103 -0
  9. package/android/src/main/java/app/capgo/stripe/identity/StripeIdentityPlugin.kt +69 -0
  10. package/android/src/main/java/app/capgo/stripe/identity/models/Executor.kt +22 -0
  11. package/android/src/main/res/.gitkeep +0 -0
  12. package/dist/docs.json +317 -0
  13. package/dist/esm/definitions.d.ts +20 -0
  14. package/dist/esm/definitions.js +2 -0
  15. package/dist/esm/definitions.js.map +1 -0
  16. package/dist/esm/events.enum.d.ts +9 -0
  17. package/dist/esm/events.enum.js +10 -0
  18. package/dist/esm/events.enum.js.map +1 -0
  19. package/dist/esm/index.d.ts +4 -0
  20. package/dist/esm/index.js +7 -0
  21. package/dist/esm/index.js.map +1 -0
  22. package/dist/esm/web.d.ts +20 -0
  23. package/dist/esm/web.js +39 -0
  24. package/dist/esm/web.js.map +1 -0
  25. package/dist/plugin.cjs.js +62 -0
  26. package/dist/plugin.cjs.js.map +1 -0
  27. package/dist/plugin.js +64 -0
  28. package/dist/plugin.js.map +1 -0
  29. package/ios/Sources/StripeIdentityPlugin/IdentityVerificationSheetEvents.swift +8 -0
  30. package/ios/Sources/StripeIdentityPlugin/Info.plist +24 -0
  31. package/ios/Sources/StripeIdentityPlugin/StripeIdentity.swift +86 -0
  32. package/ios/Sources/StripeIdentityPlugin/StripeIdentityPlugin.swift +51 -0
  33. package/ios/Tests/StripeIdentityPluginTests/StripeIdentityPluginTests.swift +15 -0
  34. package/package.json +95 -0
@@ -0,0 +1,75 @@
1
+ ext {
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
6
+
7
+ playServicesWalletVersion = project.hasProperty('playServicesWalletVersion') ? rootProject.ext.playServicesWalletVersion : '19.2.+'
8
+ identityVersion = project.hasProperty('identityVersion') ? rootProject.ext.identityVersion : '23.10.+'
9
+ }
10
+
11
+ buildscript {
12
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.2.20'
13
+ repositories {
14
+ google()
15
+ mavenCentral()
16
+ }
17
+ dependencies {
18
+ classpath 'com.android.tools.build:gradle:8.13.0'
19
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
20
+ }
21
+ }
22
+
23
+ apply plugin: 'com.android.library'
24
+ apply plugin: 'kotlin-android'
25
+
26
+ android {
27
+ namespace = "app.capgo.stripe.identity"
28
+ compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
29
+ defaultConfig {
30
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
31
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
32
+ versionCode 1
33
+ versionName "1.0"
34
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
35
+ }
36
+ buildTypes {
37
+ release {
38
+ minifyEnabled false
39
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
40
+ }
41
+ }
42
+ lintOptions {
43
+ abortOnError = false
44
+ }
45
+ compileOptions {
46
+ sourceCompatibility JavaVersion.VERSION_21
47
+ targetCompatibility JavaVersion.VERSION_21
48
+ }
49
+ kotlinOptions {
50
+ jvmTarget = JavaVersion.VERSION_21
51
+ }
52
+ }
53
+
54
+ repositories {
55
+ google()
56
+ mavenCentral()
57
+ }
58
+
59
+
60
+ dependencies {
61
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
62
+ implementation project(':capacitor-android')
63
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
64
+ testImplementation "junit:junit:$junitVersion"
65
+ androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
66
+ androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
67
+
68
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
69
+
70
+ implementation("com.stripe:identity:$identityVersion") {
71
+ exclude group: 'androidx.emoji2', module: 'emoji2'
72
+ }
73
+
74
+ implementation "com.google.android.gms:play-services-wallet:$playServicesWalletVersion"
75
+ }
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,11 @@
1
+ package app.capgo.stripe.identity;
2
+
3
+
4
+ enum class IdentityVerificationSheetEvent(val webEventName: String) {
5
+ Loaded("identityVerificationSheetLoaded"),
6
+ FailedToLoad("identityVerificationSheetFailedToLoad"),
7
+ Completed("identityVerificationSheetCompleted"),
8
+ Canceled("identityVerificationSheetCanceled"),
9
+ Failed("identityVerificationSheetFailed"),
10
+ VerificationResult("identityVerificationResult"),
11
+ }
@@ -0,0 +1,103 @@
1
+ package app.capgo.stripe.identity
2
+
3
+ import android.app.Activity
4
+ import android.content.Context
5
+ import androidx.core.util.Supplier
6
+ import com.getcapacitor.Bridge
7
+ import com.getcapacitor.JSObject
8
+ import com.getcapacitor.Logger
9
+ import com.getcapacitor.PluginCall
10
+ import app.capgo.stripe.identity.models.Executor
11
+ import com.google.android.gms.common.util.BiConsumer
12
+ import com.stripe.android.identity.IdentityVerificationSheet
13
+
14
+ class StripeIdentity(
15
+ contextSupplier: Supplier<Context>,
16
+ activitySupplier: Supplier<Activity>,
17
+ notifyListenersFunction: BiConsumer<String, JSObject>,
18
+ pluginLogTag: String
19
+ ) : Executor(
20
+ contextSupplier,
21
+ activitySupplier,
22
+ notifyListenersFunction,
23
+ pluginLogTag,
24
+ "StripeIdentityExecutor"
25
+ ) {
26
+ var verificationSheet: IdentityVerificationSheet? = null
27
+ private val emptyObject = JSObject()
28
+
29
+ private var verificationId: String? = null
30
+ private var ephemeralKeySecret: String? = null
31
+
32
+ init {
33
+ this.contextSupplier = contextSupplier
34
+ }
35
+
36
+ fun initialize(call: PluginCall) {
37
+ call.resolve()
38
+ }
39
+
40
+ fun create(call: PluginCall) {
41
+ verificationId = call.getString("verificationId", null)
42
+ ephemeralKeySecret = call.getString("ephemeralKeySecret", null)
43
+
44
+ if (verificationId == null || ephemeralKeySecret == null) {
45
+ val errorText =
46
+ "Invalid Params. This method require verificationId or ephemeralKeySecret."
47
+ notifyListeners(
48
+ IdentityVerificationSheetEvent.FailedToLoad.webEventName,
49
+ JSObject().put("error", errorText)
50
+ )
51
+ call.reject(errorText)
52
+ return
53
+ }
54
+
55
+ this.notifyListeners(IdentityVerificationSheetEvent.Loaded.webEventName, emptyObject)
56
+ call.resolve()
57
+ }
58
+
59
+ fun present(call: PluginCall) {
60
+ try {
61
+ verificationSheet!!.present(
62
+ verificationId!!,
63
+ ephemeralKeySecret!!
64
+ )
65
+ Logger.info("Presented Identity Verification Sheet")
66
+ call.resolve()
67
+ } catch (ex: Exception) {
68
+ call.reject(ex.localizedMessage, ex)
69
+ }
70
+ }
71
+
72
+ fun onVerificationCompleted() {
73
+ notifyListeners(IdentityVerificationSheetEvent.VerificationResult.webEventName,
74
+ JSObject().put(
75
+ "result",
76
+ IdentityVerificationSheetEvent.Completed.webEventName
77
+ )
78
+ )
79
+ }
80
+
81
+ fun onVerificationCancelled() {
82
+ notifyListeners(IdentityVerificationSheetEvent.VerificationResult.webEventName,
83
+ JSObject().put(
84
+ "result",
85
+ IdentityVerificationSheetEvent.Canceled.webEventName
86
+ )
87
+ )
88
+ }
89
+
90
+ fun onVerificationFailed(errorMessage: String?) {
91
+ notifyListeners(IdentityVerificationSheetEvent.VerificationResult.webEventName,
92
+ JSObject()
93
+ .put(
94
+ "result",
95
+ IdentityVerificationSheetEvent.Failed.webEventName
96
+ )
97
+ .put(
98
+ "error",
99
+ JSObject().put("message", errorMessage)
100
+ )
101
+ )
102
+ }
103
+ }
@@ -0,0 +1,69 @@
1
+ package app.capgo.stripe.identity
2
+
3
+ import android.content.ContentResolver
4
+ import android.net.Uri
5
+ import com.getcapacitor.JSObject
6
+ import com.getcapacitor.Plugin
7
+ import com.getcapacitor.PluginCall
8
+ import com.getcapacitor.PluginMethod
9
+ import com.getcapacitor.annotation.CapacitorPlugin
10
+ import com.stripe.android.identity.IdentityVerificationSheet
11
+ import com.stripe.android.identity.IdentityVerificationSheet.Companion.create
12
+ import com.stripe.android.identity.IdentityVerificationSheet.VerificationFlowResult
13
+
14
+ @CapacitorPlugin(name = "StripeIdentity")
15
+ class StripeIdentityPlugin : Plugin() {
16
+ private val implementation = StripeIdentity(
17
+ { this.context },
18
+ { this.activity },
19
+ { eventName: String?, data: JSObject? -> this.notifyListeners(eventName, data) },
20
+ logTag
21
+ )
22
+
23
+ override fun load() {
24
+ val resources = activity.applicationContext.resources
25
+ val resourceId = resources.getIdentifier("ic_launcher", "mipmap", activity.packageName)
26
+ val icon = Uri.Builder()
27
+ .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
28
+ .authority(resources.getResourcePackageName(resourceId))
29
+ .appendPath(resources.getResourceTypeName(resourceId))
30
+ .appendPath(resources.getResourceEntryName(resourceId))
31
+ .build()
32
+
33
+ implementation.verificationSheet = create(
34
+ activity,
35
+ IdentityVerificationSheet.Configuration(icon)
36
+ ) { verificationFlowResult: VerificationFlowResult? ->
37
+ // handle verificationResult
38
+ if (verificationFlowResult is VerificationFlowResult.Completed) {
39
+ // The user has completed uploading their documents.
40
+ // Let them know that the verification is processing.
41
+ implementation.onVerificationCompleted()
42
+ } else if (verificationFlowResult is VerificationFlowResult.Canceled) {
43
+ // The user did not complete uploading their documents.
44
+ // You should allow them to try again.
45
+ implementation.onVerificationCancelled()
46
+ } else if (verificationFlowResult is VerificationFlowResult.Failed) {
47
+ // If the flow fails, you should display the localized error
48
+ // message to your user using throwable.getLocalizedMessage()
49
+ val errorMessage = verificationFlowResult.throwable.localizedMessage;
50
+ implementation.onVerificationFailed(errorMessage)
51
+ }
52
+ }
53
+ }
54
+
55
+ @PluginMethod
56
+ fun initialize(call: PluginCall) {
57
+ implementation.initialize(call)
58
+ }
59
+
60
+ @PluginMethod
61
+ fun create(call: PluginCall) {
62
+ implementation.create(call)
63
+ }
64
+
65
+ @PluginMethod
66
+ fun present(call: PluginCall) {
67
+ implementation.present(call)
68
+ }
69
+ }
@@ -0,0 +1,22 @@
1
+ package app.capgo.stripe.identity.models
2
+
3
+ import android.app.Activity
4
+ import android.content.Context
5
+ import androidx.core.util.Supplier
6
+ import com.getcapacitor.JSObject
7
+ import com.google.android.gms.common.util.BiConsumer
8
+
9
+ abstract class Executor(
10
+ protected var contextSupplier: Supplier<Context>,
11
+ protected val activitySupplier: Supplier<Activity>,
12
+ protected var notifyListenersFunction: BiConsumer<String, JSObject>,
13
+ pluginLogTag: String,
14
+ executorTag: String
15
+ ) {
16
+ protected val logTag: String = "$pluginLogTag|$executorTag"
17
+
18
+ // Eventually we can change the notification directly here!
19
+ protected fun notifyListeners(eventName: String, data: JSObject) {
20
+ notifyListenersFunction.accept(eventName, data)
21
+ }
22
+ }
File without changes
package/dist/docs.json ADDED
@@ -0,0 +1,317 @@
1
+ {
2
+ "api": {
3
+ "name": "StripeIdentityPlugin",
4
+ "slug": "stripeidentityplugin",
5
+ "docs": "",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "initialize",
10
+ "signature": "(options: InitializeIdentityVerificationSheetOption) => Promise<void>",
11
+ "parameters": [
12
+ {
13
+ "name": "options",
14
+ "docs": "",
15
+ "type": "InitializeIdentityVerificationSheetOption"
16
+ }
17
+ ],
18
+ "returns": "Promise<void>",
19
+ "tags": [],
20
+ "docs": "",
21
+ "complexTypes": [
22
+ "InitializeIdentityVerificationSheetOption"
23
+ ],
24
+ "slug": "initialize"
25
+ },
26
+ {
27
+ "name": "create",
28
+ "signature": "(options: CreateIdentityVerificationSheetOption) => Promise<void>",
29
+ "parameters": [
30
+ {
31
+ "name": "options",
32
+ "docs": "",
33
+ "type": "CreateIdentityVerificationSheetOption"
34
+ }
35
+ ],
36
+ "returns": "Promise<void>",
37
+ "tags": [],
38
+ "docs": "",
39
+ "complexTypes": [
40
+ "CreateIdentityVerificationSheetOption"
41
+ ],
42
+ "slug": "create"
43
+ },
44
+ {
45
+ "name": "present",
46
+ "signature": "() => Promise<void>",
47
+ "parameters": [],
48
+ "returns": "Promise<void>",
49
+ "tags": [],
50
+ "docs": "",
51
+ "complexTypes": [],
52
+ "slug": "present"
53
+ },
54
+ {
55
+ "name": "addListener",
56
+ "signature": "(eventName: IdentityVerificationSheetEventsEnum.Loaded, listenerFunc: () => void) => Promise<PluginListenerHandle>",
57
+ "parameters": [
58
+ {
59
+ "name": "eventName",
60
+ "docs": "",
61
+ "type": "IdentityVerificationSheetEventsEnum.Loaded"
62
+ },
63
+ {
64
+ "name": "listenerFunc",
65
+ "docs": "",
66
+ "type": "() => void"
67
+ }
68
+ ],
69
+ "returns": "Promise<PluginListenerHandle>",
70
+ "tags": [],
71
+ "docs": "",
72
+ "complexTypes": [
73
+ "PluginListenerHandle",
74
+ "IdentityVerificationSheetEventsEnum"
75
+ ],
76
+ "slug": "addlisteneridentityverificationsheeteventsenumloaded-"
77
+ },
78
+ {
79
+ "name": "addListener",
80
+ "signature": "(eventName: IdentityVerificationSheetEventsEnum.FailedToLoad, listenerFunc: (info: StripeIdentityError) => void) => Promise<PluginListenerHandle>",
81
+ "parameters": [
82
+ {
83
+ "name": "eventName",
84
+ "docs": "",
85
+ "type": "IdentityVerificationSheetEventsEnum.FailedToLoad"
86
+ },
87
+ {
88
+ "name": "listenerFunc",
89
+ "docs": "",
90
+ "type": "(info: StripeIdentityError) => void"
91
+ }
92
+ ],
93
+ "returns": "Promise<PluginListenerHandle>",
94
+ "tags": [],
95
+ "docs": "",
96
+ "complexTypes": [
97
+ "PluginListenerHandle",
98
+ "IdentityVerificationSheetEventsEnum",
99
+ "StripeIdentityError"
100
+ ],
101
+ "slug": "addlisteneridentityverificationsheeteventsenumfailedtoload-"
102
+ },
103
+ {
104
+ "name": "addListener",
105
+ "signature": "(eventName: IdentityVerificationSheetEventsEnum.VerificationResult, listenerFunc: (result: IdentityVerificationResult) => void) => Promise<PluginListenerHandle>",
106
+ "parameters": [
107
+ {
108
+ "name": "eventName",
109
+ "docs": "",
110
+ "type": "IdentityVerificationSheetEventsEnum.VerificationResult"
111
+ },
112
+ {
113
+ "name": "listenerFunc",
114
+ "docs": "",
115
+ "type": "(result: IdentityVerificationResult) => void"
116
+ }
117
+ ],
118
+ "returns": "Promise<PluginListenerHandle>",
119
+ "tags": [],
120
+ "docs": "",
121
+ "complexTypes": [
122
+ "PluginListenerHandle",
123
+ "IdentityVerificationSheetEventsEnum",
124
+ "IdentityVerificationResult"
125
+ ],
126
+ "slug": "addlisteneridentityverificationsheeteventsenumverificationresult-"
127
+ }
128
+ ],
129
+ "properties": []
130
+ },
131
+ "interfaces": [
132
+ {
133
+ "name": "InitializeIdentityVerificationSheetOption",
134
+ "slug": "initializeidentityverificationsheetoption",
135
+ "docs": "",
136
+ "tags": [],
137
+ "methods": [],
138
+ "properties": [
139
+ {
140
+ "name": "publishableKey",
141
+ "tags": [],
142
+ "docs": "",
143
+ "complexTypes": [],
144
+ "type": "string"
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "name": "CreateIdentityVerificationSheetOption",
150
+ "slug": "createidentityverificationsheetoption",
151
+ "docs": "",
152
+ "tags": [],
153
+ "methods": [],
154
+ "properties": [
155
+ {
156
+ "name": "verificationId",
157
+ "tags": [],
158
+ "docs": "",
159
+ "complexTypes": [],
160
+ "type": "string"
161
+ },
162
+ {
163
+ "name": "ephemeralKeySecret",
164
+ "tags": [],
165
+ "docs": "",
166
+ "complexTypes": [],
167
+ "type": "string"
168
+ },
169
+ {
170
+ "name": "clientSecret",
171
+ "tags": [],
172
+ "docs": "This client secret is used only for the web platform.",
173
+ "complexTypes": [],
174
+ "type": "string | undefined"
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ "name": "PluginListenerHandle",
180
+ "slug": "pluginlistenerhandle",
181
+ "docs": "",
182
+ "tags": [],
183
+ "methods": [],
184
+ "properties": [
185
+ {
186
+ "name": "remove",
187
+ "tags": [],
188
+ "docs": "",
189
+ "complexTypes": [],
190
+ "type": "() => Promise<void>"
191
+ }
192
+ ]
193
+ },
194
+ {
195
+ "name": "StripeIdentityError",
196
+ "slug": "stripeidentityerror",
197
+ "docs": "",
198
+ "tags": [],
199
+ "methods": [],
200
+ "properties": [
201
+ {
202
+ "name": "code",
203
+ "tags": [],
204
+ "docs": "",
205
+ "complexTypes": [],
206
+ "type": "string | undefined"
207
+ },
208
+ {
209
+ "name": "message",
210
+ "tags": [],
211
+ "docs": "",
212
+ "complexTypes": [],
213
+ "type": "string"
214
+ }
215
+ ]
216
+ },
217
+ {
218
+ "name": "IdentityVerificationResult",
219
+ "slug": "identityverificationresult",
220
+ "docs": "",
221
+ "tags": [],
222
+ "methods": [],
223
+ "properties": [
224
+ {
225
+ "name": "result",
226
+ "tags": [],
227
+ "docs": "",
228
+ "complexTypes": [
229
+ "IdentityVerificationSheetResultInterface"
230
+ ],
231
+ "type": "IdentityVerificationSheetResultInterface"
232
+ },
233
+ {
234
+ "name": "error",
235
+ "tags": [],
236
+ "docs": "",
237
+ "complexTypes": [
238
+ "StripeIdentityError"
239
+ ],
240
+ "type": "StripeIdentityError"
241
+ }
242
+ ]
243
+ }
244
+ ],
245
+ "enums": [
246
+ {
247
+ "name": "IdentityVerificationSheetEventsEnum",
248
+ "slug": "identityverificationsheeteventsenum",
249
+ "members": [
250
+ {
251
+ "name": "Loaded",
252
+ "value": "'identityVerificationSheetLoaded'",
253
+ "tags": [],
254
+ "docs": ""
255
+ },
256
+ {
257
+ "name": "FailedToLoad",
258
+ "value": "'identityVerificationSheetFailedToLoad'",
259
+ "tags": [],
260
+ "docs": ""
261
+ },
262
+ {
263
+ "name": "Completed",
264
+ "value": "'identityVerificationSheetCompleted'",
265
+ "tags": [],
266
+ "docs": ""
267
+ },
268
+ {
269
+ "name": "Canceled",
270
+ "value": "'identityVerificationSheetCanceled'",
271
+ "tags": [],
272
+ "docs": ""
273
+ },
274
+ {
275
+ "name": "Failed",
276
+ "value": "'identityVerificationSheetFailed'",
277
+ "tags": [],
278
+ "docs": ""
279
+ },
280
+ {
281
+ "name": "VerificationResult",
282
+ "value": "'identityVerificationResult'",
283
+ "tags": [],
284
+ "docs": ""
285
+ }
286
+ ]
287
+ }
288
+ ],
289
+ "typeAliases": [
290
+ {
291
+ "name": "IdentityVerificationSheetResultInterface",
292
+ "slug": "identityverificationsheetresultinterface",
293
+ "docs": "",
294
+ "types": [
295
+ {
296
+ "text": "IdentityVerificationSheetEventsEnum.Completed",
297
+ "complexTypes": [
298
+ "IdentityVerificationSheetEventsEnum"
299
+ ]
300
+ },
301
+ {
302
+ "text": "IdentityVerificationSheetEventsEnum.Canceled",
303
+ "complexTypes": [
304
+ "IdentityVerificationSheetEventsEnum"
305
+ ]
306
+ },
307
+ {
308
+ "text": "IdentityVerificationSheetEventsEnum.Failed",
309
+ "complexTypes": [
310
+ "IdentityVerificationSheetEventsEnum"
311
+ ]
312
+ }
313
+ ]
314
+ }
315
+ ],
316
+ "pluginConfigs": []
317
+ }
@@ -0,0 +1,20 @@
1
+ import type { PluginListenerHandle } from '@capacitor/core';
2
+ import type { IdentityVerificationSheetEventsEnum, IdentityVerificationSheetResultInterface } from './events.enum';
3
+ import type { CreateIdentityVerificationSheetOption, InitializeIdentityVerificationSheetOption } from './web';
4
+ export * from './events.enum';
5
+ export interface StripeIdentityError {
6
+ code?: string;
7
+ message: string;
8
+ }
9
+ export interface IdentityVerificationResult {
10
+ result: IdentityVerificationSheetResultInterface;
11
+ error?: StripeIdentityError;
12
+ }
13
+ export interface StripeIdentityPlugin {
14
+ initialize(options: InitializeIdentityVerificationSheetOption): Promise<void>;
15
+ create(options: CreateIdentityVerificationSheetOption): Promise<void>;
16
+ present(): Promise<void>;
17
+ addListener(eventName: IdentityVerificationSheetEventsEnum.Loaded, listenerFunc: () => void): Promise<PluginListenerHandle>;
18
+ addListener(eventName: IdentityVerificationSheetEventsEnum.FailedToLoad, listenerFunc: (info: StripeIdentityError) => void): Promise<PluginListenerHandle>;
19
+ addListener(eventName: IdentityVerificationSheetEventsEnum.VerificationResult, listenerFunc: (result: IdentityVerificationResult) => void): Promise<PluginListenerHandle>;
20
+ }
@@ -0,0 +1,2 @@
1
+ export * from './events.enum';
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAKA,cAAc,eAAe,CAAC","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nimport type { IdentityVerificationSheetEventsEnum, IdentityVerificationSheetResultInterface } from './events.enum';\nimport type { CreateIdentityVerificationSheetOption, InitializeIdentityVerificationSheetOption } from './web';\n\nexport * from './events.enum';\nexport interface StripeIdentityError {\n code?: string;\n message: string;\n}\n\nexport interface IdentityVerificationResult {\n result: IdentityVerificationSheetResultInterface;\n error?: StripeIdentityError;\n}\n\nexport interface StripeIdentityPlugin {\n initialize(options: InitializeIdentityVerificationSheetOption): Promise<void>;\n create(options: CreateIdentityVerificationSheetOption): Promise<void>;\n present(): Promise<void>;\n\n addListener(\n eventName: IdentityVerificationSheetEventsEnum.Loaded,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: IdentityVerificationSheetEventsEnum.FailedToLoad,\n listenerFunc: (info: StripeIdentityError) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: IdentityVerificationSheetEventsEnum.VerificationResult,\n listenerFunc: (result: IdentityVerificationResult) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ export declare enum IdentityVerificationSheetEventsEnum {
2
+ Loaded = "identityVerificationSheetLoaded",
3
+ FailedToLoad = "identityVerificationSheetFailedToLoad",
4
+ Completed = "identityVerificationSheetCompleted",
5
+ Canceled = "identityVerificationSheetCanceled",
6
+ Failed = "identityVerificationSheetFailed",
7
+ VerificationResult = "identityVerificationResult"
8
+ }
9
+ export type IdentityVerificationSheetResultInterface = IdentityVerificationSheetEventsEnum.Completed | IdentityVerificationSheetEventsEnum.Canceled | IdentityVerificationSheetEventsEnum.Failed;
@@ -0,0 +1,10 @@
1
+ export var IdentityVerificationSheetEventsEnum;
2
+ (function (IdentityVerificationSheetEventsEnum) {
3
+ IdentityVerificationSheetEventsEnum["Loaded"] = "identityVerificationSheetLoaded";
4
+ IdentityVerificationSheetEventsEnum["FailedToLoad"] = "identityVerificationSheetFailedToLoad";
5
+ IdentityVerificationSheetEventsEnum["Completed"] = "identityVerificationSheetCompleted";
6
+ IdentityVerificationSheetEventsEnum["Canceled"] = "identityVerificationSheetCanceled";
7
+ IdentityVerificationSheetEventsEnum["Failed"] = "identityVerificationSheetFailed";
8
+ IdentityVerificationSheetEventsEnum["VerificationResult"] = "identityVerificationResult";
9
+ })(IdentityVerificationSheetEventsEnum || (IdentityVerificationSheetEventsEnum = {}));
10
+ //# sourceMappingURL=events.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.enum.js","sourceRoot":"","sources":["../../src/events.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mCAOX;AAPD,WAAY,mCAAmC;IAC7C,iFAA0C,CAAA;IAC1C,6FAAsD,CAAA;IACtD,uFAAgD,CAAA;IAChD,qFAA8C,CAAA;IAC9C,iFAA0C,CAAA;IAC1C,wFAAiD,CAAA;AACnD,CAAC,EAPW,mCAAmC,KAAnC,mCAAmC,QAO9C","sourcesContent":["export enum IdentityVerificationSheetEventsEnum {\n Loaded = 'identityVerificationSheetLoaded',\n FailedToLoad = 'identityVerificationSheetFailedToLoad',\n Completed = 'identityVerificationSheetCompleted',\n Canceled = 'identityVerificationSheetCanceled',\n Failed = 'identityVerificationSheetFailed',\n VerificationResult = 'identityVerificationResult',\n}\n\nexport type IdentityVerificationSheetResultInterface =\n | IdentityVerificationSheetEventsEnum.Completed\n | IdentityVerificationSheetEventsEnum.Canceled\n | IdentityVerificationSheetEventsEnum.Failed;\n"]}
@@ -0,0 +1,4 @@
1
+ import type { StripeIdentityPlugin } from './definitions';
2
+ declare const StripeIdentity: StripeIdentityPlugin;
3
+ export * from './definitions';
4
+ export { StripeIdentity };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const StripeIdentity = registerPlugin('StripeIdentity', {
3
+ web: () => import('./web').then((m) => new m.StripeIdentityWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { StripeIdentity };
7
+ //# sourceMappingURL=index.js.map