@moonpay/platform-sdk-react-native 1.16.0 → 1.18.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/README.md +24 -1
- package/dist/index.cjs +91 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -16
- package/dist/index.d.ts +58 -16
- package/dist/index.js +93 -34
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -28,15 +28,15 @@ import * as GooglePaySdk from '@moonpay/platform-protocol/sdks/google-pay';
|
|
|
28
28
|
export { Event as GooglePayEvent, SetupError as SetupGooglePayError } from '@moonpay/platform-protocol/sdks/google-pay';
|
|
29
29
|
import * as WidgetSdk from '@moonpay/platform-protocol/sdks/widget';
|
|
30
30
|
export { SetupError as SetupWidgetError, Event as WidgetEvent } from '@moonpay/platform-protocol/sdks/widget';
|
|
31
|
-
import { FrameTransport, FrameOptions, PresentationMode, ThemeOptions, ListAssetsParams, ListTransactionsParams } from '@moonpay/platform-sdk-core';
|
|
32
|
-
export { ListAssetsParams, ThemeOptions } from '@moonpay/platform-sdk-core';
|
|
31
|
+
import { FrameTransport, FrameOptions, PresentationMode, ThemeOptions, Credentials, GetCredentialsError, ListAssetsParams, ListTransactionsParams } from '@moonpay/platform-sdk-core';
|
|
32
|
+
export { Credentials, GetCredentialsError, ListAssetsParams, ThemeOptions } from '@moonpay/platform-sdk-core';
|
|
33
33
|
import { GetPaymentMethodsError, GetQuoteError, GetAssetsError, GetTransactionsError, SimulateBankTransferError, DevPlatformApiError, GetCustomerError, SubmitCustomerKycError, GetCustomerUploadUrlError, SubmitCustomerFilesError, CreateIdentityError, GetIdentityError, UpdateIdentityError, VerifyIdentityError, GetIdentityUploadUrlError, SubmitIdentityFilesError } from '@moonpay/platform-protocol/api/errors';
|
|
34
34
|
import { UpdateIdentityRequestBody, IdentityFileUploadUrlRequestBody, IdentityFileUploadUrl, SubmitIdentityFilesRequestBody, CreateIdentityRequestBody, Identity, IdentityVerificationResponse } from '@moonpay/platform-protocol/api/identity';
|
|
35
35
|
import { ResetConnectionError } from '@moonpay/platform-protocol/sdks/reset';
|
|
36
36
|
import { ViewStyle } from 'react-native';
|
|
37
|
+
import WebView, { WebViewProps } from 'react-native-webview';
|
|
37
38
|
import { ProtocolMessage } from '@moonpay/platform-protocol/protocol';
|
|
38
39
|
import { RefObject, ReactNode } from 'react';
|
|
39
|
-
import WebView from 'react-native-webview';
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Transport surface the RN SDK passes around internally. `WebViewTransport`
|
|
@@ -234,6 +234,18 @@ interface RNClient {
|
|
|
234
234
|
* call `setupAuth()` to drive the customer through email/OTP.
|
|
235
235
|
*/
|
|
236
236
|
setupAuth(options: SetupAuthOptions): Promise<Result<AuthFrame, AuthSdk.SetupError>>;
|
|
237
|
+
/**
|
|
238
|
+
* Returns the connected customer's `{ accessToken, clientToken }` so you can
|
|
239
|
+
* forward the `accessToken` to your own backend for customer-scoped Platform
|
|
240
|
+
* API calls (e.g. server-side quote fetching).
|
|
241
|
+
*
|
|
242
|
+
* Advanced escape hatch — the SDK otherwise keeps these credentials internal.
|
|
243
|
+
* The `accessToken` is short-lived and scoped to the connected customer. Errs
|
|
244
|
+
* with `noActiveSession` until a customer session exists — call
|
|
245
|
+
* `getConnection()` (and `connect()` / `setupAuth()` where needed) first.
|
|
246
|
+
* Synchronous — returns a `Result`, not a Promise.
|
|
247
|
+
*/
|
|
248
|
+
getCredentials(): Result<Credentials, GetCredentialsError>;
|
|
237
249
|
getPaymentMethods(): Promise<Result<{
|
|
238
250
|
data: ListPaymentMethodsResponse;
|
|
239
251
|
}, GetPaymentMethodsError>>;
|
|
@@ -318,9 +330,11 @@ interface MoonPayAddCardProps {
|
|
|
318
330
|
onEvent?: (event: AddCardSdk.Event) => void;
|
|
319
331
|
/** Container style. Defaults to flex: 1. */
|
|
320
332
|
style?: ViewStyle;
|
|
333
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
334
|
+
webViewProps?: Partial<WebViewProps>;
|
|
321
335
|
}
|
|
322
336
|
/** Inline add-card frame — embed card entry in your own layout/animation. */
|
|
323
|
-
declare function MoonPayAddCard({ onEvent, style }: MoonPayAddCardProps): JSX.Element;
|
|
337
|
+
declare function MoonPayAddCard({ onEvent, style, webViewProps }: MoonPayAddCardProps): JSX.Element;
|
|
324
338
|
|
|
325
339
|
interface MoonPayApplePayButtonProps {
|
|
326
340
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -331,22 +345,26 @@ interface MoonPayApplePayButtonProps {
|
|
|
331
345
|
onEvent?: (event: ApplePaySdk.Event) => void;
|
|
332
346
|
/** Container style. Defaults to height 48. */
|
|
333
347
|
style?: ViewStyle;
|
|
348
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
349
|
+
webViewProps?: Partial<WebViewProps>;
|
|
334
350
|
}
|
|
335
351
|
/** Inline Apple Pay button. Render it wherever it should appear in your layout. */
|
|
336
|
-
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
352
|
+
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
337
353
|
|
|
338
354
|
interface MoonPayAuthProps {
|
|
339
355
|
/** Callback for auth lifecycle events. */
|
|
340
356
|
onEvent?: (event: AuthSdk.Event) => void;
|
|
341
357
|
/** Container style. Defaults to flex: 1. */
|
|
342
358
|
style?: ViewStyle;
|
|
359
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
360
|
+
webViewProps?: Partial<WebViewProps>;
|
|
343
361
|
}
|
|
344
362
|
/**
|
|
345
363
|
* Inline auth frame for headless / Identity-API integrations. Requires a clientToken in context —
|
|
346
364
|
* call getConnection() (or render <MoonPayConnectionCheck>) first; if it resolves with
|
|
347
365
|
* `connectionRequired`, mount this component. Emits an error event otherwise.
|
|
348
366
|
*/
|
|
349
|
-
declare function MoonPayAuth({ onEvent, style }: MoonPayAuthProps): JSX.Element;
|
|
367
|
+
declare function MoonPayAuth({ onEvent, style, webViewProps }: MoonPayAuthProps): JSX.Element;
|
|
350
368
|
|
|
351
369
|
interface MoonPayBuyButtonProps {
|
|
352
370
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -357,9 +375,11 @@ interface MoonPayBuyButtonProps {
|
|
|
357
375
|
onEvent?: (event: BuyButtonSdk.Event) => void;
|
|
358
376
|
/** Container style. Defaults to height 48. */
|
|
359
377
|
style?: ViewStyle;
|
|
378
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
379
|
+
webViewProps?: Partial<WebViewProps>;
|
|
360
380
|
}
|
|
361
381
|
/** Inline card/buy button. Render it wherever it should appear in your layout. */
|
|
362
|
-
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, }: MoonPayBuyButtonProps): JSX.Element;
|
|
382
|
+
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
|
|
363
383
|
|
|
364
384
|
interface MoonPayBuyFrameProps {
|
|
365
385
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -368,9 +388,11 @@ interface MoonPayBuyFrameProps {
|
|
|
368
388
|
externalTransactionId?: string;
|
|
369
389
|
/** Callback for buy frame lifecycle events. */
|
|
370
390
|
onEvent?: (event: BuySdk.Event) => void;
|
|
391
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
392
|
+
webViewProps?: Partial<WebViewProps>;
|
|
371
393
|
}
|
|
372
394
|
/** Headless buy frame (renders nothing visible). The declarative alternative to client.setupBuy(). */
|
|
373
|
-
declare function MoonPayBuyFrame({ quote, externalTransactionId, onEvent, }: MoonPayBuyFrameProps): JSX.Element;
|
|
395
|
+
declare function MoonPayBuyFrame({ quote, externalTransactionId, onEvent, webViewProps, }: MoonPayBuyFrameProps): JSX.Element;
|
|
374
396
|
|
|
375
397
|
interface MoonPayChallengeProps {
|
|
376
398
|
/** Full challenge URL received from a frame's `challenge` event. Mount-time only. */
|
|
@@ -379,9 +401,11 @@ interface MoonPayChallengeProps {
|
|
|
379
401
|
onEvent?: (event: ChallengeSdk.Event) => void;
|
|
380
402
|
/** Container style. Defaults to flex: 1. */
|
|
381
403
|
style?: ViewStyle;
|
|
404
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
405
|
+
webViewProps?: Partial<WebViewProps>;
|
|
382
406
|
}
|
|
383
407
|
/** Inline 3DS/challenge frame. Mount it when a payment frame emits a `challenge` event. */
|
|
384
|
-
declare function MoonPayChallenge({ url, onEvent, style }: MoonPayChallengeProps): JSX.Element;
|
|
408
|
+
declare function MoonPayChallenge({ url, onEvent, style, webViewProps, }: MoonPayChallengeProps): JSX.Element;
|
|
385
409
|
|
|
386
410
|
interface MoonPayConnectProps {
|
|
387
411
|
/** Theme for this connect frame. Overrides the provider-level `theme`. Mount-time only. */
|
|
@@ -390,9 +414,11 @@ interface MoonPayConnectProps {
|
|
|
390
414
|
onEvent?: (event: ConnectSdk.Event) => void;
|
|
391
415
|
/** Container style. Defaults to flex: 1. */
|
|
392
416
|
style?: ViewStyle;
|
|
417
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
418
|
+
webViewProps?: Partial<WebViewProps>;
|
|
393
419
|
}
|
|
394
420
|
/** Inline connect frame. On an active completion, credentials are applied to the shared client automatically. */
|
|
395
|
-
declare function MoonPayConnect({ theme, onEvent, style }: MoonPayConnectProps): JSX.Element;
|
|
421
|
+
declare function MoonPayConnect({ theme, onEvent, style, webViewProps, }: MoonPayConnectProps): JSX.Element;
|
|
396
422
|
|
|
397
423
|
type ConnectionCheckEvent = {
|
|
398
424
|
kind: 'complete';
|
|
@@ -417,29 +443,35 @@ interface MoonPayConnectionCheckProps {
|
|
|
417
443
|
skipKyc?: boolean;
|
|
418
444
|
/** Emits `complete` with the Connection, or `error`. */
|
|
419
445
|
onEvent?: (event: ConnectionCheckEvent) => void;
|
|
446
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
447
|
+
webViewProps?: Partial<WebViewProps>;
|
|
420
448
|
}
|
|
421
449
|
/**
|
|
422
450
|
* Headless connection check (renders nothing visible). The declarative
|
|
423
451
|
* alternative to client.getConnection() — on an active connection,
|
|
424
452
|
* credentials are applied to the shared client automatically.
|
|
425
453
|
*/
|
|
426
|
-
declare function MoonPayConnectionCheck({ skipKyc, onEvent, }: MoonPayConnectionCheckProps): JSX.Element;
|
|
454
|
+
declare function MoonPayConnectionCheck({ skipKyc, onEvent, webViewProps, }: MoonPayConnectionCheckProps): JSX.Element;
|
|
427
455
|
|
|
428
456
|
interface MoonPayConnectionResetProps {
|
|
429
457
|
/** Callback for connection reset lifecycle events. */
|
|
430
458
|
onEvent?: (event: ConnectionResetEvent) => void;
|
|
459
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
460
|
+
webViewProps?: Partial<WebViewProps>;
|
|
431
461
|
}
|
|
432
462
|
/** Headless reset frame (renders nothing visible). The declarative alternative to client.resetConnection(). */
|
|
433
|
-
declare function MoonPayConnectionReset({ onEvent }: MoonPayConnectionResetProps): JSX.Element;
|
|
463
|
+
declare function MoonPayConnectionReset({ onEvent, webViewProps, }: MoonPayConnectionResetProps): JSX.Element;
|
|
434
464
|
|
|
435
465
|
interface MoonPayCustomerExportProps {
|
|
436
466
|
/** Callback for customer-export lifecycle events. */
|
|
437
467
|
onEvent?: (event: CustomerExportSdk.Event) => void;
|
|
438
468
|
/** Container style. Defaults to flex: 1. */
|
|
439
469
|
style?: ViewStyle;
|
|
470
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
471
|
+
webViewProps?: Partial<WebViewProps>;
|
|
440
472
|
}
|
|
441
473
|
/** Inline customer-export consent frame — embed export consent capture in your own layout. */
|
|
442
|
-
declare function MoonPayCustomerExport({ onEvent, style }: MoonPayCustomerExportProps): JSX.Element;
|
|
474
|
+
declare function MoonPayCustomerExport({ onEvent, style, webViewProps, }: MoonPayCustomerExportProps): JSX.Element;
|
|
443
475
|
|
|
444
476
|
interface MoonPayGooglePayButtonProps {
|
|
445
477
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -450,9 +482,11 @@ interface MoonPayGooglePayButtonProps {
|
|
|
450
482
|
onEvent?: (event: GooglePaySdk.Event) => void;
|
|
451
483
|
/** Container style. Defaults to height 48. */
|
|
452
484
|
style?: ViewStyle;
|
|
485
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
486
|
+
webViewProps?: Partial<WebViewProps>;
|
|
453
487
|
}
|
|
454
488
|
/** Inline Google Pay button. Render it wherever it should appear in your layout. */
|
|
455
|
-
declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, }: MoonPayGooglePayButtonProps): JSX.Element;
|
|
489
|
+
declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayGooglePayButtonProps): JSX.Element;
|
|
456
490
|
|
|
457
491
|
interface MoonPayWidgetProps {
|
|
458
492
|
/** Quote signature from getQuote(). Mount-time only — changing it reloads the widget. */
|
|
@@ -463,9 +497,11 @@ interface MoonPayWidgetProps {
|
|
|
463
497
|
onEvent?: (event: WidgetSdk.Event) => void;
|
|
464
498
|
/** Container style. Defaults to flex: 1. */
|
|
465
499
|
style?: ViewStyle;
|
|
500
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
501
|
+
webViewProps?: Partial<WebViewProps>;
|
|
466
502
|
}
|
|
467
503
|
/** Inline widget frame. Render it wherever it should appear in your layout. */
|
|
468
|
-
declare function MoonPayWidget({ quote, externalTransactionId, onEvent, style, }: MoonPayWidgetProps): JSX.Element;
|
|
504
|
+
declare function MoonPayWidget({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayWidgetProps): JSX.Element;
|
|
469
505
|
|
|
470
506
|
interface MoonPayFrameProps {
|
|
471
507
|
/** The transport instance managing this frame's communication. */
|
|
@@ -474,12 +510,18 @@ interface MoonPayFrameProps {
|
|
|
474
510
|
hidden?: boolean;
|
|
475
511
|
/** Optional style overrides for the container view. */
|
|
476
512
|
style?: ViewStyle;
|
|
513
|
+
/**
|
|
514
|
+
* Advanced: extra props forwarded to the underlying react-native-webview.
|
|
515
|
+
* `ref`, `source`, and `onMessage` are managed by the SDK and cannot be
|
|
516
|
+
* overridden; all other props (including `originWhitelist`) may be set here.
|
|
517
|
+
*/
|
|
518
|
+
webViewProps?: Partial<WebViewProps>;
|
|
477
519
|
}
|
|
478
520
|
/**
|
|
479
521
|
* Reusable React Native component that renders a MoonPay frame as a WebView.
|
|
480
522
|
* Bridges the WebViewTransport to the actual WebView instance.
|
|
481
523
|
*/
|
|
482
|
-
declare function MoonPayFrame({ transport, hidden, style }: MoonPayFrameProps): JSX.Element | null;
|
|
524
|
+
declare function MoonPayFrame({ transport, hidden, style, webViewProps, }: MoonPayFrameProps): JSX.Element | null;
|
|
483
525
|
|
|
484
526
|
interface MoonPayProviderProps {
|
|
485
527
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -28,15 +28,15 @@ import * as GooglePaySdk from '@moonpay/platform-protocol/sdks/google-pay';
|
|
|
28
28
|
export { Event as GooglePayEvent, SetupError as SetupGooglePayError } from '@moonpay/platform-protocol/sdks/google-pay';
|
|
29
29
|
import * as WidgetSdk from '@moonpay/platform-protocol/sdks/widget';
|
|
30
30
|
export { SetupError as SetupWidgetError, Event as WidgetEvent } from '@moonpay/platform-protocol/sdks/widget';
|
|
31
|
-
import { FrameTransport, FrameOptions, PresentationMode, ThemeOptions, ListAssetsParams, ListTransactionsParams } from '@moonpay/platform-sdk-core';
|
|
32
|
-
export { ListAssetsParams, ThemeOptions } from '@moonpay/platform-sdk-core';
|
|
31
|
+
import { FrameTransport, FrameOptions, PresentationMode, ThemeOptions, Credentials, GetCredentialsError, ListAssetsParams, ListTransactionsParams } from '@moonpay/platform-sdk-core';
|
|
32
|
+
export { Credentials, GetCredentialsError, ListAssetsParams, ThemeOptions } from '@moonpay/platform-sdk-core';
|
|
33
33
|
import { GetPaymentMethodsError, GetQuoteError, GetAssetsError, GetTransactionsError, SimulateBankTransferError, DevPlatformApiError, GetCustomerError, SubmitCustomerKycError, GetCustomerUploadUrlError, SubmitCustomerFilesError, CreateIdentityError, GetIdentityError, UpdateIdentityError, VerifyIdentityError, GetIdentityUploadUrlError, SubmitIdentityFilesError } from '@moonpay/platform-protocol/api/errors';
|
|
34
34
|
import { UpdateIdentityRequestBody, IdentityFileUploadUrlRequestBody, IdentityFileUploadUrl, SubmitIdentityFilesRequestBody, CreateIdentityRequestBody, Identity, IdentityVerificationResponse } from '@moonpay/platform-protocol/api/identity';
|
|
35
35
|
import { ResetConnectionError } from '@moonpay/platform-protocol/sdks/reset';
|
|
36
36
|
import { ViewStyle } from 'react-native';
|
|
37
|
+
import WebView, { WebViewProps } from 'react-native-webview';
|
|
37
38
|
import { ProtocolMessage } from '@moonpay/platform-protocol/protocol';
|
|
38
39
|
import { RefObject, ReactNode } from 'react';
|
|
39
|
-
import WebView from 'react-native-webview';
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Transport surface the RN SDK passes around internally. `WebViewTransport`
|
|
@@ -234,6 +234,18 @@ interface RNClient {
|
|
|
234
234
|
* call `setupAuth()` to drive the customer through email/OTP.
|
|
235
235
|
*/
|
|
236
236
|
setupAuth(options: SetupAuthOptions): Promise<Result<AuthFrame, AuthSdk.SetupError>>;
|
|
237
|
+
/**
|
|
238
|
+
* Returns the connected customer's `{ accessToken, clientToken }` so you can
|
|
239
|
+
* forward the `accessToken` to your own backend for customer-scoped Platform
|
|
240
|
+
* API calls (e.g. server-side quote fetching).
|
|
241
|
+
*
|
|
242
|
+
* Advanced escape hatch — the SDK otherwise keeps these credentials internal.
|
|
243
|
+
* The `accessToken` is short-lived and scoped to the connected customer. Errs
|
|
244
|
+
* with `noActiveSession` until a customer session exists — call
|
|
245
|
+
* `getConnection()` (and `connect()` / `setupAuth()` where needed) first.
|
|
246
|
+
* Synchronous — returns a `Result`, not a Promise.
|
|
247
|
+
*/
|
|
248
|
+
getCredentials(): Result<Credentials, GetCredentialsError>;
|
|
237
249
|
getPaymentMethods(): Promise<Result<{
|
|
238
250
|
data: ListPaymentMethodsResponse;
|
|
239
251
|
}, GetPaymentMethodsError>>;
|
|
@@ -318,9 +330,11 @@ interface MoonPayAddCardProps {
|
|
|
318
330
|
onEvent?: (event: AddCardSdk.Event) => void;
|
|
319
331
|
/** Container style. Defaults to flex: 1. */
|
|
320
332
|
style?: ViewStyle;
|
|
333
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
334
|
+
webViewProps?: Partial<WebViewProps>;
|
|
321
335
|
}
|
|
322
336
|
/** Inline add-card frame — embed card entry in your own layout/animation. */
|
|
323
|
-
declare function MoonPayAddCard({ onEvent, style }: MoonPayAddCardProps): JSX.Element;
|
|
337
|
+
declare function MoonPayAddCard({ onEvent, style, webViewProps }: MoonPayAddCardProps): JSX.Element;
|
|
324
338
|
|
|
325
339
|
interface MoonPayApplePayButtonProps {
|
|
326
340
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -331,22 +345,26 @@ interface MoonPayApplePayButtonProps {
|
|
|
331
345
|
onEvent?: (event: ApplePaySdk.Event) => void;
|
|
332
346
|
/** Container style. Defaults to height 48. */
|
|
333
347
|
style?: ViewStyle;
|
|
348
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
349
|
+
webViewProps?: Partial<WebViewProps>;
|
|
334
350
|
}
|
|
335
351
|
/** Inline Apple Pay button. Render it wherever it should appear in your layout. */
|
|
336
|
-
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
352
|
+
declare function MoonPayApplePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayApplePayButtonProps): JSX.Element;
|
|
337
353
|
|
|
338
354
|
interface MoonPayAuthProps {
|
|
339
355
|
/** Callback for auth lifecycle events. */
|
|
340
356
|
onEvent?: (event: AuthSdk.Event) => void;
|
|
341
357
|
/** Container style. Defaults to flex: 1. */
|
|
342
358
|
style?: ViewStyle;
|
|
359
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
360
|
+
webViewProps?: Partial<WebViewProps>;
|
|
343
361
|
}
|
|
344
362
|
/**
|
|
345
363
|
* Inline auth frame for headless / Identity-API integrations. Requires a clientToken in context —
|
|
346
364
|
* call getConnection() (or render <MoonPayConnectionCheck>) first; if it resolves with
|
|
347
365
|
* `connectionRequired`, mount this component. Emits an error event otherwise.
|
|
348
366
|
*/
|
|
349
|
-
declare function MoonPayAuth({ onEvent, style }: MoonPayAuthProps): JSX.Element;
|
|
367
|
+
declare function MoonPayAuth({ onEvent, style, webViewProps }: MoonPayAuthProps): JSX.Element;
|
|
350
368
|
|
|
351
369
|
interface MoonPayBuyButtonProps {
|
|
352
370
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -357,9 +375,11 @@ interface MoonPayBuyButtonProps {
|
|
|
357
375
|
onEvent?: (event: BuyButtonSdk.Event) => void;
|
|
358
376
|
/** Container style. Defaults to height 48. */
|
|
359
377
|
style?: ViewStyle;
|
|
378
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
379
|
+
webViewProps?: Partial<WebViewProps>;
|
|
360
380
|
}
|
|
361
381
|
/** Inline card/buy button. Render it wherever it should appear in your layout. */
|
|
362
|
-
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, }: MoonPayBuyButtonProps): JSX.Element;
|
|
382
|
+
declare function MoonPayBuyButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
|
|
363
383
|
|
|
364
384
|
interface MoonPayBuyFrameProps {
|
|
365
385
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -368,9 +388,11 @@ interface MoonPayBuyFrameProps {
|
|
|
368
388
|
externalTransactionId?: string;
|
|
369
389
|
/** Callback for buy frame lifecycle events. */
|
|
370
390
|
onEvent?: (event: BuySdk.Event) => void;
|
|
391
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
392
|
+
webViewProps?: Partial<WebViewProps>;
|
|
371
393
|
}
|
|
372
394
|
/** Headless buy frame (renders nothing visible). The declarative alternative to client.setupBuy(). */
|
|
373
|
-
declare function MoonPayBuyFrame({ quote, externalTransactionId, onEvent, }: MoonPayBuyFrameProps): JSX.Element;
|
|
395
|
+
declare function MoonPayBuyFrame({ quote, externalTransactionId, onEvent, webViewProps, }: MoonPayBuyFrameProps): JSX.Element;
|
|
374
396
|
|
|
375
397
|
interface MoonPayChallengeProps {
|
|
376
398
|
/** Full challenge URL received from a frame's `challenge` event. Mount-time only. */
|
|
@@ -379,9 +401,11 @@ interface MoonPayChallengeProps {
|
|
|
379
401
|
onEvent?: (event: ChallengeSdk.Event) => void;
|
|
380
402
|
/** Container style. Defaults to flex: 1. */
|
|
381
403
|
style?: ViewStyle;
|
|
404
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
405
|
+
webViewProps?: Partial<WebViewProps>;
|
|
382
406
|
}
|
|
383
407
|
/** Inline 3DS/challenge frame. Mount it when a payment frame emits a `challenge` event. */
|
|
384
|
-
declare function MoonPayChallenge({ url, onEvent, style }: MoonPayChallengeProps): JSX.Element;
|
|
408
|
+
declare function MoonPayChallenge({ url, onEvent, style, webViewProps, }: MoonPayChallengeProps): JSX.Element;
|
|
385
409
|
|
|
386
410
|
interface MoonPayConnectProps {
|
|
387
411
|
/** Theme for this connect frame. Overrides the provider-level `theme`. Mount-time only. */
|
|
@@ -390,9 +414,11 @@ interface MoonPayConnectProps {
|
|
|
390
414
|
onEvent?: (event: ConnectSdk.Event) => void;
|
|
391
415
|
/** Container style. Defaults to flex: 1. */
|
|
392
416
|
style?: ViewStyle;
|
|
417
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
418
|
+
webViewProps?: Partial<WebViewProps>;
|
|
393
419
|
}
|
|
394
420
|
/** Inline connect frame. On an active completion, credentials are applied to the shared client automatically. */
|
|
395
|
-
declare function MoonPayConnect({ theme, onEvent, style }: MoonPayConnectProps): JSX.Element;
|
|
421
|
+
declare function MoonPayConnect({ theme, onEvent, style, webViewProps, }: MoonPayConnectProps): JSX.Element;
|
|
396
422
|
|
|
397
423
|
type ConnectionCheckEvent = {
|
|
398
424
|
kind: 'complete';
|
|
@@ -417,29 +443,35 @@ interface MoonPayConnectionCheckProps {
|
|
|
417
443
|
skipKyc?: boolean;
|
|
418
444
|
/** Emits `complete` with the Connection, or `error`. */
|
|
419
445
|
onEvent?: (event: ConnectionCheckEvent) => void;
|
|
446
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
447
|
+
webViewProps?: Partial<WebViewProps>;
|
|
420
448
|
}
|
|
421
449
|
/**
|
|
422
450
|
* Headless connection check (renders nothing visible). The declarative
|
|
423
451
|
* alternative to client.getConnection() — on an active connection,
|
|
424
452
|
* credentials are applied to the shared client automatically.
|
|
425
453
|
*/
|
|
426
|
-
declare function MoonPayConnectionCheck({ skipKyc, onEvent, }: MoonPayConnectionCheckProps): JSX.Element;
|
|
454
|
+
declare function MoonPayConnectionCheck({ skipKyc, onEvent, webViewProps, }: MoonPayConnectionCheckProps): JSX.Element;
|
|
427
455
|
|
|
428
456
|
interface MoonPayConnectionResetProps {
|
|
429
457
|
/** Callback for connection reset lifecycle events. */
|
|
430
458
|
onEvent?: (event: ConnectionResetEvent) => void;
|
|
459
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
460
|
+
webViewProps?: Partial<WebViewProps>;
|
|
431
461
|
}
|
|
432
462
|
/** Headless reset frame (renders nothing visible). The declarative alternative to client.resetConnection(). */
|
|
433
|
-
declare function MoonPayConnectionReset({ onEvent }: MoonPayConnectionResetProps): JSX.Element;
|
|
463
|
+
declare function MoonPayConnectionReset({ onEvent, webViewProps, }: MoonPayConnectionResetProps): JSX.Element;
|
|
434
464
|
|
|
435
465
|
interface MoonPayCustomerExportProps {
|
|
436
466
|
/** Callback for customer-export lifecycle events. */
|
|
437
467
|
onEvent?: (event: CustomerExportSdk.Event) => void;
|
|
438
468
|
/** Container style. Defaults to flex: 1. */
|
|
439
469
|
style?: ViewStyle;
|
|
470
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
471
|
+
webViewProps?: Partial<WebViewProps>;
|
|
440
472
|
}
|
|
441
473
|
/** Inline customer-export consent frame — embed export consent capture in your own layout. */
|
|
442
|
-
declare function MoonPayCustomerExport({ onEvent, style }: MoonPayCustomerExportProps): JSX.Element;
|
|
474
|
+
declare function MoonPayCustomerExport({ onEvent, style, webViewProps, }: MoonPayCustomerExportProps): JSX.Element;
|
|
443
475
|
|
|
444
476
|
interface MoonPayGooglePayButtonProps {
|
|
445
477
|
/** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
|
|
@@ -450,9 +482,11 @@ interface MoonPayGooglePayButtonProps {
|
|
|
450
482
|
onEvent?: (event: GooglePaySdk.Event) => void;
|
|
451
483
|
/** Container style. Defaults to height 48. */
|
|
452
484
|
style?: ViewStyle;
|
|
485
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
486
|
+
webViewProps?: Partial<WebViewProps>;
|
|
453
487
|
}
|
|
454
488
|
/** Inline Google Pay button. Render it wherever it should appear in your layout. */
|
|
455
|
-
declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, }: MoonPayGooglePayButtonProps): JSX.Element;
|
|
489
|
+
declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayGooglePayButtonProps): JSX.Element;
|
|
456
490
|
|
|
457
491
|
interface MoonPayWidgetProps {
|
|
458
492
|
/** Quote signature from getQuote(). Mount-time only — changing it reloads the widget. */
|
|
@@ -463,9 +497,11 @@ interface MoonPayWidgetProps {
|
|
|
463
497
|
onEvent?: (event: WidgetSdk.Event) => void;
|
|
464
498
|
/** Container style. Defaults to flex: 1. */
|
|
465
499
|
style?: ViewStyle;
|
|
500
|
+
/** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
|
|
501
|
+
webViewProps?: Partial<WebViewProps>;
|
|
466
502
|
}
|
|
467
503
|
/** Inline widget frame. Render it wherever it should appear in your layout. */
|
|
468
|
-
declare function MoonPayWidget({ quote, externalTransactionId, onEvent, style, }: MoonPayWidgetProps): JSX.Element;
|
|
504
|
+
declare function MoonPayWidget({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayWidgetProps): JSX.Element;
|
|
469
505
|
|
|
470
506
|
interface MoonPayFrameProps {
|
|
471
507
|
/** The transport instance managing this frame's communication. */
|
|
@@ -474,12 +510,18 @@ interface MoonPayFrameProps {
|
|
|
474
510
|
hidden?: boolean;
|
|
475
511
|
/** Optional style overrides for the container view. */
|
|
476
512
|
style?: ViewStyle;
|
|
513
|
+
/**
|
|
514
|
+
* Advanced: extra props forwarded to the underlying react-native-webview.
|
|
515
|
+
* `ref`, `source`, and `onMessage` are managed by the SDK and cannot be
|
|
516
|
+
* overridden; all other props (including `originWhitelist`) may be set here.
|
|
517
|
+
*/
|
|
518
|
+
webViewProps?: Partial<WebViewProps>;
|
|
477
519
|
}
|
|
478
520
|
/**
|
|
479
521
|
* Reusable React Native component that renders a MoonPay frame as a WebView.
|
|
480
522
|
* Bridges the WebViewTransport to the actual WebView instance.
|
|
481
523
|
*/
|
|
482
|
-
declare function MoonPayFrame({ transport, hidden, style }: MoonPayFrameProps): JSX.Element | null;
|
|
524
|
+
declare function MoonPayFrame({ transport, hidden, style, webViewProps, }: MoonPayFrameProps): JSX.Element | null;
|
|
483
525
|
|
|
484
526
|
interface MoonPayProviderProps {
|
|
485
527
|
/**
|