react-native-unit-components 1.2.1 → 1.4.0
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 +0 -255
- package/ios/Camera/Camera.swift +22 -0
- package/ios/Camera/CameraExportModule.m +7 -0
- package/ios/UNAppInfo/UNAppInfo.swift +19 -0
- package/ios/UNAppInfo/UNAppInfoExportModule.m +7 -0
- package/ios/UnitReactNativeComponentsViewManager.swift +7 -7
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +24 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +24 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +28 -3
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +11 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +32 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +8 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +18 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +7 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +37 -3
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +9 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +97 -0
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -0
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js +45 -0
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js.map +1 -0
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/hooks/listenerToBus.js +4 -1
- package/lib/commonjs/hooks/listenerToBus.js.map +1 -1
- package/lib/commonjs/messages/webMessages/activityMessage.js +12 -0
- package/lib/commonjs/messages/webMessages/activityMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/cardMessage.js +1 -0
- package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/checkMessage.js +13 -0
- package/lib/commonjs/messages/webMessages/checkMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/onLoadMessage.js +17 -0
- package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +42 -1
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/sharedTypes/account.types.js +8 -1
- package/lib/commonjs/sharedTypes/account.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/achCredit.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/activity.types.js +6 -0
- package/lib/commonjs/sharedTypes/activity.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/authorization.types.js +2 -0
- package/lib/commonjs/sharedTypes/authorization.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/card.types.js +15 -0
- package/lib/commonjs/sharedTypes/card.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/checkDeposit.types.js +22 -0
- package/lib/commonjs/sharedTypes/checkDeposit.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/index.js +11 -0
- package/lib/commonjs/sharedTypes/index.js.map +1 -1
- package/lib/commonjs/sharedTypes/onLoadResponse.types.js +0 -4
- package/lib/commonjs/sharedTypes/onLoadResponse.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/transactions.types.js +52 -0
- package/lib/commonjs/sharedTypes/transactions.types.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +35 -2
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +14 -1
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +24 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +24 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +30 -5
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +8 -0
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +33 -2
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +6 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +18 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +7 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js +39 -5
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +6 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +88 -0
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -0
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js +37 -0
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js.map +1 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/hooks/listenerToBus.js +4 -1
- package/lib/module/hooks/listenerToBus.js.map +1 -1
- package/lib/module/messages/webMessages/activityMessage.js +5 -0
- package/lib/module/messages/webMessages/activityMessage.js.map +1 -0
- package/lib/module/messages/webMessages/cardMessage.js +1 -0
- package/lib/module/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/webMessages/checkMessage.js +6 -0
- package/lib/module/messages/webMessages/checkMessage.js.map +1 -0
- package/lib/module/messages/webMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/onLoadMessage.js +10 -0
- package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -0
- package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +37 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/sharedTypes/account.types.js +6 -0
- package/lib/module/sharedTypes/account.types.js.map +1 -1
- package/lib/module/sharedTypes/achCredit.types.js.map +1 -1
- package/lib/module/sharedTypes/activity.types.js +2 -0
- package/lib/module/sharedTypes/activity.types.js.map +1 -0
- package/lib/module/sharedTypes/authorization.types.js +2 -0
- package/lib/module/sharedTypes/authorization.types.js.map +1 -0
- package/lib/module/sharedTypes/card.types.js +13 -1
- package/lib/module/sharedTypes/card.types.js.map +1 -1
- package/lib/module/sharedTypes/checkDeposit.types.js +15 -0
- package/lib/module/sharedTypes/checkDeposit.types.js.map +1 -0
- package/lib/module/sharedTypes/index.js +2 -1
- package/lib/module/sharedTypes/index.js.map +1 -1
- package/lib/module/sharedTypes/onLoadResponse.types.js +1 -1
- package/lib/module/sharedTypes/onLoadResponse.types.js.map +1 -1
- package/lib/module/sharedTypes/transactions.types.js +44 -0
- package/lib/module/sharedTypes/transactions.types.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +34 -2
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/html.js +15 -2
- 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 +11 -3
- package/lib/typescript/components/UNAccountComponent/UNAccountComponent.utils.d.ts +3 -0
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +5 -2
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.utils.d.ts +1 -0
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -2
- package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +9 -3
- package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +3 -0
- package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +12 -0
- package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts +3 -0
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/messages/webMessages/activityMessage.d.ts +5 -0
- package/lib/typescript/messages/webMessages/cardMessage.d.ts +5 -1
- package/lib/typescript/messages/webMessages/checkMessage.d.ts +8 -0
- package/lib/typescript/messages/webMessages/index.d.ts +4 -2
- package/lib/typescript/messages/webMessages/onLoadMessage.d.ts +30 -0
- package/lib/typescript/messages/webMessages/unitMessages.d.ts +2 -2
- package/lib/typescript/scripts/html/bodyScript.d.ts +6 -0
- package/lib/typescript/sharedTypes/account.types.d.ts +18 -4
- package/lib/typescript/sharedTypes/achCredit.types.d.ts +6 -0
- package/lib/typescript/sharedTypes/activity.types.d.ts +7 -0
- package/lib/typescript/sharedTypes/authorization.types.d.ts +20 -0
- package/lib/typescript/sharedTypes/card.types.d.ts +12 -0
- package/lib/typescript/sharedTypes/checkDeposit.types.d.ts +46 -0
- package/lib/typescript/sharedTypes/index.d.ts +2 -1
- package/lib/typescript/sharedTypes/onLoadResponse.types.d.ts +12 -16
- package/lib/typescript/sharedTypes/transactions.types.d.ts +80 -0
- package/lib/typescript/webComponent/WebComponent.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +30 -3
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +30 -3
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +52 -9
- package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +11 -0
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +45 -4
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +7 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +24 -3
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +8 -1
- package/src/components/UNCardComponent/UNCardComponent.tsx +51 -7
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +9 -0
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +112 -0
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.ts +40 -0
- package/src/components/index.ts +1 -0
- package/src/hooks/listenerToBus.ts +4 -1
- package/src/messages/webMessages/activityMessage.ts +8 -0
- package/src/messages/webMessages/cardMessage.ts +6 -0
- package/src/messages/webMessages/checkMessage.ts +14 -0
- package/src/messages/webMessages/index.ts +6 -0
- package/src/messages/webMessages/onLoadMessage.ts +45 -0
- package/src/messages/webMessages/unitMessages.ts +2 -2
- package/src/scripts/html/bodyScript.ts +42 -1
- package/src/sharedTypes/account.types.ts +33 -19
- package/src/sharedTypes/achCredit.types.ts +7 -0
- package/src/sharedTypes/activity.types.ts +8 -0
- package/src/sharedTypes/authorization.types.ts +22 -0
- package/src/sharedTypes/card.types.ts +13 -0
- package/src/sharedTypes/checkDeposit.types.ts +50 -0
- package/src/sharedTypes/index.ts +2 -1
- package/src/sharedTypes/onLoadResponse.types.ts +15 -23
- package/src/sharedTypes/transactions.types.ts +84 -0
- package/src/webComponent/WebComponent.tsx +36 -2
- package/src/webComponent/html.ts +15 -2
- package/android/src/main/res/values/themes.xml +0 -16
- package/android/src/main/res/values-night/themes.xml +0 -16
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.UNFraudReason = exports.UNCloseReason = void 0;
|
|
6
|
+
exports.UNFraudReason = exports.UNCloseReason = exports.UNAccountMenuAction = void 0;
|
|
7
7
|
var UNAccountStatus;
|
|
8
8
|
(function (UNAccountStatus) {
|
|
9
9
|
UNAccountStatus["Open"] = "Open";
|
|
@@ -28,4 +28,11 @@ exports.UNFraudReason = UNFraudReason;
|
|
|
28
28
|
UNFraudReason["IdentityTheft"] = "IdentityTheft";
|
|
29
29
|
UNFraudReason["LinkedToFraudulentCustomer"] = "LinkedToFraudulentCustomer";
|
|
30
30
|
})(UNFraudReason || (exports.UNFraudReason = UNFraudReason = {}));
|
|
31
|
+
let UNAccountMenuAction;
|
|
32
|
+
exports.UNAccountMenuAction = UNAccountMenuAction;
|
|
33
|
+
(function (UNAccountMenuAction) {
|
|
34
|
+
UNAccountMenuAction["OpenAccountDetails"] = "OpenAccountDetails";
|
|
35
|
+
UNAccountMenuAction["OpenAccountStatements"] = "OpenAccountStatements";
|
|
36
|
+
UNAccountMenuAction["DownloadBankVerificationLetter"] = "DownloadBankVerificationLetter";
|
|
37
|
+
})(UNAccountMenuAction || (exports.UNAccountMenuAction = UNAccountMenuAction = {}));
|
|
31
38
|
//# sourceMappingURL=account.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNAccountStatus","UNCloseReason","exports","UNFraudReason"],"sources":["account.types.ts"],"sourcesContent":["import type { UNRelationship, UNTags } from './types';\n\nexport type UNAccountData = UNDepositAccount | UNBatchAccount | UNCreditAccount\n\nenum UNAccountStatus {\n Open =
|
|
1
|
+
{"version":3,"names":["UNAccountStatus","UNCloseReason","exports","UNFraudReason","UNAccountMenuAction"],"sources":["account.types.ts"],"sourcesContent":["import type { UNRelationship, UNTags } from './types';\n\nexport type UNAccountData = UNDepositAccount | UNBatchAccount | UNCreditAccount\n\nexport type UNCounterpartyAccountData = {\n id: string\n attributes: {\n name: string\n tags?: { [key: string]: string }\n }\n}\n\nenum UNAccountStatus {\n Open = 'Open',\n Closed = 'Closed',\n Frozen = 'Frozen',\n}\n\nexport enum UNCloseReason {\n Fraud = 'Fraud',\n ByCustomer = 'ByCustomer',\n}\n\nexport enum UNFraudReason {\n ACHActivity = 'ACHActivity',\n CardActivity = 'CardActivity',\n CheckActivity = 'CheckActivity',\n ApplicationHistory = 'ApplicationHistory',\n AccountActivity = 'AccountActivity',\n ClientIdentified = 'ClientIdentified',\n IdentityTheft = 'IdentityTheft',\n LinkedToFraudulentCustomer = 'LinkedToFraudulentCustomer',\n}\n\nexport type UNDepositAccount = {\n id: string\n type: 'depositAccount'\n attributes: {\n createdAt: string\n updatedAt?: string\n name: string\n depositProduct: string\n routingNumber: string\n accountNumber: string\n maskedAccountNumber?: string\n secondaryAccountNumber?: {\n routingNumber: string\n accountNumber: string\n }\n balance: number\n hold: number\n reserve: number\n available: number\n overdraftLimit?: number\n currency: string\n tags: UNTags\n status: UNAccountStatus\n closeReason?: string\n fraudReason?: UNFraudReason\n closeReasonText?: string\n freezeReason?: string\n isOverdrawnWithinLimit?: boolean\n }\n relationships: {\n customer?: UNRelationship\n customers?: UNRelationship\n org: UNRelationship\n }\n // included?: Individual[]\n}\n\nexport type UNBatchAccount = {\n id: string\n type: 'batchAccount'\n attributes: {\n createdAt: Date\n updatedAt?: Date\n name: string\n depositProduct: string\n routingNumber: string\n accountNumber: string\n maskedAccountNumber?: string\n balance: number\n hold: number\n reserve: number\n available: number\n currency: string\n status: 'Open' | 'Closed'\n closeReason?: string\n fraudReason?: UNFraudReason\n closeReasonText?: string\n freezeReason?: string\n tags?: { [key: string]: string }\n }\n relationships: {\n org: UNRelationship\n }\n}\n\nexport type UNCreditAccount = {\n id: string\n type: 'creditAccount'\n attributes: {\n createdAt: Date\n updatedAt?: Date\n name: string\n creditTerms: string\n balance: number\n hold: number\n reserve: number\n available: number\n creditLimit: number\n currency: string\n tags: { [key: string]: string }\n status: UNAccountStatus\n closeReason?: UNCloseReason\n fraudReason?: UNFraudReason\n closeReasonText?: string\n freezeReason?: string\n }\n relationships: {\n customer: UNRelationship,\n org: UNRelationship\n }\n}\n\nexport enum UNAccountMenuAction {\n OpenAccountDetails = 'OpenAccountDetails',\n OpenAccountStatements = 'OpenAccountStatements',\n DownloadBankVerificationLetter = 'DownloadBankVerificationLetter',\n}\n"],"mappings":";;;;;;IAYKA,eAAe;AAAA,WAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;AAAA,GAAfA,eAAe,KAAfA,eAAe;AAAA,IAMRC,aAAa;AAAAC,OAAA,CAAAD,aAAA,GAAAA,aAAA;AAAA,WAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAAC,OAAA,CAAAD,aAAA,GAAbA,aAAa;AAAA,IAKbE,aAAa;AAAAD,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAAA,WAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAAD,OAAA,CAAAC,aAAA,GAAbA,aAAa;AAAA,IAuGbC,mBAAmB;AAAAF,OAAA,CAAAE,mBAAA,GAAAA,mBAAA;AAAA,WAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;AAAA,GAAnBA,mBAAmB,KAAAF,OAAA,CAAAE,mBAAA,GAAnBA,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"names":[],"sources":["achCredit.types.ts"],"sourcesContent":["import type { RESPONSE_KEYS } from '../messages/webMessages/onLoadMessage';\nimport type { UNAccountData, UNCounterpartyAccountData } from './account.types';\nimport type { UNAchCounterparty, UNCounterpartyVerificationMethod, UNPaymentStatus } from './payments.types';\nimport type { UNTags, UNRelationship } from './types';\n\nexport type UNACHOnLoadData = {\n [RESPONSE_KEYS.account]: UNAccountData,\n [RESPONSE_KEYS.counterpartyAccount]: [UNCounterpartyAccountData]\n}\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":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["activity.types.ts"],"sourcesContent":["import type { RESPONSE_KEYS } from '../messages/webMessages/onLoadMessage';\nimport type { UNAuthorizationData } from './authorization.types';\nimport type { UNTransactionData } from './transactions.types';\n\nexport type UNActivityOnLoadData = {\n [RESPONSE_KEYS.authorization]: UNAuthorizationData,\n [RESPONSE_KEYS.transactions]: UNTransactionData,\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["authorization.types.ts"],"sourcesContent":["export type UNAuthorizationData = {\n type: string,\n id: string,\n attributes: UNAuthorizationDetails\n}\n\nexport type UNAuthorizationDetails = {\n cardNetwork: string,\n createdAt: Date,\n amount: string,\n merchant?: UNAuthorizationMerchant,\n cardLast4Digits: string,\n recurring : boolean,\n summary: string,\n}\n\nexport type UNAuthorizationMerchant = {\n name: string,\n type: string,\n category: string,\n location?: string,\n}\n"],"mappings":""}
|
|
@@ -3,4 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.UNCardMenuAction = void 0;
|
|
7
|
+
let UNCardMenuAction;
|
|
8
|
+
exports.UNCardMenuAction = UNCardMenuAction;
|
|
9
|
+
(function (UNCardMenuAction) {
|
|
10
|
+
UNCardMenuAction["Freeze"] = "Freeze";
|
|
11
|
+
UNCardMenuAction["ManagePin"] = "ManagePin";
|
|
12
|
+
UNCardMenuAction["Replace"] = "Replace";
|
|
13
|
+
UNCardMenuAction["Report"] = "Report";
|
|
14
|
+
UNCardMenuAction["Close"] = "Close";
|
|
15
|
+
UNCardMenuAction["Activate"] = "Activate";
|
|
16
|
+
UNCardMenuAction["Unfreeze"] = "Unfreeze";
|
|
17
|
+
UNCardMenuAction["ChangePin"] = "ChangePin";
|
|
18
|
+
UNCardMenuAction["SetPin"] = "SetPin";
|
|
19
|
+
UNCardMenuAction["AddToWallet"] = "AddToWallet";
|
|
20
|
+
})(UNCardMenuAction || (exports.UNCardMenuAction = UNCardMenuAction = {}));
|
|
6
21
|
//# sourceMappingURL=card.types.js.map
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"names":["UNCardMenuAction","exports"],"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\nexport enum UNCardMenuAction {\n Freeze = 'Freeze',\n ManagePin = 'ManagePin',\n Replace = 'Replace',\n Report = 'Report',\n Close = 'Close',\n Activate = 'Activate',\n Unfreeze = 'Unfreeze',\n ChangePin = 'ChangePin',\n SetPin = 'SetPin',\n AddToWallet = 'AddToWallet'\n}\n"],"mappings":";;;;;;IA4DYA,gBAAgB;AAAAC,OAAA,CAAAD,gBAAA,GAAAA,gBAAA;AAAA,WAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAAC,OAAA,CAAAD,gBAAA,GAAhBA,gBAAgB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UNCheckDepositStatus = void 0;
|
|
7
|
+
let UNCheckDepositStatus;
|
|
8
|
+
exports.UNCheckDepositStatus = UNCheckDepositStatus;
|
|
9
|
+
(function (UNCheckDepositStatus) {
|
|
10
|
+
UNCheckDepositStatus["AwaitingImages"] = "AwaitingImages";
|
|
11
|
+
UNCheckDepositStatus["AwaitingFrontImage"] = "AwaitingFrontImage";
|
|
12
|
+
UNCheckDepositStatus["AwaitingBackImage"] = "AwaitingBackImage";
|
|
13
|
+
UNCheckDepositStatus["PendingReview"] = "PendingReview";
|
|
14
|
+
UNCheckDepositStatus["AwaitingCustomerConfirmation"] = "AwaitingCustomerConfirmation";
|
|
15
|
+
UNCheckDepositStatus["Pending"] = "Pending";
|
|
16
|
+
UNCheckDepositStatus["Rejected"] = "Rejected";
|
|
17
|
+
UNCheckDepositStatus["Clearing"] = "Clearing";
|
|
18
|
+
UNCheckDepositStatus["Sent"] = "Sent";
|
|
19
|
+
UNCheckDepositStatus["Canceled"] = "Canceled";
|
|
20
|
+
UNCheckDepositStatus["Returned"] = "Returned";
|
|
21
|
+
})(UNCheckDepositStatus || (exports.UNCheckDepositStatus = UNCheckDepositStatus = {}));
|
|
22
|
+
//# sourceMappingURL=checkDeposit.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNCheckDepositStatus","exports"],"sources":["checkDeposit.types.ts"],"sourcesContent":["import type { UNRelationship } from './types';\n\nexport type UNCheckDepositData = {\n\tid: string\n\ttype: string\n\tattributes: UNCheckDepositAttributes\n\trelationships: UNCheckDepositRelationships\n}\n\nexport type UNCheckDepositAttributes = {\n createdAt: Date\n status: keyof typeof UNCheckDepositStatus\n reason?: string\n description: string\n amount: Cents\n checkNumber?: string\n counterparty: UNCheckCounterparty\n settlementDate?: Date\n tags?: {[key: string]: string}\n}\n\nexport type UNCheckDepositRelationships = {\n account: UNRelationship\n customer?: UNRelationship\n customers?: UNRelationship\n org?: UNRelationship\n transaction?: UNRelationship\n}\n\nexport enum UNCheckDepositStatus {\n\tAwaitingImages = 'AwaitingImages',\n\tAwaitingFrontImage = 'AwaitingFrontImage',\n\tAwaitingBackImage = 'AwaitingBackImage',\n\tPendingReview = 'PendingReview',\n\tAwaitingCustomerConfirmation = 'AwaitingCustomerConfirmation',\n\tPending = 'Pending',\n\tRejected = 'Rejected',\n\tClearing = 'Clearing',\n\tSent = 'Sent',\n\tCanceled = 'Canceled',\n\tReturned = 'Returned',\n}\n\nexport type Cents = number\n\nexport type UNCheckCounterparty = {\n\tname: string\n\taccountNumber: string\n\troutingNumber: string\n}\n"],"mappings":";;;;;;IA6BYA,oBAAoB;AAAAC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AAAA,WAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;AAAA,GAApBA,oBAAoB,KAAAC,OAAA,CAAAD,oBAAA,GAApBA,oBAAoB"}
|
|
@@ -69,4 +69,15 @@ Object.keys(_account).forEach(function (key) {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
+
var _checkDeposit = require("./checkDeposit.types");
|
|
73
|
+
Object.keys(_checkDeposit).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _checkDeposit[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _checkDeposit[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
72
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bookPayment","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_card","_onLoadResponse","_achCredit","_payments","_account"],"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
|
|
1
|
+
{"version":3,"names":["_bookPayment","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_card","_onLoadResponse","_achCredit","_payments","_account","_checkDeposit"],"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';\nexport * from './checkDeposit.types';\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,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AAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,SAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,SAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,aAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,aAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,aAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,aAAA,CAAAV,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["onLoadResponse.types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":[],"sources":["onLoadResponse.types.ts"],"sourcesContent":["export type UNOnLoadResponseData<T> = {\n data: T,\n}\n\nexport type UNError = {\n errors: UNErrorData[]\n}\n\nexport type UNErrorData = {\n status: string,\n title: string,\n detail?: string,\n details?: string,\n meta?: Record<string, string>\n}\n\nexport type UNOnLoadResponse<T> =\n | UNOnLoadResponseData<T>\n | UNError\n"],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UNTransactionType = exports.UNDirection = void 0;
|
|
7
|
+
let UNDirection;
|
|
8
|
+
exports.UNDirection = UNDirection;
|
|
9
|
+
(function (UNDirection) {
|
|
10
|
+
UNDirection["Debit"] = "Debit";
|
|
11
|
+
UNDirection["Credit"] = "Credit";
|
|
12
|
+
})(UNDirection || (exports.UNDirection = UNDirection = {}));
|
|
13
|
+
let UNTransactionType;
|
|
14
|
+
exports.UNTransactionType = UNTransactionType;
|
|
15
|
+
(function (UNTransactionType) {
|
|
16
|
+
UNTransactionType["ATM"] = "atmTransaction";
|
|
17
|
+
UNTransactionType["Adjustment"] = "adjustmentTransaction";
|
|
18
|
+
UNTransactionType["BillPay"] = "billPayTransaction";
|
|
19
|
+
UNTransactionType["Book"] = "bookTransaction";
|
|
20
|
+
UNTransactionType["Card"] = "cardTransaction";
|
|
21
|
+
UNTransactionType["CardReversal"] = "cardReverTransactionTypessalTransaction";
|
|
22
|
+
UNTransactionType["Chargeback"] = "chargebackTransaction";
|
|
23
|
+
UNTransactionType["CheckDeposit"] = "checkDepositTransaction";
|
|
24
|
+
UNTransactionType["DishonoredACH"] = "dishonoredAchTransaction";
|
|
25
|
+
UNTransactionType["Dispute"] = "disputeTransaction";
|
|
26
|
+
UNTransactionType["DisputeSettlement"] = "disputeSettlementTransaction";
|
|
27
|
+
UNTransactionType["Fee"] = "feeTransaction";
|
|
28
|
+
UNTransactionType["InterchangeShare"] = "interchangeShareTransaction";
|
|
29
|
+
UNTransactionType["Interest"] = "interestTransaction";
|
|
30
|
+
UNTransactionType["InterestShare"] = "interestShareTransaction";
|
|
31
|
+
UNTransactionType["NegativeBalanceCoverage"] = "negativeBalanceCoverageTransaction";
|
|
32
|
+
UNTransactionType["OriginatedACH"] = "originatedAchTransaction";
|
|
33
|
+
UNTransactionType["PaymentAdvance"] = "paymentAdvanceTransaction";
|
|
34
|
+
UNTransactionType["PaymentCanceled"] = "paymentCanceledTransaction";
|
|
35
|
+
UNTransactionType["Purchase"] = "purchaseTransaction";
|
|
36
|
+
UNTransactionType["ReceivedACH"] = "receivedAchTransaction";
|
|
37
|
+
UNTransactionType["Release"] = "releaseTransaction";
|
|
38
|
+
UNTransactionType["RepaidPaymentAdvance"] = "repaidPaymentAdvanceTransaction";
|
|
39
|
+
UNTransactionType["ReturnedACH"] = "returnedAchTransaction";
|
|
40
|
+
UNTransactionType["ReturnedCheckDeposit"] = "returnedCheckDepositTransaction";
|
|
41
|
+
UNTransactionType["ReturnedReceivedACH"] = "returnedReceivedAchTransaction";
|
|
42
|
+
UNTransactionType["Reward"] = "rewardTransaction";
|
|
43
|
+
UNTransactionType["Settlement"] = "settlementTransaction";
|
|
44
|
+
UNTransactionType["SponsoredInterest"] = "sponsoredInterestTransaction";
|
|
45
|
+
UNTransactionType["Wire"] = "wireTransaction";
|
|
46
|
+
UNTransactionType["AccountLowBalanceClosure"] = "accountLowBalanceClosureTransaction";
|
|
47
|
+
UNTransactionType["CashDeposit"] = "cashDepositTransaction";
|
|
48
|
+
UNTransactionType["BankRepayment"] = "bankRepaymentTransaction";
|
|
49
|
+
UNTransactionType["CustomerRepayment"] = "CustomerRepaymentTransaction";
|
|
50
|
+
UNTransactionType["CustomerRepaymentReturned"] = "CustomerRepaymentReturnedTransaction";
|
|
51
|
+
})(UNTransactionType || (exports.UNTransactionType = UNTransactionType = {}));
|
|
52
|
+
//# sourceMappingURL=transactions.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNDirection","exports","UNTransactionType"],"sources":["transactions.types.ts"],"sourcesContent":["export type UNTransactionData = {\n type: UNTransactionType,\n id: string,\n attributes: UNATransactionAttributes,\n relationships: UNTransactionRelationships\n}\n\nexport type UNATransactionAttributes = {\n createdAt: Date,\n amount: string,\n direction?: UNDirection,\n balance?: string,\n summary?: string,\n companyName?: string,\n counterpartyName?: string,\n counterpartyRoutingNumber?: string,\n reason?: string,\n}\n\nexport type UNTransactionRelationships = {\n customer?: {\n data: {\n type: string\n id: number\n }\n }\n customers?: {\n data: [\n {\n type: 'customer'\n id: string\n }\n ]\n }\n org?: {\n data: {\n type: string\n id: number\n }\n }\n}\n\nexport enum UNDirection {\n\tDebit = 'Debit',\n\tCredit = 'Credit',\n}\n\nexport enum UNTransactionType {\n\tATM = 'atmTransaction',\n\tAdjustment = 'adjustmentTransaction',\n\tBillPay = 'billPayTransaction',\n\tBook = 'bookTransaction',\n\tCard = 'cardTransaction',\n\tCardReversal = 'cardReverTransactionTypessalTransaction',\n\tChargeback = 'chargebackTransaction',\n\tCheckDeposit = 'checkDepositTransaction',\n\tDishonoredACH = 'dishonoredAchTransaction',\n\tDispute = 'disputeTransaction',\n\tDisputeSettlement = 'disputeSettlementTransaction',\n\tFee = 'feeTransaction',\n\tInterchangeShare = 'interchangeShareTransaction',\n\tInterest = 'interestTransaction',\n\tInterestShare = 'interestShareTransaction',\n\tNegativeBalanceCoverage = 'negativeBalanceCoverageTransaction',\n\tOriginatedACH = 'originatedAchTransaction',\n\tPaymentAdvance = 'paymentAdvanceTransaction',\n\tPaymentCanceled = 'paymentCanceledTransaction',\n\tPurchase = 'purchaseTransaction',\n\tReceivedACH = 'receivedAchTransaction',\n\tRelease = 'releaseTransaction',\n\tRepaidPaymentAdvance = 'repaidPaymentAdvanceTransaction',\n\tReturnedACH = 'returnedAchTransaction',\n\tReturnedCheckDeposit = 'returnedCheckDepositTransaction',\n\tReturnedReceivedACH = 'returnedReceivedAchTransaction',\n\tReward = 'rewardTransaction',\n\tSettlement = 'settlementTransaction',\n\tSponsoredInterest = 'sponsoredInterestTransaction',\n\tWire = 'wireTransaction',\n\tAccountLowBalanceClosure = 'accountLowBalanceClosureTransaction',\n\tCashDeposit = 'cashDepositTransaction',\n\tBankRepayment = 'bankRepaymentTransaction',\n\tCustomerRepayment = 'CustomerRepaymentTransaction',\n\tCustomerRepaymentReturned = 'CustomerRepaymentReturnedTransaction',\n}\n"],"mappings":";;;;;;IA0CYA,WAAW;AAAAC,OAAA,CAAAD,WAAA,GAAAA,WAAA;AAAA,WAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAAC,OAAA,CAAAD,WAAA,GAAXA,WAAW;AAAA,IAKXE,iBAAiB;AAAAD,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAAA,WAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;AAAA,GAAjBA,iBAAiB,KAAAD,OAAA,CAAAC,iBAAA,GAAjBA,iBAAiB"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.WebComponentType = exports.WebComponent = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
8
9
|
var _reactNativeWebview = require("react-native-webview");
|
|
9
10
|
var _EventBus = _interopRequireDefault(require("../helpers/EventBus"));
|
|
10
11
|
var _html = _interopRequireWildcard(require("./html"));
|
|
@@ -19,6 +20,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
19
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
22
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
UNAppInfo
|
|
26
|
+
} = _reactNative.NativeModules;
|
|
22
27
|
let WebComponentType;
|
|
23
28
|
exports.WebComponentType = WebComponentType;
|
|
24
29
|
(function (WebComponentType) {
|
|
@@ -27,6 +32,7 @@ exports.WebComponentType = WebComponentType;
|
|
|
27
32
|
WebComponentType["activity"] = "unit-elements-activity";
|
|
28
33
|
WebComponentType["slot"] = "unit-elements-sdk-slot";
|
|
29
34
|
WebComponentType["account"] = "unit-elements-account";
|
|
35
|
+
WebComponentType["checkDeposit"] = "unit-elements-check-deposit";
|
|
30
36
|
WebComponentType["achDebitPayment"] = "unit-elements-ach-debit-payment";
|
|
31
37
|
WebComponentType["achCreditPayment"] = "unit-elements-ach-credit-payment";
|
|
32
38
|
})(WebComponentType || (exports.WebComponentType = WebComponentType = {}));
|
|
@@ -34,6 +40,7 @@ const WebComponent = /*#__PURE__*/_react.default.forwardRef(function WebComponen
|
|
|
34
40
|
const [unitScript, setUnitScript] = (0, _react.useState)(_UnitSdk.globalUnitScript);
|
|
35
41
|
const [sourceHtml, setSourceHtml] = (0, _react.useState)(null);
|
|
36
42
|
const [componentCurrentTheme, setComponentCurrentTheme] = (0, _react.useState)(props.theme ?? _UnitSdkManager.UnitSDK.getTheme());
|
|
43
|
+
const [baseName, setBaseName] = (0, _react.useState)();
|
|
37
44
|
const width = props.width ?? '100%';
|
|
38
45
|
const updateUnitScript = data => {
|
|
39
46
|
setUnitScript(data.unitScript);
|
|
@@ -49,6 +56,24 @@ const WebComponent = /*#__PURE__*/_react.default.forwardRef(function WebComponen
|
|
|
49
56
|
busEventKey: _sdkMessage.SDKMessage.IS_SDK_INITIALIZED,
|
|
50
57
|
action: updateInitializedParams
|
|
51
58
|
});
|
|
59
|
+
(0, _react.useEffect)(() => {
|
|
60
|
+
const getAppName = async () => {
|
|
61
|
+
// For iOS, we extend the app name from the HTML to display a prettier access request message.
|
|
62
|
+
// On Android, there is no request message sent from HTML.
|
|
63
|
+
try {
|
|
64
|
+
if (_reactNative.Platform.OS == 'ios') {
|
|
65
|
+
const name = await UNAppInfo.getBundleName();
|
|
66
|
+
setBaseName(name.replace(/ /g, '-'));
|
|
67
|
+
} else {
|
|
68
|
+
// android
|
|
69
|
+
setBaseName('unit');
|
|
70
|
+
}
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error(error);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
getAppName();
|
|
76
|
+
}, []);
|
|
52
77
|
(0, _react.useEffect)(() => {
|
|
53
78
|
if (!unitScript) {
|
|
54
79
|
(0, _UnitSdk.fetchUnitScript)();
|
|
@@ -81,8 +106,14 @@ const WebComponent = /*#__PURE__*/_react.default.forwardRef(function WebComponen
|
|
|
81
106
|
}
|
|
82
107
|
return null;
|
|
83
108
|
};
|
|
109
|
+
if (!baseName) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
84
112
|
return /*#__PURE__*/_react.default.createElement(_reactNativeWebview.WebView, {
|
|
85
113
|
ref: webRef,
|
|
114
|
+
originWhitelist: ['*'],
|
|
115
|
+
mediaPlaybackRequiresUserAction: false,
|
|
116
|
+
allowsInlineMediaPlayback: true,
|
|
86
117
|
cacheEnabled: false,
|
|
87
118
|
scrollEnabled: props.isScrollable,
|
|
88
119
|
nestedScrollEnabled: props.nestedScrollEnabled,
|
|
@@ -95,9 +126,11 @@ const WebComponent = /*#__PURE__*/_react.default.forwardRef(function WebComponen
|
|
|
95
126
|
opacity: 0.99
|
|
96
127
|
},
|
|
97
128
|
source: {
|
|
98
|
-
html: sourceHtml
|
|
129
|
+
html: sourceHtml,
|
|
130
|
+
baseUrl: `https://${baseName}`
|
|
99
131
|
},
|
|
100
|
-
onMessage: onMessage
|
|
132
|
+
onMessage: onMessage,
|
|
133
|
+
androidHardwareAccelerationDisabled: true
|
|
101
134
|
});
|
|
102
135
|
});
|
|
103
136
|
exports.WebComponent = WebComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeWebview","_EventBus","_interopRequireDefault","_html","_unitMessages","_listenerToBus","_bodyHtml","_UnitSdk","_UnitSdkManager","_sdkMessage","_WebComponent","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","WebComponentType","exports","WebComponent","React","forwardRef","props","webRef","unitScript","setUnitScript","useState","globalUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","UnitSDK","getTheme","width","updateUnitScript","data","updateInitializedParams","useListenerToBus","busEventKey","SDKMessage","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","useEffect","fetchUnitScript","componentParams","params","newHtml","html","replace","HTML_PLACEHOLDER","BODY","getHtmlBody","type","valueOf","presentationMode","SCRIPT_FROM_NATIVE","script","onMessage","e","message","JSON","parse","nativeEvent","UnitMessage","UNIT_REQUEST_REFRESH","details","EventBus","Instance","event","UNIT_REQUEST_DOWNLOAD","handleRequestDownload","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","WebView","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":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AAEA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAA6D,SAAAG,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAjB,wBAAAa,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BA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AE7D,KAAK,CAAC6D,mBAAoB;IAC/CC,QAAQ,EAAET,SAAU;IACpBU,cAAc,EAAC,OAAO;IACtBC,kBAAkB,EAAE9D,UAAW;IAC/B+D,KAAK,EAAE;MAAEpD,KAAK,EAAEA,KAAK;MAAEqD,IAAI,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAI,CAAE;IAC/CC,MAAM,EAAE;MAAExC,IAAI,EAAEtB;IAAW,CAAE;IAC7BgC,SAAS,EAAEA;EAAU,EAAG;AAE9B,CAAC,CAAC;AAAC1C,OAAA,CAAAC,YAAA,GAAAA,YAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_EventBus","_interopRequireDefault","_html","_unitMessages","_listenerToBus","_bodyHtml","_UnitSdk","_UnitSdkManager","_sdkMessage","_WebComponent","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","UNAppInfo","NativeModules","WebComponentType","exports","WebComponent","React","forwardRef","props","webRef","unitScript","setUnitScript","useState","globalUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","UnitSDK","getTheme","baseName","setBaseName","width","updateUnitScript","data","updateInitializedParams","useListenerToBus","busEventKey","SDKMessage","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","useEffect","getAppName","Platform","OS","name","getBundleName","replace","error","console","fetchUnitScript","componentParams","params","newHtml","html","HTML_PLACEHOLDER","BODY","getHtmlBody","type","valueOf","presentationMode","SCRIPT_FROM_NATIVE","script","onMessage","e","message","JSON","parse","nativeEvent","UnitMessage","UNIT_REQUEST_REFRESH","details","EventBus","Instance","event","UNIT_REQUEST_DOWNLOAD","handleRequestDownload","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","WebView","ref","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","flex","opacity","source","baseUrl","androidHardwareAccelerationDisabled"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { NativeModules, Platform } from 'react-native';\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\nconst { UNAppInfo } = NativeModules;\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 checkDeposit = 'unit-elements-check-deposit',\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 [baseName, setBaseName] = useState<string>();\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\n const getAppName = async () => {\n // For iOS, we extend the app name from the HTML to display a prettier access request message.\n // On Android, there is no request message sent from HTML.\n try {\n if (Platform.OS == 'ios') {\n const name = await UNAppInfo.getBundleName();\n setBaseName(name.replace(/ /g, '-'));\n } else { // android\n setBaseName('unit');\n }\n } catch (error: any) {\n console.error(error);\n }\n };\n\n getAppName();\n }, []);\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 if (!baseName) {\n return null;\n }\n\n return (\n <WebView\n ref={webRef}\n originWhitelist={['*']}\n mediaPlaybackRequiresUserAction={false}\n allowsInlineMediaPlayback={true}\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, baseUrl: `https://${baseName}` }}\n onMessage={onMessage}\n androidHardwareAccelerationDisabled\n />\n );\n});\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAV,OAAA;AAEA,IAAAW,WAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AAA6D,SAAAI,uBAAAS,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAlB,wBAAAc,GAAA,E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kC,SAAS,EAAEA,SAAU;IACrBmC,mCAAmC;EAAA,EACnC;AAEN,CAAC,CAAC;AAACtF,OAAA,CAAAC,YAAA,GAAAA,YAAA"}
|
|
@@ -26,7 +26,7 @@ const htmlText = `
|
|
|
26
26
|
}
|
|
27
27
|
</script>
|
|
28
28
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
|
|
29
|
-
</
|
|
29
|
+
</head>
|
|
30
30
|
|
|
31
31
|
<body style="margin: 0;">
|
|
32
32
|
${HTML_PLACEHOLDER.BODY}
|
|
@@ -48,17 +48,30 @@ const htmlText = `
|
|
|
48
48
|
|
|
49
49
|
${_bodyScript.LISTENERS.requestCloseFlow}
|
|
50
50
|
|
|
51
|
+
${_bodyScript.LISTENERS.cardActivated}
|
|
52
|
+
|
|
51
53
|
${_bodyScript.LISTENERS.cardStatusChange}
|
|
52
54
|
|
|
53
55
|
${_bodyScript.LISTENERS.unitRequestExternalSdk}
|
|
54
56
|
|
|
55
57
|
${_bodyScript.LISTENERS.unitAccountChanged}
|
|
56
58
|
|
|
59
|
+
${_bodyScript.LISTENERS.unitActivityFiltersChanged}
|
|
60
|
+
|
|
57
61
|
${_bodyScript.DISPATCH_RENDERING_EVENT}
|
|
58
62
|
|
|
63
|
+
${_bodyScript.DISPATCH_OPEN_ACTIONS_MENU}
|
|
64
|
+
|
|
65
|
+
${_bodyScript.DISPATCH_REQUEST_CARD_ACTION}
|
|
66
|
+
|
|
67
|
+
${_bodyScript.DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT}
|
|
68
|
+
|
|
69
|
+
${_bodyScript.DISPATCH_REQUEST_ACCOUNT_ACTION}
|
|
70
|
+
|
|
59
71
|
${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}
|
|
60
72
|
</script>
|
|
61
73
|
</body>
|
|
74
|
+
</html>
|
|
62
75
|
`;
|
|
63
76
|
var _default = htmlText;
|
|
64
77
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_bodyScript","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","exports","htmlText","Platform","OS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","LISTENERS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardStatusChange","unitRequestExternalSdk","unitAccountChanged","DISPATCH_RENDERING_EVENT","_default","default"],"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 </
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_bodyScript","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","exports","htmlText","Platform","OS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","LISTENERS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardActivated","cardStatusChange","unitRequestExternalSdk","unitAccountChanged","unitActivityFiltersChanged","DISPATCH_RENDERING_EVENT","DISPATCH_OPEN_ACTIONS_MENU","DISPATCH_REQUEST_CARD_ACTION","DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT","DISPATCH_REQUEST_ACCOUNT_ACTION","_default","default"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT, DISPATCH_REQUEST_CARD_ACTION, DISPATCH_OPEN_ACTIONS_MENU, DISPATCH_REQUEST_ACCOUNT_ACTION, DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT } 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 </head>\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.cardActivated}\n\n ${LISTENERS.cardStatusChange}\n\n ${LISTENERS.unitRequestExternalSdk}\n\n ${LISTENERS.unitAccountChanged}\n\n ${LISTENERS.unitActivityFiltersChanged}\n\n ${DISPATCH_RENDERING_EVENT}\n\n ${DISPATCH_OPEN_ACTIONS_MENU}\n\n ${DISPATCH_REQUEST_CARD_ACTION}\n\n ${DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT}\n\n ${DISPATCH_REQUEST_ACCOUNT_ACTION}\n\n ${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}\n </script>\n </body>\n </html>\n`;\n\nexport default htmlText;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,GAAG;EAC9BC,WAAW,EAAE,eAAe;EAC5BC,IAAI,EAAE,kBAAkB;EACxBC,kBAAkB,EAAE;AACtB,CAAC;AAACC,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA;AAEF,MAAMK,QAAQ,GAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAaC,qBAAQ,CAACC,EAAG;AACzB,qBAAqBD,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,QAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMP,gBAAgB,CAACE,IAAK;AAC5B;AACA;AACA,QAAQM,+BAAoB;AAC5B;AACA,QAAQC,4BAAiB;AACzB;AACA,QAAQC,qBAAS,CAACC,YAAa;AAC/B;AACA,QAAQD,qBAAS,CAACE,MAAO;AACzB;AACA,QAAQF,qBAAS,CAACG,mBAAoB;AACtC;AACA,QAAQH,qBAAS,CAACI,gBAAiB;AACnC;AACA,QAAQJ,qBAAS,CAACK,eAAgB;AAClC;AACA,QAAQL,qBAAS,CAACM,gBAAiB;AACnC;AACA,QAAQN,qBAAS,CAACO,aAAc;AAChC;AACA,QAAQP,qBAAS,CAACQ,gBAAiB;AACnC;AACA,QAAQR,qBAAS,CAACS,sBAAuB;AACzC;AACA,QAAQT,qBAAS,CAACU,kBAAmB;AACrC;AACA,QAAQV,qBAAS,CAACW,0BAA2B;AAC7C;AACA,QAAQC,oCAAyB;AACjC;AACA,QAAQC,sCAA2B;AACnC;AACA,QAAQC,wCAA6B;AACrC;AACA,QAAQC,kDAAuC;AAC/C;AACA,QAAQC,2CAAgC;AACxC;AACA,QAAQ1B,gBAAgB,CAACG,kBAAmB;AAC5C;AACA;AACA;AACA,CAAC;AAAC,IAAAwB,QAAA,GAEatB,QAAQ;AAAAD,OAAA,CAAAwB,OAAA,GAAAD,QAAA"}
|
|
@@ -6,9 +6,32 @@ import { View } from 'react-native';
|
|
|
6
6
|
import { UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
7
7
|
import { getACHCreditParams, getACHCreditScript } from './UNACHCreditComponent.utils';
|
|
8
8
|
import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
|
|
9
|
+
import { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';
|
|
9
10
|
export const UNACHCreditComponent = props => {
|
|
10
11
|
const [height, setHeight] = useState(0);
|
|
11
12
|
const [presentationMode, setPresentationMode] = useState(PresentationMode.Inherit);
|
|
13
|
+
const handleUnitOnLoad = response => {
|
|
14
|
+
if (!props.onLoad) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (RESPONSE_KEYS.errors in response) {
|
|
18
|
+
props.onLoad(response);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (RESPONSE_KEYS.account in response && RESPONSE_KEYS.counterpartyAccount in response) {
|
|
22
|
+
// ACHOnLoadResponse;
|
|
23
|
+
const achOnload = {
|
|
24
|
+
data: {
|
|
25
|
+
[RESPONSE_KEYS.account]: response[RESPONSE_KEYS.account].data,
|
|
26
|
+
[RESPONSE_KEYS.counterpartyAccount]: response[RESPONSE_KEYS.counterpartyAccount].data
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
props.onLoad(achOnload);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
console.error('On Load Error: unexpected response type');
|
|
33
|
+
return;
|
|
34
|
+
};
|
|
12
35
|
const handleWebViewMessage = message => {
|
|
13
36
|
if (!message || !message.details) return;
|
|
14
37
|
switch (message.type) {
|
|
@@ -19,7 +42,7 @@ export const UNACHCreditComponent = props => {
|
|
|
19
42
|
break;
|
|
20
43
|
}
|
|
21
44
|
case UnitMessage.UNIT_ON_LOAD:
|
|
22
|
-
|
|
45
|
+
handleUnitOnLoad(message.details);
|
|
23
46
|
break;
|
|
24
47
|
case PageMessage.PAGE_HEIGHT:
|
|
25
48
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","WebComponent","WebComponentType","PresentationMode","PageMessage","View","UnitMessage","getACHCreditParams","getACHCreditScript","PaymentMessage","UNACHCreditComponent","props","height","setHeight","presentationMode","setPresentationMode","Inherit","handleWebViewMessage","message","details","type","PAYMENT_CREATED","achCreditEvent","onPaymentCreated","
|
|
1
|
+
{"version":3,"names":["React","useState","WebComponent","WebComponentType","PresentationMode","PageMessage","View","UnitMessage","getACHCreditParams","getACHCreditScript","PaymentMessage","RESPONSE_KEYS","UNACHCreditComponent","props","height","setHeight","presentationMode","setPresentationMode","Inherit","handleUnitOnLoad","response","onLoad","errors","account","counterpartyAccount","achOnload","data","console","error","handleWebViewMessage","message","details","type","PAYMENT_CREATED","achCreditEvent","onPaymentCreated","UNIT_ON_LOAD","PAGE_HEIGHT","currentHeight","Default","renderACHCreditWebView","createElement","achCreditPayment","params","script","onMessage","isScrollable","theme","style"],"sources":["UNACHCreditComponent.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport type { UNOnLoadResponse, UNACHData, UNACHOnLoadData, UNError, UNOnLoadResponseData } from '../../sharedTypes';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { View } from 'react-native';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\nimport { getACHCreditParams, getACHCreditScript } from './UNACHCreditComponent.utils';\nimport { PaymentMessage } from '../../messages/webMessages/paymentsMessage';\nimport type { ACHEvent } from '../../messages/webMessages/achCreditMessage';\nimport { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';\n\nexport interface UNACHCreditComponentProps {\n accountId: string;\n customerToken: string;\n theme?: string;\n isAutoFocus?: boolean;\n fee?: number;\n onPaymentCreated?: (data: UNACHData) => void;\n onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;\n}\n\nexport const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {\n const [height, setHeight] = useState<number>(0);\n const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);\n\n const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {\n if (!props.onLoad) {\n return;\n }\n\n if (RESPONSE_KEYS.errors in response) {\n props.onLoad(response as UNError);\n return;\n }\n\n if (RESPONSE_KEYS.account in response && RESPONSE_KEYS.counterpartyAccount in response) {\n // ACHOnLoadResponse;\n const achOnload: UNOnLoadResponseData<UNACHOnLoadData> = {\n data: {\n [RESPONSE_KEYS.account]: response[RESPONSE_KEYS.account].data,\n [RESPONSE_KEYS.counterpartyAccount]: response[RESPONSE_KEYS.counterpartyAccount].data,\n }\n };\n props.onLoad(achOnload);\n return;\n }\n\n console.error('On Load Error: unexpected response type');\n return;\n };\n\n const handleWebViewMessage = (message: WebViewMessage) => {\n if (!message || !message.details) return;\n\n switch (message.type) {\n case PaymentMessage.PAYMENT_CREATED: {\n const achCreditEvent = message.details as ACHEvent;\n props.onPaymentCreated && props.onPaymentCreated(achCreditEvent.data as UNACHData);\n break;\n }\n case UnitMessage.UNIT_ON_LOAD:\n handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);\n break;\n case PageMessage.PAGE_HEIGHT: {\n const currentHeight = (message.details as HeightEvent).height;\n setHeight(currentHeight);\n if (presentationMode === PresentationMode.Inherit && currentHeight === 0) {\n setPresentationMode(PresentationMode.Default);\n }\n break;\n }\n }\n };\n\n const renderACHCreditWebView = () => {\n return (\n <WebComponent\n type={WebComponentType.achCreditPayment}\n presentationMode={presentationMode}\n params={getACHCreditParams(props)}\n script={getACHCreditScript()}\n onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}\n isScrollable={false}\n theme={props.theme}\n />\n );\n };\n\n if (presentationMode === PresentationMode.Inherit) {\n return renderACHCreditWebView();\n }\n\n return (\n <View style={{ height: height }}>\n {renderACHCreditWebView()}\n </View>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,iCAAiC;AAChF,SAASC,gBAAgB,QAAQ,6BAA6B;AAG9D,SAAsBC,WAAW,QAAQ,wCAAwC;AACjF,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,WAAW,QAAQ,yCAAyC;AACrE,SAASC,kBAAkB,EAAEC,kBAAkB,QAAQ,8BAA8B;AACrF,SAASC,cAAc,QAAQ,4CAA4C;AAE3E,SAASC,aAAa,QAAiC,0CAA0C;AAYjG,OAAO,MAAMC,oBAAoB,GAAIC,KAAgC,IAAK;EACxE,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGd,QAAQ,CAAS,CAAC,CAAC;EAC/C,MAAM,CAACe,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGhB,QAAQ,CAAmBG,gBAAgB,CAACc,OAAO,CAAC;EAEpG,MAAMC,gBAAgB,GAAIC,QAAiC,IAAK;IAC9D,IAAI,CAACP,KAAK,CAACQ,MAAM,EAAE;MACjB;IACF;IAEA,IAAIV,aAAa,CAACW,MAAM,IAAIF,QAAQ,EAAE;MACpCP,KAAK,CAACQ,MAAM,CAACD,QAAQ,CAAY;MACjC;IACF;IAEA,IAAIT,aAAa,CAACY,OAAO,IAAIH,QAAQ,IAAIT,aAAa,CAACa,mBAAmB,IAAIJ,QAAQ,EAAE;MACtF;MACA,MAAMK,SAAgD,GAAG;QACvDC,IAAI,EAAE;UACJ,CAACf,aAAa,CAACY,OAAO,GAAGH,QAAQ,CAACT,aAAa,CAACY,OAAO,CAAC,CAACG,IAAI;UAC7D,CAACf,aAAa,CAACa,mBAAmB,GAAGJ,QAAQ,CAACT,aAAa,CAACa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,CAACkC;IAAM,EACnB;EAEN,CAAC;EAED,IAAI/B,gBAAgB,KAAKZ,gBAAgB,CAACc,OAAO,EAAE;IACjD,OAAOsB,sBAAsB,EAAE;EACjC;EAEA,oBACExC,KAAA,CAAAyC,aAAA,CAACnC,IAAI;IAAC0C,KAAK,EAAE;MAAElC,MAAM,EAAEA;IAAO;EAAE,GAC7B0B,sBAAsB,EAAE,CACpB;AAEX,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
|
7
7
|
import { getACHDebitParams, getACHDebitScript, getAndroidPackageName, injectUnitPlaidResponse } from './UNACHDebitComponent.utils';
|
|
8
8
|
import { openLink } from 'react-native-plaid-link-sdk';
|
|
9
9
|
import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
|
|
10
|
+
import { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';
|
|
10
11
|
export const UNACHDebitComponent = props => {
|
|
11
12
|
const [height, setHeight] = useState(0);
|
|
12
13
|
const [appPackageName, setAppPackageName] = useState('');
|
|
@@ -25,6 +26,28 @@ export const UNACHDebitComponent = props => {
|
|
|
25
26
|
const dispatchUnitPlaidResponse = success => {
|
|
26
27
|
injectUnitPlaidResponse(webRef.current, success);
|
|
27
28
|
};
|
|
29
|
+
const handleUnitOnLoad = response => {
|
|
30
|
+
if (!props.onLoad) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (RESPONSE_KEYS.errors in response) {
|
|
34
|
+
props.onLoad(response);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (RESPONSE_KEYS.account in response && RESPONSE_KEYS.counterpartyAccount in response) {
|
|
38
|
+
// ACHOnLoadResponse;
|
|
39
|
+
const achOnload = {
|
|
40
|
+
data: {
|
|
41
|
+
[RESPONSE_KEYS.account]: response[RESPONSE_KEYS.account].data,
|
|
42
|
+
[RESPONSE_KEYS.counterpartyAccount]: response[RESPONSE_KEYS.counterpartyAccount].data
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
props.onLoad(achOnload);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
console.error('On Load Error: unexpected response type');
|
|
49
|
+
return;
|
|
50
|
+
};
|
|
28
51
|
const handleWebViewMessage = message => {
|
|
29
52
|
if (!message || !message.details) return;
|
|
30
53
|
switch (message.type) {
|
|
@@ -35,7 +58,7 @@ export const UNACHDebitComponent = props => {
|
|
|
35
58
|
break;
|
|
36
59
|
}
|
|
37
60
|
case UnitMessage.UNIT_ON_LOAD:
|
|
38
|
-
|
|
61
|
+
handleUnitOnLoad(message.details);
|
|
39
62
|
break;
|
|
40
63
|
case PageMessage.PAGE_HEIGHT:
|
|
41
64
|
{
|