react-native-unit-components 1.1.0 → 1.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.
- package/README.md +70 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +8 -0
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +12 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +4 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +6 -5
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/cardMessage.js +1 -13
- package/lib/commonjs/messages/nativeMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/accountMessage.js +12 -0
- package/lib/commonjs/messages/webMessages/accountMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +14 -3
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/sharedTypes/account.types.js +31 -0
- package/lib/commonjs/sharedTypes/account.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/achCredit.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/bookPayment.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/card.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/index.js +11 -0
- package/lib/commonjs/sharedTypes/index.js.map +1 -1
- package/lib/commonjs/sharedTypes/onLoadResponse.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/payments.types.js +6 -6
- package/lib/commonjs/sharedTypes/payments.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/types.js.map +1 -1
- package/lib/commonjs/sharedTypes/wallet.types.js +13 -1
- package/lib/commonjs/sharedTypes/wallet.types.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.js +2 -1
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +2 -0
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +8 -0
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +11 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +4 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +7 -6
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/messages/nativeMessages/cardMessage.js +0 -11
- package/lib/module/messages/nativeMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/webMessages/accountMessage.js +5 -0
- package/lib/module/messages/webMessages/accountMessage.js.map +1 -0
- package/lib/module/messages/webMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +14 -3
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/sharedTypes/account.types.js +23 -0
- package/lib/module/sharedTypes/account.types.js.map +1 -0
- package/lib/module/sharedTypes/achCredit.types.js.map +1 -1
- package/lib/module/sharedTypes/bookPayment.types.js.map +1 -1
- package/lib/module/sharedTypes/card.types.js.map +1 -1
- package/lib/module/sharedTypes/index.js +1 -0
- package/lib/module/sharedTypes/index.js.map +1 -1
- package/lib/module/sharedTypes/onLoadResponse.types.js.map +1 -1
- package/lib/module/sharedTypes/payments.types.js +4 -4
- package/lib/module/sharedTypes/payments.types.js.map +1 -1
- package/lib/module/sharedTypes/types.js.map +1 -1
- package/lib/module/sharedTypes/wallet.types.js +11 -0
- package/lib/module/sharedTypes/wallet.types.js.map +1 -1
- package/lib/module/webComponent/WebComponent.js +2 -1
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/html.js +2 -0
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +2 -2
- package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +2 -2
- package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +4 -2
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +2 -2
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -2
- package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +2 -2
- package/lib/typescript/messages/nativeMessages/cardMessage.d.ts +4 -13
- package/lib/typescript/messages/webMessages/accountMessage.d.ts +8 -0
- package/lib/typescript/messages/webMessages/index.d.ts +3 -2
- package/lib/typescript/messages/webMessages/unitMessages.d.ts +2 -2
- package/lib/typescript/scripts/html/bodyScript.d.ts +1 -0
- package/lib/typescript/sharedTypes/account.types.d.ts +114 -0
- package/lib/typescript/sharedTypes/achCredit.types.d.ts +13 -13
- package/lib/typescript/sharedTypes/bookPayment.types.d.ts +11 -11
- package/lib/typescript/sharedTypes/card.types.d.ts +18 -18
- package/lib/typescript/sharedTypes/index.d.ts +1 -0
- package/lib/typescript/sharedTypes/onLoadResponse.types.d.ts +3 -3
- package/lib/typescript/sharedTypes/payments.types.d.ts +5 -5
- package/lib/typescript/sharedTypes/types.d.ts +7 -7
- package/lib/typescript/sharedTypes/wallet.types.d.ts +11 -2
- package/package.json +1 -1
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +3 -3
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +3 -3
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +11 -3
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +15 -4
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +3 -3
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +11 -1
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.tsx +8 -7
- package/src/components/UNCardComponent/UNCardComponent.tsx +5 -5
- package/src/messages/nativeMessages/cardMessage.ts +5 -15
- package/src/messages/webMessages/accountMessage.ts +12 -0
- package/src/messages/webMessages/index.ts +3 -0
- package/src/messages/webMessages/unitMessages.ts +2 -2
- package/src/scripts/html/bodyScript.ts +14 -2
- package/src/sharedTypes/account.types.ts +117 -0
- package/src/sharedTypes/achCredit.types.ts +13 -13
- package/src/sharedTypes/bookPayment.types.ts +11 -11
- package/src/sharedTypes/card.types.ts +18 -18
- package/src/sharedTypes/index.ts +1 -0
- package/src/sharedTypes/onLoadResponse.types.ts +5 -5
- package/src/sharedTypes/payments.types.ts +5 -5
- package/src/sharedTypes/types.ts +8 -8
- package/src/sharedTypes/wallet.types.ts +13 -3
- package/src/webComponent/WebComponent.tsx +1 -1
- package/src/webComponent/html.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["achCredit.types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["achCredit.types.ts"],"sourcesContent":["import type { UNAchCounterparty, UNCounterpartyVerificationMethod, UNPaymentStatus } from './payments.types';\nimport type { UNTags, UNRelationship } from './types';\n\nexport type UNACHData = {\n type: 'achPayment',\n id: string,\n attributes: {\n createdAt: string | Date,\n status: UNPaymentStatus,\n settlementDate?: Date,\n reason: string,\n direction: 'Debit' | 'Credit',\n description: string,\n transactionSummaryOverride?: string,\n amount: string,\n tags: UNTags,\n addenda?: string\n\t\tcounterparty: UNAchCounterparty\n\t\texpectedCompletionDate?: Date\n\t\tcounterpartyVerificationMethod?:keyof typeof UNCounterpartyVerificationMethod\n\t\tsameDay?: boolean\n },\n relationships: {\n account: UNRelationship,\n customer?: UNRelationship,\n customers?: UNRelationship,\n counterpartyAccount: UNRelationship,\n counterpartyCustomer: UNRelationship,\n transaction: UNRelationship,\n recurringPayment: UNRelationship\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["bookPayment.types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["bookPayment.types.ts"],"sourcesContent":["import type { UNPaymentStatus } from './payments.types';\nimport type { UNTags, UNRelationship } from './types';\n\nexport type UNBookPaymentData = {\n type: 'bookPayment',\n id: string,\n attributes: {\n createdAt: string | Date,\n status: UNPaymentStatus,\n reason: string,\n direction: 'Debit' | 'Credit',\n description: string,\n transactionSummaryOverride?: string,\n amount: string,\n tags: UNTags,\n },\n relationships: {\n account: UNRelationship,\n customer?: UNRelationship,\n customers?: UNRelationship,\n counterpartyAccount: UNRelationship,\n counterpartyCustomer: UNRelationship,\n transaction: UNRelationship,\n recurringPayment: UNRelationship\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["card.types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["card.types.ts"],"sourcesContent":["import type { UNAddress, UNFullName, UNLimits, UNRelationship, UNTags } from './types';\n\nexport type UNCardData = UNIndividualDebitCard | UNBusinessDebitCard\n\ntype UNCardStatus = 'Active' | 'Inactive' | 'Stolen' | 'Lost' | 'Frozen' | 'ClosedByCustomer' | 'SuspectedFraud'\n\nexport type UNIndividualDebitCard = {\n id: string,\n type: 'individualDebitCard' | 'individualVirtualDebitCard',\n attributes: {\n createdAt: string,\n last4Digits: string,\n expirationDate: string,\n status: UNCardStatus,\n shippingAddress?: UNAddress, /* not exists in virtual card */\n updatedAt?: string,\n design?: string,\n additionalEmbossedText?: string,\n idempotencyKey?: string,\n tags?: UNTags,\n limits?: UNLimits,\n printOnlyBusinessName?: boolean\n },\n relationships: {\n account: UNRelationship,\n customer: UNRelationship\n }\n}\n\nexport type UNBusinessDebitCard = {\n id: string,\n type: 'businessDebitCard' | 'businessVirtualDebitCard',\n attributes: {\n fullName: UNFullName,\n dateOfBirth: string,\n address: UNAddress,\n shippingAddress?: UNAddress,\n phone: string,\n email: string,\n createdAt: string,\n last4Digits: string,\n expirationDate: string,\n status: UNCardStatus,\n updatedAt?: string,\n ssn?: string,\n passport?: string,\n nationality?: string,\n design?: string,\n additionalEmbossedText?: string,\n idempotencyKey?: string,\n tags?: Record<string, string>\n limits?: UNLimits,\n printOnlyBusinessName?: boolean\n },\n relationships: {\n account: UNRelationship,\n customer: UNRelationship\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\nexport * from './onLoadResponse.types';\nexport * from './achCredit.types';\nexport * from './payments.types';\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,wBAAwB;AACtC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\nexport * from './onLoadResponse.types';\nexport * from './achCredit.types';\nexport * from './payments.types';\nexport * from \"./account.types\";\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,wBAAwB;AACtC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["onLoadResponse.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { UNCardData } from '../sharedTypes';\n\nexport type
|
|
1
|
+
{"version":3,"names":[],"sources":["onLoadResponse.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { UNCardData } from '../sharedTypes';\n\nexport type UNSuccessResponseUnitOnLoad = {\n /*\n Object since the current response data types from 'Activities' and 'BookPayment' do not have documentation.\n When things are determined, we may update it\n */\n data: UNCardData | Object,\n included: [Object],\n errors: null\n}\n\nexport type UNErrorResponseUnitOnLoad = {\n errors: [\n {\n status: string,\n title: string,\n detail?: string,\n details?: string,\n meta?: Record<string, string>\n }\n ]\n}\nexport type UNResponseUnitOnLoadEvent =\n | UNSuccessResponseUnitOnLoad\n | UNErrorResponseUnitOnLoad\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export let
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
})(
|
|
1
|
+
export let UNCounterpartyVerificationMethod;
|
|
2
|
+
(function (UNCounterpartyVerificationMethod) {
|
|
3
|
+
UNCounterpartyVerificationMethod["Plaid"] = "Plaid";
|
|
4
|
+
})(UNCounterpartyVerificationMethod || (UNCounterpartyVerificationMethod = {}));
|
|
5
5
|
//# sourceMappingURL=payments.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["UNCounterpartyVerificationMethod"],"sources":["payments.types.ts"],"sourcesContent":["export type UNPaymentStatus = 'Sent' | 'Rejected'\n\nexport type UNAchCounterparty = {\n\tname: string\n\taccountNumber: string\n\troutingNumber: string\n\taccountType: UNAccountType\n}\n\ntype UNAccountType = 'Savings' | 'Checking'\n\nexport enum UNCounterpartyVerificationMethod {\n\tPlaid = 'Plaid',\n}\n"],"mappings":"AAWA,WAAYA,gCAAgC;AAE3C,WAFWA,gCAAgC;EAAhCA,gCAAgC;AAAA,GAAhCA,gCAAgC,KAAhCA,gCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type UNAddress = {\n street: string,\n street2?: string,\n city: string,\n state: string,\n postalCode: string,\n country: string\n}\n\nexport type UNLimits = {\n dailyWithdrawal?: string | number,\n dailyPurchase?: string | number,\n monthlyWithdrawal?: string | number,\n monthlyPurchase?: string | number,\n}\n\ntype UNData = {\n type: string,\n id: string\n}\n\nexport type UNRelationship = {\n data:\n | null\n | []\n | UNData\n | UNData[]\n}\n\nexport type UNFullName = {\n first: string,\n last: string\n}\n\nexport type UNTags = Record<string, string> // TODO: specify Tag type\n"],"mappings":""}
|
|
@@ -8,4 +8,15 @@ export let UNWalletName;
|
|
|
8
8
|
UNWalletName["Apple"] = "APPLE";
|
|
9
9
|
UNWalletName["Google"] = "GOOGLE";
|
|
10
10
|
})(UNWalletName || (UNWalletName = {}));
|
|
11
|
+
export let UNCardAddToWalletStatus;
|
|
12
|
+
(function (UNCardAddToWalletStatus) {
|
|
13
|
+
UNCardAddToWalletStatus[UNCardAddToWalletStatus["pending"] = 0] = "pending";
|
|
14
|
+
UNCardAddToWalletStatus["readyToProvisioning"] = "ReadyToProvision";
|
|
15
|
+
UNCardAddToWalletStatus["addedToWallet"] = "AlreadyProvisioned";
|
|
16
|
+
UNCardAddToWalletStatus["iosProvisionedInCurrentDevice"] = "ProvisionedInCurrentDevice";
|
|
17
|
+
UNCardAddToWalletStatus["iosProvisionedInPairedDevice"] = "ProvisionedInPairedDevice";
|
|
18
|
+
UNCardAddToWalletStatus["androidNotInstalled"] = "NotInstalled";
|
|
19
|
+
UNCardAddToWalletStatus["androidWalletSetupNotCompleted"] = "WalletSetupNotCompleted";
|
|
20
|
+
UNCardAddToWalletStatus["androidWalletAppUpdateAvailable"] = "WalletAppUpdateAvailable";
|
|
21
|
+
})(UNCardAddToWalletStatus || (UNCardAddToWalletStatus = {}));
|
|
11
22
|
//# sourceMappingURL=wallet.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNWalletCode","UNWalletName"],"sources":["wallet.types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["UNWalletCode","UNWalletName","UNCardAddToWalletStatus"],"sources":["wallet.types.ts"],"sourcesContent":["export enum UNWalletCode {\n Apple = 'ApplePayPushProvision',\n Google = 'GooglePayPushProvision',\n}\n\nexport enum UNWalletName {\n Apple = 'APPLE',\n Google = 'GOOGLE',\n}\n\nexport interface UNWallet {\n name: string;\n code: string;\n status: UNCardAddToWalletStatus\n}\n\nexport enum UNCardAddToWalletStatus {\n pending,\n readyToProvisioning = 'ReadyToProvision',\n addedToWallet = 'AlreadyProvisioned',\n iosProvisionedInCurrentDevice = 'ProvisionedInCurrentDevice',\n iosProvisionedInPairedDevice = 'ProvisionedInPairedDevice',\n androidNotInstalled = 'NotInstalled',\n androidWalletSetupNotCompleted = 'WalletSetupNotCompleted',\n androidWalletAppUpdateAvailable = 'WalletAppUpdateAvailable'\n\n}\n"],"mappings":"AAAA,WAAYA,YAAY;AAGvB,WAHWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY;AAKxB,WAAYC,YAAY;AAGvB,WAHWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY;AAWxB,WAAYC,uBAAuB;AAUlC,WAVWA,uBAAuB;EAAvBA,uBAAuB,CAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","WebView","EventBus","html","HTML_PLACEHOLDER","UnitMessage","useListenerToBus","getHtmlBody","fetchUnitScript","globalUnitScript","UnitSDK","SDKMessage","handleRequestDownload","WebComponentType","WebComponent","forwardRef","props","webRef","unitScript","setUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","getTheme","width","updateUnitScript","data","updateInitializedParams","busEventKey","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","componentParams","params","newHtml","replace","BODY","type","valueOf","presentationMode","SCRIPT_FROM_NATIVE","script","onMessage","e","message","JSON","parse","nativeEvent","UNIT_REQUEST_REFRESH","details","Instance","event","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","ref","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","flex","source"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport EventBus from '../helpers/EventBus';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { useListenerToBus } from '../hooks/listenerToBus';\nimport { getHtmlBody, PresentationMode } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { handleRequestDownload } from './WebComponent.utils';\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n width?: number;\n}\n\nexport enum WebComponentType {\n card = 'unit-elements-card',\n bookPayment = 'unit-elements-book-payment',\n activity = 'unit-elements-activity',\n slot = 'unit-elements-sdk-slot',\n account = 'unit-elements-account',\n achDebitPayment = 'unit-elements-ach-debit-payment',\n achCreditPayment = 'unit-elements-ach-credit-payment'\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [componentCurrentTheme, setComponentCurrentTheme] = useState<string | undefined>(props.theme ?? UnitSDK.getTheme());\n const width = props.width ?? '100%';\n\n const updateUnitScript = (data: SdkScriptFetched) => {\n setUnitScript(data.unitScript);\n };\n\n const updateInitializedParams = () => {\n setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());\n };\n\n useListenerToBus({ busEventKey: SDKMessage.IS_SCRIPT_FETCHED, action: updateUnitScript });\n useListenerToBus({ busEventKey: SDKMessage.IS_SDK_INITIALIZED, action: updateInitializedParams });\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const componentParams = (props.params || '') + (componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '');\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, componentCurrentTheme, props.script]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details as RequestRefreshEvent);\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW);\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n\n return null;\n };\n\n return (\n <WebView\n ref={webRef}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode=\"never\"\n injectedJavaScript={unitScript}\n style={{ width: width, flex: 1 }}\n source={{ html: sourceHtml }}\n onMessage={onMessage} />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,OAAO,QAA6B,sBAAsB;AACnE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,IAAIC,gBAAgB,QAAQ,QAAQ;AAC/C,SAA8BC,WAAW,QAA8B,sCAAsC;AAC7G,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,WAAW,QAA0B,0BAA0B;AACxE,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,+BAA+B;AACjF,SAASC,OAAO,QAAQ,kCAAkC;AAE1D,SAASC,UAAU,QAA0B,uCAAuC;AACpF,SAASC,qBAAqB,QAAQ,sBAAsB;AAe5D,WAAYC,gBAAgB;AAQ3B,WARWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB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,CAAC;EAED,oBACEvD,KAAA,CAAA4D,aAAA,CAACzD,OAAO;IACN0D,GAAG,EAAE1C,MAAO;IACZ2C,YAAY,EAAE,KAAM;IACpBC,aAAa,EAAE7C,KAAK,CAAC8C,YAAa;IAClCC,mBAAmB,EAAE/C,KAAK,CAAC+C,mBAAoB;IAC/CC,QAAQ,EAAER,SAAU;IACpBS,cAAc,EAAC,OAAO;IACtBC,kBAAkB,EAAEhD,UAAW;IAC/BiD,KAAK,EAAE;MAAEzC,KAAK,EAAEA,KAAK;MAAE0C,IAAI,EAAE;
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","WebView","EventBus","html","HTML_PLACEHOLDER","UnitMessage","useListenerToBus","getHtmlBody","fetchUnitScript","globalUnitScript","UnitSDK","SDKMessage","handleRequestDownload","WebComponentType","WebComponent","forwardRef","props","webRef","unitScript","setUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","getTheme","width","updateUnitScript","data","updateInitializedParams","busEventKey","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","componentParams","params","newHtml","replace","BODY","type","valueOf","presentationMode","SCRIPT_FROM_NATIVE","script","onMessage","e","message","JSON","parse","nativeEvent","UNIT_REQUEST_REFRESH","details","Instance","event","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","ref","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","flex","opacity","source"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport EventBus from '../helpers/EventBus';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { useListenerToBus } from '../hooks/listenerToBus';\nimport { getHtmlBody, PresentationMode } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { handleRequestDownload } from './WebComponent.utils';\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n width?: number;\n}\n\nexport enum WebComponentType {\n card = 'unit-elements-card',\n bookPayment = 'unit-elements-book-payment',\n activity = 'unit-elements-activity',\n slot = 'unit-elements-sdk-slot',\n account = 'unit-elements-account',\n achDebitPayment = 'unit-elements-ach-debit-payment',\n achCreditPayment = 'unit-elements-ach-credit-payment'\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [componentCurrentTheme, setComponentCurrentTheme] = useState<string | undefined>(props.theme ?? UnitSDK.getTheme());\n const width = props.width ?? '100%';\n\n const updateUnitScript = (data: SdkScriptFetched) => {\n setUnitScript(data.unitScript);\n };\n\n const updateInitializedParams = () => {\n setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());\n };\n\n useListenerToBus({ busEventKey: SDKMessage.IS_SCRIPT_FETCHED, action: updateUnitScript });\n useListenerToBus({ busEventKey: SDKMessage.IS_SDK_INITIALIZED, action: updateInitializedParams });\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const componentParams = (props.params || '') + (componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '');\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, componentCurrentTheme, props.script]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details as RequestRefreshEvent);\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW);\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n\n return null;\n };\n\n return (\n <WebView\n ref={webRef}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode=\"never\"\n injectedJavaScript={unitScript}\n style={{ width: width, flex: 1, opacity: 0.99}}\n source={{ html: sourceHtml }}\n onMessage={onMessage} />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,OAAO,QAA6B,sBAAsB;AACnE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,IAAIC,gBAAgB,QAAQ,QAAQ;AAC/C,SAA8BC,WAAW,QAA8B,sCAAsC;AAC7G,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,WAAW,QAA0B,0BAA0B;AACxE,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,+BAA+B;AACjF,SAASC,OAAO,QAAQ,kCAAkC;AAE1D,SAASC,UAAU,QAA0B,uCAAuC;AACpF,SAASC,qBAA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AAC;EAED,IAAI,CAAC1B,UAAU,EAAE,OAAO,IAAI;EAE5B,MAAMoC,SAAS,GAAIH,KAAU,IAAK;IAChC,IAAIrC,KAAK,CAACyC,YAAY,EAAE;MACtBzC,KAAK,CAACyC,YAAY,CAACJ,KAAK,CAAC;IAC3B;IAEA,OAAO,IAAI;EACb,CAAC;EAED,oBACEvD,KAAA,CAAA4D,aAAA,CAACzD,OAAO;IACN0D,GAAG,EAAE1C,MAAO;IACZ2C,YAAY,EAAE,KAAM;IACpBC,aAAa,EAAE7C,KAAK,CAAC8C,YAAa;IAClCC,mBAAmB,EAAE/C,KAAK,CAAC+C,mBAAoB;IAC/CC,QAAQ,EAAER,SAAU;IACpBS,cAAc,EAAC,OAAO;IACtBC,kBAAkB,EAAEhD,UAAW;IAC/BiD,KAAK,EAAE;MAAEzC,KAAK,EAAEA,KAAK;MAAE0C,IAAI,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAI,CAAE;IAC/CC,MAAM,EAAE;MAAEnE,IAAI,EAAEiB;IAAW,CAAE;IAC7BwB,SAAS,EAAEA;EAAU,EAAG;AAE9B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","DISPATCH_RENDERING_EVENT","LISTENERS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","htmlText","OS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardStatusChange","unitRequestExternalSdk"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT } from '../scripts/html/bodyScript';\n\nexport const HTML_PLACEHOLDER = {\n SCRIPT_UNIT: '<SCRIPT_UNIT>',\n BODY: '<BODY_HTML_CODE>',\n SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>'\n};\n\nconst htmlText = `\n <!DOCTYPE html>\n <html lang=\"en\">\n\n <head lang=\"en\">\n <title>Unit Web SDK Demo</title>\n <script>\n window.UnitMobileSDK = true\n window.UnitMobileSDKConfig = {\n os: \"${Platform.OS}\",\n walletName: \"${Platform.OS === 'ios' ? 'Apple' : 'Google'}\",\n }\n </script>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0\">\n </html>\n\n <body style=\"margin: 0;\">\n ${HTML_PLACEHOLDER.BODY}\n\n <script>\n ${POST_MESSAGE_TO_SDK}\n\n ${POST_PAGE_HEIGHT}\n\n ${LISTENERS.isPageLoaded}\n\n ${LISTENERS.onLoad}\n\n ${LISTENERS.unitRequestDownload}\n\n ${LISTENERS.requestRendering}\n\n ${LISTENERS.requestOpenLink}\n\n ${LISTENERS.requestCloseFlow}\n\n ${LISTENERS.cardStatusChange}\n\n ${LISTENERS.unitRequestExternalSdk}\n\n ${DISPATCH_RENDERING_EVENT}\n\n ${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}\n </script>\n </body>\n`;\n\nexport default htmlText;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,wBAAwB,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAEvH,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,WAAW,EAAE,eAAe;EAC5BC,IAAI,EAAE,kBAAkB;EACxBC,kBAAkB,EAAE;AACtB,CAAC;AAED,MAAMC,QAAQ,GAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAaT,QAAQ,CAACU,EAAG;AACzB,qBAAqBV,QAAQ,CAACU,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,QAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,MAAML,gBAAgB,CAACE,IAAK;AAC5B;AACA;AACA,QAAQJ,mBAAoB;AAC5B;AACA,QAAQC,gBAAiB;AACzB;AACA,QAAQF,SAAS,CAACS,YAAa;AAC/B;AACA,QAAQT,SAAS,CAACU,MAAO;AACzB;AACA,QAAQV,SAAS,CAACW,mBAAoB;AACtC;AACA,QAAQX,SAAS,CAACY,gBAAiB;AACnC;AACA,QAAQZ,SAAS,CAACa,eAAgB;AAClC;AACA,QAAQb,SAAS,CAACc,gBAAiB;AACnC;AACA,QAAQd,SAAS,CAACe,gBAAiB;AACnC;AACA,QAAQf,SAAS,CAACgB,sBAAuB;AACzC;AACA,
|
|
1
|
+
{"version":3,"names":["Platform","DISPATCH_RENDERING_EVENT","LISTENERS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","htmlText","OS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardStatusChange","unitRequestExternalSdk","unitAccountChanged"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT } from '../scripts/html/bodyScript';\n\nexport const HTML_PLACEHOLDER = {\n SCRIPT_UNIT: '<SCRIPT_UNIT>',\n BODY: '<BODY_HTML_CODE>',\n SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>'\n};\n\nconst htmlText = `\n <!DOCTYPE html>\n <html lang=\"en\">\n\n <head lang=\"en\">\n <title>Unit Web SDK Demo</title>\n <script>\n window.UnitMobileSDK = true\n window.UnitMobileSDKConfig = {\n os: \"${Platform.OS}\",\n walletName: \"${Platform.OS === 'ios' ? 'Apple' : 'Google'}\",\n }\n </script>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0\">\n </html>\n\n <body style=\"margin: 0;\">\n ${HTML_PLACEHOLDER.BODY}\n\n <script>\n ${POST_MESSAGE_TO_SDK}\n\n ${POST_PAGE_HEIGHT}\n\n ${LISTENERS.isPageLoaded}\n\n ${LISTENERS.onLoad}\n\n ${LISTENERS.unitRequestDownload}\n\n ${LISTENERS.requestRendering}\n\n ${LISTENERS.requestOpenLink}\n\n ${LISTENERS.requestCloseFlow}\n\n ${LISTENERS.cardStatusChange}\n\n ${LISTENERS.unitRequestExternalSdk}\n\n ${LISTENERS.unitAccountChanged}\n\n ${DISPATCH_RENDERING_EVENT}\n\n ${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}\n </script>\n </body>\n`;\n\nexport default htmlText;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,wBAAwB,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAEvH,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,WAAW,EAAE,eAAe;EAC5BC,IAAI,EAAE,kBAAkB;EACxBC,kBAAkB,EAAE;AACtB,CAAC;AAED,MAAMC,QAAQ,GAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAaT,QAAQ,CAACU,EAAG;AACzB,qBAAqBV,QAAQ,CAACU,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,QAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,MAAML,gBAAgB,CAACE,IAAK;AAC5B;AACA;AACA,QAAQJ,mBAAoB;AAC5B;AACA,QAAQC,gBAAiB;AACzB;AACA,QAAQF,SAAS,CAACS,YAAa;AAC/B;AACA,QAAQT,SAAS,CAACU,MAAO;AACzB;AACA,QAAQV,SAAS,CAACW,mBAAoB;AACtC;AACA,QAAQX,SAAS,CAACY,gBAAiB;AACnC;AACA,QAAQZ,SAAS,CAACa,eAAgB;AAClC;AACA,QAAQb,SAAS,CAACc,gBAAiB;AACnC;AACA,QAAQd,SAAS,CAACe,gBAAiB;AACnC;AACA,QAAQf,SAAS,CAACgB,sBAAuB;AACzC;AACA,QAAQhB,SAAS,CAACiB,kBAAmB;AACrC;AACA,QAAQlB,wBAAyB;AACjC;AACA,QAAQI,gBAAgB,CAACG,kBAAmB;AAC5C;AACA;AACA,CAAC;AAED,eAAeC,QAAQ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UNResponseUnitOnLoadEvent, UNACHData } from '../../sharedTypes';
|
|
2
2
|
export interface UNACHCreditComponentProps {
|
|
3
3
|
accountId: string;
|
|
4
4
|
customerToken: string;
|
|
@@ -6,6 +6,6 @@ export interface UNACHCreditComponentProps {
|
|
|
6
6
|
isAutoFocus?: boolean;
|
|
7
7
|
fee?: number;
|
|
8
8
|
onPaymentCreated?: (data: UNACHData) => void;
|
|
9
|
-
onLoad?: (response:
|
|
9
|
+
onLoad?: (response: UNResponseUnitOnLoadEvent) => void;
|
|
10
10
|
}
|
|
11
11
|
export declare const UNACHCreditComponent: (props: UNACHCreditComponentProps) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UNResponseUnitOnLoadEvent, UNACHData } from '../../sharedTypes';
|
|
2
2
|
export interface UNACHDebitComponentProps {
|
|
3
3
|
accountId: string;
|
|
4
4
|
customerToken: string;
|
|
@@ -6,6 +6,6 @@ export interface UNACHDebitComponentProps {
|
|
|
6
6
|
isAutoFocus?: boolean;
|
|
7
7
|
fee?: number;
|
|
8
8
|
onPaymentCreated?: (data: UNACHData) => void;
|
|
9
|
-
onLoad?: (response:
|
|
9
|
+
onLoad?: (response: UNResponseUnitOnLoadEvent) => void;
|
|
10
10
|
}
|
|
11
11
|
export declare const UNACHDebitComponent: (props: UNACHDebitComponentProps) => JSX.Element;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UNResponseUnitOnLoadEvent } from '../../sharedTypes';
|
|
2
|
+
import type { UNAccountData } from '../../sharedTypes/account.types';
|
|
2
3
|
export interface UNAccountComponentProps {
|
|
3
4
|
accountId?: string;
|
|
4
5
|
customerToken: string;
|
|
5
6
|
theme?: string;
|
|
6
|
-
onLoad?: (response:
|
|
7
|
+
onLoad?: (response: UNResponseUnitOnLoadEvent) => void;
|
|
8
|
+
onAccountChanged?: (account: UNAccountData) => void;
|
|
7
9
|
}
|
|
8
10
|
export declare enum AccountAction {
|
|
9
11
|
List = "account-list",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UNResponseUnitOnLoadEvent } from '../../sharedTypes';
|
|
2
2
|
export interface UNActivityComponentProps {
|
|
3
3
|
accountId: string;
|
|
4
4
|
customerToken: string;
|
|
5
5
|
theme?: string;
|
|
6
|
-
onLoad?: (response:
|
|
6
|
+
onLoad?: (response: UNResponseUnitOnLoadEvent) => void;
|
|
7
7
|
}
|
|
8
8
|
export declare const UNActivityComponent: (props: UNActivityComponentProps) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UNResponseUnitOnLoadEvent, UNBookPaymentData } from '../../sharedTypes';
|
|
2
2
|
export interface UNBookPaymentComponentProps {
|
|
3
3
|
accountId: string;
|
|
4
4
|
customerToken: string;
|
|
@@ -7,6 +7,6 @@ export interface UNBookPaymentComponentProps {
|
|
|
7
7
|
counterPartyName: string;
|
|
8
8
|
theme?: string;
|
|
9
9
|
onPaymentCreated?: (data: UNBookPaymentData) => void;
|
|
10
|
-
onLoad?: (response:
|
|
10
|
+
onLoad?: (response: UNResponseUnitOnLoadEvent) => void;
|
|
11
11
|
}
|
|
12
12
|
export declare const UNBookPaymentComponent: (props: UNBookPaymentComponentProps) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UNResponseUnitOnLoadEvent, UNCardData } from '../../sharedTypes';
|
|
2
2
|
import type { NativeModules } from 'react-native';
|
|
3
3
|
export interface UNCardComponentProps {
|
|
4
4
|
cardId: string;
|
|
@@ -7,7 +7,7 @@ export interface UNCardComponentProps {
|
|
|
7
7
|
hideActionsMenuButton?: boolean;
|
|
8
8
|
hideCardTitle?: boolean;
|
|
9
9
|
hideSensitiveDataButton?: boolean;
|
|
10
|
-
onLoad?: (response:
|
|
10
|
+
onLoad?: (response: UNResponseUnitOnLoadEvent) => void;
|
|
11
11
|
onStatusChanged?: (card: UNCardData) => void;
|
|
12
12
|
pushProvisioningModule?: typeof NativeModules;
|
|
13
13
|
}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
+
import type { UNCardAddToWalletStatus } from '../../sharedTypes/wallet.types';
|
|
1
2
|
export declare enum CardNativeMessage {
|
|
2
3
|
CARD_GET_ADD_TO_WALLET_STATUS = "cardGetAddToWalletStatus",
|
|
3
4
|
CARD_UPDATE_ADD_TO_WALLET_STATUS = "cardUpdateAddToWalletStatus",
|
|
4
5
|
CARD_START_PUSH_PROVISIONING = "cardStartPushProvisioning"
|
|
5
6
|
}
|
|
6
|
-
export declare enum CardAddToWalletStatus {
|
|
7
|
-
pending = 0,
|
|
8
|
-
readyToProvisioning = "ReadyToProvision",
|
|
9
|
-
addedToWallet = "AlreadyProvisioned",
|
|
10
|
-
iosProvisionedInCurrentDevice = "ProvisionedInCurrentDevice",
|
|
11
|
-
iosProvisionedInPairedDevice = "ProvisionedInPairedDevice",
|
|
12
|
-
androidNotInstalled = "NotInstalled",
|
|
13
|
-
androidWalletSetupNotCompleted = "WalletSetupNotCompleted",
|
|
14
|
-
androidWalletAppUpdateAvailable = "WalletAppUpdateAvailable"
|
|
15
|
-
}
|
|
16
7
|
export declare enum CardAddToWalletErrors {
|
|
17
8
|
closedNativeWalletScreen = "VP_ERROR_302"
|
|
18
9
|
}
|
|
19
|
-
export interface
|
|
20
|
-
status:
|
|
10
|
+
export interface UNCardAddToWalletStatusEvent {
|
|
11
|
+
status: UNCardAddToWalletStatus;
|
|
21
12
|
}
|
|
22
13
|
export interface CardGetAddToWalletStatusEvent {
|
|
23
14
|
cardId: string;
|
|
@@ -25,4 +16,4 @@ export interface CardGetAddToWalletStatusEvent {
|
|
|
25
16
|
export interface CardStartPushProvisioningEvent {
|
|
26
17
|
cardId: string;
|
|
27
18
|
}
|
|
28
|
-
export type CardNativeEvent =
|
|
19
|
+
export type CardNativeEvent = UNCardAddToWalletStatusEvent | CardGetAddToWalletStatusEvent | CardStartPushProvisioningEvent;
|
|
@@ -4,8 +4,9 @@ import type { CardEvent, CardMessage } from './cardMessage';
|
|
|
4
4
|
import type { PageEvent, PageMessage } from './pageMessage';
|
|
5
5
|
import type { PaymentMessage } from './paymentsMessage';
|
|
6
6
|
import type { UnitEvent, UnitMessage } from './unitMessages';
|
|
7
|
-
|
|
8
|
-
type
|
|
7
|
+
import type { AccountEvent, AccountMessage } from './accountMessage';
|
|
8
|
+
export type WebViewMessageType = PageMessage | CardMessage | UnitMessage | PaymentMessage | AccountMessage;
|
|
9
|
+
type WebViewEvent = PageEvent | UnitEvent | CardEvent | BookPaymentEvent | PaymentMessage | ACHEvent | AccountEvent;
|
|
9
10
|
export interface WebViewMessage {
|
|
10
11
|
type: WebViewMessageType;
|
|
11
12
|
details?: WebViewEvent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UNResponseUnitOnLoadEvent } from '../../sharedTypes';
|
|
2
2
|
export declare enum UnitMessage {
|
|
3
3
|
UNIT_REQUEST_RENDERING = "unitRequestRendering",
|
|
4
4
|
UNIT_REQUEST_REFRESH = "unitRequestRefresh",
|
|
@@ -48,5 +48,5 @@ interface PlaidLinkTokenAttributes {
|
|
|
48
48
|
export interface RequestExternalSdkEvent {
|
|
49
49
|
type: string;
|
|
50
50
|
}
|
|
51
|
-
export type UnitEvent = RequestRenderingEvent | RequestRefreshEvent | RequestOpenLinkEvent |
|
|
51
|
+
export type UnitEvent = RequestRenderingEvent | RequestRefreshEvent | RequestOpenLinkEvent | UNResponseUnitOnLoadEvent | RequestDownloadEvent | PlaidTokenCreatedEvent | RequestExternalSdkEvent;
|
|
52
52
|
export {};
|
|
@@ -11,6 +11,7 @@ export declare const LISTENERS: {
|
|
|
11
11
|
cardStatusChange: string;
|
|
12
12
|
unitRequestExternalSdk: string;
|
|
13
13
|
unitPaymentCreated: string;
|
|
14
|
+
unitAccountChanged: string;
|
|
14
15
|
};
|
|
15
16
|
export declare const DISPATCH_RENDERING_EVENT: string;
|
|
16
17
|
export declare const DISPATCH_REQUEST_REFRESH: string;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { UNRelationship, UNTags } from './types';
|
|
2
|
+
export type UNAccountData = UNDepositAccount | UNBatchAccount | UNCreditAccount;
|
|
3
|
+
declare enum UNAccountStatus {
|
|
4
|
+
Open = "Open",
|
|
5
|
+
Closed = "Closed",
|
|
6
|
+
Frozen = "Frozen"
|
|
7
|
+
}
|
|
8
|
+
export declare enum UNCloseReason {
|
|
9
|
+
Fraud = "Fraud",
|
|
10
|
+
ByCustomer = "ByCustomer"
|
|
11
|
+
}
|
|
12
|
+
export declare enum UNFraudReason {
|
|
13
|
+
ACHActivity = "ACHActivity",
|
|
14
|
+
CardActivity = "CardActivity",
|
|
15
|
+
CheckActivity = "CheckActivity",
|
|
16
|
+
ApplicationHistory = "ApplicationHistory",
|
|
17
|
+
AccountActivity = "AccountActivity",
|
|
18
|
+
ClientIdentified = "ClientIdentified",
|
|
19
|
+
IdentityTheft = "IdentityTheft",
|
|
20
|
+
LinkedToFraudulentCustomer = "LinkedToFraudulentCustomer"
|
|
21
|
+
}
|
|
22
|
+
export type UNDepositAccount = {
|
|
23
|
+
id: string;
|
|
24
|
+
type: "depositAccount";
|
|
25
|
+
attributes: {
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt?: string;
|
|
28
|
+
name: string;
|
|
29
|
+
depositProduct: string;
|
|
30
|
+
routingNumber: string;
|
|
31
|
+
accountNumber: string;
|
|
32
|
+
maskedAccountNumber?: string;
|
|
33
|
+
secondaryAccountNumber?: {
|
|
34
|
+
routingNumber: string;
|
|
35
|
+
accountNumber: string;
|
|
36
|
+
};
|
|
37
|
+
balance: number;
|
|
38
|
+
hold: number;
|
|
39
|
+
reserve: number;
|
|
40
|
+
available: number;
|
|
41
|
+
overdraftLimit?: number;
|
|
42
|
+
currency: string;
|
|
43
|
+
tags: UNTags;
|
|
44
|
+
status: UNAccountStatus;
|
|
45
|
+
closeReason?: string;
|
|
46
|
+
fraudReason?: UNFraudReason;
|
|
47
|
+
closeReasonText?: string;
|
|
48
|
+
freezeReason?: string;
|
|
49
|
+
isOverdrawnWithinLimit?: boolean;
|
|
50
|
+
};
|
|
51
|
+
relationships: {
|
|
52
|
+
customer?: UNRelationship;
|
|
53
|
+
customers?: UNRelationship;
|
|
54
|
+
org: UNRelationship;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type UNBatchAccount = {
|
|
58
|
+
id: string;
|
|
59
|
+
type: "batchAccount";
|
|
60
|
+
attributes: {
|
|
61
|
+
createdAt: Date;
|
|
62
|
+
updatedAt?: Date;
|
|
63
|
+
name: string;
|
|
64
|
+
depositProduct: string;
|
|
65
|
+
routingNumber: string;
|
|
66
|
+
accountNumber: string;
|
|
67
|
+
maskedAccountNumber?: string;
|
|
68
|
+
balance: number;
|
|
69
|
+
hold: number;
|
|
70
|
+
reserve: number;
|
|
71
|
+
available: number;
|
|
72
|
+
currency: string;
|
|
73
|
+
status: "Open" | "Closed";
|
|
74
|
+
closeReason?: string;
|
|
75
|
+
fraudReason?: UNFraudReason;
|
|
76
|
+
closeReasonText?: string;
|
|
77
|
+
freezeReason?: string;
|
|
78
|
+
tags?: {
|
|
79
|
+
[key: string]: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
relationships: {
|
|
83
|
+
org: UNRelationship;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export type UNCreditAccount = {
|
|
87
|
+
id: string;
|
|
88
|
+
type: "creditAccount";
|
|
89
|
+
attributes: {
|
|
90
|
+
createdAt: Date;
|
|
91
|
+
updatedAt?: Date;
|
|
92
|
+
name: string;
|
|
93
|
+
creditTerms: string;
|
|
94
|
+
balance: number;
|
|
95
|
+
hold: number;
|
|
96
|
+
reserve: number;
|
|
97
|
+
available: number;
|
|
98
|
+
creditLimit: number;
|
|
99
|
+
currency: string;
|
|
100
|
+
tags: {
|
|
101
|
+
[key: string]: string;
|
|
102
|
+
};
|
|
103
|
+
status: UNAccountStatus;
|
|
104
|
+
closeReason?: UNCloseReason;
|
|
105
|
+
fraudReason?: UNFraudReason;
|
|
106
|
+
closeReasonText?: string;
|
|
107
|
+
freezeReason?: string;
|
|
108
|
+
};
|
|
109
|
+
relationships: {
|
|
110
|
+
customer: UNRelationship;
|
|
111
|
+
org: UNRelationship;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export {};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { UNAchCounterparty, UNCounterpartyVerificationMethod, UNPaymentStatus } from './payments.types';
|
|
2
|
+
import type { UNTags, UNRelationship } from './types';
|
|
3
3
|
export type UNACHData = {
|
|
4
4
|
type: 'achPayment';
|
|
5
5
|
id: string;
|
|
6
6
|
attributes: {
|
|
7
7
|
createdAt: string | Date;
|
|
8
|
-
status:
|
|
8
|
+
status: UNPaymentStatus;
|
|
9
9
|
settlementDate?: Date;
|
|
10
10
|
reason: string;
|
|
11
11
|
direction: 'Debit' | 'Credit';
|
|
12
12
|
description: string;
|
|
13
13
|
transactionSummaryOverride?: string;
|
|
14
14
|
amount: string;
|
|
15
|
-
tags:
|
|
15
|
+
tags: UNTags;
|
|
16
16
|
addenda?: string;
|
|
17
|
-
counterparty:
|
|
17
|
+
counterparty: UNAchCounterparty;
|
|
18
18
|
expectedCompletionDate?: Date;
|
|
19
|
-
counterpartyVerificationMethod?: keyof typeof
|
|
19
|
+
counterpartyVerificationMethod?: keyof typeof UNCounterpartyVerificationMethod;
|
|
20
20
|
sameDay?: boolean;
|
|
21
21
|
};
|
|
22
22
|
relationships: {
|
|
23
|
-
account:
|
|
24
|
-
customer?:
|
|
25
|
-
customers?:
|
|
26
|
-
counterpartyAccount:
|
|
27
|
-
counterpartyCustomer:
|
|
28
|
-
transaction:
|
|
29
|
-
recurringPayment:
|
|
23
|
+
account: UNRelationship;
|
|
24
|
+
customer?: UNRelationship;
|
|
25
|
+
customers?: UNRelationship;
|
|
26
|
+
counterpartyAccount: UNRelationship;
|
|
27
|
+
counterpartyCustomer: UNRelationship;
|
|
28
|
+
transaction: UNRelationship;
|
|
29
|
+
recurringPayment: UNRelationship;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { UNPaymentStatus } from './payments.types';
|
|
2
|
+
import type { UNTags, UNRelationship } from './types';
|
|
3
3
|
export type UNBookPaymentData = {
|
|
4
4
|
type: 'bookPayment';
|
|
5
5
|
id: string;
|
|
6
6
|
attributes: {
|
|
7
7
|
createdAt: string | Date;
|
|
8
|
-
status:
|
|
8
|
+
status: UNPaymentStatus;
|
|
9
9
|
reason: string;
|
|
10
10
|
direction: 'Debit' | 'Credit';
|
|
11
11
|
description: string;
|
|
12
12
|
transactionSummaryOverride?: string;
|
|
13
13
|
amount: string;
|
|
14
|
-
tags:
|
|
14
|
+
tags: UNTags;
|
|
15
15
|
};
|
|
16
16
|
relationships: {
|
|
17
|
-
account:
|
|
18
|
-
customer?:
|
|
19
|
-
customers?:
|
|
20
|
-
counterpartyAccount:
|
|
21
|
-
counterpartyCustomer:
|
|
22
|
-
transaction:
|
|
23
|
-
recurringPayment:
|
|
17
|
+
account: UNRelationship;
|
|
18
|
+
customer?: UNRelationship;
|
|
19
|
+
customers?: UNRelationship;
|
|
20
|
+
counterpartyAccount: UNRelationship;
|
|
21
|
+
counterpartyCustomer: UNRelationship;
|
|
22
|
+
transaction: UNRelationship;
|
|
23
|
+
recurringPayment: UNRelationship;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type UNCardData =
|
|
3
|
-
type
|
|
4
|
-
export type
|
|
1
|
+
import type { UNAddress, UNFullName, UNLimits, UNRelationship, UNTags } from './types';
|
|
2
|
+
export type UNCardData = UNIndividualDebitCard | UNBusinessDebitCard;
|
|
3
|
+
type UNCardStatus = 'Active' | 'Inactive' | 'Stolen' | 'Lost' | 'Frozen' | 'ClosedByCustomer' | 'SuspectedFraud';
|
|
4
|
+
export type UNIndividualDebitCard = {
|
|
5
5
|
id: string;
|
|
6
6
|
type: 'individualDebitCard' | 'individualVirtualDebitCard';
|
|
7
7
|
attributes: {
|
|
8
8
|
createdAt: string;
|
|
9
9
|
last4Digits: string;
|
|
10
10
|
expirationDate: string;
|
|
11
|
-
status:
|
|
12
|
-
shippingAddress?:
|
|
11
|
+
status: UNCardStatus;
|
|
12
|
+
shippingAddress?: UNAddress;
|
|
13
13
|
updatedAt?: string;
|
|
14
14
|
design?: string;
|
|
15
15
|
additionalEmbossedText?: string;
|
|
16
16
|
idempotencyKey?: string;
|
|
17
|
-
tags?:
|
|
18
|
-
limits?:
|
|
17
|
+
tags?: UNTags;
|
|
18
|
+
limits?: UNLimits;
|
|
19
19
|
printOnlyBusinessName?: boolean;
|
|
20
20
|
};
|
|
21
21
|
relationships: {
|
|
22
|
-
account:
|
|
23
|
-
customer:
|
|
22
|
+
account: UNRelationship;
|
|
23
|
+
customer: UNRelationship;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
export type
|
|
26
|
+
export type UNBusinessDebitCard = {
|
|
27
27
|
id: string;
|
|
28
28
|
type: 'businessDebitCard' | 'businessVirtualDebitCard';
|
|
29
29
|
attributes: {
|
|
30
|
-
fullName:
|
|
30
|
+
fullName: UNFullName;
|
|
31
31
|
dateOfBirth: string;
|
|
32
|
-
address:
|
|
33
|
-
shippingAddress?:
|
|
32
|
+
address: UNAddress;
|
|
33
|
+
shippingAddress?: UNAddress;
|
|
34
34
|
phone: string;
|
|
35
35
|
email: string;
|
|
36
36
|
createdAt: string;
|
|
37
37
|
last4Digits: string;
|
|
38
38
|
expirationDate: string;
|
|
39
|
-
status:
|
|
39
|
+
status: UNCardStatus;
|
|
40
40
|
updatedAt?: string;
|
|
41
41
|
ssn?: string;
|
|
42
42
|
passport?: string;
|
|
@@ -45,12 +45,12 @@ export type BusinessDebitCard = {
|
|
|
45
45
|
additionalEmbossedText?: string;
|
|
46
46
|
idempotencyKey?: string;
|
|
47
47
|
tags?: Record<string, string>;
|
|
48
|
-
limits?:
|
|
48
|
+
limits?: UNLimits;
|
|
49
49
|
printOnlyBusinessName?: boolean;
|
|
50
50
|
};
|
|
51
51
|
relationships: {
|
|
52
|
-
account:
|
|
53
|
-
customer:
|
|
52
|
+
account: UNRelationship;
|
|
53
|
+
customer: UNRelationship;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
export {};
|