@capacitor-community/stripe-terminal 6.1.0 → 6.2.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 (33) hide show
  1. package/README.md +303 -34
  2. package/android/src/main/java/com/getcapacitor/community/stripe/terminal/StripeTerminal.java +267 -49
  3. package/android/src/main/java/com/getcapacitor/community/stripe/terminal/StripeTerminalPlugin.java +30 -0
  4. package/android/src/main/java/com/getcapacitor/community/stripe/terminal/TerminalEvent.kt +3 -0
  5. package/android/src/main/java/com/getcapacitor/community/stripe/terminal/helper/TerminalMappers.java +96 -0
  6. package/dist/docs.json +431 -66
  7. package/dist/esm/definitions.d.ts +94 -5
  8. package/dist/esm/definitions.js.map +1 -1
  9. package/dist/esm/events.enum.d.ts +4 -1
  10. package/dist/esm/events.enum.js +3 -0
  11. package/dist/esm/events.enum.js.map +1 -1
  12. package/dist/esm/stripe-types/proto.d.ts +501 -0
  13. package/dist/esm/stripe-types/proto.js +2 -0
  14. package/dist/esm/stripe-types/proto.js.map +1 -0
  15. package/dist/esm/stripe.enum.d.ts +51 -0
  16. package/dist/esm/stripe.enum.js +55 -0
  17. package/dist/esm/stripe.enum.js.map +1 -1
  18. package/dist/esm/terminalMappers.d.ts +23 -0
  19. package/dist/esm/terminalMappers.js +119 -0
  20. package/dist/esm/terminalMappers.js.map +1 -0
  21. package/dist/esm/web.d.ts +20 -2
  22. package/dist/esm/web.js +134 -13
  23. package/dist/esm/web.js.map +1 -1
  24. package/dist/plugin.cjs.js +308 -13
  25. package/dist/plugin.cjs.js.map +1 -1
  26. package/dist/plugin.js +309 -15
  27. package/dist/plugin.js.map +1 -1
  28. package/ios/Plugin/StripeTerminal.swift +248 -63
  29. package/ios/Plugin/StripeTerminalPlugin.m +6 -0
  30. package/ios/Plugin/StripeTerminalPlugin.swift +25 -4
  31. package/ios/Plugin/TerminalEvents.swift +3 -0
  32. package/ios/Plugin/TerminalMappers.swift +127 -0
  33. package/package.json +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA6BA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nimport type { TerminalEventsEnum } from './events.enum';\nimport type {\n TerminalConnectTypes,\n UpdateTimeEstimate,\n SimulateReaderUpdate,\n SimulatedCardType,\n BatteryStatus,\n ReaderEvent,\n ReaderDisplayMessage,\n ReaderInputOption,\n PaymentStatus,\n DisconnectReason,\n ConnectionStatus,\n} from './stripe.enum';\n\nexport type ReaderInterface = {\n index: number;\n serialNumber: string;\n};\n\nexport type ReaderSoftwareUpdateInterface = {\n version: string;\n settingsVersion: string;\n requiredAt: number;\n timeEstimate: UpdateTimeEstimate;\n};\n\nexport * from './events.enum';\nexport * from './stripe.enum';\nexport interface StripeTerminalPlugin {\n initialize(options: {\n tokenProviderEndpoint?: string;\n isTest: boolean;\n }): Promise<void>;\n discoverReaders(options: {\n type: TerminalConnectTypes;\n locationId?: string;\n }): Promise<{\n readers: ReaderInterface[];\n }>;\n setConnectionToken(options: { token: string }): Promise<void>;\n /**\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.models/-simulator-configuration/index.html)\n */\n setSimulatorConfiguration(options: {\n update?: SimulateReaderUpdate;\n simulatedCard?: SimulatedCardType;\n simulatedTipAmount?: number;\n }): Promise<void>;\n connectReader(options: { reader: ReaderInterface }): Promise<void>;\n getConnectedReader(): Promise<{ reader: ReaderInterface | null }>;\n disconnectReader(): Promise<void>;\n cancelDiscoverReaders(): Promise<void>;\n collectPaymentMethod(options: { paymentIntent: string }): Promise<void>;\n cancelCollectPaymentMethod(): Promise<void>;\n confirmPaymentIntent(): Promise<void>;\n\n addListener(\n eventName: TerminalEventsEnum.Loaded,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.RequestedConnectionToken,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.DiscoveredReaders,\n listenerFunc: ({ readers }: { readers: ReaderInterface[] }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.ConnectedReader,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when the reader is disconnected, either in response to [`disconnectReader()`](#disconnectreader)\n * or some connection error.\n *\n * For all reader types, this is emitted in response to [`disconnectReader()`](#disconnectreader)\n * without a `reason` property.\n *\n * For Bluetooth and USB readers, this is emitted with a `reason` property when the reader disconnects.\n *\n * **Note:** For Bluetooth and USB readers, when you call [`disconnectReader()`](#disconnectreader), this event\n * will be emitted twice: one without a `reason` in acknowledgement of your call, and again with a `reason` when the reader\n * finishes disconnecting.\n */\n addListener(\n eventName: TerminalEventsEnum.DisconnectedReader,\n listenerFunc: ({ reason }: { reason?: DisconnectReason }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when the Terminal's connection status changed.\n *\n * Note: You should *not* use this method to detect when a reader unexpectedly disconnects from your app,\n * as it cannot be used to accurately distinguish between expected and unexpected disconnect events.\n *\n * To detect unexpected disconnects (e.g. to automatically notify your user), you should instead use\n * the UnexpectedReaderDisconnect event.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-terminal-listener/on-connection-status-change.html)\n */\n addListener(\n eventName: TerminalEventsEnum.ConnectionStatusChange,\n listenerFunc: ({ status }: { status: ConnectionStatus }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * The Terminal disconnected unexpectedly from the reader.\n *\n * In your implementation of this method, you may want to notify your user that the reader disconnected.\n * You may also call [`discoverReaders()`](#discoverreaders) to begin scanning for readers, and attempt\n * to automatically reconnect to the disconnected reader. Be sure to either set a timeout or make it\n * possible to cancel calls to `discoverReaders()`\n *\n * When connected to a Bluetooth or USB reader, you can get more information about the disconnect by\n * implementing the DisconnectedReader event.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-terminal-listener/on-unexpected-reader-disconnect.html)\n */\n addListener(\n eventName: TerminalEventsEnum.UnexpectedReaderDisconnect,\n listenerFunc: ({ reader }: { reader: ReaderInterface }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.ConfirmedPaymentIntent,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.CollectedPaymentIntent,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when [`cancelCollectPaymentMethod()`](#cancelcollectpaymentmethod) is called and succeeds.\n * The Promise returned by `cancelCollectPaymentMethod()` will also be resolved.\n */\n addListener(\n eventName: TerminalEventsEnum.Canceled,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when either [`collectPaymentMethod()`](#collectpaymentmethod) or [`confirmPaymentIntent()`](#confirmpaymentintent)\n * fails. The Promise returned by the relevant call will also be rejected.\n */\n addListener(\n eventName: TerminalEventsEnum.Failed,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when a software update is available for the connected reader.\n */\n addListener(\n eventName: TerminalEventsEnum.ReportAvailableUpdate,\n listenerFunc: ({\n update,\n }: {\n update: ReaderSoftwareUpdateInterface;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted when the connected reader begins installing a software update.\n * If a mandatory software update is available when a reader first connects, that update is\n * automatically installed. The update will be installed before ConnectedReader is emitted and\n * before the Promise returned by [`connectReader()`](#connectreader) resolves.\n * In this case, you will receive this sequence of events:\n *\n * 1. StartInstallingUpdate\n * 2. ReaderSoftwareUpdateProgress (repeatedly)\n * 3. FinishInstallingUpdates\n * 4. ConnectedReader\n * 5. `connectReader()` Promise resolves\n *\n * Your app should show UI to the user indiciating that a software update is being installed\n * to explain why connecting is taking longer than usual.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-start-installing-update.html)\n */\n addListener(\n eventName: TerminalEventsEnum.StartInstallingUpdate,\n listenerFunc: ({\n update,\n }: {\n update: ReaderSoftwareUpdateInterface;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted periodically while reader software is updating to inform of the installation progress.\n * `progress` is a float between 0 and 1.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-report-reader-software-update-progress.html)\n */\n addListener(\n eventName: TerminalEventsEnum.ReaderSoftwareUpdateProgress,\n listenerFunc: ({ progress }: { progress: number }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-finish-installing-update.html)\n */\n addListener(\n eventName: TerminalEventsEnum.FinishInstallingUpdate,\n listenerFunc: (\n args:\n | {\n update: ReaderSoftwareUpdateInterface;\n }\n | {\n error: string;\n },\n ) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted upon connection and every 10 minutes.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-battery-level-update.html)\n */\n addListener(\n eventName: TerminalEventsEnum.BatteryLevel,\n listenerFunc: ({\n level,\n charging,\n status,\n }: {\n level: number;\n charging: boolean;\n status: BatteryStatus;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listenable/on-report-reader-event.html)\n */\n addListener(\n eventName: TerminalEventsEnum.ReaderEvent,\n listenerFunc: ({ event }: { event: ReaderEvent }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted when the Terminal requests that a message be displayed in your app.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-request-reader-display-message.html)\n */\n addListener(\n eventName: TerminalEventsEnum.RequestDisplayMessage,\n listenerFunc: ({\n messageType,\n message,\n }: {\n messageType: ReaderDisplayMessage;\n message: string;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted when the reader begins waiting for input. Your app should prompt the customer\n * to present a source using one of the given input options. If the reader emits a message,\n * the RequestDisplayMessage event will be emitted.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-request-reader-input.html)\n */\n addListener(\n eventName: TerminalEventsEnum.RequestReaderInput,\n listenerFunc: ({\n options,\n message,\n }: {\n options: ReaderInputOption[];\n message: string;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-terminal-listener/on-payment-status-change.html)\n */\n addListener(\n eventName: TerminalEventsEnum.PaymentStatusChange,\n listenerFunc: ({ status }: { status: PaymentStatus }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * @deprecated\n * This method has been deprecated and replaced by the `collectPaymentMethod`.\n * Similarly, note that TerminalEvents.Completed is now obsolete.\n * And, method `confirmPaymentIntent` added to be executed after `collectPaymentMethod` is executed.\n *\n * This is left as type string to avoid accidental use.\n */\n collect: string;\n\n /**\n * @deprecated\n * This method has been deprecated and replaced by the `cancelCollectPaymentMethod`.\n *\n * This is left as type string to avoid accidental use.\n */\n cancelCollect: string;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAkGA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nimport type { TerminalEventsEnum } from './events.enum';\nimport type {\n TerminalConnectTypes,\n UpdateTimeEstimate,\n SimulateReaderUpdate,\n SimulatedCardType,\n BatteryStatus,\n ReaderEvent,\n ReaderDisplayMessage,\n ReaderInputOption,\n PaymentStatus,\n DisconnectReason,\n ConnectionStatus,\n NetworkStatus,\n LocationStatus,\n DeviceType,\n} from './stripe.enum';\n\nexport type ReaderInterface = {\n /**\n * The unique serial number is primary identifier inner plugin.\n */\n serialNumber: string;\n\n label: string;\n batteryLevel: number;\n batteryStatus: BatteryStatus;\n simulated: boolean;\n id: number;\n availableUpdate: ReaderSoftwareUpdateInterface | undefined;\n locationId: string;\n ipAddress: string;\n status: NetworkStatus;\n location: LocationInterface | undefined;\n locationStatus: LocationStatus;\n deviceType: DeviceType;\n deviceSoftwareVersion: string | null;\n\n /**\n * iOS Only properties. These properties are not available on Android.\n */\n isCharging: number;\n\n /**\n * Android Only properties. These properties are not available on iOS.\n */\n baseUrl: string;\n bootloaderVersion: string;\n configVersion: string;\n emvKeyProfileId: string;\n firmwareVersion: string;\n hardwareVersion: string;\n macKeyProfileId: string;\n pinKeyProfileId: string;\n trackKeyProfileId: string;\n settingsVersion: string;\n pinKeysetId: string;\n\n /**\n * @deprecated This property has been deprecated and should use the `serialNumber` property.\n */\n index?: number;\n};\nexport type LocationInterface = {\n id: string;\n displayName: string;\n address: {\n city: string;\n country: string;\n postalCode: string;\n line1: string;\n line2: string;\n state: string;\n };\n ipAddress: string;\n};\n\nexport type ReaderSoftwareUpdateInterface = {\n deviceSoftwareVersion: string;\n estimatedUpdateTime: UpdateTimeEstimate;\n requiredAt: number;\n};\n\nexport type CartLineItem = {\n displayName: string;\n quantity: number;\n amount: number;\n};\n\nexport type Cart = {\n currency: string;\n tax: number;\n total: number;\n lineItems: CartLineItem[];\n};\n\nexport * from './events.enum';\nexport * from './stripe.enum';\nexport interface StripeTerminalPlugin {\n initialize(options: {\n tokenProviderEndpoint?: string;\n isTest: boolean;\n }): Promise<void>;\n discoverReaders(options: {\n type: TerminalConnectTypes;\n locationId?: string;\n }): Promise<{\n readers: ReaderInterface[];\n }>;\n setConnectionToken(options: { token: string }): Promise<void>;\n /**\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.models/-simulator-configuration/index.html)\n */\n setSimulatorConfiguration(options: {\n update?: SimulateReaderUpdate;\n simulatedCard?: SimulatedCardType;\n simulatedTipAmount?: number;\n }): Promise<void>;\n\n /**\n * @param options.autoReconnectOnUnexpectedDisconnect If true, the SDK will automatically attempt to reconnect to the reader. default is false.\n */\n connectReader(options: {\n reader: ReaderInterface;\n autoReconnectOnUnexpectedDisconnect?: boolean;\n\n /**\n * iOS and LocalMobileReader only. Android needs to be set to PaymentIntent only.\n */\n merchantDisplayName?: string;\n\n /**\n * iOS and LocalMobileReader only. Android needs to be set to PaymentIntent only.\n * The Stripe account ID for which these funds are intended.\n */\n onBehalfOf?: string;\n }): Promise<void>;\n getConnectedReader(): Promise<{ reader: ReaderInterface | null }>;\n disconnectReader(): Promise<void>;\n cancelDiscoverReaders(): Promise<void>;\n collectPaymentMethod(options: { paymentIntent: string }): Promise<void>;\n cancelCollectPaymentMethod(): Promise<void>;\n confirmPaymentIntent(): Promise<void>;\n installAvailableUpdate(): Promise<void>;\n cancelInstallUpdate(): Promise<void>;\n setReaderDisplay(options: Cart): Promise<void>;\n clearReaderDisplay(): Promise<void>;\n rebootReader(): Promise<void>;\n cancelReaderReconnection(): Promise<void>;\n\n addListener(\n eventName: TerminalEventsEnum.Loaded,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.RequestedConnectionToken,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.DiscoveredReaders,\n listenerFunc: ({ readers }: { readers: ReaderInterface[] }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.ConnectedReader,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when the reader is disconnected, either in response to [`disconnectReader()`](#disconnectreader)\n * or some connection error.\n *\n * For all reader types, this is emitted in response to [`disconnectReader()`](#disconnectreader)\n * without a `reason` property.\n *\n * For Bluetooth and USB readers, this is emitted with a `reason` property when the reader disconnects.\n *\n * **Note:** For Bluetooth and USB readers, when you call [`disconnectReader()`](#disconnectreader), this event\n * will be emitted twice: one without a `reason` in acknowledgement of your call, and again with a `reason` when the reader\n * finishes disconnecting.\n */\n addListener(\n eventName: TerminalEventsEnum.DisconnectedReader,\n listenerFunc: ({ reason }: { reason?: DisconnectReason }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when the Terminal's connection status changed.\n *\n * Note: You should *not* use this method to detect when a reader unexpectedly disconnects from your app,\n * as it cannot be used to accurately distinguish between expected and unexpected disconnect events.\n *\n * To detect unexpected disconnects (e.g. to automatically notify your user), you should instead use\n * the UnexpectedReaderDisconnect event.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-terminal-listener/on-connection-status-change.html)\n */\n addListener(\n eventName: TerminalEventsEnum.ConnectionStatusChange,\n listenerFunc: ({ status }: { status: ConnectionStatus }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * The Terminal disconnected unexpectedly from the reader.\n *\n * In your implementation of this method, you may want to notify your user that the reader disconnected.\n * You may also call [`discoverReaders()`](#discoverreaders) to begin scanning for readers, and attempt\n * to automatically reconnect to the disconnected reader. Be sure to either set a timeout or make it\n * possible to cancel calls to `discoverReaders()`\n *\n * When connected to a Bluetooth or USB reader, you can get more information about the disconnect by\n * implementing the DisconnectedReader event.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-terminal-listener/on-unexpected-reader-disconnect.html)\n */\n addListener(\n eventName: TerminalEventsEnum.UnexpectedReaderDisconnect,\n listenerFunc: ({ reader }: { reader: ReaderInterface }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.ConfirmedPaymentIntent,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.CollectedPaymentIntent,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when [`cancelCollectPaymentMethod()`](#cancelcollectpaymentmethod) is called and succeeds.\n * The Promise returned by `cancelCollectPaymentMethod()` will also be resolved.\n */\n addListener(\n eventName: TerminalEventsEnum.Canceled,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when either [`collectPaymentMethod()`](#collectpaymentmethod) or [`confirmPaymentIntent()`](#confirmpaymentintent)\n * fails. The Promise returned by the relevant call will also be rejected.\n */\n addListener(\n eventName: TerminalEventsEnum.Failed,\n listenerFunc: () => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Emitted when a software update is available for the connected reader.\n */\n addListener(\n eventName: TerminalEventsEnum.ReportAvailableUpdate,\n listenerFunc: ({\n update,\n }: {\n update: ReaderSoftwareUpdateInterface;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted when the connected reader begins installing a software update.\n * If a mandatory software update is available when a reader first connects, that update is\n * automatically installed. The update will be installed before ConnectedReader is emitted and\n * before the Promise returned by [`connectReader()`](#connectreader) resolves.\n * In this case, you will receive this sequence of events:\n *\n * 1. StartInstallingUpdate\n * 2. ReaderSoftwareUpdateProgress (repeatedly)\n * 3. FinishInstallingUpdates\n * 4. ConnectedReader\n * 5. `connectReader()` Promise resolves\n *\n * Your app should show UI to the user indiciating that a software update is being installed\n * to explain why connecting is taking longer than usual.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-start-installing-update.html)\n */\n addListener(\n eventName: TerminalEventsEnum.StartInstallingUpdate,\n listenerFunc: ({\n update,\n }: {\n update: ReaderSoftwareUpdateInterface;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted periodically while reader software is updating to inform of the installation progress.\n * `progress` is a float between 0 and 1.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-report-reader-software-update-progress.html)\n */\n addListener(\n eventName: TerminalEventsEnum.ReaderSoftwareUpdateProgress,\n listenerFunc: ({ progress }: { progress: number }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-finish-installing-update.html)\n */\n addListener(\n eventName: TerminalEventsEnum.FinishInstallingUpdate,\n listenerFunc: (\n args:\n | {\n update: ReaderSoftwareUpdateInterface;\n }\n | {\n error: string;\n },\n ) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted upon connection and every 10 minutes.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-battery-level-update.html)\n */\n addListener(\n eventName: TerminalEventsEnum.BatteryLevel,\n listenerFunc: ({\n level,\n charging,\n status,\n }: {\n level: number;\n charging: boolean;\n status: BatteryStatus;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listenable/on-report-reader-event.html)\n */\n addListener(\n eventName: TerminalEventsEnum.ReaderEvent,\n listenerFunc: ({ event }: { event: ReaderEvent }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted when the Terminal requests that a message be displayed in your app.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-request-reader-display-message.html)\n */\n addListener(\n eventName: TerminalEventsEnum.RequestDisplayMessage,\n listenerFunc: ({\n messageType,\n message,\n }: {\n messageType: ReaderDisplayMessage;\n message: string;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * **Only applicable to Bluetooth and USB readers.**\n *\n * Emitted when the reader begins waiting for input. Your app should prompt the customer\n * to present a source using one of the given input options. If the reader emits a message,\n * the RequestDisplayMessage event will be emitted.\n *\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-reader-listener/on-request-reader-input.html)\n */\n addListener(\n eventName: TerminalEventsEnum.RequestReaderInput,\n listenerFunc: ({\n options,\n message,\n }: {\n options: ReaderInputOption[];\n message: string;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * [*Stripe docs reference*](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.callable/-terminal-listener/on-payment-status-change.html)\n */\n addListener(\n eventName: TerminalEventsEnum.PaymentStatusChange,\n listenerFunc: ({ status }: { status: PaymentStatus }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.ReaderReconnectStarted,\n listenerFunc: ({\n reader,\n reason,\n }: {\n reader: ReaderInterface;\n reason: string;\n }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.ReaderReconnectSucceeded,\n listenerFunc: ({ reader }: { reader: ReaderInterface }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: TerminalEventsEnum.ReaderReconnectFailed,\n listenerFunc: ({ reader }: { reader: ReaderInterface }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * @deprecated\n * This method has been deprecated and replaced by the `collectPaymentMethod`.\n * Similarly, note that TerminalEvents.Completed is now obsolete.\n * And, method `confirmPaymentIntent` added to be executed after `collectPaymentMethod` is executed.\n *\n * This is left as type string to avoid accidental use.\n */\n collect: string;\n\n /**\n * @deprecated\n * This method has been deprecated and replaced by the `cancelCollectPaymentMethod`.\n *\n * This is left as type string to avoid accidental use.\n */\n cancelCollect: string;\n}\n"]}
@@ -19,6 +19,9 @@ export declare enum TerminalEventsEnum {
19
19
  ReaderEvent = "terminalReaderEvent",
20
20
  RequestDisplayMessage = "terminalRequestDisplayMessage",
21
21
  RequestReaderInput = "terminalRequestReaderInput",
22
- PaymentStatusChange = "terminalPaymentStatusChange"
22
+ PaymentStatusChange = "terminalPaymentStatusChange",
23
+ ReaderReconnectStarted = "terminalReaderReconnectStarted",
24
+ ReaderReconnectSucceeded = "terminalReaderReconnectSucceeded",
25
+ ReaderReconnectFailed = "terminalReaderReconnectFailed"
23
26
  }
24
27
  export declare type TerminalResultInterface = TerminalEventsEnum.ConfirmedPaymentIntent | TerminalEventsEnum.CollectedPaymentIntent | TerminalEventsEnum.Canceled | TerminalEventsEnum.Failed;
@@ -21,5 +21,8 @@ export var TerminalEventsEnum;
21
21
  TerminalEventsEnum["RequestDisplayMessage"] = "terminalRequestDisplayMessage";
22
22
  TerminalEventsEnum["RequestReaderInput"] = "terminalRequestReaderInput";
23
23
  TerminalEventsEnum["PaymentStatusChange"] = "terminalPaymentStatusChange";
24
+ TerminalEventsEnum["ReaderReconnectStarted"] = "terminalReaderReconnectStarted";
25
+ TerminalEventsEnum["ReaderReconnectSucceeded"] = "terminalReaderReconnectSucceeded";
26
+ TerminalEventsEnum["ReaderReconnectFailed"] = "terminalReaderReconnectFailed";
24
27
  })(TerminalEventsEnum || (TerminalEventsEnum = {}));
25
28
  //# sourceMappingURL=events.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.enum.js","sourceRoot":"","sources":["../../src/events.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,kBAsBX;AAtBD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,qEAA+C,CAAA;IAC/C,iFAA2D,CAAA;IAC3D,iEAA2C,CAAA;IAC3C,uEAAiD,CAAA;IACjD,+EAAyD,CAAA;IACzD,uFAAiE,CAAA;IACjE,+EAAyD,CAAA;IACzD,+EAAyD,CAAA;IACzD,mDAA6B,CAAA;IAC7B,+CAAyB,CAAA;IACzB,mFAA6D,CAAA;IAC7D,6EAAuD,CAAA;IACvD,6EAAuD,CAAA;IACvD,2FAAqE,CAAA;IACrE,+EAAyD,CAAA;IACzD,2DAAqC,CAAA;IACrC,yDAAmC,CAAA;IACnC,6EAAuD,CAAA;IACvD,uEAAiD,CAAA;IACjD,yEAAmD,CAAA;AACrD,CAAC,EAtBW,kBAAkB,KAAlB,kBAAkB,QAsB7B","sourcesContent":["export enum TerminalEventsEnum {\n Loaded = 'terminalLoaded',\n DiscoveredReaders = 'terminalDiscoveredReaders',\n CancelDiscoveredReaders = 'terminalCancelDiscoveredReaders',\n ConnectedReader = 'terminalConnectedReader',\n DisconnectedReader = 'terminalDisconnectedReader',\n ConnectionStatusChange = 'terminalConnectionStatusChange',\n UnexpectedReaderDisconnect = 'terminalUnexpectedReaderDisconnect',\n ConfirmedPaymentIntent = 'terminalConfirmedPaymentIntent',\n CollectedPaymentIntent = 'terminalCollectedPaymentIntent',\n Canceled = 'terminalCanceled',\n Failed = 'terminalFailed',\n RequestedConnectionToken = 'terminalRequestedConnectionToken',\n ReportAvailableUpdate = 'terminalReportAvailableUpdate',\n StartInstallingUpdate = 'terminalStartInstallingUpdate',\n ReaderSoftwareUpdateProgress = 'terminalReaderSoftwareUpdateProgress',\n FinishInstallingUpdate = 'terminalFinishInstallingUpdate',\n BatteryLevel = 'terminalBatteryLevel',\n ReaderEvent = 'terminalReaderEvent',\n RequestDisplayMessage = 'terminalRequestDisplayMessage',\n RequestReaderInput = 'terminalRequestReaderInput',\n PaymentStatusChange = 'terminalPaymentStatusChange',\n}\n\nexport type TerminalResultInterface =\n | TerminalEventsEnum.ConfirmedPaymentIntent\n | TerminalEventsEnum.CollectedPaymentIntent\n | TerminalEventsEnum.Canceled\n | TerminalEventsEnum.Failed;\n"]}
1
+ {"version":3,"file":"events.enum.js","sourceRoot":"","sources":["../../src/events.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,kBAyBX;AAzBD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,qEAA+C,CAAA;IAC/C,iFAA2D,CAAA;IAC3D,iEAA2C,CAAA;IAC3C,uEAAiD,CAAA;IACjD,+EAAyD,CAAA;IACzD,uFAAiE,CAAA;IACjE,+EAAyD,CAAA;IACzD,+EAAyD,CAAA;IACzD,mDAA6B,CAAA;IAC7B,+CAAyB,CAAA;IACzB,mFAA6D,CAAA;IAC7D,6EAAuD,CAAA;IACvD,6EAAuD,CAAA;IACvD,2FAAqE,CAAA;IACrE,+EAAyD,CAAA;IACzD,2DAAqC,CAAA;IACrC,yDAAmC,CAAA;IACnC,6EAAuD,CAAA;IACvD,uEAAiD,CAAA;IACjD,yEAAmD,CAAA;IACnD,+EAAyD,CAAA;IACzD,mFAA6D,CAAA;IAC7D,6EAAuD,CAAA;AACzD,CAAC,EAzBW,kBAAkB,KAAlB,kBAAkB,QAyB7B","sourcesContent":["export enum TerminalEventsEnum {\n Loaded = 'terminalLoaded',\n DiscoveredReaders = 'terminalDiscoveredReaders',\n CancelDiscoveredReaders = 'terminalCancelDiscoveredReaders',\n ConnectedReader = 'terminalConnectedReader',\n DisconnectedReader = 'terminalDisconnectedReader',\n ConnectionStatusChange = 'terminalConnectionStatusChange',\n UnexpectedReaderDisconnect = 'terminalUnexpectedReaderDisconnect',\n ConfirmedPaymentIntent = 'terminalConfirmedPaymentIntent',\n CollectedPaymentIntent = 'terminalCollectedPaymentIntent',\n Canceled = 'terminalCanceled',\n Failed = 'terminalFailed',\n RequestedConnectionToken = 'terminalRequestedConnectionToken',\n ReportAvailableUpdate = 'terminalReportAvailableUpdate',\n StartInstallingUpdate = 'terminalStartInstallingUpdate',\n ReaderSoftwareUpdateProgress = 'terminalReaderSoftwareUpdateProgress',\n FinishInstallingUpdate = 'terminalFinishInstallingUpdate',\n BatteryLevel = 'terminalBatteryLevel',\n ReaderEvent = 'terminalReaderEvent',\n RequestDisplayMessage = 'terminalRequestDisplayMessage',\n RequestReaderInput = 'terminalRequestReaderInput',\n PaymentStatusChange = 'terminalPaymentStatusChange',\n ReaderReconnectStarted = 'terminalReaderReconnectStarted',\n ReaderReconnectSucceeded = 'terminalReaderReconnectSucceeded',\n ReaderReconnectFailed = 'terminalReaderReconnectFailed',\n}\n\nexport type TerminalResultInterface =\n | TerminalEventsEnum.ConfirmedPaymentIntent\n | TerminalEventsEnum.CollectedPaymentIntent\n | TerminalEventsEnum.Canceled\n | TerminalEventsEnum.Failed;\n"]}
@@ -0,0 +1,501 @@
1
+ /** Properties of a TipOption. */
2
+ interface ITipOption {
3
+ /** REQUIRED: Amount of this tip option */
4
+ amount?: number | null;
5
+ /** Descriptor of the amount, displayed in the button */
6
+ label?: string | null;
7
+ }
8
+ /** Properties of a TipConfiguration. */
9
+ export interface ITipConfiguration {
10
+ /** List of at most 3 options */
11
+ options?: ITipOption[] | null;
12
+ /** Hide the custom amount button */
13
+ hide_custom_amount?: boolean | null;
14
+ }
15
+ /** Properties of a TipSelection. */
16
+ interface ITipSelection {
17
+ /** Amount associated with the selection */
18
+ amount?: number | null;
19
+ }
20
+ /** CreditCardBrand enum. */
21
+ declare type CreditCardBrand = 'INVALID_CREDIT_CARD_BRAND' | 'UNKNOWN_CREDIT' | 'AMERICAN_EXPRESS' | 'DINERS' | 'DISCOVER' | 'JCB' | 'MASTERCARD' | 'VISA' | 'CUP';
22
+ /** CardEntryMethod enum. */
23
+ declare type CardEntryMethod = 'INVALID_ENTRY_METHOD' | 'CHIP_READ' | 'CONTACTLESS' | 'FSWIPE' | 'KEYED' | 'SWIPED' | 'BARCODE_READ';
24
+ /** Properties of a CardPaymentMethod. */
25
+ interface ICardPaymentMethod {
26
+ /** Masked card data */
27
+ masked_pan?: string | null;
28
+ /** The card expiration date */
29
+ expiration_date?: string | null;
30
+ /** Brand of credit card tender, determined by BIN table lookup */
31
+ card_brand?: CreditCardBrand | null;
32
+ /** Entry method of payment */
33
+ card_entry_method?: CardEntryMethod | null;
34
+ }
35
+ /** Properties of a PaymentMethod. */
36
+ export interface IPaymentMethod {
37
+ /** PaymentMethod card_payment */
38
+ card_payment?: ICardPaymentMethod | null;
39
+ /** Tip selection chosen by the cardholder */
40
+ tip_selection?: ITipSelection | null;
41
+ }
42
+ /** Properties of a PaymentMethod. */
43
+ export interface IPaymentMethodReadReusableResponse {
44
+ /** Unique identifier for the Payment Method object */
45
+ id?: string | null;
46
+ /** Time at which the Payment Method object was created. Measured in seconds since the Unix epoch */
47
+ created?: number | null;
48
+ /** Customer ID */
49
+ customer?: string | null;
50
+ /** Whether this charge was made in live mode or not */
51
+ livemode?: boolean | null;
52
+ /** Meta data in JSON format */
53
+ metadata?: {
54
+ [k: string]: string;
55
+ } | null;
56
+ /** PaymentMethod type */
57
+ type?: string | null;
58
+ /** Card representation of payment method */
59
+ card?: ICardPaymentMethodReadReusableResponse | null;
60
+ }
61
+ /** Properties of a CardPaymentMethod. */
62
+ interface ICardPaymentMethodReadReusableResponse {
63
+ /** Masked card data */
64
+ masked_pan?: string | null;
65
+ /** The card expiration date */
66
+ expiration_date?: string | null;
67
+ /** Brand of credit card tender, determined by BIN table lookup */
68
+ card_brand?: CreditCardBrand | null;
69
+ /** Entry method of payment */
70
+ card_entry_method?: CardEntryMethod | null;
71
+ }
72
+ /** Properties of an ErrorResponse. */
73
+ export interface IErrorResponse {
74
+ /** The type of error returned. */
75
+ type?: string | null;
76
+ /** ID of failed charge */
77
+ charge?: string | null;
78
+ /** For some errors that could be handled programmatically, a short string indicating the error code reported. (https://stripe.com/docs/error-codes) */
79
+ code?: string | null;
80
+ /** For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one. (https://stripe.com/docs/declines#issuer-declines) */
81
+ decline_code?: string | null;
82
+ /** A URL to more information about the error code reported. */
83
+ doc_url?: string | null;
84
+ /** A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. */
85
+ message?: string | null;
86
+ /** If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. */
87
+ param?: string | null;
88
+ /** Source used for the error */
89
+ source?: ISource | null;
90
+ /** Payment intent used for the error */
91
+ payment_intent?: IPaymentIntent | null;
92
+ }
93
+ /** Properties of an Owner. */
94
+ export interface IOwner {
95
+ /** Owner address */
96
+ address?: string | null;
97
+ /** Owner email */
98
+ email?: string | null;
99
+ /** Owner name */
100
+ name?: string | null;
101
+ /** Owner phone */
102
+ phone?: string | null;
103
+ /** Owner verified_address */
104
+ verified_address?: string | null;
105
+ /** Owner verified_email */
106
+ verified_email?: string | null;
107
+ /** Owner verified_name */
108
+ verified_name?: string | null;
109
+ /** Owner verified_phone */
110
+ verified_phone?: string | null;
111
+ }
112
+ /** Properties of a PaymentMethodDetails. */
113
+ export interface IPaymentMethodDetails {
114
+ /** Payment Method type (e.g. "card_present") */
115
+ type?: string | null;
116
+ /** PaymentMethodDetails card_present */
117
+ card_present?: ICardPresent | null;
118
+ /** PaymentMethodDetails interac_present */
119
+ interac_present?: ICardPresent | null;
120
+ }
121
+ /** Properties of a Refund. */
122
+ interface IRefund {
123
+ /** Refund id */
124
+ id?: string | null;
125
+ /** Refund amount */
126
+ amount?: number | null;
127
+ /** Refund charge */
128
+ charge?: string | null;
129
+ /** Time at which the Refund object was created. Measured in seconds since the Unix epoch */
130
+ created?: number | null;
131
+ /** Three-letter ISO currency code, in lowercase. Must be a supported currency */
132
+ currency?: string | null;
133
+ /** Meta data in JSON format */
134
+ metadata?: {
135
+ [k: string]: string;
136
+ } | null;
137
+ /** Reason for refund */
138
+ reason?: string | null;
139
+ /** Status of refund */
140
+ status?: string | null;
141
+ /** Actual details of the payment method */
142
+ payment_method_details?: IPaymentMethodDetails | null;
143
+ /** If the refund failed, the reason for refund failure if known. */
144
+ failure_reason?: string | null;
145
+ }
146
+ /** Properties of a Refunds. */
147
+ interface IRefunds {
148
+ /** Refunds data */
149
+ data?: IRefund[] | null;
150
+ /** Refunds has_more */
151
+ has_more?: boolean | null;
152
+ /** Refunds total_count */
153
+ total_count?: number | null;
154
+ }
155
+ /** Properties of a Charge. */
156
+ interface ICharge {
157
+ /** ID for charge */
158
+ id?: string | null;
159
+ /** Amount that is associated with the charge */
160
+ amount?: number | null;
161
+ /** Amount that is associated with a refund of the charge */
162
+ amount_refunded?: number | null;
163
+ /** Whether this charge has been captured */
164
+ captured?: boolean | null;
165
+ /** Whether this charge has been refunded */
166
+ refunded?: boolean | null;
167
+ /** Time at which the Charge object was created. Measured in seconds since the Unix epoch */
168
+ created?: number | null;
169
+ /** Three-letter ISO currency code, in lowercase. Must be a supported currency. */
170
+ currency?: string | null;
171
+ /** An arbitrary string attached to the object. Often useful for displaying to users. */
172
+ description?: string | null;
173
+ /** An arbitrary string to be displayed on your customer's credit card statement. */
174
+ statement_descriptor?: string | null;
175
+ /** Email address that the receipt for the resulting payment will be sent to. */
176
+ receipt_email?: string | null;
177
+ /** Failure code if the charge was declined */
178
+ failure_code?: string | null;
179
+ /** Message associated with the failure code */
180
+ failure_message?: string | null;
181
+ /** Whether this charge was made in live mode or not */
182
+ livemode?: boolean | null;
183
+ /** Meta data in JSON format */
184
+ metadata?: {
185
+ [k: string]: string;
186
+ } | null;
187
+ /** Source associated with the charge */
188
+ source?: ISource | null;
189
+ /** Payment intent ID associated with the charge */
190
+ payment_intent?: string | null;
191
+ /** Status of the charge */
192
+ status?: string | null;
193
+ /** Payment method ID */
194
+ payment_method?: string | null;
195
+ /** Actual details of the payment method */
196
+ payment_method_details?: IPaymentMethodDetails | null;
197
+ /** Whether the charge was paid */
198
+ paid?: boolean | null;
199
+ /** Receipt URL */
200
+ receipt_url?: string | null;
201
+ /** Refunds associated with charge */
202
+ refunds?: IRefunds | null;
203
+ }
204
+ /** Properties of a Charges. */
205
+ interface ICharges {
206
+ /** Charges data */
207
+ data?: ICharge[] | null;
208
+ /** Charges has_more */
209
+ has_more?: boolean | null;
210
+ /** Charges total_count */
211
+ total_count?: number | null;
212
+ }
213
+ /** Properties of a CardPresent. */
214
+ interface ICardPresent {
215
+ /** The last four digits of the card. */
216
+ last4?: string | null;
217
+ /** Card brand */
218
+ brand?: string | null;
219
+ /** Customer's signature if signed */
220
+ evidence_customer_signature?: string | null;
221
+ /** Method used by POS to read the card */
222
+ read_method?: string | null;
223
+ /** The EMV authorization response payload */
224
+ emv_auth_data?: string | null;
225
+ /** The EMV authorization response code */
226
+ authorization_response_code?: string | null;
227
+ /** AID */
228
+ dedicated_file_name?: string | null;
229
+ /** AID name */
230
+ application_preferred_name?: string | null;
231
+ /** TVR */
232
+ terminal_verification_results?: string | null;
233
+ /** TSI */
234
+ transaction_status_information?: string | null;
235
+ /** CVM type */
236
+ cvm_type?: string | null;
237
+ /** CardPresent reader */
238
+ reader?: string | null;
239
+ /** CardPresent fingerprint */
240
+ fingerprint?: string | null;
241
+ /** CardPresent authorization_code */
242
+ authorization_code?: string | null;
243
+ }
244
+ /** Properties of a Source. */
245
+ export interface ISource {
246
+ /** Unique identifier for the source card object. */
247
+ id?: string | null;
248
+ /** Source type (e.g. "card_present") */
249
+ type?: string | null;
250
+ /** Card payment method */
251
+ card_present?: ICardPresent | null;
252
+ /** Interac version of card present */
253
+ interac_present?: ICardPresent | null;
254
+ /** Meta data in JSON format */
255
+ metadata?: {
256
+ [k: string]: string;
257
+ } | null;
258
+ /** Owner data */
259
+ owner?: IOwner | null;
260
+ }
261
+ export interface IPaymentIntent {
262
+ /** Unique identifier for the Payment Intent object */
263
+ id?: string | null;
264
+ /** Time at which the Payment Intent object was created. Measured in seconds since the Unix epoch */
265
+ created?: number | null;
266
+ /** Status of this PaymentIntent */
267
+ status?: string | null;
268
+ /** Amount intended to be collected by this Payment Intent */
269
+ amount?: number | null;
270
+ /** Three-letter ISO currency code, in lowercase. Must be a supported currency. */
271
+ currency?: string | null;
272
+ /** Card present payment source field map */
273
+ source?: ISource | null;
274
+ /** An arbitrary string to be displayed on your customer's credit card statement. */
275
+ statement_descriptor?: string | null;
276
+ /** An arbitrary string attached to the object. Often useful for displaying to users. */
277
+ description?: string | null;
278
+ /** Email address that the receipt for the resulting payment will be sent to. */
279
+ receipt_email?: string | null;
280
+ /** Whether this charge was made in live mode or not */
281
+ livemode?: boolean | null;
282
+ /** Last payment error on a charge (if retrieved) */
283
+ last_payment_error?: IErrorResponse | null;
284
+ /** Meta data in JSON format */
285
+ metadata?: {
286
+ [k: string]: string;
287
+ } | null;
288
+ /** Charges associated with the payment intent */
289
+ charges?: ICharges | null;
290
+ /** ID for payment method */
291
+ payment_method?: string | null;
292
+ }
293
+ export interface ISetupIntent {
294
+ /** Unique identifier for the object. */
295
+ id?: string | null;
296
+ /** The client secret of this SetupIntent. Used for client-side retrieval using a publishable key. */
297
+ client_secret?: string | null;
298
+ /** ID of the Customer this SetupIntent belongs to, if one exists. */
299
+ customer?: string | null;
300
+ /** An arbitrary string attached to the object. Often useful for displaying to users. */
301
+ description?: string | null;
302
+ /** The error encountered in the previous SetupIntent confirmation. */
303
+ last_setup_error?: ILastSetupError | null;
304
+ /** Meta data in JSON format */
305
+ metadata?: {
306
+ [k: string]: string;
307
+ } | null;
308
+ /** If present, this property tells you what actions you need to take in order for your customer to continue payment setup. */
309
+ next_action?: INextAction | null;
310
+ /** ID of the payment method used with this SetupIntent. */
311
+ payment_method?: string | null;
312
+ /** The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. */
313
+ payment_method_types?: string[] | null;
314
+ /** Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. */
315
+ status?: string | null;
316
+ /** Indicates how the payment method is intended to be used in the future. */
317
+ usage?: string | null;
318
+ /** Time at which the object was created. Measured in seconds since the Unix epoch. */
319
+ created?: number | null;
320
+ /** The most recent SetupAttempt for this SetupIntent. */
321
+ latest_attempt?: ISetupAttempt | null;
322
+ /** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */
323
+ livemode?: boolean | null;
324
+ /** ID of the multi use Mandate generated by the SetupIntent. */
325
+ mandate?: string | null;
326
+ /** ID of the single_use Mandate generated by the SetupIntent. */
327
+ single_use_mandate?: string | null;
328
+ /** ID of the Connect application that created the SetupIntent. */
329
+ application?: string | null;
330
+ /** The account (if any) for which the setup is intended. */
331
+ on_behalf_of?: string | null;
332
+ /** Payment-method-specific configuration for this SetupIntent. */
333
+ payment_method_options?: IPaymentMethodOptions | null;
334
+ }
335
+ /** Properties of a SetupAttempt. */
336
+ export interface ISetupAttempt {
337
+ /** Unique identifier for the object. */
338
+ id?: string | null;
339
+ /** String representing the object’s type: "setup_attempt" */
340
+ object?: string | null;
341
+ /** ID of the Connect application that created the SetupIntent. */
342
+ application?: string | null;
343
+ /** Time at which the object was created. Measured in seconds since the Unix epoch. */
344
+ created?: number | null;
345
+ /** ID of the Customer this SetupIntent belongs to, if one exists. */
346
+ customer?: string | null;
347
+ /** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */
348
+ livemode?: boolean | null;
349
+ /** The account (if any) for which the setup is intended. */
350
+ on_behalf_of?: string | null;
351
+ /** ID of the payment method used with this SetupAttempt. */
352
+ payment_method?: string | null;
353
+ /** Details about the payment method at the time of SetupIntent confirmation. */
354
+ payment_method_details?: IPaymentMethodDetails | null;
355
+ /** The error encountered during this attempt to confirm the SetupIntent, if any. */
356
+ setup_error?: ISetupError | null;
357
+ /** ID of the SetupIntent that this attempt belongs to. */
358
+ setup_intent?: string | null;
359
+ /** Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. */
360
+ status?: string | null;
361
+ /** The value of usage on the SetupIntent at the time of this confirmation, one of off_session or on_session. */
362
+ usage?: string | null;
363
+ }
364
+ /** Properties of a SetupError. */
365
+ export interface ISetupError {
366
+ /** For some errors that could be handled programmatically, a short string indicating the error code reported. */
367
+ code?: string | null;
368
+ /** For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one. */
369
+ decline_code?: string | null;
370
+ /** A URL to more information about the error code reported. */
371
+ doc_url?: string | null;
372
+ /** A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. */
373
+ message?: string | null;
374
+ /** If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. */
375
+ param?: string | null;
376
+ /** The PaymentMethod object for errors returned on a request involving a PaymentMethod. */
377
+ payment_method?: IPaymentMethod | null;
378
+ /** If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. */
379
+ payment_method_type?: string | null;
380
+ /** The type of error returned. One of api_connection_error, api_error, authentication_error, card_error, idempotency_error, invalid_request_error, or rate_limit_error */
381
+ type?: string | null;
382
+ }
383
+ /** Properties of an ActivateTerminalRequest. */
384
+ export interface IActivateTerminalRequest {
385
+ /** An activation token obtained from Stripe that can be used to activate the reader */
386
+ pos_activation_token?: string | null;
387
+ /** The fingerprint for the POS authenticating to rabbit */
388
+ pos_device_id?: string | null;
389
+ /** The terminal hardware information */
390
+ pos_hardware_info?: any | null;
391
+ /** The terminal software information */
392
+ pos_software_info?: any | null;
393
+ /** Provide RPC error if reader is currently in use */
394
+ fail_if_in_use?: boolean | null;
395
+ /** The logical identity of terminal (i.e. lane number) authenticating to rabbit. */
396
+ terminal_id?: string | null;
397
+ /** ActivateTerminalRequest terminal_ip */
398
+ terminal_ip?: string | null;
399
+ /** The store name associated with the POS */
400
+ store_name?: string | null;
401
+ /** The store address associated with the POS */
402
+ store_address?: any | null;
403
+ }
404
+ /** Properties of a SetReaderDisplayRequest. */
405
+ export interface ISetReaderDisplayRequest {
406
+ /** SetReaderDisplayRequest type */
407
+ type?: string | null;
408
+ /** SetReaderDisplayRequest cart */
409
+ cart?: ICart | null;
410
+ }
411
+ export interface ICart {
412
+ /** All line items in the basket */
413
+ line_items?: ILineItem[] | null;
414
+ /** Modifiers that have been applied to the basket. */
415
+ modifiers?: IModifier[] | null;
416
+ /** Any discounts that have been added to the basket. */
417
+ discounts?: IDiscount[] | null;
418
+ /** Tenders that have been charged/refunded */
419
+ tenders?: ITender[] | null;
420
+ /** Total amount of tax */
421
+ tax?: number | null;
422
+ /** Total balance of cart due */
423
+ total?: number | null;
424
+ /** The currency of the basket (i.e. USD or AUD). */
425
+ currency?: string | null;
426
+ }
427
+ /** Properties of a LineItem. */
428
+ interface ILineItem {
429
+ /** LineItem quantity */
430
+ quantity?: number | null;
431
+ /** A detailed description of the item. */
432
+ description?: string | null;
433
+ /** This is equal to extended_price - discount + modifiers */
434
+ amount?: number | null;
435
+ /** The discounts that have been applied to this line item. */
436
+ discounts?: IDiscount[] | null;
437
+ /** The modifiers that have been applied to this line item. */
438
+ modifiers?: IModifier[] | null;
439
+ }
440
+ interface IModifier {
441
+ /** A detailed description of discount. */
442
+ description?: string | null;
443
+ /** Amount in cents of the modification. */
444
+ amount?: number | null;
445
+ }
446
+ /** Properties of a Discount. */
447
+ interface IDiscount {
448
+ /** A detailed description of discount. */
449
+ description?: string | null;
450
+ /** The amount and mechanism of the discount */
451
+ amount?: number | null;
452
+ }
453
+ /** Properties of a Tender. */
454
+ interface ITender {
455
+ /** A detailed description of tender. */
456
+ description?: string | null;
457
+ /** Amount in cents of the tender. */
458
+ amount?: number | null;
459
+ }
460
+ interface ILastSetupError {
461
+ /** For some errors that could be handled programmatically, a short string indicating the error code reported. */
462
+ code?: string | null;
463
+ /** For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one. */
464
+ decline_code?: string | null;
465
+ /** A URL to more information about the error code reported. */
466
+ doc_url?: string | null;
467
+ /** A human-readable message providing more details about the error. For card errors, these messages can be shown to users. */
468
+ message?: string | null;
469
+ /** If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. */
470
+ param?: string | null;
471
+ /** The PaymentMethod object for errors returned on a request involving a PaymentMethod. */
472
+ payment_method?: IPaymentMethod | null;
473
+ /** One of: api_connection_error, api_error, authentication_error, card_error, idempotency_error, invalid_request_error, or rate_limit_error */
474
+ type?: string | null;
475
+ }
476
+ interface INextAction {
477
+ /** Contains instructions for authenticating by redirecting your customer to another page or application. */
478
+ redirect_to_url?: IRedirectToUrl | null;
479
+ /** Type of the next action to perform, one of redirect_to_url or use_stripe_sdk. */
480
+ type?: string | null;
481
+ /** When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. */
482
+ use_stripe_sdk?: {
483
+ [k: string]: string;
484
+ } | null;
485
+ }
486
+ interface IRedirectToUrl {
487
+ /** If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. */
488
+ return_url?: string | null;
489
+ /** The URL you must redirect your customer to in order to authenticate. */
490
+ url?: string | null;
491
+ }
492
+ interface IPaymentMethodOptions {
493
+ /** PaymentMethodOptions card */
494
+ card?: ICardOptions | null;
495
+ }
496
+ interface ICardOptions {
497
+ /** CardOptions request_three_d_secure */
498
+ request_three_d_secure?: Request3dSecureType | null;
499
+ }
500
+ declare type Request3dSecureType = 'automatic' | 'any';
501
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=proto.js.map