@bunnyapp/components 1.6.0-beta.19 → 1.6.0-beta.20

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 (118) hide show
  1. package/dist/cjs/index.js +1529 -1321
  2. package/dist/cjs/types/src/components/Checkout/QuoteCheckout.d.ts +1 -1
  3. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/CreditCard.d.ts +17 -13
  4. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/MiniCreditCard.d.ts +27 -0
  5. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/components/CardImage.d.ts +14 -0
  6. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/index.d.ts +1 -1
  7. package/dist/cjs/types/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +1 -6
  8. package/dist/cjs/types/src/components/PaymentForm/DemoPay/hooks/useApproveHold.d.ts +1 -1
  9. package/dist/cjs/types/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +4 -4
  10. package/dist/cjs/types/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +7 -16
  11. package/dist/cjs/types/src/components/PaymentForm/PaymentForm.d.ts +5 -6
  12. package/dist/cjs/types/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -6
  13. package/dist/cjs/types/src/components/PaymentForm/Stripe/hooks/useApproveHold.d.ts +1 -1
  14. package/dist/cjs/types/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +4 -4
  15. package/dist/cjs/types/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +4 -5
  16. package/dist/cjs/types/src/components/PaymentForm/Stripe/stripeUtils.d.ts +1 -1
  17. package/dist/cjs/types/src/components/PaymentForm/components/CheckoutFooter.d.ts +2 -0
  18. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodDetails.d.ts +2 -0
  19. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodFooter.d.ts +4 -0
  20. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodSelector.d.ts +2 -0
  21. package/dist/cjs/types/src/components/PaymentForm/context/CustomCheckoutFunctionContext.d.ts +5 -0
  22. package/dist/cjs/types/src/components/PaymentForm/context/OverrideTokenContext.d.ts +4 -0
  23. package/dist/cjs/types/src/components/PaymentForm/context/PaymentProvider.d.ts +31 -0
  24. package/dist/cjs/types/src/components/PaymentForm/context/SelectedPaymentPluginContext.d.ts +6 -0
  25. package/dist/cjs/types/src/components/PaymentForm/context/SelectedPluginProvider.d.ts +16 -0
  26. package/dist/cjs/types/src/components/PaymentForm/context/ShowPaymentDetailsContext.d.ts +5 -0
  27. package/dist/cjs/types/src/components/PaymentForm/fragments/PaymentForm_PaymentMethodsFragment.d.ts +10 -0
  28. package/dist/cjs/types/src/components/PaymentForm/hooks/useAutoSetDefaultPaymentMethod.d.ts +2 -5
  29. package/dist/cjs/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +24 -0
  30. package/dist/cjs/types/src/components/PaymentForm/hooks/usePayableCurrency.d.ts +6 -0
  31. package/dist/cjs/types/src/components/PaymentForm/hooks/useRemovePaymentMethod.d.ts +2 -0
  32. package/dist/cjs/types/src/components/PaymentForm/hooks/useSetDefaultPaymentMethod.d.ts +5 -0
  33. package/dist/cjs/types/src/components/PaymentForm/types/PaymentType.d.ts +5 -0
  34. package/dist/cjs/types/src/components/Signup/PaymentForms.d.ts +3 -4
  35. package/dist/cjs/types/src/components/Subscriptions/Subscriptions.d.ts +1 -1
  36. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/QuantityInput.d.ts +1 -1
  37. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +1 -1
  38. package/dist/cjs/types/src/graphql/queries/getCurrentUserData.d.ts +11 -7
  39. package/dist/cjs/types/src/hooks/useCurrentUserData.d.ts +11 -7
  40. package/dist/cjs/types/src/hooks/useIsMobile.d.ts +9 -0
  41. package/dist/cjs/types/src/hooks/usePaymentMethod.d.ts +47 -6
  42. package/dist/cjs/types/src/hooks/usePaymentPlugins.d.ts +13 -27
  43. package/dist/cjs/types/src/utils/QueryKeyFactory.d.ts +1 -0
  44. package/dist/cjs/types/src/utils/apiUtils/invokePlugin.d.ts +10 -0
  45. package/dist/esm/index.js +1549 -1341
  46. package/dist/esm/types/src/components/Checkout/QuoteCheckout.d.ts +1 -1
  47. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/CreditCard.d.ts +17 -13
  48. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/MiniCreditCard.d.ts +27 -0
  49. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/components/CardImage.d.ts +14 -0
  50. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/index.d.ts +1 -1
  51. package/dist/esm/types/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +1 -6
  52. package/dist/esm/types/src/components/PaymentForm/DemoPay/hooks/useApproveHold.d.ts +1 -1
  53. package/dist/esm/types/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +4 -4
  54. package/dist/esm/types/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +7 -16
  55. package/dist/esm/types/src/components/PaymentForm/PaymentForm.d.ts +5 -6
  56. package/dist/esm/types/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -6
  57. package/dist/esm/types/src/components/PaymentForm/Stripe/hooks/useApproveHold.d.ts +1 -1
  58. package/dist/esm/types/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +4 -4
  59. package/dist/esm/types/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +4 -5
  60. package/dist/esm/types/src/components/PaymentForm/Stripe/stripeUtils.d.ts +1 -1
  61. package/dist/esm/types/src/components/PaymentForm/components/CheckoutFooter.d.ts +2 -0
  62. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodDetails.d.ts +2 -0
  63. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodFooter.d.ts +4 -0
  64. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodSelector.d.ts +2 -0
  65. package/dist/esm/types/src/components/PaymentForm/context/CustomCheckoutFunctionContext.d.ts +5 -0
  66. package/dist/esm/types/src/components/PaymentForm/context/OverrideTokenContext.d.ts +4 -0
  67. package/dist/esm/types/src/components/PaymentForm/context/PaymentProvider.d.ts +31 -0
  68. package/dist/esm/types/src/components/PaymentForm/context/SelectedPaymentPluginContext.d.ts +6 -0
  69. package/dist/esm/types/src/components/PaymentForm/context/SelectedPluginProvider.d.ts +16 -0
  70. package/dist/esm/types/src/components/PaymentForm/context/ShowPaymentDetailsContext.d.ts +5 -0
  71. package/dist/esm/types/src/components/PaymentForm/fragments/PaymentForm_PaymentMethodsFragment.d.ts +10 -0
  72. package/dist/esm/types/src/components/PaymentForm/hooks/useAutoSetDefaultPaymentMethod.d.ts +2 -5
  73. package/dist/esm/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +24 -0
  74. package/dist/esm/types/src/components/PaymentForm/hooks/usePayableCurrency.d.ts +6 -0
  75. package/dist/esm/types/src/components/PaymentForm/hooks/useRemovePaymentMethod.d.ts +2 -0
  76. package/dist/esm/types/src/components/PaymentForm/hooks/useSetDefaultPaymentMethod.d.ts +5 -0
  77. package/dist/esm/types/src/components/PaymentForm/types/PaymentType.d.ts +5 -0
  78. package/dist/esm/types/src/components/Signup/PaymentForms.d.ts +3 -4
  79. package/dist/esm/types/src/components/Subscriptions/Subscriptions.d.ts +1 -1
  80. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/QuantityInput.d.ts +1 -1
  81. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +1 -1
  82. package/dist/esm/types/src/graphql/queries/getCurrentUserData.d.ts +11 -7
  83. package/dist/esm/types/src/hooks/useCurrentUserData.d.ts +11 -7
  84. package/dist/esm/types/src/hooks/useIsMobile.d.ts +9 -0
  85. package/dist/esm/types/src/hooks/usePaymentMethod.d.ts +47 -6
  86. package/dist/esm/types/src/hooks/usePaymentPlugins.d.ts +13 -27
  87. package/dist/esm/types/src/utils/QueryKeyFactory.d.ts +1 -0
  88. package/dist/esm/types/src/utils/apiUtils/invokePlugin.d.ts +10 -0
  89. package/dist/index.d.ts +26 -9
  90. package/package.json +1 -1
  91. package/dist/cjs/types/src/components/PaymentForm/CheckoutFooter.d.ts +0 -13
  92. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/LargCardIcon.d.ts +0 -2
  93. package/dist/cjs/types/src/components/PaymentForm/DemoPay/CreditCard/PlusIcon.d.ts +0 -4
  94. package/dist/cjs/types/src/components/PaymentForm/PaymentMethodDetails.d.ts +0 -7
  95. package/dist/cjs/types/src/components/PaymentForm/PaymentMethodSelector.d.ts +0 -7
  96. package/dist/cjs/types/src/components/PaymentForm/SavePaymentMethodFooter.d.ts +0 -6
  97. package/dist/cjs/types/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +0 -7
  98. package/dist/cjs/types/src/components/PaymentForm/hooks/usePaymentMethodSelectorPlugin.d.ts +0 -10
  99. package/dist/cjs/types/src/components/PaymentForm/useRemovePaymentMethod.d.ts +0 -3
  100. package/dist/cjs/types/src/components/PaymentForm/useSetDefaultPaymentMethod.d.ts +0 -6
  101. package/dist/cjs/types/src/contexts/PaymentContext.d.ts +0 -10
  102. package/dist/esm/types/src/components/PaymentForm/CheckoutFooter.d.ts +0 -13
  103. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/LargCardIcon.d.ts +0 -2
  104. package/dist/esm/types/src/components/PaymentForm/DemoPay/CreditCard/PlusIcon.d.ts +0 -4
  105. package/dist/esm/types/src/components/PaymentForm/PaymentMethodDetails.d.ts +0 -7
  106. package/dist/esm/types/src/components/PaymentForm/PaymentMethodSelector.d.ts +0 -7
  107. package/dist/esm/types/src/components/PaymentForm/SavePaymentMethodFooter.d.ts +0 -6
  108. package/dist/esm/types/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +0 -7
  109. package/dist/esm/types/src/components/PaymentForm/hooks/usePaymentMethodSelectorPlugin.d.ts +0 -10
  110. package/dist/esm/types/src/components/PaymentForm/useRemovePaymentMethod.d.ts +0 -3
  111. package/dist/esm/types/src/components/PaymentForm/useSetDefaultPaymentMethod.d.ts +0 -6
  112. package/dist/esm/types/src/contexts/PaymentContext.d.ts +0 -10
  113. /package/dist/cjs/types/src/components/PaymentForm/{CouponEditor.d.ts → components/CouponEditor.d.ts} +0 -0
  114. /package/dist/cjs/types/src/components/PaymentForm/{PaymentFormTypes.d.ts → types/PaymentFormTypes.d.ts} +0 -0
  115. /package/dist/cjs/types/src/utils/{apiUtils.d.ts → apiUtils/apiUtils.d.ts} +0 -0
  116. /package/dist/esm/types/src/components/PaymentForm/{CouponEditor.d.ts → components/CouponEditor.d.ts} +0 -0
  117. /package/dist/esm/types/src/components/PaymentForm/{PaymentFormTypes.d.ts → types/PaymentFormTypes.d.ts} +0 -0
  118. /package/dist/esm/types/src/utils/{apiUtils.d.ts → apiUtils/apiUtils.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { Account, PaymentMethod, TaxationRequiredAccountFields } from '@bunnyapp/common';
2
2
  import { FragmentOf } from 'gql.tada';
3
- import { InvoiceQuoteParentProps } from '../PaymentForm/PaymentFormTypes';
3
+ import { InvoiceQuoteParentProps } from '../PaymentForm/types/PaymentFormTypes';
4
4
  export declare const QuoteCheckout_QuoteFragment: import("gql.tada").TadaDocumentNode<{
5
5
  id: string | null;
6
6
  accountId: string;
@@ -1,21 +1,25 @@
1
- import { PaymentMethod } from '@bunnyapp/common';
1
+ import { FragmentOf } from 'gql.tada';
2
2
  import { ShadowType } from '../../../../types/shadowType';
3
+ export declare const CreditCard_PaymentMethodFragment: import("gql.tada").TadaDocumentNode<{
4
+ [$tada.fragmentRefs]: {
5
+ CardImage_PaymentMethodFragment: "PaymentMethod";
6
+ };
7
+ id: string;
8
+ expirationDate: unknown;
9
+ metadata: {
10
+ identifier: string | null;
11
+ } | null;
12
+ }, {}, {
13
+ fragment: "CreditCard_PaymentMethodFragment";
14
+ on: "PaymentMethod";
15
+ masked: true;
16
+ }>;
3
17
  type CreditCardProps = {
4
18
  onClickRemove: () => void;
5
19
  onClickUpdate: () => void;
6
- paymentMethodData: PaymentMethod;
20
+ paymentMethod: FragmentOf<typeof CreditCard_PaymentMethodFragment>;
7
21
  shadow?: ShadowType;
8
22
  cardEnabled?: boolean;
9
23
  };
10
- declare const CreditCard: ({ onClickRemove, onClickUpdate, paymentMethodData, shadow, cardEnabled, }: CreditCardProps) => import("react/jsx-runtime").JSX.Element;
11
- export declare const MiniCreditCard: ({ className, buttons, hideDropdownMenu, hideDefaultTag, onClickRemove, paymentMethodData, onClickSetDefault, id, }: {
12
- className?: string;
13
- buttons?: React.ReactNode;
14
- hideDropdownMenu?: boolean;
15
- hideDefaultTag?: boolean;
16
- onClickRemove?: () => void;
17
- paymentMethodData?: PaymentMethod;
18
- onClickSetDefault?: () => void;
19
- id?: string;
20
- }) => import("react/jsx-runtime").JSX.Element;
24
+ declare const CreditCard: ({ onClickRemove, onClickUpdate, paymentMethod: maskedPaymentMethod, shadow, cardEnabled, }: CreditCardProps) => import("react/jsx-runtime").JSX.Element;
21
25
  export default CreditCard;
@@ -0,0 +1,27 @@
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const MiniCreditCard_PaymentMethodFragment: import("gql.tada").TadaDocumentNode<{
3
+ [$tada.fragmentRefs]: {
4
+ CardImage_PaymentMethodFragment: "PaymentMethod";
5
+ };
6
+ isDefault: boolean | null;
7
+ metadata: {
8
+ issuer: string | null;
9
+ type: string | null;
10
+ identifier: string | null;
11
+ } | null;
12
+ id: string;
13
+ }, {}, {
14
+ fragment: "MiniCreditCard_PaymentMethodFragment";
15
+ on: "PaymentMethod";
16
+ masked: true;
17
+ }>;
18
+ export declare function MiniCreditCard({ className, buttons, hideDropdownMenu, hideDefaultTag, onClickRemove, paymentMethod: maskedPaymentMethod, onClickSetDefault, id, }: {
19
+ className?: string;
20
+ buttons?: React.ReactNode;
21
+ hideDropdownMenu?: boolean;
22
+ hideDefaultTag?: boolean;
23
+ onClickRemove?: () => void;
24
+ paymentMethod?: FragmentOf<typeof MiniCreditCard_PaymentMethodFragment>;
25
+ onClickSetDefault?: () => void;
26
+ id?: string;
27
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const CardImage_PaymentMethodFragment: import("gql.tada").TadaDocumentNode<{
3
+ metadata: {
4
+ issuer: string | null;
5
+ type: string | null;
6
+ } | null;
7
+ }, {}, {
8
+ fragment: "CardImage_PaymentMethodFragment";
9
+ on: "PaymentMethod";
10
+ masked: true;
11
+ }>;
12
+ export declare function CardImage({ paymentMethod: maskedPaymentMethod, }: {
13
+ paymentMethod: FragmentOf<typeof CardImage_PaymentMethodFragment>;
14
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export { MiniCreditCard } from './CreditCard';
1
+ export { MiniCreditCard } from './MiniCreditCard';
@@ -1,7 +1,2 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare const DemoPayForm: ({ onFail, onSavePaymentMethod, plugin, }: {
3
- onFail: (error: any) => void;
4
- onSavePaymentMethod: (response: any) => void;
5
- plugin: PluginData;
6
- }) => import("react/jsx-runtime").JSX.Element;
1
+ declare const DemoPayForm: () => import("react/jsx-runtime").JSX.Element;
7
2
  export default DemoPayForm;
@@ -8,6 +8,6 @@ export declare function useApproveHold({ onApproveHoldSuccess, onApproveHoldErro
8
8
  quote: Quote;
9
9
  paymentMethodId: string;
10
10
  }) => Promise<void>;
11
- isSaving: boolean;
11
+ isApprovingHold: boolean;
12
12
  };
13
13
  export default useApproveHold;
@@ -1,12 +1,12 @@
1
- import { FormattedInvoice, Invoice, PaymentMethod, PluginData, Quote } from '@bunnyapp/common';
2
- export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, plugin, }: {
1
+ import { FormattedInvoice, Invoice, PluginData, Quote } from '@bunnyapp/common';
2
+ export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, plugin, }: {
3
3
  onPaymentSuccess?: (response: any) => void;
4
4
  onPaymentError?: (error: any) => void;
5
5
  quote?: Quote;
6
6
  invoice?: FormattedInvoice | Invoice;
7
- storedPaymentMethod?: PaymentMethod;
8
7
  plugin: PluginData | undefined;
9
8
  }): {
10
- pay: () => Promise<void>;
9
+ pay: (paymentMethodId: string) => Promise<void>;
10
+ isPaying: boolean;
11
11
  };
12
12
  export default usePay;
@@ -1,22 +1,13 @@
1
- import { FormattedInvoice, PluginData, Quote } from '@bunnyapp/common';
2
- export declare function useSave({ onSaveSuccess, onSaveError, token, apiHost, accountId, }: {
1
+ export declare function useSave({ onSaveSuccess, onSaveError, accountId, }: {
3
2
  onSaveSuccess?: (response: any) => void;
4
3
  onSaveError?: (error: any) => void;
5
- quote?: Quote;
6
- invoice?: FormattedInvoice;
7
- token?: string;
8
- apiHost: string;
9
- accountId?: string;
4
+ accountId: string | undefined;
10
5
  }): {
11
- save: ({ cardDetails, plugin, savePaymentMethod, }: {
12
- cardDetails: {
13
- number: string;
14
- expiry: string;
15
- cvc: string;
16
- };
17
- plugin: PluginData;
18
- savePaymentMethod: boolean;
19
- }) => Promise<void>;
6
+ save: (cardDetails: {
7
+ number: string;
8
+ expiry: string;
9
+ cvc: string;
10
+ }) => Promise<string | undefined>;
20
11
  isSaving: boolean;
21
12
  };
22
13
  export default useSave;
@@ -1,18 +1,17 @@
1
- import { FormattedInvoice, Invoice, PluginData, Quote } from '@bunnyapp/common';
2
- export declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, paymentHoldOptions, }: {
1
+ import { FormattedInvoice, Invoice, Quote } from '@bunnyapp/common';
2
+ export declare function PaymentForm({ invoice, quote, onPaymentSuccess, onPaymentHoldSuccess, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, paymentHoldOptions, }: {
3
3
  invoice?: FormattedInvoice | Invoice;
4
4
  quote?: Quote;
5
- onFail: (error: any) => void;
6
- onPaymentSuccess?: () => void;
5
+ onPaymentSuccess?: (response: any) => void;
7
6
  onPaymentHoldSuccess?: (response: any) => void;
8
7
  onSavePaymentMethod?: (response: any) => void;
9
8
  onRemovePaymentMethod?: () => void;
10
9
  onSetDefaultPaymentMethod?: () => void;
11
10
  accountId?: string;
12
11
  overrideToken?: string;
13
- customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
12
+ customCheckoutFunction?: (pluginId: string, paymentMethodId: string) => Promise<any>;
14
13
  paymentHoldOptions?: {
15
14
  payToAccept?: boolean;
16
15
  amountToHold?: number;
17
16
  };
18
- }) => import("react/jsx-runtime").JSX.Element;
17
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,7 +1,2 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare const StripeForm: ({ plugin, onFail, onSavePaymentMethod, }: {
3
- plugin: PluginData;
4
- onFail: (error: any) => void;
5
- onSavePaymentMethod: (response: any) => void;
6
- }) => import("react/jsx-runtime").JSX.Element;
1
+ declare const StripeForm: () => import("react/jsx-runtime").JSX.Element;
7
2
  export default StripeForm;
@@ -8,6 +8,6 @@ export declare function useApproveHold({ onApproveHoldSuccess, onApproveHoldErro
8
8
  quote: Quote;
9
9
  paymentMethodId: string;
10
10
  }) => Promise<void>;
11
- isSaving: boolean;
11
+ isApprovingHold: boolean;
12
12
  };
13
13
  export default useApproveHold;
@@ -1,12 +1,12 @@
1
- import { FormattedInvoice, Invoice, PaymentMethod, PluginData, Quote } from '@bunnyapp/common';
2
- export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, plugin, }: {
1
+ import { FormattedInvoice, Invoice, PluginData, Quote } from '@bunnyapp/common';
2
+ export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, plugin, }: {
3
3
  onPaymentSuccess?: (response: any) => void;
4
4
  onPaymentError?: (error: any) => void;
5
5
  quote?: Quote;
6
6
  invoice?: FormattedInvoice | Invoice;
7
- storedPaymentMethod?: PaymentMethod;
8
7
  plugin: PluginData | undefined;
9
8
  }): {
10
- pay: () => Promise<void>;
9
+ pay: (paymentMethodId: string) => Promise<void>;
10
+ isPaying: boolean;
11
11
  };
12
12
  export default usePay;
@@ -1,11 +1,10 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- export declare function useSave({ onSaveSuccess, onSaveError, }: {
1
+ export declare function useSave({ onSaveSuccess, onSaveError, accountId, }: {
3
2
  onSaveSuccess?: (response: any) => void;
4
3
  onSaveError?: (error: any) => void;
4
+ accountId: string | undefined;
5
5
  }): {
6
- save: ({ plugin }: {
7
- plugin: PluginData;
8
- }) => Promise<void>;
6
+ save: () => Promise<string | undefined>;
7
+ createStripePaymentMethodId: () => Promise<string>;
9
8
  isSaving: boolean;
10
9
  };
11
10
  export default useSave;
@@ -23,7 +23,7 @@ export declare const createPaymentHold: ({ quote, plugin, token, apiHost, paymen
23
23
  apiHost: string;
24
24
  paymentMethodId: string;
25
25
  }) => Promise<any>;
26
- export declare const useStripePlugin: (plugin: PluginData | undefined, apiHost: string, currencyId: string, token?: string, accountId?: string) => {
26
+ export declare const useStripePlugin: (plugin: PluginData | undefined, currencyId: string, accountId?: string) => {
27
27
  stripe: Stripe | null;
28
28
  options: import("@stripe/stripe-js").StripeElementsOptionsMode;
29
29
  };
@@ -0,0 +1,2 @@
1
+ declare const CheckoutFooter: () => import("react/jsx-runtime").JSX.Element;
2
+ export default CheckoutFooter;
@@ -0,0 +1,2 @@
1
+ declare const PaymentMethodDetails: () => import("react/jsx-runtime").JSX.Element;
2
+ export default PaymentMethodDetails;
@@ -0,0 +1,4 @@
1
+ export declare function PaymentMethodFooter({ onSubmit, noPadding, }: {
2
+ onSubmit: () => void;
3
+ noPadding?: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ declare const PaymentMethodSelector: () => import("react/jsx-runtime").JSX.Element;
2
+ export default PaymentMethodSelector;
@@ -0,0 +1,5 @@
1
+ declare const CustomCheckoutFunctionProvider: ({ value, children }: {
2
+ value: ((pluginId: string, paymentMethodId: string) => Promise<any>) | undefined;
3
+ children?: import("react").ReactNode;
4
+ }) => import("react/jsx-runtime").JSX.Element, useCustomCheckoutFunction: () => ((pluginId: string, paymentMethodId: string) => Promise<any>) | undefined;
5
+ export { CustomCheckoutFunctionProvider, useCustomCheckoutFunction };
@@ -0,0 +1,4 @@
1
+ export type OverrideTokenContextValues = {
2
+ overrideToken?: string;
3
+ };
4
+ export declare const OverrideTokenContext: import("react").Context<OverrideTokenContextValues>;
@@ -0,0 +1,31 @@
1
+ import { FormattedInvoice, Invoice, Quote } from '@bunnyapp/common';
2
+ import { PaymentType } from '../types/PaymentType';
3
+ declare const useAmountDue: () => string | undefined;
4
+ declare const usePaymentType: () => PaymentType | undefined;
5
+ declare const useIsPaying: () => boolean | undefined;
6
+ declare const useHandlePaymentFormSubmit: () => (demoPayCardDetails?: {
7
+ number: string;
8
+ expiry: string;
9
+ cvc: string;
10
+ }) => Promise<void>;
11
+ declare const useIsSaving: () => boolean | undefined;
12
+ declare const useAccountId: () => string | undefined;
13
+ export { useAccountId, useAmountDue, useHandlePaymentFormSubmit, useIsPaying, useIsSaving, usePaymentType, };
14
+ export declare function PaymentProvider({ children, accountId, quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, paymentHoldOptions, onSavePaymentMethod, }: {
15
+ children: React.ReactNode;
16
+ accountId?: string;
17
+ quote: Quote | undefined;
18
+ invoice: FormattedInvoice | Invoice | undefined;
19
+ onPaymentSuccess?: (response: any) => void;
20
+ onPaymentHoldSuccess?: (response: any) => void;
21
+ paymentHoldOptions: {
22
+ payToAccept?: boolean;
23
+ amountToHold?: number;
24
+ };
25
+ onSavePaymentMethod?: (response: any) => void;
26
+ }): import("react/jsx-runtime").JSX.Element;
27
+ export declare function StripeWrapper({ children, currencyId, accountId, }: {
28
+ children: React.ReactNode;
29
+ currencyId: string;
30
+ accountId?: string;
31
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { PluginData } from '@bunnyapp/common';
2
+ declare const SelectedPaymentPluginProvider: ({ initialValue, children, }: {
3
+ initialValue?: PluginData | undefined;
4
+ children?: import("react").ReactNode;
5
+ }) => import("react/jsx-runtime").JSX.Element, useSelectedPaymentPlugin: () => [PluginData | undefined, import("react").Dispatch<import("react").SetStateAction<PluginData | undefined>>];
6
+ export { SelectedPaymentPluginProvider, useSelectedPaymentPlugin };
@@ -0,0 +1,16 @@
1
+ declare const useSelectedPluginId: () => [string | undefined, import("react").Dispatch<import("react").SetStateAction<string | undefined>>];
2
+ declare const useSelectedPlugin: () => any;
3
+ export { useSelectedPlugin, // Get the selected plugin data (derived from the id using useSelectedPluginId)
4
+ useSelectedPluginId, };
5
+ /**
6
+ * SelectedPluginProvider manages the selected payment plugin state.
7
+ *
8
+ * Data Flow Pattern:
9
+ * - Children components should set the plugin ID using `setSelectedPluginId` from `useSelectedPluginId`
10
+ * - This provider then derives the `selectedPlugin` from that ID and provides it via `useSelectedPlugin`
11
+ * - This ensures that data flows only downward: children control the ID, and the provider computes and provides the data
12
+ */
13
+ export declare function SelectedPluginProvider({ children, accountId, }: {
14
+ children: React.ReactNode;
15
+ accountId?: string;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ declare const ShowPaymentDetailsProvider: ({ initialValue, children, }: {
2
+ initialValue?: boolean | undefined;
3
+ children?: import("react").ReactNode;
4
+ }) => import("react/jsx-runtime").JSX.Element, useShowPaymentDetails: () => [boolean, import("react").Dispatch<import("react").SetStateAction<boolean>>];
5
+ export { ShowPaymentDetailsProvider, useShowPaymentDetails };
@@ -0,0 +1,10 @@
1
+ export declare const PaymentForm_PaymentMethodsFragment: import("gql.tada").TadaDocumentNode<{
2
+ [$tada.fragmentRefs]: {
3
+ MiniCreditCard_PaymentMethodFragment: "PaymentMethod";
4
+ };
5
+ id: string;
6
+ }, {}, {
7
+ fragment: "PaymentForm_PaymentMethodsFragment";
8
+ on: "PaymentMethod";
9
+ masked: true;
10
+ }>;
@@ -1,8 +1,5 @@
1
- import { PaymentMethod } from '@bunnyapp/common';
2
- declare const useAutoSetDefaultPaymentMethod: ({ accountId, token, handleSetDefault, setDefaultPaymentMethodLoading, enabled, }: {
3
- accountId: string | undefined;
4
- token?: string;
5
- handleSetDefault: (paymentMethod: PaymentMethod) => void;
1
+ declare const useAutoSetDefaultPaymentMethod: ({ handleSetDefault, setDefaultPaymentMethodLoading, enabled, }: {
2
+ handleSetDefault: (paymentMethodId: string) => void;
6
3
  setDefaultPaymentMethodLoading: boolean;
7
4
  enabled?: boolean;
8
5
  }) => void;
@@ -0,0 +1,24 @@
1
+ import { FormattedInvoice, Invoice, PluginData, Quote } from '@bunnyapp/common';
2
+ import { PaymentType } from '../types/PaymentType';
3
+ declare const useHandlePayment: ({ quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, plugin, paymentHoldOptions, accountId, }: {
4
+ quote?: Quote;
5
+ invoice?: FormattedInvoice | Invoice;
6
+ onPaymentSuccess?: (response: any) => void;
7
+ onPaymentHoldSuccess?: (response: any) => void;
8
+ plugin: PluginData | undefined;
9
+ paymentHoldOptions: {
10
+ payToAccept?: boolean;
11
+ amountToHold?: number;
12
+ };
13
+ accountId: string | undefined;
14
+ }) => {
15
+ handleApproveHold: (overridePaymentMethodId?: string) => Promise<void>;
16
+ handlePayment: (overridePaymentMethodId: string) => Promise<void>;
17
+ handleCheckoutNoPayment: import("@tanstack/react-query").UseMutateFunction<{
18
+ savePaymentMethod: boolean | undefined;
19
+ }, Error, void, unknown>;
20
+ isPaying: boolean;
21
+ paymentType: PaymentType;
22
+ formattedAmountDue: string | undefined;
23
+ };
24
+ export default useHandlePayment;
@@ -0,0 +1,6 @@
1
+ export declare function usePayableCurrency({ payableCurrencyId }: {
2
+ payableCurrencyId?: string;
3
+ }): {
4
+ currencyId: string | undefined;
5
+ isCurrencyIdLoading: boolean;
6
+ };
@@ -0,0 +1,2 @@
1
+ declare function useRemovePaymentMethod(onRemovePaymentMethod?: () => void, onError?: (message: string) => void): (data: any) => Promise<void>;
2
+ export default useRemovePaymentMethod;
@@ -0,0 +1,5 @@
1
+ declare function useSetDefaultPaymentMethod(onError?: (message: string) => void, onSuccess?: () => void): {
2
+ setDefaultPaymentMethod: (paymentMethodId: string) => Promise<void>;
3
+ loading: boolean;
4
+ };
5
+ export default useSetDefaultPaymentMethod;
@@ -0,0 +1,5 @@
1
+ export declare enum PaymentType {
2
+ PAY = "PAY",
3
+ APPROVE_HOLD = "APPROVE_HOLD",
4
+ CHECKOUT_NO_PAYMENT = "CHECKOUT_NO_PAYMENT"
5
+ }
@@ -1,13 +1,12 @@
1
- import { PluginData, Quote } from '@bunnyapp/common';
2
- export default function PaymentForms({ quote, handlePaymentSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, defaultValues, }: {
1
+ import { Quote } from '@bunnyapp/common';
2
+ export default function PaymentForms({ quote, handlePaymentSuccess, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, defaultValues, }: {
3
3
  quote?: Quote;
4
4
  handlePaymentSuccess: () => void;
5
- handlePaymentFail: (error: any) => void;
6
5
  handleSubmit: (formData: FormData) => void;
7
6
  proceedingToPayment: boolean;
8
7
  accountId?: string;
9
8
  overrideToken?: string;
10
- customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
9
+ customCheckoutFunction?: (pluginId: string, paymentMethodId: string) => Promise<any>;
11
10
  defaultValues?: DefaultSignupValues;
12
11
  }): import("react/jsx-runtime").JSX.Element;
13
12
  export type FormData = {
@@ -1,5 +1,5 @@
1
1
  export declare const Subscriptions_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
2
- state: "ACTIVE" | "TRIAL" | "PENDING" | "EXPIRED" | "CANCELED" | "TRIAL_EXPIRED";
2
+ state: "TRIAL" | "ACTIVE" | "CANCELED" | "EXPIRED" | "TRIAL_EXPIRED" | "PENDING";
3
3
  }, {}, {
4
4
  fragment: "Subscriptions_SubscriptionFragment";
5
5
  on: "Subscription";
@@ -11,7 +11,7 @@ export declare const QuantityInput_SubscriptionChargeFragment: import("gql.tada"
11
11
  }>;
12
12
  export declare const QuantityInput_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
13
13
  id: string;
14
- state: "ACTIVE" | "TRIAL" | "PENDING" | "EXPIRED" | "CANCELED" | "TRIAL_EXPIRED";
14
+ state: "TRIAL" | "ACTIVE" | "CANCELED" | "EXPIRED" | "TRIAL_EXPIRED" | "PENDING";
15
15
  priceList: {
16
16
  id: string;
17
17
  } | null;
@@ -12,7 +12,7 @@ export declare const CanShowQuantitiesInput_SubscriptionChargeFragment: import("
12
12
  }>;
13
13
  export declare const CanShowQuantitiesInput_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
14
14
  id: string;
15
- state: "ACTIVE" | "TRIAL" | "PENDING" | "EXPIRED" | "CANCELED" | "TRIAL_EXPIRED";
15
+ state: "TRIAL" | "ACTIVE" | "CANCELED" | "EXPIRED" | "TRIAL_EXPIRED" | "PENDING";
16
16
  priceList: {
17
17
  id: string;
18
18
  } | null;
@@ -2,12 +2,16 @@ declare const getCurrentUserData: ({ token, apiHost }: {
2
2
  token?: string;
3
3
  apiHost: string;
4
4
  }) => Promise<{
5
- authObjectName: any;
6
- account: any;
7
- companyName: any;
8
- returnUrl: any;
9
- privacyUrl: any;
10
- termsUrl: any;
11
- entityId: any;
5
+ authObjectName: string | null;
6
+ account: {
7
+ billingCountry: string | null;
8
+ currencyId: string | null;
9
+ id: string;
10
+ } | null;
11
+ companyName: string | null | undefined;
12
+ returnUrl: string | null | undefined;
13
+ privacyUrl: string | null;
14
+ termsUrl: string | null;
15
+ entityId: string | null;
12
16
  }>;
13
17
  export default getCurrentUserData;
@@ -1,13 +1,17 @@
1
1
  import { currentUser as CurrentUser } from '@bunnyapp/common';
2
2
  declare const useCurrentUserData: (token: string | undefined) => {
3
3
  currentUser: {
4
- authObjectName: any;
5
- account: any;
6
- companyName: any;
7
- returnUrl: any;
8
- privacyUrl: any;
9
- termsUrl: any;
10
- entityId: any;
4
+ authObjectName: string | null;
5
+ account: {
6
+ billingCountry: string | null;
7
+ currencyId: string | null;
8
+ id: string;
9
+ } | null;
10
+ companyName: string | null | undefined;
11
+ returnUrl: string | null | undefined;
12
+ privacyUrl: string | null;
13
+ termsUrl: string | null;
14
+ entityId: string | null;
11
15
  } | CurrentUser;
12
16
  isCurrentUserDataLoading: boolean;
13
17
  };
@@ -0,0 +1,9 @@
1
+ export declare enum BreakpointNumbers {
2
+ xs = 480,
3
+ sm = 768,
4
+ md = 992,
5
+ lg = 1200,
6
+ xl = 1400,
7
+ xxl = 2000
8
+ }
9
+ export declare const useIsMobile: (breakpointSize?: BreakpointNumbers) => boolean;
@@ -1,11 +1,52 @@
1
- import { PaymentMethod } from '@bunnyapp/common';
2
- export declare const usePaymentMethod: ({ accountId, token, apiHost, enabled, }: {
1
+ export declare const usePaymentMethod: ({ accountId, enabled, }: {
3
2
  accountId?: string;
4
- token?: string;
5
- apiHost: string;
6
3
  enabled?: boolean;
7
4
  }) => {
8
- paymentMethods: PaymentMethod[];
9
- defaultPaymentMethod: PaymentMethod | undefined;
5
+ paymentMethods: {
6
+ id: string;
7
+ pluginId: string | null;
8
+ accountId: string | null;
9
+ expirationDate: unknown;
10
+ plugin: {
11
+ guid: string;
12
+ id: string;
13
+ } | null;
14
+ state: "UNKNOWN" | "SUCCESS" | "FAILED" | null;
15
+ metadata: {
16
+ issuer: string | null;
17
+ identifier: string | null;
18
+ kind: string | null;
19
+ description: string | null;
20
+ icon: string | null;
21
+ type: string | null;
22
+ } | null;
23
+ isDefault: boolean | null;
24
+ [$tada.fragmentRefs]: {
25
+ PaymentForm_PaymentMethodsFragment: "PaymentMethod";
26
+ };
27
+ }[] | undefined;
28
+ defaultPaymentMethod: {
29
+ id: string;
30
+ pluginId: string | null;
31
+ accountId: string | null;
32
+ expirationDate: unknown;
33
+ plugin: {
34
+ guid: string;
35
+ id: string;
36
+ } | null;
37
+ state: "UNKNOWN" | "SUCCESS" | "FAILED" | null;
38
+ metadata: {
39
+ issuer: string | null;
40
+ identifier: string | null;
41
+ kind: string | null;
42
+ description: string | null;
43
+ icon: string | null;
44
+ type: string | null;
45
+ } | null;
46
+ isDefault: boolean | null;
47
+ [$tada.fragmentRefs]: {
48
+ PaymentForm_PaymentMethodsFragment: "PaymentMethod";
49
+ };
50
+ } | undefined;
10
51
  isLoading: boolean;
11
52
  };