@amos.com/react-amos-js 0.3.7 → 0.3.8
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/dist/index.d.ts +66 -1
- package/package.json +10 -10
- package/dist/src/index.d.ts +0 -66
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,67 @@
|
|
|
1
1
|
/// <reference types="googlepay" />
|
|
2
|
-
|
|
2
|
+
import { Appearance, CreditCardAdditionalFields } from '@amos.com/amos-js';
|
|
3
|
+
import { components } from '@amos.com/node';
|
|
4
|
+
import { ComponentProps, RefObject } from 'react';
|
|
5
|
+
export type { Appearance, AppearanceLabels, CreateCustomerInput, CreatePaymentIntentInput, CreateSetupIntentInput, CreditCardAdditionalFields, EmbedToken, EmbedTokenJwt, Message, PaymentIntent, RenderTokenJwt, SetupIntent, ThemeVariable, } from '@amos.com/amos-js';
|
|
6
|
+
export { createMessage, decodeJwt, formatGooglePayPaymentData, getEmbedOrigin, } from '@amos.com/amos-js';
|
|
7
|
+
type IframeRef = RefObject<HTMLIFrameElement | null> | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Validate the embedded card/bank iframe form before payment
|
|
10
|
+
* confirmation.
|
|
11
|
+
*
|
|
12
|
+
* Resolves to `true` if the form is valid, `false` if it is not, or
|
|
13
|
+
* `false` if the iframe does not respond within 5 seconds.
|
|
14
|
+
*/
|
|
15
|
+
export declare function validateForm({ iframeRef, }: {
|
|
16
|
+
iframeRef: IframeRef;
|
|
17
|
+
}): Promise<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* Confirm a payment intent in the embedded iframe flow.
|
|
20
|
+
*
|
|
21
|
+
* Pass the embed JWT (`token`) returned by your server's
|
|
22
|
+
* `POST /payment_intents` call.
|
|
23
|
+
*/
|
|
24
|
+
export declare function confirmPaymentIntent({ iframeRef, token, }: {
|
|
25
|
+
iframeRef: IframeRef;
|
|
26
|
+
} & Pick<components["schemas"]["EmbedToken"], "token">): void;
|
|
27
|
+
/**
|
|
28
|
+
* Confirm a setup intent in the embedded iframe flow. Use this when
|
|
29
|
+
* saving a payment method for future use.
|
|
30
|
+
*
|
|
31
|
+
* Pass the embed JWT (`token`) returned by your server's
|
|
32
|
+
* `POST /setup_intents` call.
|
|
33
|
+
*/
|
|
34
|
+
export declare function confirmSetupIntent({ iframeRef, token, }: {
|
|
35
|
+
iframeRef: IframeRef;
|
|
36
|
+
} & Pick<components["schemas"]["EmbedToken"], "token">): void;
|
|
37
|
+
type IframePassthroughProps = Omit<ComponentProps<"iframe">, "src" | "title" | "name" | "role" | "allow">;
|
|
38
|
+
type AmosCreditCardPaymentMethodFormProps = IframePassthroughProps & {
|
|
39
|
+
renderToken: string;
|
|
40
|
+
appearance?: Appearance;
|
|
41
|
+
onPaymentIntentConfirmationSucceeded?: (paymentIntent: components["schemas"]["PaymentIntent"]) => void;
|
|
42
|
+
onSetupIntentConfirmationSucceeded?: (setupIntent: components["schemas"]["SetupIntent"]) => void;
|
|
43
|
+
onConfirmationFailed: (errorMessage: string) => void;
|
|
44
|
+
additionalFields?: CreditCardAdditionalFields;
|
|
45
|
+
};
|
|
46
|
+
export declare function AmosCreditCardPaymentMethodForm({ ref, renderToken, appearance, onPaymentIntentConfirmationSucceeded, onSetupIntentConfirmationSucceeded, onConfirmationFailed, additionalFields, style, ...rest }: AmosCreditCardPaymentMethodFormProps): import("react").JSX.Element;
|
|
47
|
+
type AmosBankAccountPaymentMethodFormProps = IframePassthroughProps & {
|
|
48
|
+
renderToken: string;
|
|
49
|
+
appearance?: Appearance;
|
|
50
|
+
onPaymentIntentConfirmationSucceeded?: (paymentIntent: components["schemas"]["PaymentIntent"]) => void;
|
|
51
|
+
onSetupIntentConfirmationSucceeded?: (setupIntent: components["schemas"]["SetupIntent"]) => void;
|
|
52
|
+
onConfirmationFailed: (errorMessage: string) => void;
|
|
53
|
+
};
|
|
54
|
+
export declare function AmosBankAccountPaymentMethodForm({ ref, renderToken, appearance, onPaymentIntentConfirmationSucceeded, onSetupIntentConfirmationSucceeded, onConfirmationFailed, style, ...rest }: AmosBankAccountPaymentMethodFormProps): import("react").JSX.Element;
|
|
55
|
+
type AmosGooglePayButtonProps = IframePassthroughProps & {
|
|
56
|
+
renderToken: string;
|
|
57
|
+
amount: string;
|
|
58
|
+
merchantName: string;
|
|
59
|
+
appearance?: Appearance;
|
|
60
|
+
onInitiatePaymentIntentRequest: ({ paymentIntentCreateAttributes, customerCreateAttributes, }: {
|
|
61
|
+
paymentIntentCreateAttributes: components["schemas"]["CreatePaymentIntentInput"];
|
|
62
|
+
customerCreateAttributes: components["schemas"]["CreateCustomerInput"];
|
|
63
|
+
}) => Promise<components["schemas"]["EmbedToken"]["token"]>;
|
|
64
|
+
onPaymentIntentConfirmationSucceeded: (paymentIntent: components["schemas"]["PaymentIntent"]) => void;
|
|
65
|
+
onConfirmationFailed: (errorMessage: string) => void;
|
|
66
|
+
};
|
|
67
|
+
export declare function AmosGooglePayButton({ ref, renderToken, amount, merchantName, appearance, onInitiatePaymentIntentRequest, onPaymentIntentConfirmationSucceeded, onConfirmationFailed, style, ...rest }: AmosGooglePayButtonProps): import("react").JSX.Element;
|
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.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"author": "Amos",
|
|
36
36
|
"description": "React SDK for embedding Amos payment methods via iframes. Wraps @amos.com/amos-js.",
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@biomejs/biome": "2.
|
|
39
|
-
"@changesets/cli": "
|
|
40
|
-
"@types/node": "
|
|
41
|
-
"@types/react": "19.2.
|
|
38
|
+
"@biomejs/biome": "2.5.1",
|
|
39
|
+
"@changesets/cli": "2.31.0",
|
|
40
|
+
"@types/node": "26.0.0",
|
|
41
|
+
"@types/react": "19.2.17",
|
|
42
42
|
"typescript": "6.0.3",
|
|
43
|
-
"vite": "8.0
|
|
44
|
-
"vite-plugin-dts": "
|
|
43
|
+
"vite": "8.1.0",
|
|
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.
|
|
49
|
-
"@types/googlepay": "0.7.
|
|
47
|
+
"@amos.com/amos-js": "0.3.11",
|
|
48
|
+
"@amos.com/node": "0.1.14",
|
|
49
|
+
"@types/googlepay": "0.7.11"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": "^17 || ^18 || ^19"
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Appearance, CreditCardAdditionalFields } from '@amos.com/amos-js';
|
|
2
|
-
import { components } from '@amos.com/node';
|
|
3
|
-
import { ComponentProps, RefObject } from 'react';
|
|
4
|
-
export type { Appearance, AppearanceLabels, CreateCustomerInput, CreatePaymentIntentInput, CreateSetupIntentInput, CreditCardAdditionalFields, EmbedToken, EmbedTokenJwt, Message, PaymentIntent, RenderTokenJwt, SetupIntent, ThemeVariable, } from '@amos.com/amos-js';
|
|
5
|
-
export { createMessage, decodeJwt, formatGooglePayPaymentData, getEmbedOrigin, } from '@amos.com/amos-js';
|
|
6
|
-
type IframeRef = RefObject<HTMLIFrameElement | null> | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Validate the embedded card/bank iframe form before payment
|
|
9
|
-
* confirmation.
|
|
10
|
-
*
|
|
11
|
-
* Resolves to `true` if the form is valid, `false` if it is not, or
|
|
12
|
-
* `false` if the iframe does not respond within 5 seconds.
|
|
13
|
-
*/
|
|
14
|
-
export declare function validateForm({ iframeRef, }: {
|
|
15
|
-
iframeRef: IframeRef;
|
|
16
|
-
}): Promise<boolean>;
|
|
17
|
-
/**
|
|
18
|
-
* Confirm a payment intent in the embedded iframe flow.
|
|
19
|
-
*
|
|
20
|
-
* Pass the embed JWT (`token`) returned by your server's
|
|
21
|
-
* `POST /payment_intents` call.
|
|
22
|
-
*/
|
|
23
|
-
export declare function confirmPaymentIntent({ iframeRef, token, }: {
|
|
24
|
-
iframeRef: IframeRef;
|
|
25
|
-
} & Pick<components["schemas"]["EmbedToken"], "token">): void;
|
|
26
|
-
/**
|
|
27
|
-
* Confirm a setup intent in the embedded iframe flow. Use this when
|
|
28
|
-
* saving a payment method for future use.
|
|
29
|
-
*
|
|
30
|
-
* Pass the embed JWT (`token`) returned by your server's
|
|
31
|
-
* `POST /setup_intents` call.
|
|
32
|
-
*/
|
|
33
|
-
export declare function confirmSetupIntent({ iframeRef, token, }: {
|
|
34
|
-
iframeRef: IframeRef;
|
|
35
|
-
} & Pick<components["schemas"]["EmbedToken"], "token">): void;
|
|
36
|
-
type IframePassthroughProps = Omit<ComponentProps<"iframe">, "src" | "title" | "name" | "role" | "allow">;
|
|
37
|
-
type AmosCreditCardPaymentMethodFormProps = IframePassthroughProps & {
|
|
38
|
-
renderToken: string;
|
|
39
|
-
appearance?: Appearance;
|
|
40
|
-
onPaymentIntentConfirmationSucceeded?: (paymentIntent: components["schemas"]["PaymentIntent"]) => void;
|
|
41
|
-
onSetupIntentConfirmationSucceeded?: (setupIntent: components["schemas"]["SetupIntent"]) => void;
|
|
42
|
-
onConfirmationFailed: (errorMessage: string) => void;
|
|
43
|
-
additionalFields?: CreditCardAdditionalFields;
|
|
44
|
-
};
|
|
45
|
-
export declare function AmosCreditCardPaymentMethodForm({ ref, renderToken, appearance, onPaymentIntentConfirmationSucceeded, onSetupIntentConfirmationSucceeded, onConfirmationFailed, additionalFields, style, ...rest }: AmosCreditCardPaymentMethodFormProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
type AmosBankAccountPaymentMethodFormProps = IframePassthroughProps & {
|
|
47
|
-
renderToken: string;
|
|
48
|
-
appearance?: Appearance;
|
|
49
|
-
onPaymentIntentConfirmationSucceeded?: (paymentIntent: components["schemas"]["PaymentIntent"]) => void;
|
|
50
|
-
onSetupIntentConfirmationSucceeded?: (setupIntent: components["schemas"]["SetupIntent"]) => void;
|
|
51
|
-
onConfirmationFailed: (errorMessage: string) => void;
|
|
52
|
-
};
|
|
53
|
-
export declare function AmosBankAccountPaymentMethodForm({ ref, renderToken, appearance, onPaymentIntentConfirmationSucceeded, onSetupIntentConfirmationSucceeded, onConfirmationFailed, style, ...rest }: AmosBankAccountPaymentMethodFormProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
type AmosGooglePayButtonProps = IframePassthroughProps & {
|
|
55
|
-
renderToken: string;
|
|
56
|
-
amount: string;
|
|
57
|
-
merchantName: string;
|
|
58
|
-
appearance?: Appearance;
|
|
59
|
-
onInitiatePaymentIntentRequest: ({ paymentIntentCreateAttributes, customerCreateAttributes, }: {
|
|
60
|
-
paymentIntentCreateAttributes: components["schemas"]["CreatePaymentIntentInput"];
|
|
61
|
-
customerCreateAttributes: components["schemas"]["CreateCustomerInput"];
|
|
62
|
-
}) => Promise<components["schemas"]["EmbedToken"]["token"]>;
|
|
63
|
-
onPaymentIntentConfirmationSucceeded: (paymentIntent: components["schemas"]["PaymentIntent"]) => void;
|
|
64
|
-
onConfirmationFailed: (errorMessage: string) => void;
|
|
65
|
-
};
|
|
66
|
-
export declare function AmosGooglePayButton({ ref, renderToken, amount, merchantName, appearance, onInitiatePaymentIntentRequest, onPaymentIntentConfirmationSucceeded, onConfirmationFailed, style, ...rest }: AmosGooglePayButtonProps): import("react/jsx-runtime").JSX.Element;
|