@amos.com/react-amos-js 0.3.15 → 0.3.17
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 +5 -15
- package/package.json +3 -3
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`, `
|
|
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 {
|
|
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:** `
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"vite-plugin-dts": "5.0.2"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@amos.com/amos-js": "0.3.
|
|
48
|
-
"@amos.com/node": "0.1.
|
|
47
|
+
"@amos.com/amos-js": "0.3.19",
|
|
48
|
+
"@amos.com/node": "0.1.23",
|
|
49
49
|
"@types/googlepay": "0.7.11"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|