@guestyorg/tokenization-js 1.0.3 → 1.0.4

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 CHANGED
@@ -58,7 +58,7 @@ This is equivalent to the following script:
58
58
  #### Async/Await
59
59
 
60
60
  ```js
61
- import { loadScript } from '@guesty/tokenization-js';
61
+ import { loadScript } from '@guestyorg/tokenization-js';
62
62
 
63
63
  try {
64
64
  const guestyTokenization = await loadScript();
@@ -71,7 +71,7 @@ try {
71
71
  #### Promises
72
72
 
73
73
  ```js
74
- import { loadScript } from '@guesty/tokenization-js';
74
+ import { loadScript } from '@guestyorg/tokenization-js';
75
75
 
76
76
  loadScript()
77
77
  .then((guestyTokenization) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guestyorg/tokenization-js",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Guesty Tokenization SDK loading utility and types",
5
5
  "main": "index.js",
6
6
  "module": "lib/esm/guesty-tokenization-js.js",
package/types/index.d.ts CHANGED
@@ -21,6 +21,14 @@ export interface GuestyTokenizationStyles {
21
21
  }
22
22
 
23
23
  type Section = 'cardholderName' | 'paymentDetails' | 'billingAddress';
24
+ type TCardholderNameInput = 'firstName' | 'lastName' | 'cardHolderId';
25
+ type TBillingAddressInput = 'street' | 'city' | 'state' | 'zipCode' | 'country';
26
+ type TPaymentDetailsInput = 'cardNumber' | 'expirationDate' | 'csc';
27
+
28
+ type TInput =
29
+ | TCardholderNameInput
30
+ | TBillingAddressInput
31
+ | TPaymentDetailsInput;
24
32
 
25
33
  export interface GuestyTokenizationRenderOptions {
26
34
  containerId: string;
@@ -31,19 +39,19 @@ export interface GuestyTokenizationRenderOptions {
31
39
  styles?: GuestyTokenizationStyles;
32
40
  lang?: string;
33
41
  initialValues?: {
34
- firstName?: string;
35
- lastName?: string;
36
- street?: string;
37
- city?: string;
38
- state?: string;
39
- zipCode?: string;
40
- country?: string;
42
+ [key in Exclude<TInput, 'cardHolderId' | TPaymentDetailsInput>]?: string;
41
43
  };
42
44
  showInitialValuesToggle?: boolean;
43
45
  initialValuesToggleLabel?: string;
44
46
  sections?: Section[];
45
47
  showSupportedCards?: boolean;
46
48
  showPciCompliantLink?: boolean;
49
+ inputsConfig?: {
50
+ [key in TInput]?: {
51
+ label?: string;
52
+ placeholder?: string;
53
+ };
54
+ };
47
55
  }
48
56
 
49
57
  export interface PaymentMethod {