@moonpay/platform-sdk-react-native 1.19.0 → 1.21.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/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -72,6 +72,7 @@ var applePaySpec = {
|
|
|
72
72
|
clientToken: ctx.core.context.clientToken,
|
|
73
73
|
signature: props.quote,
|
|
74
74
|
...props.externalTransactionId && { externalTransactionId: props.externalTransactionId },
|
|
75
|
+
...props.applePayButtonSettings && { applePayButtonSettings: props.applePayButtonSettings },
|
|
75
76
|
...(0, import_platform_sdk_core.presentationParams)(props.presentation)
|
|
76
77
|
}),
|
|
77
78
|
createCommands: createQuoteCommands,
|
|
@@ -170,6 +171,7 @@ var buyButtonSpec = {
|
|
|
170
171
|
clientToken: ctx.core.context.clientToken,
|
|
171
172
|
signature: props.quote,
|
|
172
173
|
...props.externalTransactionId && { externalTransactionId: props.externalTransactionId },
|
|
174
|
+
...props.applePayButtonSettings && { applePayButtonSettings: props.applePayButtonSettings },
|
|
173
175
|
...(0, import_platform_sdk_core.presentationParams)(props.presentation)
|
|
174
176
|
}),
|
|
175
177
|
createCommands: createQuoteCommands,
|
|
@@ -481,7 +483,11 @@ var connectionResetSpec = {
|
|
|
481
483
|
path: import_platform_sdk_core.FRAME_PATHS.reset,
|
|
482
484
|
hidden: true,
|
|
483
485
|
handshakeTimeout: 5e3,
|
|
484
|
-
|
|
486
|
+
// The reset frame is authorized by the connect-flow `clientToken` (or an
|
|
487
|
+
// apiKey), not the raw sessionToken — see the Reset frame reference. It
|
|
488
|
+
// carries no session of its own. Attached automatically from context; when
|
|
489
|
+
// absent the frame simply fails to load and reset resolves as a no-op.
|
|
490
|
+
buildParams: (ctx) => ({ clientToken: ctx.core.context.clientToken }),
|
|
485
491
|
mapMessage: (msg) => {
|
|
486
492
|
if (msg.kind === "complete") return { kind: "complete" };
|
|
487
493
|
if (msg.kind === "error") {
|
|
@@ -528,6 +534,7 @@ function MoonPayFrame({
|
|
|
528
534
|
allowsInlineMediaPlayback: true,
|
|
529
535
|
javaScriptEnabled: true,
|
|
530
536
|
domStorageEnabled: true,
|
|
537
|
+
paymentRequestEnabled: true,
|
|
531
538
|
style: { flex: 1 },
|
|
532
539
|
...webViewProps,
|
|
533
540
|
ref: webViewRef,
|
|
@@ -733,6 +740,7 @@ async function setupApplePay(deps, opts) {
|
|
|
733
740
|
const { handle, dispose } = await deps.mountSession(applePaySpec, {
|
|
734
741
|
quote: opts.quote,
|
|
735
742
|
externalTransactionId: opts.externalTransactionId,
|
|
743
|
+
applePayButtonSettings: opts.applePayButtonSettings,
|
|
736
744
|
presentation: opts.presentation
|
|
737
745
|
});
|
|
738
746
|
handle.onEvent((event) => opts.onEvent?.(event));
|
|
@@ -811,6 +819,7 @@ async function setupBuyButton(deps, opts) {
|
|
|
811
819
|
const { handle, dispose } = await deps.mountSession(buyButtonSpec, {
|
|
812
820
|
quote: opts.quote,
|
|
813
821
|
externalTransactionId: opts.externalTransactionId,
|
|
822
|
+
applePayButtonSettings: opts.applePayButtonSettings,
|
|
814
823
|
presentation: opts.presentation
|
|
815
824
|
});
|
|
816
825
|
handle.onEvent((event) => opts.onEvent?.(event));
|
|
@@ -1441,6 +1450,7 @@ var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
|
1441
1450
|
function MoonPayApplePayButton({
|
|
1442
1451
|
quote,
|
|
1443
1452
|
externalTransactionId,
|
|
1453
|
+
applePayButtonSettings,
|
|
1444
1454
|
onEvent,
|
|
1445
1455
|
style,
|
|
1446
1456
|
webViewProps
|
|
@@ -1449,7 +1459,7 @@ function MoonPayApplePayButton({
|
|
|
1449
1459
|
MoonPayFrameView,
|
|
1450
1460
|
{
|
|
1451
1461
|
spec: applePaySpec,
|
|
1452
|
-
props: { quote, externalTransactionId },
|
|
1462
|
+
props: { quote, externalTransactionId, applePayButtonSettings },
|
|
1453
1463
|
style,
|
|
1454
1464
|
defaultStyle: { height: 48 },
|
|
1455
1465
|
onEvent,
|
|
@@ -1479,6 +1489,7 @@ var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
|
1479
1489
|
function MoonPayBuyButton({
|
|
1480
1490
|
quote,
|
|
1481
1491
|
externalTransactionId,
|
|
1492
|
+
applePayButtonSettings,
|
|
1482
1493
|
onEvent,
|
|
1483
1494
|
style,
|
|
1484
1495
|
webViewProps
|
|
@@ -1487,7 +1498,7 @@ function MoonPayBuyButton({
|
|
|
1487
1498
|
MoonPayFrameView,
|
|
1488
1499
|
{
|
|
1489
1500
|
spec: buyButtonSpec,
|
|
1490
|
-
props: { quote, externalTransactionId },
|
|
1501
|
+
props: { quote, externalTransactionId, applePayButtonSettings },
|
|
1491
1502
|
style,
|
|
1492
1503
|
defaultStyle: { height: 48 },
|
|
1493
1504
|
onEvent,
|