@stripe/connect-js 3.3.42-preview-1 → 3.3.43-preview-2

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.
@@ -251,7 +251,7 @@ const initStripeConnect = (stripePromise, initParams) => {
251
251
  element[method] = function (value) {
252
252
  stripeConnectInstance.then(() => {
253
253
  if (!this[`${method}InternalOnly`]) {
254
- throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.42-preview-1`);
254
+ throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.43-preview-2`);
255
255
  }
256
256
  this[`${method}InternalOnly`](value);
257
257
  });
@@ -305,7 +305,7 @@ const createWrapper = stripeConnect => {
305
305
  sdk: true,
306
306
  sdkOptions: {
307
307
  // This will be replaced by the npm package version when bundling
308
- sdkVersion: "3.3.42-preview-1"
308
+ sdkVersion: "3.3.43-preview-2"
309
309
  }
310
310
  })
311
311
  }));
package/dist/connect.js CHANGED
@@ -255,7 +255,7 @@ const initStripeConnect = (stripePromise, initParams) => {
255
255
  element[method] = function (value) {
256
256
  stripeConnectInstance.then(() => {
257
257
  if (!this[`${method}InternalOnly`]) {
258
- throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.42-preview-1`);
258
+ throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.43-preview-2`);
259
259
  }
260
260
  this[`${method}InternalOnly`](value);
261
261
  });
@@ -309,7 +309,7 @@ const createWrapper = stripeConnect => {
309
309
  sdk: true,
310
310
  sdkOptions: {
311
311
  // This will be replaced by the npm package version when bundling
312
- sdkVersion: "3.3.42-preview-1"
312
+ sdkVersion: "3.3.43-preview-2"
313
313
  }
314
314
  })
315
315
  }));
package/dist/pure.esm.js CHANGED
@@ -251,7 +251,7 @@ const initStripeConnect = (stripePromise, initParams) => {
251
251
  element[method] = function (value) {
252
252
  stripeConnectInstance.then(() => {
253
253
  if (!this[`${method}InternalOnly`]) {
254
- throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.42-preview-1`);
254
+ throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.43-preview-2`);
255
255
  }
256
256
  this[`${method}InternalOnly`](value);
257
257
  });
@@ -305,7 +305,7 @@ const createWrapper = stripeConnect => {
305
305
  sdk: true,
306
306
  sdkOptions: {
307
307
  // This will be replaced by the npm package version when bundling
308
- sdkVersion: "3.3.42-preview-1"
308
+ sdkVersion: "3.3.43-preview-2"
309
309
  }
310
310
  })
311
311
  }));
package/dist/pure.js CHANGED
@@ -255,7 +255,7 @@ const initStripeConnect = (stripePromise, initParams) => {
255
255
  element[method] = function (value) {
256
256
  stripeConnectInstance.then(() => {
257
257
  if (!this[`${method}InternalOnly`]) {
258
- throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.42-preview-1`);
258
+ throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.43-preview-2`);
259
259
  }
260
260
  this[`${method}InternalOnly`](value);
261
261
  });
@@ -309,7 +309,7 @@ const createWrapper = stripeConnect => {
309
309
  sdk: true,
310
310
  sdkOptions: {
311
311
  // This will be replaced by the npm package version when bundling
312
- sdkVersion: "3.3.42-preview-1"
312
+ sdkVersion: "3.3.43-preview-2"
313
313
  }
314
314
  })
315
315
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "3.3.42-preview-1",
3
+ "version": "3.3.43-preview-2",
4
4
  "description": "Connect.js loading utility package",
5
5
  "main": "dist/connect.js",
6
6
  "module": "dist/connect.esm.js",
package/types/shared.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import type {
2
2
  ConnectElementCustomMethodConfig,
3
3
  ConnectElementCommonMethodConfig,
4
+ EmbeddedError,
5
+ EmbeddedErrorType,
4
6
  } from "./config";
5
7
  export declare type LoadConnectAndInitialize = (
6
8
  initParams: IStripeConnectInitParams
@@ -417,6 +419,67 @@ export type IStripeConnectUpdateParams = {
417
419
  locale?: string;
418
420
  };
419
421
 
422
+ /**
423
+ * Reasons why risk signals collection was skipped.
424
+ */
425
+ export declare type RiskSignalsCollectionSkippedReason =
426
+ /**
427
+ * Required component (account_onboarding) not enabled.
428
+ */
429
+ | "required_component_not_enabled"
430
+ /**
431
+ * The account doesn't have a risk signals collection requirement.
432
+ */
433
+ | "not_required"
434
+ /**
435
+ * The risk signals collection requirement has already been fulfilled.
436
+ */
437
+ | "requirement_fulfilled";
438
+
439
+ /**
440
+ * Error types that can occur during risk signals collection.
441
+ */
442
+ export declare type RiskSignalsCollectionErrorType = Extract<
443
+ EmbeddedErrorType,
444
+ | "api_connection_error"
445
+ | "invalid_request_error"
446
+ | "rate_limit_error"
447
+ | "api_error"
448
+ >;
449
+
450
+ /**
451
+ * Errors that can occur during risk signals collection.
452
+ */
453
+ export declare type RiskSignalsCollectionError =
454
+ /**
455
+ * Error occurred during general Connect.js loading.
456
+ */
457
+ | { type: "load_error"; loadError: EmbeddedError }
458
+
459
+ /**
460
+ * Error occurred during risk signals collection.
461
+ */
462
+ | { type: RiskSignalsCollectionErrorType; message?: string };
463
+
464
+ /**
465
+ * Event emitted during risk signals collection.
466
+ */
467
+ export declare type RiskSignalsCollectionEvent =
468
+ /**
469
+ * Risk signals collection completed and successfully received by Stripe.
470
+ */
471
+ | { status: "completed" }
472
+
473
+ /**
474
+ * Risk signals collection skipped with reason.
475
+ */
476
+ | { status: "skipped"; skippedReason: RiskSignalsCollectionSkippedReason }
477
+
478
+ /**
479
+ * Risk signals collection failed due to error and was not sent to Stripe server.
480
+ */
481
+ | { status: "failed"; error: RiskSignalsCollectionError };
482
+
420
483
  /**
421
484
  * Initialization parameters for Connect JS. See https://stripe.com/docs/connect/get-started-connect-embedded-components#configuring-connect-js for more details.
422
485
  */
@@ -447,6 +510,12 @@ export interface IStripeConnectInitParams {
447
510
  * An array of custom fonts, which embedded components created from a ConnectInstance can use.
448
511
  */
449
512
  fonts?: Array<CssFontSource | CustomFontSource>;
513
+
514
+ /**
515
+ * Callback for risk signals collection event
516
+ * @param {RiskSignalsCollectionEvent} event - The risk signals collection event containing status and additional details.
517
+ */
518
+ onRiskSignalsCollection?: (event: RiskSignalsCollectionEvent) => void;
450
519
  }
451
520
 
452
521
  type ConnectElementCustomMethods = typeof ConnectElementCustomMethodConfig;