@xpayeg/react 2.2.0 → 2.3.0
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 +7 -0
- package/dist/index.cjs +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @xpayeg/react
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#471](https://github.com/xpayeg/xpay/pull/471) [`e76a6c3`](https://github.com/xpayeg/xpay/commit/e76a6c3e5f73f4dcf1f108b6be0e1a63dce5d1b9) Thanks [@Elmosh](https://github.com/Elmosh)! - Deferred Elements accept `paymentMethodTypes` (e.g. `["card"]`) to restrict which payment methods the element renders. Narrow-only: the list is intersected with the methods enabled for your account, so a type you have not enabled is never rendered, and an empty intersection fails with `loaderror` instead of rendering an empty frame. Fixed for the element's lifetime; pass the same values when your server creates the session so display and acceptance match. One method per element is the pattern for per-method rows in your own selector.
|
|
9
|
+
|
|
3
10
|
## 2.2.0
|
|
4
11
|
### Minor Changes
|
|
5
12
|
|
package/dist/index.cjs
CHANGED
|
@@ -84,9 +84,11 @@ function XPayProvider({ xpay: xpayProp, options, children }) {
|
|
|
84
84
|
const prev = lastDeferredRef.current;
|
|
85
85
|
lastDeferredRef.current = {
|
|
86
86
|
amount: options.amount,
|
|
87
|
-
currency: options.currency
|
|
87
|
+
currency: options.currency,
|
|
88
|
+
paymentMethodTypes: options.paymentMethodTypes
|
|
88
89
|
};
|
|
89
90
|
if (!prev) return;
|
|
91
|
+
if (JSON.stringify(prev.paymentMethodTypes ?? null) !== JSON.stringify(options.paymentMethodTypes ?? null)) console.warn("Unsupported prop change: options.paymentMethodTypes is fixed for the element's lifetime. Remount <XPayProvider> (e.g. with a React key) to change it.");
|
|
90
92
|
const updates = {};
|
|
91
93
|
if (options.amount !== prev.amount) updates.amount = options.amount;
|
|
92
94
|
if (options.currency !== prev.currency) updates.currency = options.currency;
|
package/dist/index.mjs
CHANGED
|
@@ -83,9 +83,11 @@ function XPayProvider({ xpay: xpayProp, options, children }) {
|
|
|
83
83
|
const prev = lastDeferredRef.current;
|
|
84
84
|
lastDeferredRef.current = {
|
|
85
85
|
amount: options.amount,
|
|
86
|
-
currency: options.currency
|
|
86
|
+
currency: options.currency,
|
|
87
|
+
paymentMethodTypes: options.paymentMethodTypes
|
|
87
88
|
};
|
|
88
89
|
if (!prev) return;
|
|
90
|
+
if (JSON.stringify(prev.paymentMethodTypes ?? null) !== JSON.stringify(options.paymentMethodTypes ?? null)) console.warn("Unsupported prop change: options.paymentMethodTypes is fixed for the element's lifetime. Remount <XPayProvider> (e.g. with a React key) to change it.");
|
|
89
91
|
const updates = {};
|
|
90
92
|
if (options.amount !== prev.amount) updates.amount = options.amount;
|
|
91
93
|
if (options.currency !== prev.currency) updates.currency = options.currency;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpayeg/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "XPay React components — PaymentElement, CheckoutButton, and hooks",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"rollup-plugin-dts": "^6.4.1",
|
|
50
50
|
"tsdown": "^0.22.0",
|
|
51
51
|
"typescript": "5.9.3",
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
52
|
+
"@xpayeg/sdk": "2.3.0",
|
|
53
|
+
"@xpay/tsconfig": "0.0.0"
|
|
54
54
|
},
|
|
55
55
|
"repository": {
|
|
56
56
|
"type": "git",
|