@chargehive/types 2.6.8 → 2.7.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/chargehive.d.ts +10 -1
- package/package.json +1 -1
- package/validation.d.ts +1 -1
package/chargehive.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
PCIBridgeTokenizeEphemeralResponse,
|
|
5
5
|
PCIBridgeTokenizeResponse,
|
|
6
6
|
} from '@pci-bridge/types/pcibridge';
|
|
7
|
-
import {Validation, ValidationEventData} from './validation';
|
|
7
|
+
import {Validation, ValidationEventData, Validator} from './validation';
|
|
8
8
|
import {Address, Person} from './address';
|
|
9
9
|
|
|
10
10
|
type EmptyObject = Record<string, never>;
|
|
@@ -15,6 +15,8 @@ declare global
|
|
|
15
15
|
var ChargeHive: ChargeHiveType;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
export type ButtonState = 'unavailable' | 'loading' | 'disabled' | 'ready';
|
|
19
|
+
|
|
18
20
|
declare type FieldName = PCIBFieldName;
|
|
19
21
|
|
|
20
22
|
export interface ChargeHiveEventTarget extends Omit<EventTarget, 'dispatchEvent'>
|
|
@@ -41,6 +43,8 @@ export interface ChargeHiveType extends ChargeType, ChargeHiveEventTarget
|
|
|
41
43
|
|
|
42
44
|
readonly correlationID: string;
|
|
43
45
|
|
|
46
|
+
readonly locale: string;
|
|
47
|
+
|
|
44
48
|
initialize(options: ChargeHiveInitOptions);
|
|
45
49
|
|
|
46
50
|
isInitialized(): boolean;
|
|
@@ -114,8 +118,10 @@ export interface ChargeHiveInitOptions
|
|
|
114
118
|
merchantPlacement: string;
|
|
115
119
|
country: string;
|
|
116
120
|
currency: string;
|
|
121
|
+
locale?: string;
|
|
117
122
|
environment?: ChargeEnvironment;
|
|
118
123
|
walletOptions?: WalletOptions;
|
|
124
|
+
capabilities?: PaymentMethodType[];
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
export interface InitResponse
|
|
@@ -280,6 +286,7 @@ export interface OrderItem
|
|
|
280
286
|
}
|
|
281
287
|
|
|
282
288
|
export type EventName = PCIBEventName
|
|
289
|
+
| 'init-response'
|
|
283
290
|
| 'init'
|
|
284
291
|
| 'token'
|
|
285
292
|
| 'token-config'
|
|
@@ -311,6 +318,7 @@ export type ChargeHiveEventData = {
|
|
|
311
318
|
readonly 'method-type-changed': ChargehiveMethodTypeChangedEvent;
|
|
312
319
|
readonly 'charge-id': string;
|
|
313
320
|
|
|
321
|
+
readonly 'init-response': InitResponse;
|
|
314
322
|
readonly 'init': InitResponse;
|
|
315
323
|
readonly 'cancel': undefined;
|
|
316
324
|
readonly 'ready': undefined;
|
|
@@ -336,6 +344,7 @@ export type ChargehiveTokenEvent = TokenizeResponse
|
|
|
336
344
|
interface ChargehiveSuccessEvent
|
|
337
345
|
{
|
|
338
346
|
chargeId: string;
|
|
347
|
+
methodId: string;
|
|
339
348
|
transactionId: string;
|
|
340
349
|
transactedAmount: {
|
|
341
350
|
currency: string;
|
package/package.json
CHANGED
package/validation.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {FieldName} from './chargehive';
|
|
|
6
6
|
|
|
7
7
|
export type ValidationEventData = Map<FieldName, Validation>;
|
|
8
8
|
|
|
9
|
-
export type Validator = () => Promise<
|
|
9
|
+
export type Validator = () => Promise<ValidationEventData>;
|
|
10
10
|
|
|
11
11
|
export type Validation = {
|
|
12
12
|
isValid: boolean;
|