@bunnyapp/components 1.0.15 → 1.0.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.
- package/dist/cjs/index.js +295 -243
- package/dist/cjs/src/components/BillingDetails/BillingDetails.d.ts +7 -2
- package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +3 -2
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +3 -2
- package/dist/cjs/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +3 -2
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +4 -3
- package/dist/cjs/src/components/Signup/Signup.d.ts +1 -3
- package/dist/cjs/src/contexts/PaymentContext.d.ts +2 -1
- package/dist/cjs/src/hooks/usePaymentMethod.d.ts +1 -1
- package/dist/cjs/src/hooks/useToken.d.ts +2 -0
- package/dist/esm/index.js +296 -244
- package/dist/esm/src/components/BillingDetails/BillingDetails.d.ts +7 -2
- package/dist/esm/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +3 -2
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +3 -2
- package/dist/esm/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +3 -2
- package/dist/esm/src/components/Signup/PaymentForms.d.ts +4 -3
- package/dist/esm/src/components/Signup/Signup.d.ts +1 -3
- package/dist/esm/src/contexts/PaymentContext.d.ts +2 -1
- package/dist/esm/src/hooks/usePaymentMethod.d.ts +1 -1
- package/dist/esm/src/hooks/useToken.d.ts +2 -0
- package/dist/index.d.ts +9 -6
- package/package.json +1 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import "../../styles/index.less";
|
|
2
2
|
import { ShadowType } from "../../types/shadowType";
|
|
3
|
-
declare const BillingDetails: ({ entityId,
|
|
3
|
+
declare const BillingDetails: ({ entityId, isCardEnabled, shadow, className, accountId: accountIdProp, hidePaymentMethodForm, countryListFilter, }: {
|
|
4
4
|
entityId: string;
|
|
5
|
-
accountId: string;
|
|
6
5
|
isCardEnabled?: boolean | undefined;
|
|
7
6
|
shadow?: ShadowType | undefined;
|
|
8
7
|
className?: string | undefined;
|
|
8
|
+
accountId?: string | undefined;
|
|
9
|
+
hidePaymentMethodForm?: boolean | undefined;
|
|
10
|
+
countryListFilter?: ((country: {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}) => boolean) | undefined;
|
|
9
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
15
|
export default BillingDetails;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { FormattedInvoice, PaymentMethod, Quote } from "@bunnyapp/common";
|
|
2
|
-
export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, }: {
|
|
1
|
+
import { FormattedInvoice, PaymentMethod, PluginData, Quote } from "@bunnyapp/common";
|
|
2
|
+
export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, plugin, }: {
|
|
3
3
|
onPaymentSuccess: (response: any) => void;
|
|
4
4
|
onPaymentError?: (error: any) => void;
|
|
5
5
|
quote?: Quote;
|
|
6
6
|
invoice?: FormattedInvoice;
|
|
7
7
|
storedPaymentMethod?: PaymentMethod;
|
|
8
|
+
plugin: PluginData | undefined;
|
|
8
9
|
}): {
|
|
9
10
|
pay: () => Promise<void>;
|
|
10
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FormattedInvoice, Quote } from "@bunnyapp/common";
|
|
1
|
+
import { FormattedInvoice, PluginData, Quote } from "@bunnyapp/common";
|
|
2
2
|
import { GraphQLClient } from "graphql-request";
|
|
3
|
-
export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, }: {
|
|
3
|
+
export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, }: {
|
|
4
4
|
entityId: string;
|
|
5
5
|
invoice?: FormattedInvoice | undefined;
|
|
6
6
|
quote?: Quote | undefined;
|
|
@@ -10,4 +10,5 @@ export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess
|
|
|
10
10
|
accountId?: string | undefined;
|
|
11
11
|
overrideToken?: string | undefined;
|
|
12
12
|
graphQLClient: GraphQLClient;
|
|
13
|
+
customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
|
|
13
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { FormattedInvoice, PaymentMethod, Quote } from "@bunnyapp/common";
|
|
2
|
-
export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, }: {
|
|
1
|
+
import { FormattedInvoice, PaymentMethod, PluginData, Quote } from "@bunnyapp/common";
|
|
2
|
+
export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, plugin, }: {
|
|
3
3
|
onPaymentSuccess?: (response: any) => void;
|
|
4
4
|
onPaymentError?: (error: any) => void;
|
|
5
5
|
quote?: Quote;
|
|
6
6
|
invoice?: FormattedInvoice;
|
|
7
7
|
storedPaymentMethod?: PaymentMethod;
|
|
8
|
+
plugin: PluginData | undefined;
|
|
8
9
|
}): {
|
|
9
10
|
pay: () => Promise<void>;
|
|
10
11
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Quote } from "@bunnyapp/common";
|
|
2
|
-
export default function PaymentForms({ quote,
|
|
1
|
+
import { PluginData, Quote } from "@bunnyapp/common";
|
|
2
|
+
export default function PaymentForms({ quote, handlePaymentSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, entityId, accountId, overrideToken, customCheckoutFunction, }: {
|
|
3
3
|
quote?: Quote;
|
|
4
|
-
|
|
4
|
+
handlePaymentSuccess: () => void;
|
|
5
5
|
handlePaymentFail: (error: any) => void;
|
|
6
6
|
handleSubmit: (formData: FormData) => void;
|
|
7
7
|
proceedingToPayment: boolean;
|
|
8
8
|
entityId: string;
|
|
9
9
|
accountId?: string;
|
|
10
10
|
overrideToken?: string;
|
|
11
|
+
customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
|
|
11
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export type FormData = {
|
|
13
14
|
firstName: string;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "../../styles/index.less";
|
|
3
3
|
import { ShadowType } from "../../types/shadowType";
|
|
4
|
-
export default function Signup({
|
|
5
|
-
/** The API token to use for the signup. Signup needs a Bunny api client token, not a portalSessionToken. */
|
|
6
|
-
apiToken: string;
|
|
4
|
+
export default function Signup({ companyName, entityId, priceListCode, returnUrl, isCardEnabled, className, shadow, style, }: {
|
|
7
5
|
/** The company name to display on the signup page */
|
|
8
6
|
companyName: string;
|
|
9
7
|
/** The entity ID to use for the signup */
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PaymentMethod } from "@bunnyapp/common";
|
|
2
|
+
import { PaymentMethod, PluginData } from "@bunnyapp/common";
|
|
3
3
|
export type PaymentContextValues = {
|
|
4
4
|
onClickCancel?: () => void;
|
|
5
5
|
accountId?: string;
|
|
6
6
|
overrideToken?: string;
|
|
7
7
|
storedPaymentMethod?: PaymentMethod;
|
|
8
|
+
customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
|
|
8
9
|
};
|
|
9
10
|
export declare const PaymentContext: import("react").Context<PaymentContextValues>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
export declare const usePaymentMethod: (graphQLClient: GraphQLClient
|
|
2
|
+
export declare const usePaymentMethod: (graphQLClient: GraphQLClient) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<any, Error>;
|