@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.d.cts
CHANGED
|
@@ -3,6 +3,8 @@ export { AssetStatus, GetQuoteParams, ListAssetsResponse, ListPaymentMethodsResp
|
|
|
3
3
|
import { Customer } from '@moonpay/platform-protocol/api/customer';
|
|
4
4
|
export { Customer } from '@moonpay/platform-protocol/api/customer';
|
|
5
5
|
export { CardResponse } from '@moonpay/platform-protocol/frames/add-card';
|
|
6
|
+
import * as ApplePayFrame$1 from '@moonpay/platform-protocol/frames/apple-pay';
|
|
7
|
+
export { ApplePayButtonSettings } from '@moonpay/platform-protocol/frames/apple-pay';
|
|
6
8
|
export { Cancellation as ChallengeCancellation, CompleteResult as ChallengeCompleteResult } from '@moonpay/platform-protocol/frames/challenge';
|
|
7
9
|
import { Connection } from '@moonpay/platform-protocol/models/connection';
|
|
8
10
|
export { Connection, ConnectionStatus } from '@moonpay/platform-protocol/models/connection';
|
|
@@ -87,6 +89,8 @@ interface SetupApplePayOptions {
|
|
|
87
89
|
quote: string;
|
|
88
90
|
/** Partner-assigned identifier for this transaction attempt. */
|
|
89
91
|
externalTransactionId?: string;
|
|
92
|
+
/** Styling for the standalone Apple Pay button. Passed through to the frame, which is authoritative. */
|
|
93
|
+
applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
|
|
90
94
|
/** Frame chrome. Defaults to the frame's own default (bare) when omitted. */
|
|
91
95
|
presentation?: PresentationMode;
|
|
92
96
|
/** Callback for Apple Pay lifecycle events. */
|
|
@@ -127,6 +131,8 @@ interface SetupBuyButtonOptions {
|
|
|
127
131
|
quote: string;
|
|
128
132
|
/** Partner-assigned identifier for this transaction attempt. */
|
|
129
133
|
externalTransactionId?: string;
|
|
134
|
+
/** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. */
|
|
135
|
+
applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
|
|
130
136
|
/** Frame chrome. Defaults to the frame's own default (bare) when omitted. */
|
|
131
137
|
presentation?: PresentationMode;
|
|
132
138
|
/** Callback for buy-button frame lifecycle events. */
|
|
@@ -341,6 +347,8 @@ interface MoonPayApplePayButtonProps {
|
|
|
341
347
|
quote: string;
|
|
342
348
|
/** Partner-assigned identifier for this transaction attempt. Mount-time only. */
|
|
343
349
|
externalTransactionId?: string;
|
|
350
|
+
/** Styling for the Apple Pay button. Passed through to the frame, which is authoritative. Mount-time only. */
|
|
351
|
+
applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
|
|
344
352
|
/** Callback for Apple Pay lifecycle events. */
|
|
345
353
|
onEvent?: (event: ApplePaySdk.Event) => void;
|
|
346
354
|
/** Container style. Defaults to height 48. */
|
|
@@ -349,7 +357,7 @@ interface MoonPayApplePayButtonProps {
|
|
|
349
357
|
webViewProps?: Partial<WebViewProps>;
|
|
350
358
|
}
|
|
351
359
|
/** Inline Apple Pay button. Render it wherever it should appear in your layout. */
|
|
352
|
-
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
360
|
+
declare function MoonPayApplePayButton({ quote, externalTransactionId, applePayButtonSettings, onEvent, style, webViewProps, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
353
361
|
|
|
354
362
|
interface MoonPayAuthProps {
|
|
355
363
|
/** Callback for auth lifecycle events. */
|
|
@@ -371,6 +379,8 @@ interface MoonPayBuyButtonProps {
|
|
|
371
379
|
quote: string;
|
|
372
380
|
/** Partner-assigned identifier for this transaction attempt. Mount-time only. */
|
|
373
381
|
externalTransactionId?: string;
|
|
382
|
+
/** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. Mount-time only. */
|
|
383
|
+
applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
|
|
374
384
|
/** Callback for buy button lifecycle events. */
|
|
375
385
|
onEvent?: (event: BuyButtonSdk.Event) => void;
|
|
376
386
|
/** Container style. Defaults to height 48. */
|
|
@@ -379,7 +389,7 @@ interface MoonPayBuyButtonProps {
|
|
|
379
389
|
webViewProps?: Partial<WebViewProps>;
|
|
380
390
|
}
|
|
381
391
|
/** Inline card/buy button. Render it wherever it should appear in your layout. */
|
|
382
|
-
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
|
|
392
|
+
declare function MoonPayBuyButton({ quote, externalTransactionId, applePayButtonSettings, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
|
|
383
393
|
|
|
384
394
|
interface MoonPayBuyFrameProps {
|
|
385
395
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { AssetStatus, GetQuoteParams, ListAssetsResponse, ListPaymentMethodsResp
|
|
|
3
3
|
import { Customer } from '@moonpay/platform-protocol/api/customer';
|
|
4
4
|
export { Customer } from '@moonpay/platform-protocol/api/customer';
|
|
5
5
|
export { CardResponse } from '@moonpay/platform-protocol/frames/add-card';
|
|
6
|
+
import * as ApplePayFrame$1 from '@moonpay/platform-protocol/frames/apple-pay';
|
|
7
|
+
export { ApplePayButtonSettings } from '@moonpay/platform-protocol/frames/apple-pay';
|
|
6
8
|
export { Cancellation as ChallengeCancellation, CompleteResult as ChallengeCompleteResult } from '@moonpay/platform-protocol/frames/challenge';
|
|
7
9
|
import { Connection } from '@moonpay/platform-protocol/models/connection';
|
|
8
10
|
export { Connection, ConnectionStatus } from '@moonpay/platform-protocol/models/connection';
|
|
@@ -87,6 +89,8 @@ interface SetupApplePayOptions {
|
|
|
87
89
|
quote: string;
|
|
88
90
|
/** Partner-assigned identifier for this transaction attempt. */
|
|
89
91
|
externalTransactionId?: string;
|
|
92
|
+
/** Styling for the standalone Apple Pay button. Passed through to the frame, which is authoritative. */
|
|
93
|
+
applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
|
|
90
94
|
/** Frame chrome. Defaults to the frame's own default (bare) when omitted. */
|
|
91
95
|
presentation?: PresentationMode;
|
|
92
96
|
/** Callback for Apple Pay lifecycle events. */
|
|
@@ -127,6 +131,8 @@ interface SetupBuyButtonOptions {
|
|
|
127
131
|
quote: string;
|
|
128
132
|
/** Partner-assigned identifier for this transaction attempt. */
|
|
129
133
|
externalTransactionId?: string;
|
|
134
|
+
/** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. */
|
|
135
|
+
applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
|
|
130
136
|
/** Frame chrome. Defaults to the frame's own default (bare) when omitted. */
|
|
131
137
|
presentation?: PresentationMode;
|
|
132
138
|
/** Callback for buy-button frame lifecycle events. */
|
|
@@ -341,6 +347,8 @@ interface MoonPayApplePayButtonProps {
|
|
|
341
347
|
quote: string;
|
|
342
348
|
/** Partner-assigned identifier for this transaction attempt. Mount-time only. */
|
|
343
349
|
externalTransactionId?: string;
|
|
350
|
+
/** Styling for the Apple Pay button. Passed through to the frame, which is authoritative. Mount-time only. */
|
|
351
|
+
applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
|
|
344
352
|
/** Callback for Apple Pay lifecycle events. */
|
|
345
353
|
onEvent?: (event: ApplePaySdk.Event) => void;
|
|
346
354
|
/** Container style. Defaults to height 48. */
|
|
@@ -349,7 +357,7 @@ interface MoonPayApplePayButtonProps {
|
|
|
349
357
|
webViewProps?: Partial<WebViewProps>;
|
|
350
358
|
}
|
|
351
359
|
/** Inline Apple Pay button. Render it wherever it should appear in your layout. */
|
|
352
|
-
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
360
|
+
declare function MoonPayApplePayButton({ quote, externalTransactionId, applePayButtonSettings, onEvent, style, webViewProps, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
353
361
|
|
|
354
362
|
interface MoonPayAuthProps {
|
|
355
363
|
/** Callback for auth lifecycle events. */
|
|
@@ -371,6 +379,8 @@ interface MoonPayBuyButtonProps {
|
|
|
371
379
|
quote: string;
|
|
372
380
|
/** Partner-assigned identifier for this transaction attempt. Mount-time only. */
|
|
373
381
|
externalTransactionId?: string;
|
|
382
|
+
/** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. Mount-time only. */
|
|
383
|
+
applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
|
|
374
384
|
/** Callback for buy button lifecycle events. */
|
|
375
385
|
onEvent?: (event: BuyButtonSdk.Event) => void;
|
|
376
386
|
/** Container style. Defaults to height 48. */
|
|
@@ -379,7 +389,7 @@ interface MoonPayBuyButtonProps {
|
|
|
379
389
|
webViewProps?: Partial<WebViewProps>;
|
|
380
390
|
}
|
|
381
391
|
/** Inline card/buy button. Render it wherever it should appear in your layout. */
|
|
382
|
-
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
|
|
392
|
+
declare function MoonPayBuyButton({ quote, externalTransactionId, applePayButtonSettings, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
|
|
383
393
|
|
|
384
394
|
interface MoonPayBuyFrameProps {
|
|
385
395
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var applePaySpec = {
|
|
|
32
32
|
clientToken: ctx.core.context.clientToken,
|
|
33
33
|
signature: props.quote,
|
|
34
34
|
...props.externalTransactionId && { externalTransactionId: props.externalTransactionId },
|
|
35
|
+
...props.applePayButtonSettings && { applePayButtonSettings: props.applePayButtonSettings },
|
|
35
36
|
...presentationParams(props.presentation)
|
|
36
37
|
}),
|
|
37
38
|
createCommands: createQuoteCommands,
|
|
@@ -130,6 +131,7 @@ var buyButtonSpec = {
|
|
|
130
131
|
clientToken: ctx.core.context.clientToken,
|
|
131
132
|
signature: props.quote,
|
|
132
133
|
...props.externalTransactionId && { externalTransactionId: props.externalTransactionId },
|
|
134
|
+
...props.applePayButtonSettings && { applePayButtonSettings: props.applePayButtonSettings },
|
|
133
135
|
...presentationParams(props.presentation)
|
|
134
136
|
}),
|
|
135
137
|
createCommands: createQuoteCommands,
|
|
@@ -441,7 +443,11 @@ var connectionResetSpec = {
|
|
|
441
443
|
path: FRAME_PATHS.reset,
|
|
442
444
|
hidden: true,
|
|
443
445
|
handshakeTimeout: 5e3,
|
|
444
|
-
|
|
446
|
+
// The reset frame is authorized by the connect-flow `clientToken` (or an
|
|
447
|
+
// apiKey), not the raw sessionToken — see the Reset frame reference. It
|
|
448
|
+
// carries no session of its own. Attached automatically from context; when
|
|
449
|
+
// absent the frame simply fails to load and reset resolves as a no-op.
|
|
450
|
+
buildParams: (ctx) => ({ clientToken: ctx.core.context.clientToken }),
|
|
445
451
|
mapMessage: (msg) => {
|
|
446
452
|
if (msg.kind === "complete") return { kind: "complete" };
|
|
447
453
|
if (msg.kind === "error") {
|
|
@@ -488,6 +494,7 @@ function MoonPayFrame({
|
|
|
488
494
|
allowsInlineMediaPlayback: true,
|
|
489
495
|
javaScriptEnabled: true,
|
|
490
496
|
domStorageEnabled: true,
|
|
497
|
+
paymentRequestEnabled: true,
|
|
491
498
|
style: { flex: 1 },
|
|
492
499
|
...webViewProps,
|
|
493
500
|
ref: webViewRef,
|
|
@@ -708,6 +715,7 @@ async function setupApplePay(deps, opts) {
|
|
|
708
715
|
const { handle, dispose } = await deps.mountSession(applePaySpec, {
|
|
709
716
|
quote: opts.quote,
|
|
710
717
|
externalTransactionId: opts.externalTransactionId,
|
|
718
|
+
applePayButtonSettings: opts.applePayButtonSettings,
|
|
711
719
|
presentation: opts.presentation
|
|
712
720
|
});
|
|
713
721
|
handle.onEvent((event) => opts.onEvent?.(event));
|
|
@@ -786,6 +794,7 @@ async function setupBuyButton(deps, opts) {
|
|
|
786
794
|
const { handle, dispose } = await deps.mountSession(buyButtonSpec, {
|
|
787
795
|
quote: opts.quote,
|
|
788
796
|
externalTransactionId: opts.externalTransactionId,
|
|
797
|
+
applePayButtonSettings: opts.applePayButtonSettings,
|
|
789
798
|
presentation: opts.presentation
|
|
790
799
|
});
|
|
791
800
|
handle.onEvent((event) => opts.onEvent?.(event));
|
|
@@ -1427,6 +1436,7 @@ import { jsx as jsx6 } from "react/jsx-runtime";
|
|
|
1427
1436
|
function MoonPayApplePayButton({
|
|
1428
1437
|
quote,
|
|
1429
1438
|
externalTransactionId,
|
|
1439
|
+
applePayButtonSettings,
|
|
1430
1440
|
onEvent,
|
|
1431
1441
|
style,
|
|
1432
1442
|
webViewProps
|
|
@@ -1435,7 +1445,7 @@ function MoonPayApplePayButton({
|
|
|
1435
1445
|
MoonPayFrameView,
|
|
1436
1446
|
{
|
|
1437
1447
|
spec: applePaySpec,
|
|
1438
|
-
props: { quote, externalTransactionId },
|
|
1448
|
+
props: { quote, externalTransactionId, applePayButtonSettings },
|
|
1439
1449
|
style,
|
|
1440
1450
|
defaultStyle: { height: 48 },
|
|
1441
1451
|
onEvent,
|
|
@@ -1465,6 +1475,7 @@ import { jsx as jsx8 } from "react/jsx-runtime";
|
|
|
1465
1475
|
function MoonPayBuyButton({
|
|
1466
1476
|
quote,
|
|
1467
1477
|
externalTransactionId,
|
|
1478
|
+
applePayButtonSettings,
|
|
1468
1479
|
onEvent,
|
|
1469
1480
|
style,
|
|
1470
1481
|
webViewProps
|
|
@@ -1473,7 +1484,7 @@ function MoonPayBuyButton({
|
|
|
1473
1484
|
MoonPayFrameView,
|
|
1474
1485
|
{
|
|
1475
1486
|
spec: buyButtonSpec,
|
|
1476
|
-
props: { quote, externalTransactionId },
|
|
1487
|
+
props: { quote, externalTransactionId, applePayButtonSettings },
|
|
1477
1488
|
style,
|
|
1478
1489
|
defaultStyle: { height: 48 },
|
|
1479
1490
|
onEvent,
|