@amos.com/react-amos-js 0.11.17 → 0.11.18
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 +2 -2
- package/dist/index.d.ts +3 -0
- package/package.json +2 -2
- package/src/index.tsx +5 -0
package/README.md
CHANGED
|
@@ -586,7 +586,7 @@ When `requireAchVerification` is true (or `intent` is `"setup"`), and the render
|
|
|
586
586
|
|
|
587
587
|
**Optional props:** same as `AmosCreditCardPaymentMethodForm` — `appearance`, `billingAddressRequirement`, `defaultValues`, `onValidityChange` (`isValid` is also true after Plaid returns credentials), `onEscapeKeyPressed` — plus:
|
|
588
588
|
|
|
589
|
-
- `requireAchVerification` (`boolean`, defaults to `false`) — when true, show Plaid Embedded Link instead of routing/account fields. Ignored for `intent="setup"` (always Plaid) and when the render token has bank `verification: false`. Hosts that still have an ACH threshold should compute this themselves and pass a new value when the charge changes.
|
|
589
|
+
- `requireAchVerification` (`boolean`, defaults to `false`) — when true, show Plaid Embedded Link instead of routing/account fields. Ignored for `intent="setup"` (always Plaid) and when the render token has bank `verification: false`. Hosts that still have an ACH threshold should compute this themselves and pass a new value when the charge changes. Changing this prop hides or shows Link; it does not remount the bank form or destroy the Embedded handler.
|
|
590
590
|
- `intent` (`"payment" | "setup"`, defaults to `"payment"`) — `"setup"` always shows Plaid unless the render token disables verification. Use this when saving a bank account for later charges.
|
|
591
591
|
|
|
592
592
|
```tsx
|
|
@@ -700,7 +700,7 @@ Re-export from `@amos.com/amos-js`. Fills omitted Inter `fonts` / `--font-family
|
|
|
700
700
|
- **Amount format**: for `AmosGooglePayButton` and `AmosApplePayButton`, `amount` is a major-currency decimal string (e.g. `"50.00"` for $50.00). For `components["schemas"]["CreatePaymentIntentInput"]` on the server (card/bank create, and the object the wallet iframe sends to `onConfirm`), `amount` is a number in cents (e.g. `5000`).
|
|
701
701
|
- **Embed host / CSP**: iframes load from `https://js.amos.com` (production) and `https://js-sandbox.amos.com` (sandbox) via `getEmbedOrigin`. Parent pages that pin CSP must allow `frame-src https://js.amos.com https://js-sandbox.amos.com` (and `Permissions-Policy payment=` for those origins) **before** upgrading this package. Older SDK versions still load `embed.amos.com` / `embed-sandbox.amos.com`.
|
|
702
702
|
- **Iframe handshake**: iframe URLs include canonical search params so the embed does not 307. If the document loads but never posts `IFRAME_READY`, the SDK rewrites `src` once with `amosReload`. Appearance is applied after handshake; the iframe stays hidden until `UPDATED_APPEARANCE`, or for 1.5s after `IFRAME_READY` if appearance never acks.
|
|
703
|
-
- **Plaid Embedded Link (ACH verification)**: load `cdn.plaid.com` from the **parent** document (see CSP on `AmosBankAccountPaymentMethodForm`). Merchants do not proxy Pay API; the bank iframe mints link tokens. Pass `requireAchVerification` when the host wants Plaid, or `intent="setup"` to always show it, unless the render token disables verification. Confirm still goes through the bank iframe so Amos can attach `plaid` to the payment method. While Link loads, the SDK shows a 350px pulse skeleton until `onLoad` (1.5s fallback) — do not overlay a host loader.
|
|
703
|
+
- **Plaid Embedded Link (ACH verification)**: load `cdn.plaid.com` from the **parent** document (see CSP on `AmosBankAccountPaymentMethodForm`). Merchants do not proxy Pay API; the bank iframe mints link tokens. Pass `requireAchVerification` when the host wants Plaid, or `intent="setup"` to always show it, unless the render token disables verification. Toggling that prop hides or shows the existing Embedded handler — it does not reload Institution Search. Confirm still goes through the bank iframe so Amos can attach `plaid` to the payment method. While Link loads, the SDK shows a 350px pulse skeleton until `onLoad` (1.5s fallback) — do not overlay a host loader.
|
|
704
704
|
- **Apple Pay waiting overlay**: on browsers where Apple's QR handoff opens in a popup (non-Safari), `AmosApplePayButton` shows a fixed full-viewport overlay on the host page. **Cancel payment** is available until the buyer authorizes; after that the overlay shows **Completing your payment…** with no Cancel, then hides when `onConfirm` settles. Avoid stacking other fixed UI above it.
|
|
705
705
|
- **Going framework-free**: if you need to use Amos outside of React (vanilla JS, another framework, etc.), use [`@amos.com/amos-js`](../amos-js) directly.
|
|
706
706
|
|
package/dist/index.d.ts
CHANGED
|
@@ -136,6 +136,9 @@ type AmosBankAccountPaymentMethodFormProps = IframePassthroughProps & {
|
|
|
136
136
|
* is `"setup"` (setup always shows Plaid) or when the render token
|
|
137
137
|
* disables verification.
|
|
138
138
|
*
|
|
139
|
+
* Changing this prop hides or shows Link; it does not remount the
|
|
140
|
+
* bank form or destroy the Embedded handler.
|
|
141
|
+
*
|
|
139
142
|
* @default false
|
|
140
143
|
*/
|
|
141
144
|
requireAchVerification?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amos.com/react-amos-js",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.18",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"vite-plugin-dts": "5.0.3"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@amos.com/amos-js": "0.11.
|
|
60
|
+
"@amos.com/amos-js": "0.11.18",
|
|
61
61
|
"@types/googlepay": "0.7.12"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
package/src/index.tsx
CHANGED
|
@@ -416,6 +416,9 @@ type AmosBankAccountPaymentMethodFormProps = IframePassthroughProps & {
|
|
|
416
416
|
* is `"setup"` (setup always shows Plaid) or when the render token
|
|
417
417
|
* disables verification.
|
|
418
418
|
*
|
|
419
|
+
* Changing this prop hides or shows Link; it does not remount the
|
|
420
|
+
* bank form or destroy the Embedded handler.
|
|
421
|
+
*
|
|
419
422
|
* @default false
|
|
420
423
|
*/
|
|
421
424
|
requireAchVerification?: boolean;
|
|
@@ -458,6 +461,8 @@ export function AmosBankAccountPaymentMethodForm({
|
|
|
458
461
|
onValidityChange,
|
|
459
462
|
onEscapeKeyPressed,
|
|
460
463
|
},
|
|
464
|
+
// `requireAchVerification` is an update, not a remount: amos-js hides
|
|
465
|
+
// Embedded Link instead of destroying it when the flag flips.
|
|
461
466
|
remountDeps: [renderToken, billingAddressRequirement, intent],
|
|
462
467
|
iframePassthrough: { style, ...rest },
|
|
463
468
|
updateDeps: [
|