@chargehive/types 2.1.2 → 2.1.5

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 CHANGED
@@ -1,4 +1,8 @@
1
- import {FieldName as PCIBFieldName, PCIBridgeTokenizeResponse} from '@pci-bridge/types/pcibridge';
1
+ import {
2
+ FieldName as PCIBFieldName,
3
+ EventName as PCIBEventName,
4
+ PCIBridgeTokenizeResponse,
5
+ } from '@pci-bridge/types/pcibridge';
2
6
  import {FieldValidation} from '@pci-bridge/types/validation';
3
7
  import {InitResponse} from '../src/types/paymentauth';
4
8
  import {Address, Person} from './address';
@@ -33,9 +37,9 @@ export interface ChargeHiveType extends ChargeType, ChargeHiveEventTarget
33
37
  /**
34
38
  * PCIBridge Major Version
35
39
  */
36
- get version(): string;
40
+ readonly version: string;
37
41
 
38
- initialize(placementToken: string, projectId: string, options: ChargeHiveInitOptions);
42
+ initialize(options: ChargeHiveInitOptions);
39
43
 
40
44
  isInitialized(): boolean;
41
45
 
@@ -58,7 +62,10 @@ export interface ChargeHiveType extends ChargeType, ChargeHiveEventTarget
58
62
 
59
63
  export interface ChargeHiveInitOptions
60
64
  {
61
- billingProfileID: string;
65
+ projectId: string;
66
+ projectPlacement: string;
67
+ merchantHash: string;
68
+ merchantPlacement: string;
62
69
  country: string;
63
70
  currency: string;
64
71
  environment?: ChargeEnvironment;
@@ -134,6 +141,7 @@ export interface ChargeMeta
134
141
 
135
142
  export interface ChargeData
136
143
  {
144
+ billingProfileId: string;
137
145
  amount: number;
138
146
  currency: string;
139
147
  references?: Dictionary;
@@ -188,7 +196,7 @@ export interface OrderItem
188
196
  termUnits: number;
189
197
  }
190
198
 
191
- export type EventName =
199
+ export type EventName = PCIBEventName
192
200
  | 'init'
193
201
  | 'token'
194
202
  | 'success'
@@ -198,8 +206,6 @@ export type EventName =
198
206
  | 'authentication'
199
207
  | 'ready'
200
208
  | 'paste'
201
- | 'all-valid'
202
- | 'submit'
203
209
  | 'method-type-changed'
204
210
  | 'charge-created'
205
211
  | 'charge-id';
@@ -254,7 +260,7 @@ export type ChargeHiveEventData = {
254
260
  }
255
261
  }
256
262
 
257
- export type Dictionary = { [key: PropertyKey]: string };
263
+ export type Dictionary = { [key: string]: string };
258
264
 
259
265
  export interface AuthorizeResponse
260
266
  {
package/package.json CHANGED
@@ -6,7 +6,8 @@
6
6
  "*.d.ts"
7
7
  ],
8
8
  "dependencies": {
9
- "@pci-bridge/types": "^1.0.2"
9
+ "typescript": "^3 || ^4",
10
+ "@pci-bridge/types": "^1.0.9"
10
11
  },
11
- "version": "2.1.2"
12
+ "version": "2.1.5"
12
13
  }
package/validation.d.ts CHANGED
@@ -1,3 +1,10 @@
1
- import {FieldValidation as PCIBFieldValidation} from '@pci-bridge/types/validation';
1
+ import {
2
+ FieldValidation as PCIBFieldValidation,
3
+ CardFieldValidation as PCIBCardFieldValidation,
4
+ } from '@pci-bridge/types/validation';
2
5
 
3
6
  export type FieldValidation = PCIBFieldValidation
7
+
8
+ export type CardFieldValidation = PCIBCardFieldValidation
9
+
10
+ export type ValidationEvent = CustomEvent<FieldValidation | CardFieldValidation>;