@amos.com/amos-js 0.9.17 → 0.10.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 +32 -4
- package/dist/index.d.ts +4 -2
- package/dist/index.js +108 -2
- package/dist/index.mjs +425 -170
- package/dist/messaging.d.ts +7 -0
- package/dist/mount.d.ts +23 -3
- package/dist/payment-method-form.d.ts +8 -1
- package/dist/plaid-bank-ui.d.ts +21 -0
- package/dist/plaid-session.d.ts +12 -0
- package/dist/plaid.d.ts +82 -0
- package/dist/types.d.ts +48 -2
- package/package.json +1 -1
- package/src/index.ts +15 -0
- package/src/messaging.ts +107 -16
- package/src/mount.ts +52 -4
- package/src/payment-method-form.ts +16 -0
- package/src/plaid-bank-ui.ts +421 -0
- package/src/plaid-session.ts +41 -0
- package/src/plaid.ts +215 -0
- package/src/types.ts +60 -2
package/src/types.ts
CHANGED
|
@@ -11,6 +11,26 @@ export type PaymentMethodFormValidityChangeEvent = {
|
|
|
11
11
|
isValid: boolean;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Detected card network from the PAN prefix inside the iframe.
|
|
16
|
+
* `null` when the field is empty or the digits do not match a known brand.
|
|
17
|
+
*/
|
|
18
|
+
export type CardBrand =
|
|
19
|
+
| "visa"
|
|
20
|
+
| "mastercard"
|
|
21
|
+
| "amex"
|
|
22
|
+
| "discover"
|
|
23
|
+
| "diners"
|
|
24
|
+
| "jcb";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* PCI-safe card brand update from the credit-card iframe. Does not
|
|
28
|
+
* include the PAN, last4, or BIN.
|
|
29
|
+
*/
|
|
30
|
+
export type PaymentMethodFormCardBrandChangeEvent = {
|
|
31
|
+
brand: CardBrand | null;
|
|
32
|
+
};
|
|
33
|
+
|
|
14
34
|
/**
|
|
15
35
|
* Why an interactive confirmation attempt ended with `status: "incomplete"`.
|
|
16
36
|
*
|
|
@@ -454,12 +474,18 @@ export type Message =
|
|
|
454
474
|
/** Parent → embed: confirm a payment intent with an embed token. */
|
|
455
475
|
type: "CONFIRM_PAYMENT_INTENT";
|
|
456
476
|
} & Pick<components["schemas"]["PaymentIntent"], "id"> &
|
|
457
|
-
Pick<components["schemas"]["EmbedToken"], "token">
|
|
477
|
+
Pick<components["schemas"]["EmbedToken"], "token"> & {
|
|
478
|
+
/** Present when ACH verification completed via Plaid Link in the parent. */
|
|
479
|
+
plaid?: components["schemas"]["PlaidCredentialsInput"];
|
|
480
|
+
})
|
|
458
481
|
| ({
|
|
459
482
|
/** Parent → embed: confirm a setup intent with an embed token. */
|
|
460
483
|
type: "CONFIRM_SETUP_INTENT";
|
|
461
484
|
} & Pick<components["schemas"]["SetupIntent"], "id"> &
|
|
462
|
-
Pick<components["schemas"]["EmbedToken"], "token">
|
|
485
|
+
Pick<components["schemas"]["EmbedToken"], "token"> & {
|
|
486
|
+
/** Present when ACH verification completed via Plaid Link in the parent. */
|
|
487
|
+
plaid?: components["schemas"]["PlaidCredentialsInput"];
|
|
488
|
+
})
|
|
463
489
|
| {
|
|
464
490
|
/**
|
|
465
491
|
* Embed → parent: the interactive confirmation flow finished.
|
|
@@ -498,6 +524,38 @@ export type Message =
|
|
|
498
524
|
*/
|
|
499
525
|
type: "FORM_VALIDITY_CHANGE";
|
|
500
526
|
isValid: boolean;
|
|
527
|
+
}
|
|
528
|
+
| {
|
|
529
|
+
/**
|
|
530
|
+
* Embed → parent: detected card brand changed. `brand` is the
|
|
531
|
+
* matched network, or `null` when the field is empty or the
|
|
532
|
+
* digits do not match a known brand. Does not include PCI data.
|
|
533
|
+
*/
|
|
534
|
+
type: "CARD_BRAND_CHANGE";
|
|
535
|
+
brand: CardBrand | null;
|
|
536
|
+
}
|
|
537
|
+
| {
|
|
538
|
+
/**
|
|
539
|
+
* Embed → parent: merchant ACH verification threshold for this
|
|
540
|
+
* render token. `achThreshold` is cents, or `null` when the
|
|
541
|
+
* merchant has no threshold (manual ACH). `requireVerification`
|
|
542
|
+
* is true when the fetch failed in production (fail closed).
|
|
543
|
+
*/
|
|
544
|
+
type: "ACH_THRESHOLD";
|
|
545
|
+
achThreshold?: number | null;
|
|
546
|
+
requireVerification?: boolean;
|
|
547
|
+
}
|
|
548
|
+
| {
|
|
549
|
+
/** Parent → embed: mint a Plaid Link token for Connect. */
|
|
550
|
+
type: "CREATE_PLAID_LINK_TOKEN";
|
|
551
|
+
requestId: string;
|
|
552
|
+
}
|
|
553
|
+
| {
|
|
554
|
+
/** Embed → parent: minted Plaid Link token, or `error`. */
|
|
555
|
+
type: "PLAID_LINK_TOKEN";
|
|
556
|
+
requestId: string;
|
|
557
|
+
link_token?: string;
|
|
558
|
+
error?: string;
|
|
501
559
|
};
|
|
502
560
|
|
|
503
561
|
/**
|