@chargehive/types 2.2.10 → 2.3.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.
Files changed (2) hide show
  1. package/chargehive.d.ts +98 -8
  2. package/package.json +1 -1
package/chargehive.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
- FieldName as PCIBFieldName,
3
2
  EventName as PCIBEventName,
4
- PCIBridgeTokenizeResponse,
3
+ FieldName as PCIBFieldName,
5
4
  PCIBridgeTokenizeEphemeralResponse,
5
+ PCIBridgeTokenizeResponse,
6
6
  } from '@pci-bridge/types/pcibridge';
7
7
  import {FieldValidation} from '@pci-bridge/types/validation';
8
8
  import {Address, Person} from './address';
@@ -87,6 +87,14 @@ export interface WalletOptions
87
87
  * @default false
88
88
  */
89
89
  requireShippingPhone?: boolean;
90
+ /**
91
+ * @default false
92
+ */
93
+ requireExistingMethod?: boolean;
94
+ /**
95
+ * @default false
96
+ */
97
+ reportExistingMethod?: boolean;
90
98
  }
91
99
 
92
100
  export interface ChargeHiveInitOptions
@@ -103,12 +111,17 @@ export interface ChargeHiveInitOptions
103
111
 
104
112
  export interface InitResponse
105
113
  {
106
- riskCheckers: { [key: string]: RiskChecker };
107
- capabilities: PaymentMethodType[];
114
+ projectId: string;
115
+ projectName: string;
108
116
  serverTime: number;
109
117
  sandboxMode: boolean;
118
+ country: string;
119
+ currency: string;
120
+ /** @deprecated */
121
+ capabilities: PaymentMethodType[];
110
122
  defaultPaymentType: PaymentMethodType;
111
- projectName: string;
123
+ walletOptions: WalletOptionsResponse;
124
+ riskCheckers: { [key: string]: RiskChecker };
112
125
  }
113
126
 
114
127
  export type RiskChecker = {
@@ -134,13 +147,13 @@ export type PaymentMethodDataTypes = {
134
147
  sessionUrl?: string;
135
148
  session?: string;
136
149
  token?: ApplePayPaymentToken;
137
- }
150
+ } | unknown
138
151
  PLACEMENT_CAPABILITY_GOOGLE_PAY: {
139
152
  description: string | undefined;
140
153
  cardDetails: string | undefined;
141
154
  cardNetwork: google.payments.api.CardNetwork | undefined;
142
155
  token: string;
143
- }
156
+ } | unknown
144
157
  PLACEMENT_CAPABILITY_DIRECTDEBIT_FORM: {
145
158
  accountName: string;
146
159
  accountNum: string;
@@ -271,7 +284,9 @@ export type EventName = PCIBEventName
271
284
  | 'ready'
272
285
  | 'paste'
273
286
  | 'method-type-changed'
274
- | 'charge-id';
287
+ | 'charge-id'
288
+ | 'capability'
289
+ | 'google-pay-ready';
275
290
 
276
291
  export type ChargeHiveEventType = Extract<EventName, 'token' | 'success' | 'declined' | 'authentication' | 'error' | 'token-config'>
277
292
 
@@ -323,6 +338,15 @@ export type ChargeHiveEventData = {
323
338
  }
324
339
  error: object;
325
340
  'token-config': PaymentMethodTokenizationConfig[PaymentMethodType];
341
+ capability: {
342
+ type: PaymentMethodType;
343
+ data?: object;
344
+ };
345
+ }
346
+
347
+ export type CapabilityResult = {
348
+ result: boolean;
349
+ data?: object;
326
350
  }
327
351
 
328
352
  export type Dictionary = { [key: string]: string };
@@ -353,3 +377,69 @@ export interface TokenizeResponse
353
377
  customerError: string;
354
378
  merchantError: string;
355
379
  }
380
+
381
+ export interface WalletOptionsResponse
382
+ {
383
+ googlePay: {
384
+ merchantId?: string;
385
+ merchantName?: string;
386
+ /**
387
+ * @default true
388
+ */
389
+ requireEmail?: boolean;
390
+ /**
391
+ * @default false
392
+ */
393
+ requireShippingAddress?: boolean;
394
+ /**
395
+ * @default false
396
+ */
397
+ requireShippingPhone?: boolean;
398
+ /**
399
+ * @default false
400
+ */
401
+ requireExistingMethod?: boolean;
402
+ /**
403
+ * @default false
404
+ */
405
+ reportExistingMethod?: boolean;
406
+
407
+ allowedPaymentMethods: [{
408
+ connectorId: string;
409
+ connectorLibrary: string;
410
+ /**
411
+ * @default true
412
+ */
413
+ requireBillingAddress?: boolean;
414
+ /**
415
+ * @default false
416
+ */
417
+ requireBillingPhone?: boolean;
418
+ allowedAuthMethods?: string[];
419
+
420
+ supportCredit?: boolean;
421
+ supportDebit?: boolean;
422
+
423
+ allowedCardNetworks?: string[];
424
+
425
+ parameters: Dictionary,
426
+ }]
427
+ };
428
+
429
+ applePay: {
430
+ connectorId: string;
431
+ connectorLibrary: string;
432
+ merchantIdentifier: string;
433
+ requireBillingAddress: boolean;
434
+ requireBillingPhone: boolean;
435
+ requireEmail: boolean;
436
+ requireShippingAddress: boolean;
437
+ requireShippingPhone: boolean;
438
+ requireExistingMethod: boolean;
439
+ reportExistingMethod: boolean;
440
+ supportCredit: boolean;
441
+ supportDebit: boolean;
442
+ supportedNetworks: string[];
443
+ merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
444
+ };
445
+ }
package/package.json CHANGED
@@ -9,5 +9,5 @@
9
9
  "typescript": "^3 || ^4",
10
10
  "@pci-bridge/types": "*"
11
11
  },
12
- "version": "2.2.10"
12
+ "version": "2.3.1"
13
13
  }