@moonpay/platform-sdk-react-native 1.20.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 +8 -2
- 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 +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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,
|
|
@@ -713,6 +715,7 @@ async function setupApplePay(deps, opts) {
|
|
|
713
715
|
const { handle, dispose } = await deps.mountSession(applePaySpec, {
|
|
714
716
|
quote: opts.quote,
|
|
715
717
|
externalTransactionId: opts.externalTransactionId,
|
|
718
|
+
applePayButtonSettings: opts.applePayButtonSettings,
|
|
716
719
|
presentation: opts.presentation
|
|
717
720
|
});
|
|
718
721
|
handle.onEvent((event) => opts.onEvent?.(event));
|
|
@@ -791,6 +794,7 @@ async function setupBuyButton(deps, opts) {
|
|
|
791
794
|
const { handle, dispose } = await deps.mountSession(buyButtonSpec, {
|
|
792
795
|
quote: opts.quote,
|
|
793
796
|
externalTransactionId: opts.externalTransactionId,
|
|
797
|
+
applePayButtonSettings: opts.applePayButtonSettings,
|
|
794
798
|
presentation: opts.presentation
|
|
795
799
|
});
|
|
796
800
|
handle.onEvent((event) => opts.onEvent?.(event));
|
|
@@ -1432,6 +1436,7 @@ import { jsx as jsx6 } from "react/jsx-runtime";
|
|
|
1432
1436
|
function MoonPayApplePayButton({
|
|
1433
1437
|
quote,
|
|
1434
1438
|
externalTransactionId,
|
|
1439
|
+
applePayButtonSettings,
|
|
1435
1440
|
onEvent,
|
|
1436
1441
|
style,
|
|
1437
1442
|
webViewProps
|
|
@@ -1440,7 +1445,7 @@ function MoonPayApplePayButton({
|
|
|
1440
1445
|
MoonPayFrameView,
|
|
1441
1446
|
{
|
|
1442
1447
|
spec: applePaySpec,
|
|
1443
|
-
props: { quote, externalTransactionId },
|
|
1448
|
+
props: { quote, externalTransactionId, applePayButtonSettings },
|
|
1444
1449
|
style,
|
|
1445
1450
|
defaultStyle: { height: 48 },
|
|
1446
1451
|
onEvent,
|
|
@@ -1470,6 +1475,7 @@ import { jsx as jsx8 } from "react/jsx-runtime";
|
|
|
1470
1475
|
function MoonPayBuyButton({
|
|
1471
1476
|
quote,
|
|
1472
1477
|
externalTransactionId,
|
|
1478
|
+
applePayButtonSettings,
|
|
1473
1479
|
onEvent,
|
|
1474
1480
|
style,
|
|
1475
1481
|
webViewProps
|
|
@@ -1478,7 +1484,7 @@ function MoonPayBuyButton({
|
|
|
1478
1484
|
MoonPayFrameView,
|
|
1479
1485
|
{
|
|
1480
1486
|
spec: buyButtonSpec,
|
|
1481
|
-
props: { quote, externalTransactionId },
|
|
1487
|
+
props: { quote, externalTransactionId, applePayButtonSettings },
|
|
1482
1488
|
style,
|
|
1483
1489
|
defaultStyle: { height: 48 },
|
|
1484
1490
|
onEvent,
|