@chargehive/types 2.7.0 → 2.7.2
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 +11 -3
- package/package.json +1 -1
- package/validation.d.ts +2 -2
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>;
|
|
@@ -57,7 +57,7 @@ export interface ChargeHiveType extends ChargeType, ChargeHiveEventTarget
|
|
|
57
57
|
|
|
58
58
|
assertValid(): Promise<void>;
|
|
59
59
|
|
|
60
|
-
validate(field?: FieldName, timeout?: number): Promise<
|
|
60
|
+
validate(field?: FieldName, timeout?: number): Promise<ValidationEventData>;
|
|
61
61
|
|
|
62
62
|
tokenize(): Promise<TokenizeResponse>;
|
|
63
63
|
|
|
@@ -312,7 +312,7 @@ export type ChargeHiveEventData = {
|
|
|
312
312
|
readonly 'success': ChargehiveSuccessEvent;
|
|
313
313
|
readonly 'declined': ChargehiveDeclinedEvent;
|
|
314
314
|
readonly 'authentication': AuthenticationEvent;
|
|
315
|
-
readonly 'error':
|
|
315
|
+
readonly 'error': ChargehiveErrorEvent;
|
|
316
316
|
readonly 'token-config': PaymentMethodTokenizationConfig[PaymentMethodType];
|
|
317
317
|
readonly 'capability': ChargehiveCapabilityEvent;
|
|
318
318
|
readonly 'method-type-changed': ChargehiveMethodTypeChangedEvent;
|
|
@@ -344,6 +344,7 @@ export type ChargehiveTokenEvent = TokenizeResponse
|
|
|
344
344
|
interface ChargehiveSuccessEvent
|
|
345
345
|
{
|
|
346
346
|
chargeId: string;
|
|
347
|
+
methodId: string;
|
|
347
348
|
transactionId: string;
|
|
348
349
|
transactedAmount: {
|
|
349
350
|
currency: string;
|
|
@@ -352,6 +353,13 @@ interface ChargehiveSuccessEvent
|
|
|
352
353
|
responseBreakdown: TransactionResponse;
|
|
353
354
|
}
|
|
354
355
|
|
|
356
|
+
interface ChargehiveErrorEvent
|
|
357
|
+
{
|
|
358
|
+
requestId: string;
|
|
359
|
+
error: string;
|
|
360
|
+
code: string;
|
|
361
|
+
}
|
|
362
|
+
|
|
355
363
|
interface ChargehiveDeclinedEvent
|
|
356
364
|
{
|
|
357
365
|
chargeId: string;
|
package/package.json
CHANGED
package/validation.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
} from '@pci-bridge/types/validation';
|
|
5
5
|
import {FieldName} from './chargehive';
|
|
6
6
|
|
|
7
|
-
export type ValidationEventData = Map<FieldName, Validation>;
|
|
7
|
+
export type ValidationEventData = Map<FieldName | string, 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;
|