xendit-components-web 0.0.21 → 0.0.23

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
@@ -1,6 +1,27 @@
1
- # Unreleased
1
+ # 0.0.23
2
2
 
3
- None
3
+ ### Notable
4
+
5
+ Added support for most channels supported by Xendit (all but over the counter channels).
6
+
7
+ Cards with a brand not in the merchant's allowed brands list now show a validation error.
8
+
9
+ Added NMID display on QRIS payment screen.
10
+
11
+ ### Bug Fixes
12
+
13
+ - Now throws an error if initialized on a null origin page
14
+ - Fixed switching payment channels while a submission is in progress
15
+ - Fixed redirects after failing a payment in a redirect channel
16
+ - Fixed phone input area code width
17
+
18
+ # 0.0.22
19
+
20
+ ### Notable
21
+
22
+ Added custom branded layouts for some QR channels.
23
+
24
+ ### Bug fixes
4
25
 
5
26
  # 0.0.21
6
27
 
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.21/index.umd.js"></script>
22
+ <script src="https://assets.xendit.co/components/v0.0.23/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.21/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.23/index.d.ts) directly.
26
26
 
27
27
  ## Sessions
28
28
 
@@ -408,3 +408,24 @@ You can customize the appearance of the button using the options parameter of `c
408
408
 
409
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
410
  -->
411
+
412
+ ## Troubleshooting
413
+
414
+ ### Usage with React Strict Mode
415
+
416
+ Since React 18, Strict Mode will perform mount/unmount checks during development. This means React intentionally unmounts and remounts every component on its initial mount.
417
+
418
+ If you instantiate XenditComponents and add a listener for the `init` event in a side effect, this can cause a race condition where the event fires for the last instance before the first instance finishes mounting. Hence, you should remember to remove the `init` event listener in the effect cleanup function when Strict Mode is on.
419
+
420
+ ```typescript
421
+ useEffect(() => {
422
+ // ...
423
+ const handleInit = () => {
424
+ // ...
425
+ };
426
+ components.addEventListener("init", handleInit);
427
+ return () => {
428
+ components.removeEventListener("init", handleInit);
429
+ };
430
+ }, []);
431
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xendit-components-web",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Xendit frontend payment components SDK",
5
5
  "type": "module",
6
6
  "author": "Xendit",
@@ -54,7 +54,6 @@
54
54
  "prepare": "husky"
55
55
  },
56
56
  "dependencies": {
57
- "card-validator": "^10.0.4",
58
57
  "classnames": "^2.5.1",
59
58
  "jsbarcode": "^3.12.3",
60
59
  "libphonenumber-js": "^1.12.41",