xendit-components-web 0.0.13 → 0.0.15

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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  No unreleased changes.
4
4
 
5
+ # 0.0.15
6
+
7
+ ### Bug Fixes
8
+
9
+ - Fixed a bug where cards eligible for installments fails to pass validation due to empty string as channel property value
10
+
11
+ # 0.0.14
12
+
13
+ ### Bug Fixes
14
+
15
+ - Fixed a bug in the publish workflow
16
+ - Fixed a bug where the channel picker dropdown was not disabled when there was only one channel
17
+
5
18
  # 0.0.13
6
19
 
7
20
  ### Notable
package/README.md CHANGED
@@ -19,10 +19,10 @@ npm install xendit-components-web --save
19
19
  Or load it directly from our CDN:
20
20
 
21
21
  ```html
22
- <script src="https://assets.xendit.co/components/v0.0.13/index.umd.js"></script>
22
+ <script src="https://assets.xendit.co/components/v0.0.15/index.umd.js"></script>
23
23
  ```
24
24
 
25
- Our npm package includes TypeScript types. You also download the [.d.ts file](https://assets.xendit.co/components/v0.0.13/index.d.ts) directly.
25
+ Our npm package includes TypeScript types. You also download the [.d.ts file](https://assets.xendit.co/components/v0.0.15/index.d.ts) directly.
26
26
 
27
27
  ## Sessions
28
28
 
@@ -109,6 +109,16 @@ const groups = components.getActiveChannelGroups();
109
109
  Returns a list of channel groups. This can be used to categorize channels by type, if you want to build
110
110
  your own channel selection UI. Each channel has a `uiGroup` property which matches one group's `id` property.
111
111
 
112
+ <!--
113
+ ### `getActiveDigitalWallets`
114
+
115
+ ```typescript
116
+ const digitalWallets = components.getActiveDigitalWallets();
117
+ ```
118
+
119
+ Returns a list of digital wallets available in this session.
120
+ -->
121
+
112
122
  ### `createChannelComponent`
113
123
 
114
124
  ```typescript
@@ -127,6 +137,20 @@ This returns a `HTMLElement`, which you need to insert into your document.
127
137
  This method uses caching, it will always return the same element for the same channel, to preserve the
128
138
  values the user enters into any form fields. If you don't want that, use `destroyComponent`.
129
139
 
140
+ <!--
141
+ ### `createDigitalWalletComponent`
142
+
143
+ ```typescript
144
+ const htmlElement = components.createDigitalWalletComponent("GOOGLE_PAY");
145
+ ```
146
+
147
+ Creates a digital wallet CTA button for the specified digital wallet.
148
+
149
+ After a user clicks the button and completes the digital wallet flow, a submission will automatically begin. This is equivalent to setting the channel used (using `setCurrentChannel()`), and then calling `submit()`. The same events will be fired as a normal submission.
150
+
151
+ This returns a `HTMLElement`, which you need to insert into your document.
152
+ -->
153
+
130
154
  ### `createActionContainerComponent`
131
155
 
132
156
  ```typescript
@@ -295,7 +319,7 @@ Some CSS variables are provided to allow for easy customization. These are defin
295
319
 
296
320
  The following variables are available:
297
321
  | Variable | Description |
298
- | :- | -: |
322
+ | :- | :- |
299
323
  | --xendit-font-family | Font applied to all xendit components |
300
324
  | --xendit-color-primary | Accent color |
301
325
  | --xendit-color-text | Base text color |
@@ -310,6 +334,13 @@ The following variables are available:
310
334
  | --xendit-animation-ease | Ease function of animations |
311
335
  | --xendit-radius-1 | Border radius applied to some components |
312
336
  | --xendit-z-index-focus | Z-index applied to focused fields |
337
+ | --xendit-qr-foreground-color | The color used for QR codes (the black pixels). |
338
+ | --xendit-qr-background-color | The color used as the background of QR codes (the white pixels). |
339
+
340
+ Additionally, the following variables are set at component scope, where applicable:
341
+ | Variable | Description |
342
+ | :- | :- |
343
+ | --xendit-channel-brand-color | A brand color. Varies depending on the channel or action component where it's used. Will always be a dark color appropriate for use as a background behind white text. |
313
344
 
314
345
  ### CSS In Iframe Fields
315
346
 
@@ -351,3 +382,29 @@ const sdk = new XenditComponents({
351
382
  },
352
383
  });
353
384
  ```
385
+
386
+ <!--
387
+ ## Digital Wallet Support
388
+
389
+ Any available Digital Wallet integration is automatically added at the top of the channel picker component. You may also create a Digital Wallet button manually by calling `createDigitalWalletComponent("GOOGLE_PAY")`.
390
+
391
+ When the user pays using the digital wallet, the submission flow will automatically begin, the same as if you had called `submit()`.
392
+
393
+ Google Pay is currently the only supported digital wallet.
394
+
395
+ ### Google Pay™
396
+
397
+ Google Pay is available to Sessions that meet the following requirements:
398
+
399
+ - Your Session country is a country where Google Pay is supported.
400
+ - You have at least one Google Pay compatible payment method available in your session. (e.g. cards)
401
+ - You've provided your Google MerchantID to Xendit on the Xendit Dashboard. (If you don't have a Google MerchantID, complete registration with the [Google Pay & Wallet Console](https://pay.google.com/business/console/?utm_source=devsite&utm_medium=devsite&utm_campaign=devsite) to provision one)
402
+ - The Google Pay SDK is loaded using `<script async src="https://pay.google.com/gp/p/js/pay.js"></script>`. (You need to include the SDK yourself, we don't bundle it. There's no need to wait for it to finish loading, if it's still loading when you create the component, it'll have `display:none` until it finishes loading)
403
+ - The user is using a compatible browser. (The component will have `display:none` if the user is using an incompatible browser)
404
+
405
+ We configure Google Pay for you, providing your MerchantID, merchant name, and the allowed payment methods, including allowed card networks and authentication methods.
406
+
407
+ You can customize the appearance of the button using the options parameter of `createDigitalWalletComponent`, it accepts the same options as the [Google Pay API](https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions).
408
+
409
+ To use Google Pay, you must adhere to the Google Pay and Wallet API's [Acceptable Use Policy](https://payments.developers.google.com/terms/aup) and accept the terms defined in the [Google Pay API Terms of Service](https://payments.developers.google.com/terms/sellertos). Additionally, please ensure you follow the [Google Pay brand guidelines](https://developers.google.com/pay/api/web/guides/brand-guidelines).
410
+ -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xendit-components-web",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Xendit frontend payment components SDK",
5
5
  "type": "module",
6
6
  "author": "Xendit",
@@ -19,11 +19,7 @@
19
19
  "components"
20
20
  ],
21
21
  "files": [
22
- "./sdk/dist/index.umd.js",
23
- "./sdk/dist/index.umd.js.map",
24
- "./sdk/dist/index.esm.js",
25
- "./sdk/dist/index.esm.js.map",
26
- "./sdk/dist/index.d.ts",
22
+ "./sdk/dist/",
27
23
  "./README.md",
28
24
  "./CHANGELOG.md"
29
25
  ],
@@ -31,7 +27,7 @@
31
27
  "exports": {
32
28
  "import": {
33
29
  "types": "./sdk/dist/index.d.ts",
34
- "default": "./sdk/dist/index.esm.js"
30
+ "default": "./sdk/dist/esm/index.js"
35
31
  },
36
32
  "require": {
37
33
  "types": "./sdk/dist/index.d.ts",
@@ -74,6 +70,7 @@
74
70
  "@testing-library/dom": "^10.4.1",
75
71
  "@testing-library/jest-dom": "^6.9.1",
76
72
  "@testing-library/user-event": "^14.6.1",
73
+ "@types/googlepay": "^0.7.10",
77
74
  "@types/mime-types": "^3.0.1",
78
75
  "@types/node": "^24.11.0",
79
76
  "@types/qrcode": "^1.5.6",