Stripe Identity SDK bindings for Capacitor Applications.
npm install @capacitor-community/stripe-identity
npx cap sync
change base application theme to Theme.MaterialComponents.DayNight
at res/values/styles.xml
:
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+ <style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
parent can be any MaterialComponents. See here for other options. see more details on Stripe's native Android SDK page here.
set up camera authorization by adding NSCameraUsageDescription
in Info.plist
and add a string value that explains the usage.
see more details on Stripe's native iOS SDK page here.
If you want to implement, we recommend to read https://stripe.com/docs/identity .
import { StripeIdentity } from '@capacitor-community/stripe-identity';
// initialize is needed only for Web Platform
await StripeIdentity.initialize({
publishableKey,
});
await StripeIdentity.create({
ephemeralKeySecret,
verificationId,
// clientSecret is needed only for Web Platform
clientSecret
});
const result = await StripeIdentity.present();
initialize(...)
create(...)
present()
addListener(IdentityVerificationSheetEventsEnum.Loaded, ...)
addListener(IdentityVerificationSheetEventsEnum.FailedToLoad, ...)
addListener(IdentityVerificationSheetEventsEnum.Completed, ...)
addListener(IdentityVerificationSheetEventsEnum.Canceled, ...)
addListener(IdentityVerificationSheetEventsEnum.Failed, ...)
- Interfaces
- Type Aliases
- Enums
initialize(options: InitializeIdentityVerificationSheetOption) => Promise<void>
Param | Type |
---|---|
options |
InitializeIdentityVerificationSheetOption |
create(options: CreateIdentityVerificationSheetOption) => Promise<void>
Param | Type |
---|---|
options |
CreateIdentityVerificationSheetOption |
present() => Promise<{ identityVerificationResult: IdentityVerificationSheetResultInterface; }>
Returns: Promise<{ identityVerificationResult: IdentityVerificationSheetResultInterface; }>
addListener(eventName: IdentityVerificationSheetEventsEnum.Loaded, listenerFunc: () => void) => PluginListenerHandle
Param | Type |
---|---|
eventName |
IdentityVerificationSheetEventsEnum.Loaded |
listenerFunc |
() => void |
Returns: PluginListenerHandle
addListener(eventName: IdentityVerificationSheetEventsEnum.FailedToLoad, listenerFunc: (info: StripeIdentityError) => void) => PluginListenerHandle
Param | Type |
---|---|
eventName |
IdentityVerificationSheetEventsEnum.FailedToLoad |
listenerFunc |
(info: StripeIdentityError) => void |
Returns: PluginListenerHandle
addListener(eventName: IdentityVerificationSheetEventsEnum.Completed, listenerFunc: () => void) => PluginListenerHandle
Param | Type |
---|---|
eventName |
IdentityVerificationSheetEventsEnum.Completed |
listenerFunc |
() => void |
Returns: PluginListenerHandle
addListener(eventName: IdentityVerificationSheetEventsEnum.Canceled, listenerFunc: () => void) => PluginListenerHandle
Param | Type |
---|---|
eventName |
IdentityVerificationSheetEventsEnum.Canceled |
listenerFunc |
() => void |
Returns: PluginListenerHandle
addListener(eventName: IdentityVerificationSheetEventsEnum.Failed, listenerFunc: (info: StripeIdentityError) => void) => PluginListenerHandle
Param | Type |
---|---|
eventName |
IdentityVerificationSheetEventsEnum.Failed |
listenerFunc |
(info: StripeIdentityError) => void |
Returns: PluginListenerHandle
Prop | Type |
---|---|
publishableKey |
string |
Prop | Type | Description |
---|---|---|
verificationId |
string |
|
ephemeralKeySecret |
string |
|
clientSecret |
string |
This client secret is used only for the web platform. |
Prop | Type |
---|---|
remove |
() => Promise<void> |
Prop | Type |
---|---|
message |
string |
IdentityVerificationSheetEventsEnum.Completed | IdentityVerificationSheetEventsEnum.Canceled | IdentityVerificationSheetEventsEnum.Failed
Members | Value |
---|---|
Loaded |
'identityVerificationSheetLoaded' |
FailedToLoad |
'identityVerificationSheetFailedToLoad' |
Completed |
'identityVerificationSheetCompleted' |
Canceled |
'identityVerificationSheetCanceled' |
Failed |
'identityVerificationSheetFailed' |