@amos.com/react-amos-js 0.3.15 → 0.3.16

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.
Files changed (2) hide show
  1. package/README.md +5 -15
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -14,7 +14,7 @@ npm install @amos.com/react-amos-js
14
14
 
15
15
  - React components for the iframe payment method forms: `AmosCreditCardPaymentMethodForm`, `AmosBankAccountPaymentMethodForm`, `AmosGooglePayButton`.
16
16
  - React-flavoured iframe message helpers that accept a React `ref`: `validateForm({ iframeRef })`, `confirmPaymentIntent({ iframeRef, token })`, `confirmSetupIntent({ iframeRef, token })`.
17
- - Re-exports of the `@amos.com/amos-js` helpers and types that come up in client code: `createMessage`, `decodeJwt`, `getEmbedOrigin`, `formatGooglePayPaymentData`, `Appearance`, `Message`, `PaymentIntent`, `SetupIntent`, `EmbedToken`, etc.
17
+ - Re-exports of the `@amos.com/amos-js` helpers and types that come up in client code: `createMessage`, `decodeJwt`, `getEmbedOrigin`, `formatGooglePayPaymentData`, `FormattedGooglePayPaymentData`, `Appearance`, `Message`, etc.
18
18
 
19
19
  > **Note:** A server-side SDK (for example `@amos.com/node`) must be used alongside `@amos.com/react-amos-js` for end-to-end payment processing. `@amos.com/react-amos-js` is the client-side half.
20
20
 
@@ -129,7 +129,7 @@ import {
129
129
  confirmPaymentIntent,
130
130
  validateForm,
131
131
  } from "@amos.com/react-amos-js";
132
- import type { CreatePaymentIntentInput } from "@amos.com/react-amos-js";
132
+ import type { components } from "@amos.com/node";
133
133
 
134
134
  function CheckoutForm() {
135
135
  const iframeRef = useRef<HTMLIFrameElement>(null);
@@ -150,7 +150,7 @@ function CheckoutForm() {
150
150
  return;
151
151
  }
152
152
 
153
- const paymentIntentCreateAttributes: CreatePaymentIntentInput = {
153
+ const paymentIntentCreateAttributes: components["schemas"]["CreatePaymentIntentInput"] = {
154
154
  amount: 5000, // $50.00 in cents
155
155
  capture_method: "automatic",
156
156
  };
@@ -409,7 +409,7 @@ Transforms Google Pay payment data into an Amos-compatible `paymentMethod` paylo
409
409
 
410
410
  - `paymentData` (`google.payments.api.PaymentData`, required)
411
411
 
412
- **Returns:** `{ paymentMethod: { ... } }`
412
+ **Returns:** `FormattedGooglePayPaymentData` — the `paymentMethod` field is typed for embed confirm endpoints, so no extra type assertions are needed at call sites.
413
413
 
414
414
  ### `createMessage(message)` / `decodeJwt(token)` / `getEmbedOrigin(renderToken)`
415
415
 
@@ -417,17 +417,7 @@ Re-exports of the same advanced helpers exposed by `@amos.com/amos-js`. Most int
417
417
 
418
418
  ### Exported types
419
419
 
420
- `@amos.com/react-amos-js` re-exports the handful of OpenAPI-generated types it uses in its own component / callback signatures (and which you'll likely use in your call sites):
421
-
422
- - `CreateCustomerInput`
423
- - `CreatePaymentIntentInput`
424
- - `CreateSetupIntentInput`
425
- - `PaymentIntent`
426
- - `SetupIntent`
427
- - `EmbedToken`
428
- - `EmbedTokenJwt`
429
- - `RenderTokenJwt`
430
- - `Message`, `Appearance`, `ThemeVariable`, `CreditCardAdditionalFields`
420
+ `@amos.com/react-amos-js` re-exports everything from `@amos.com/amos-js`, including `FormattedGooglePayPaymentData`, `Message`, `Appearance`, `ThemeVariable`, and the per-form `*Options` / `*Controller` types. For OpenAPI schema types (e.g. `PaymentIntent`, `CreatePaymentIntentInput`), import `components` from `@amos.com/node`.
431
421
 
432
422
  ## Notes and potential gotchas
433
423
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amos.com/react-amos-js",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "main": "dist/index.js",
5
5
  "repository": {
6
6
  "type": "git",