@moonpay/platform-sdk-react-native 1.28.0 → 1.29.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.d.cts CHANGED
@@ -7,6 +7,8 @@ export { CardResponse } from '@moonpay/platform-protocol/frames/add-card';
7
7
  import * as ApplePayFrame$1 from '@moonpay/platform-protocol/frames/apple-pay';
8
8
  export { ApplePayButtonSettings } from '@moonpay/platform-protocol/frames/apple-pay';
9
9
  export { Cancellation as ChallengeCancellation, CompleteResult as ChallengeCompleteResult, ErrorCode as ChallengeErrorCode, ResolvedResult as ChallengeResolvedResult } from '@moonpay/platform-protocol/frames/challenge';
10
+ import * as GooglePayFrame$1 from '@moonpay/platform-protocol/frames/google-pay';
11
+ export { GooglePayButtonSettings } from '@moonpay/platform-protocol/frames/google-pay';
10
12
  import { Connection } from '@moonpay/platform-protocol/models/connection';
11
13
  export { Connection, ConnectionStatus } from '@moonpay/platform-protocol/models/connection';
12
14
  import { Result } from '@moonpay/platform-protocol/result';
@@ -85,6 +87,7 @@ interface AddCardFrame {
85
87
  dispose(): void;
86
88
  }
87
89
 
90
+ /** @deprecated Render `<MoonPayBuyButton>` instead. The Apple Pay frame is being removed. */
88
91
  interface SetupApplePayOptions {
89
92
  /** Quote signature from getQuote(). */
90
93
  quote: string;
@@ -97,6 +100,7 @@ interface SetupApplePayOptions {
97
100
  /** Callback for Apple Pay lifecycle events. */
98
101
  onEvent?: (event: ApplePaySdk.Event) => void;
99
102
  }
103
+ /** @deprecated Render `<MoonPayBuyButton>` instead. The Apple Pay frame is being removed. */
100
104
  interface ApplePayFrame {
101
105
  /** Update the quote (e.g., after expiry). */
102
106
  setQuote(signature: string): void;
@@ -136,6 +140,11 @@ interface SetupBuyButtonOptions {
136
140
  externalTransactionId?: string;
137
141
  /** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. */
138
142
  applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
143
+ /**
144
+ * Styling for the Google Pay button variant. Passed through to the frame, which is
145
+ * authoritative. Ignored when `headless` is set, since no button renders.
146
+ */
147
+ googlePayButtonSettings?: GooglePayFrame$1.GooglePayButtonSettings;
139
148
  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */
140
149
  presentation?: PresentationMode;
141
150
  /**
@@ -204,6 +213,7 @@ interface CustomerExportFrame {
204
213
  dispose(): void;
205
214
  }
206
215
 
216
+ /** @deprecated Render `<MoonPayBuyButton>` instead. The Google Pay frame is being removed. */
207
217
  interface SetupGooglePayOptions {
208
218
  /** Quote signature from getQuote(). */
209
219
  quote: string;
@@ -214,6 +224,7 @@ interface SetupGooglePayOptions {
214
224
  /** Callback for Google Pay lifecycle events. */
215
225
  onEvent?: (event: GooglePaySdk.Event) => void;
216
226
  }
227
+ /** @deprecated Render `<MoonPayBuyButton>` instead. The Google Pay frame is being removed. */
217
228
  interface GooglePayFrame {
218
229
  /** Update the quote (e.g., after expiry). */
219
230
  setQuote(signature: string): void;
@@ -292,13 +303,13 @@ interface RNClient {
292
303
  data: TransactionWithStages;
293
304
  }, SimulateBankTransferError>>;
294
305
  setupWidget(options: SetupWidgetOptions): Promise<Result<WidgetFrame, WidgetSdk.SetupError>>;
295
- /** @deprecated Render <MoonPayApplePayButton> instead — it mounts inline where you place it. */
306
+ /** @deprecated Render `<MoonPayBuyButton>` instead. It renders the Apple Pay button for an Apple Pay quote. The Apple Pay frame is being removed. */
296
307
  setupApplePay(options: SetupApplePayOptions): Promise<Result<ApplePayFrame, ApplePaySdk.SetupError>>;
297
308
  /** @deprecated Use `setupBuyButton({ ...options, headless: true })` or `<MoonPayBuyButton headless>`. The buy frame is being removed. */
298
309
  setupBuy(options: SetupBuyOptions): Promise<Result<BuyFrame, BuySdk.SetupError>>;
299
310
  /** @deprecated Render <MoonPayBuyButton> instead — it mounts inline where you place it. */
300
311
  setupBuyButton(options: SetupBuyButtonOptions): Promise<Result<BuyButtonFrame, BuyButtonSdk.SetupError>>;
301
- /** @deprecated Render <MoonPayGooglePayButton> instead — it mounts inline where you place it. */
312
+ /** @deprecated Render `<MoonPayBuyButton>` instead. It renders the Google Pay button for a Google Pay quote. The Google Pay frame is being removed. */
302
313
  setupGooglePay(options: SetupGooglePayOptions): Promise<Result<GooglePayFrame, GooglePaySdk.SetupError>>;
303
314
  deletePaymentMethod(id: string): Promise<Result<void, DevPlatformApiError>>;
304
315
  /**
@@ -366,6 +377,7 @@ interface MoonPayAddCardProps {
366
377
  /** Inline add-card frame — embed card entry in your own layout/animation. */
367
378
  declare function MoonPayAddCard({ onEvent, style, webViewProps }: MoonPayAddCardProps): JSX.Element;
368
379
 
380
+ /** @deprecated Use `MoonPayBuyButtonProps`. The Apple Pay frame is being removed. */
369
381
  interface MoonPayApplePayButtonProps {
370
382
  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
371
383
  quote: string;
@@ -387,7 +399,10 @@ interface MoonPayApplePayButtonProps {
387
399
  */
388
400
  onRef?: (webView: WebView | null) => void;
389
401
  }
390
- /** Inline Apple Pay button. Render it wherever it should appear in your layout. */
402
+ /**
403
+ * Inline Apple Pay button. Render it wherever it should appear in your layout.
404
+ * @deprecated Render `<MoonPayBuyButton>` instead. It renders the Apple Pay button for an Apple Pay quote. The Apple Pay frame is being removed.
405
+ */
391
406
  declare function MoonPayApplePayButton({ quote, externalTransactionId, applePayButtonSettings, onEvent, style, webViewProps, onRef, }: MoonPayApplePayButtonProps): JSX.Element;
392
407
 
393
408
  interface MoonPayAuthProps {
@@ -412,6 +427,8 @@ interface MoonPayBuyButtonProps {
412
427
  externalTransactionId?: string;
413
428
  /** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. Mount-time only. */
414
429
  applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
430
+ /** Styling for the Google Pay button variant. Passed through to the frame, which is authoritative. Ignored when `headless` is set. Mount-time only. */
431
+ googlePayButtonSettings?: GooglePayFrame$1.GooglePayButtonSettings;
415
432
  /**
416
433
  * Render nothing visible and process the quote on load, the way the
417
434
  * deprecated `<MoonPayBuyFrame>` did. Mount-time only.
@@ -425,7 +442,7 @@ interface MoonPayBuyButtonProps {
425
442
  webViewProps?: Partial<WebViewProps>;
426
443
  }
427
444
  /** Inline card/buy button. Render it wherever it should appear in your layout. */
428
- declare function MoonPayBuyButton({ quote, externalTransactionId, applePayButtonSettings, headless, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
445
+ declare function MoonPayBuyButton({ quote, externalTransactionId, applePayButtonSettings, googlePayButtonSettings, headless, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
429
446
 
430
447
  interface MoonPayBuyFrameProps {
431
448
  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
@@ -531,6 +548,7 @@ interface MoonPayCustomerExportProps {
531
548
  /** Inline customer-export consent frame — embed export consent capture in your own layout. */
532
549
  declare function MoonPayCustomerExport({ onEvent, style, webViewProps, }: MoonPayCustomerExportProps): JSX.Element;
533
550
 
551
+ /** @deprecated Use `MoonPayBuyButtonProps`. The Google Pay frame is being removed. */
534
552
  interface MoonPayGooglePayButtonProps {
535
553
  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
536
554
  quote: string;
@@ -543,7 +561,10 @@ interface MoonPayGooglePayButtonProps {
543
561
  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
544
562
  webViewProps?: Partial<WebViewProps>;
545
563
  }
546
- /** Inline Google Pay button. Render it wherever it should appear in your layout. */
564
+ /**
565
+ * Inline Google Pay button. Render it wherever it should appear in your layout.
566
+ * @deprecated Render `<MoonPayBuyButton>` instead. It renders the Google Pay button for a Google Pay quote. The Google Pay frame is being removed.
567
+ */
547
568
  declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayGooglePayButtonProps): JSX.Element;
548
569
 
549
570
  interface MoonPayWidgetProps {
package/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ export { CardResponse } from '@moonpay/platform-protocol/frames/add-card';
7
7
  import * as ApplePayFrame$1 from '@moonpay/platform-protocol/frames/apple-pay';
8
8
  export { ApplePayButtonSettings } from '@moonpay/platform-protocol/frames/apple-pay';
9
9
  export { Cancellation as ChallengeCancellation, CompleteResult as ChallengeCompleteResult, ErrorCode as ChallengeErrorCode, ResolvedResult as ChallengeResolvedResult } from '@moonpay/platform-protocol/frames/challenge';
10
+ import * as GooglePayFrame$1 from '@moonpay/platform-protocol/frames/google-pay';
11
+ export { GooglePayButtonSettings } from '@moonpay/platform-protocol/frames/google-pay';
10
12
  import { Connection } from '@moonpay/platform-protocol/models/connection';
11
13
  export { Connection, ConnectionStatus } from '@moonpay/platform-protocol/models/connection';
12
14
  import { Result } from '@moonpay/platform-protocol/result';
@@ -85,6 +87,7 @@ interface AddCardFrame {
85
87
  dispose(): void;
86
88
  }
87
89
 
90
+ /** @deprecated Render `<MoonPayBuyButton>` instead. The Apple Pay frame is being removed. */
88
91
  interface SetupApplePayOptions {
89
92
  /** Quote signature from getQuote(). */
90
93
  quote: string;
@@ -97,6 +100,7 @@ interface SetupApplePayOptions {
97
100
  /** Callback for Apple Pay lifecycle events. */
98
101
  onEvent?: (event: ApplePaySdk.Event) => void;
99
102
  }
103
+ /** @deprecated Render `<MoonPayBuyButton>` instead. The Apple Pay frame is being removed. */
100
104
  interface ApplePayFrame {
101
105
  /** Update the quote (e.g., after expiry). */
102
106
  setQuote(signature: string): void;
@@ -136,6 +140,11 @@ interface SetupBuyButtonOptions {
136
140
  externalTransactionId?: string;
137
141
  /** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. */
138
142
  applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
143
+ /**
144
+ * Styling for the Google Pay button variant. Passed through to the frame, which is
145
+ * authoritative. Ignored when `headless` is set, since no button renders.
146
+ */
147
+ googlePayButtonSettings?: GooglePayFrame$1.GooglePayButtonSettings;
139
148
  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */
140
149
  presentation?: PresentationMode;
141
150
  /**
@@ -204,6 +213,7 @@ interface CustomerExportFrame {
204
213
  dispose(): void;
205
214
  }
206
215
 
216
+ /** @deprecated Render `<MoonPayBuyButton>` instead. The Google Pay frame is being removed. */
207
217
  interface SetupGooglePayOptions {
208
218
  /** Quote signature from getQuote(). */
209
219
  quote: string;
@@ -214,6 +224,7 @@ interface SetupGooglePayOptions {
214
224
  /** Callback for Google Pay lifecycle events. */
215
225
  onEvent?: (event: GooglePaySdk.Event) => void;
216
226
  }
227
+ /** @deprecated Render `<MoonPayBuyButton>` instead. The Google Pay frame is being removed. */
217
228
  interface GooglePayFrame {
218
229
  /** Update the quote (e.g., after expiry). */
219
230
  setQuote(signature: string): void;
@@ -292,13 +303,13 @@ interface RNClient {
292
303
  data: TransactionWithStages;
293
304
  }, SimulateBankTransferError>>;
294
305
  setupWidget(options: SetupWidgetOptions): Promise<Result<WidgetFrame, WidgetSdk.SetupError>>;
295
- /** @deprecated Render <MoonPayApplePayButton> instead — it mounts inline where you place it. */
306
+ /** @deprecated Render `<MoonPayBuyButton>` instead. It renders the Apple Pay button for an Apple Pay quote. The Apple Pay frame is being removed. */
296
307
  setupApplePay(options: SetupApplePayOptions): Promise<Result<ApplePayFrame, ApplePaySdk.SetupError>>;
297
308
  /** @deprecated Use `setupBuyButton({ ...options, headless: true })` or `<MoonPayBuyButton headless>`. The buy frame is being removed. */
298
309
  setupBuy(options: SetupBuyOptions): Promise<Result<BuyFrame, BuySdk.SetupError>>;
299
310
  /** @deprecated Render <MoonPayBuyButton> instead — it mounts inline where you place it. */
300
311
  setupBuyButton(options: SetupBuyButtonOptions): Promise<Result<BuyButtonFrame, BuyButtonSdk.SetupError>>;
301
- /** @deprecated Render <MoonPayGooglePayButton> instead — it mounts inline where you place it. */
312
+ /** @deprecated Render `<MoonPayBuyButton>` instead. It renders the Google Pay button for a Google Pay quote. The Google Pay frame is being removed. */
302
313
  setupGooglePay(options: SetupGooglePayOptions): Promise<Result<GooglePayFrame, GooglePaySdk.SetupError>>;
303
314
  deletePaymentMethod(id: string): Promise<Result<void, DevPlatformApiError>>;
304
315
  /**
@@ -366,6 +377,7 @@ interface MoonPayAddCardProps {
366
377
  /** Inline add-card frame — embed card entry in your own layout/animation. */
367
378
  declare function MoonPayAddCard({ onEvent, style, webViewProps }: MoonPayAddCardProps): JSX.Element;
368
379
 
380
+ /** @deprecated Use `MoonPayBuyButtonProps`. The Apple Pay frame is being removed. */
369
381
  interface MoonPayApplePayButtonProps {
370
382
  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
371
383
  quote: string;
@@ -387,7 +399,10 @@ interface MoonPayApplePayButtonProps {
387
399
  */
388
400
  onRef?: (webView: WebView | null) => void;
389
401
  }
390
- /** Inline Apple Pay button. Render it wherever it should appear in your layout. */
402
+ /**
403
+ * Inline Apple Pay button. Render it wherever it should appear in your layout.
404
+ * @deprecated Render `<MoonPayBuyButton>` instead. It renders the Apple Pay button for an Apple Pay quote. The Apple Pay frame is being removed.
405
+ */
391
406
  declare function MoonPayApplePayButton({ quote, externalTransactionId, applePayButtonSettings, onEvent, style, webViewProps, onRef, }: MoonPayApplePayButtonProps): JSX.Element;
392
407
 
393
408
  interface MoonPayAuthProps {
@@ -412,6 +427,8 @@ interface MoonPayBuyButtonProps {
412
427
  externalTransactionId?: string;
413
428
  /** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. Mount-time only. */
414
429
  applePayButtonSettings?: ApplePayFrame$1.ApplePayButtonSettings;
430
+ /** Styling for the Google Pay button variant. Passed through to the frame, which is authoritative. Ignored when `headless` is set. Mount-time only. */
431
+ googlePayButtonSettings?: GooglePayFrame$1.GooglePayButtonSettings;
415
432
  /**
416
433
  * Render nothing visible and process the quote on load, the way the
417
434
  * deprecated `<MoonPayBuyFrame>` did. Mount-time only.
@@ -425,7 +442,7 @@ interface MoonPayBuyButtonProps {
425
442
  webViewProps?: Partial<WebViewProps>;
426
443
  }
427
444
  /** Inline card/buy button. Render it wherever it should appear in your layout. */
428
- declare function MoonPayBuyButton({ quote, externalTransactionId, applePayButtonSettings, headless, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
445
+ declare function MoonPayBuyButton({ quote, externalTransactionId, applePayButtonSettings, googlePayButtonSettings, headless, onEvent, style, webViewProps, }: MoonPayBuyButtonProps): JSX.Element;
429
446
 
430
447
  interface MoonPayBuyFrameProps {
431
448
  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
@@ -531,6 +548,7 @@ interface MoonPayCustomerExportProps {
531
548
  /** Inline customer-export consent frame — embed export consent capture in your own layout. */
532
549
  declare function MoonPayCustomerExport({ onEvent, style, webViewProps, }: MoonPayCustomerExportProps): JSX.Element;
533
550
 
551
+ /** @deprecated Use `MoonPayBuyButtonProps`. The Google Pay frame is being removed. */
534
552
  interface MoonPayGooglePayButtonProps {
535
553
  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */
536
554
  quote: string;
@@ -543,7 +561,10 @@ interface MoonPayGooglePayButtonProps {
543
561
  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */
544
562
  webViewProps?: Partial<WebViewProps>;
545
563
  }
546
- /** Inline Google Pay button. Render it wherever it should appear in your layout. */
564
+ /**
565
+ * Inline Google Pay button. Render it wherever it should appear in your layout.
566
+ * @deprecated Render `<MoonPayBuyButton>` instead. It renders the Google Pay button for a Google Pay quote. The Google Pay frame is being removed.
567
+ */
547
568
  declare function MoonPayGooglePayButton({ quote, externalTransactionId, onEvent, style, webViewProps, }: MoonPayGooglePayButtonProps): JSX.Element;
548
569
 
549
570
  interface MoonPayWidgetProps {
package/dist/index.js CHANGED
@@ -134,6 +134,9 @@ var buyButtonSpec = {
134
134
  signature: props.quote,
135
135
  ...props.externalTransactionId && { externalTransactionId: props.externalTransactionId },
136
136
  ...props.applePayButtonSettings && { applePayButtonSettings: props.applePayButtonSettings },
137
+ ...props.googlePayButtonSettings && {
138
+ googlePayButtonSettings: props.googlePayButtonSettings
139
+ },
137
140
  ...presentationParams(props.presentation)
138
141
  }),
139
142
  createCommands: createQuoteCommands,
@@ -829,6 +832,7 @@ async function setupBuyButton(deps, opts) {
829
832
  quote: opts.quote,
830
833
  externalTransactionId: opts.externalTransactionId,
831
834
  applePayButtonSettings: opts.applePayButtonSettings,
835
+ googlePayButtonSettings: opts.googlePayButtonSettings,
832
836
  presentation: opts.presentation
833
837
  }
834
838
  );
@@ -1578,6 +1582,7 @@ function MoonPayBuyButton({
1578
1582
  quote,
1579
1583
  externalTransactionId,
1580
1584
  applePayButtonSettings,
1585
+ googlePayButtonSettings,
1581
1586
  headless,
1582
1587
  onEvent,
1583
1588
  style,
@@ -1587,7 +1592,7 @@ function MoonPayBuyButton({
1587
1592
  MoonPayFrameView,
1588
1593
  {
1589
1594
  spec: headless ? headlessBuyButtonSpec : buyButtonSpec,
1590
- props: { quote, externalTransactionId, applePayButtonSettings },
1595
+ props: { quote, externalTransactionId, applePayButtonSettings, googlePayButtonSettings },
1591
1596
  style,
1592
1597
  defaultStyle: { height: 48 },
1593
1598
  onEvent,