@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,30 +1,16 @@
1
- type PaymentPlugin = {
2
- enabled: boolean;
3
- entities: string[];
4
- guid: string;
5
- hidden: boolean;
6
- id: string;
7
- name: string;
8
- status: string;
9
- type: string;
10
- webhookEnabled: boolean;
11
- components: {
12
- frontend: {
13
- name: string;
14
- scenarios: string[];
15
- }[];
16
- backend: {
17
- name: string;
18
- access: string[];
19
- }[];
20
- };
21
- };
22
- export declare const usePaymentPlugins: ({ apiHost, token, accountId, }: {
23
- apiHost: string;
24
- token?: string;
25
- accountId?: string;
26
- }) => {
27
- paymentPlugins: PaymentPlugin[];
1
+ export declare const usePaymentPlugins: (accountId: string | undefined) => {
2
+ paymentPlugins: {
3
+ enabled: boolean;
4
+ entities: string[];
5
+ guid: string;
6
+ hidden: boolean;
7
+ id: string;
8
+ name: string;
9
+ status: string;
10
+ type: string;
11
+ webhookEnabled: boolean;
12
+ components: unknown;
13
+ }[];
28
14
  isFetched: boolean;
29
15
  };
30
16
  export default usePaymentPlugins;
@@ -91,5 +91,6 @@ declare const QueryKeyFactory: {
91
91
  priceListId: string;
92
92
  token?: string;
93
93
  }) => string[];
94
+ paymentPluginsKey: (token?: string) => string[];
94
95
  };
95
96
  export default QueryKeyFactory;
@@ -0,0 +1,10 @@
1
+ import { PluginData } from '@bunnyapp/common';
2
+ export declare const invokePlugin: ({ method, payload, plugin, token, apiHost, componentsVersion, }: {
3
+ method: string;
4
+ payload?: Record<string, any>;
5
+ plugin: PluginData;
6
+ token?: string;
7
+ apiHost: string;
8
+ componentsVersion?: string;
9
+ }) => Promise<any>;
10
+ export default invokePlugin;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { FormattedInvoice, FormattedQuote, Transaction, Invoice as Invoice$1, Quote as Quote$1, PluginData, TransactionKind, Subscription, PaymentMethod } from '@bunnyapp/common';
2
+ import { FormattedInvoice, FormattedQuote, Transaction, Invoice as Invoice$1, Quote as Quote$1, TransactionKind, Subscription } from '@bunnyapp/common';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
4
  import { ThemeConfig } from 'antd';
5
5
  import react from 'react';
6
+ import * as gql_tada from 'gql.tada';
7
+ import { FragmentOf } from 'gql.tada';
6
8
 
7
9
  type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
8
10
 
@@ -74,23 +76,22 @@ declare function Quotes({ className, columns, filter, filterQuotes, sort, noQuot
74
76
  noQuotesMessage?: string;
75
77
  }): react_jsx_runtime.JSX.Element;
76
78
 
77
- declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, paymentHoldOptions, }: {
79
+ declare function PaymentForm({ invoice, quote, onPaymentSuccess, onPaymentHoldSuccess, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, paymentHoldOptions, }: {
78
80
  invoice?: FormattedInvoice | Invoice$1;
79
81
  quote?: Quote$1;
80
- onFail: (error: any) => void;
81
- onPaymentSuccess?: () => void;
82
+ onPaymentSuccess?: (response: any) => void;
82
83
  onPaymentHoldSuccess?: (response: any) => void;
83
84
  onSavePaymentMethod?: (response: any) => void;
84
85
  onRemovePaymentMethod?: () => void;
85
86
  onSetDefaultPaymentMethod?: () => void;
86
87
  accountId?: string;
87
88
  overrideToken?: string;
88
- customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
89
+ customCheckoutFunction?: (pluginId: string, paymentMethodId: string) => Promise<any>;
89
90
  paymentHoldOptions?: {
90
91
  payToAccept?: boolean;
91
92
  amountToHold?: number;
92
93
  };
93
- }) => react_jsx_runtime.JSX.Element;
94
+ }): react_jsx_runtime.JSX.Element | null;
94
95
 
95
96
  declare function Signup({ companyName, priceListCode, returnUrl, couponCode, className, shadow, style, defaultFirstName, defaultLastName, defaultEmail, defaultCompanyName, defaultBillingCountry, }: {
96
97
  /** The company name to display on the signup page */
@@ -221,15 +222,31 @@ declare const Footer: ({ className }: {
221
222
  className?: string;
222
223
  }) => react_jsx_runtime.JSX.Element;
223
224
 
224
- declare const MiniCreditCard: ({ className, buttons, hideDropdownMenu, hideDefaultTag, onClickRemove, paymentMethodData, onClickSetDefault, id, }: {
225
+ declare const MiniCreditCard_PaymentMethodFragment: gql_tada.TadaDocumentNode<{
226
+ [$tada.fragmentRefs]: {
227
+ CardImage_PaymentMethodFragment: "PaymentMethod";
228
+ };
229
+ isDefault: boolean | null;
230
+ metadata: {
231
+ issuer: string | null;
232
+ type: string | null;
233
+ identifier: string | null;
234
+ } | null;
235
+ id: string;
236
+ }, {}, {
237
+ fragment: "MiniCreditCard_PaymentMethodFragment";
238
+ on: "PaymentMethod";
239
+ masked: true;
240
+ }>;
241
+ declare function MiniCreditCard({ className, buttons, hideDropdownMenu, hideDefaultTag, onClickRemove, paymentMethod: maskedPaymentMethod, onClickSetDefault, id, }: {
225
242
  className?: string;
226
243
  buttons?: React.ReactNode;
227
244
  hideDropdownMenu?: boolean;
228
245
  hideDefaultTag?: boolean;
229
246
  onClickRemove?: () => void;
230
- paymentMethodData?: PaymentMethod;
247
+ paymentMethod?: FragmentOf<typeof MiniCreditCard_PaymentMethodFragment>;
231
248
  onClickSetDefault?: () => void;
232
249
  id?: string;
233
- }) => react_jsx_runtime.JSX.Element;
250
+ }): react_jsx_runtime.JSX.Element;
234
251
 
235
252
  export { BillingDetails, BunnyProvider, Footer, Invoice, MiniCreditCard, PaymentForm, Quote, Quotes, Signup, SubscriptionsWrapper as Subscriptions, Transactions, UpgradeWrapper as Upgrade };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.6.0-beta.19",
3
+ "version": "1.6.0-beta.20",
4
4
  "description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,13 +0,0 @@
1
- import { FormattedInvoice, Invoice, PluginData, Quote } from '@bunnyapp/common';
2
- declare const CheckoutFooter: ({ quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, plugin, paymentHoldOptions, }: {
3
- quote?: Quote;
4
- invoice?: FormattedInvoice | Invoice;
5
- onPaymentSuccess?: (response: any) => void;
6
- onPaymentHoldSuccess?: (response: any) => void;
7
- plugin: PluginData | undefined;
8
- paymentHoldOptions?: {
9
- payToAccept?: boolean;
10
- amountToHold?: number;
11
- };
12
- }) => import("react/jsx-runtime").JSX.Element | null;
13
- export default CheckoutFooter;
@@ -1,2 +0,0 @@
1
- declare const LargeCardIcon: () => import("react/jsx-runtime").JSX.Element;
2
- export default LargeCardIcon;
@@ -1,4 +0,0 @@
1
- declare const PlusIcon: ({ color }: {
2
- color: string;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
- export default PlusIcon;
@@ -1,7 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare const PaymentMethodDetails: ({ onFail, plugin, onSavePaymentMethod, }: {
3
- onFail: (error: any) => void;
4
- plugin: PluginData;
5
- onSavePaymentMethod: (response: any) => void;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default PaymentMethodDetails;
@@ -1,7 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare const PaymentMethodSelector: ({ paymentMethodAllowedPlugins, onSelect, value, }: {
3
- onSelect: (paymentPlugin?: PluginData) => void;
4
- paymentMethodAllowedPlugins?: PluginData[];
5
- value?: PluginData | null;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default PaymentMethodSelector;
@@ -1,6 +0,0 @@
1
- declare const SavePaymentMethodFooter: ({ isSaving, onSave, noPadding, }: {
2
- isSaving: boolean;
3
- onSave: () => void;
4
- noPadding?: boolean;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default SavePaymentMethodFooter;
@@ -1,7 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare const PaymentMethodForm: ({ plugin, onFail, onSavePaymentMethod, }: {
3
- plugin: PluginData;
4
- onFail: (error: any) => void;
5
- onSavePaymentMethod: (response: any) => void;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default PaymentMethodForm;
@@ -1,10 +0,0 @@
1
- import { PaymentMethod, PluginData } from "@bunnyapp/common";
2
- declare const usePaymentMethodSelectorPlugin: ({ defaultPaymentMethod, defaultPaymentMethodPlugin, paymentMethodAllowedPlugins, }: {
3
- defaultPaymentMethod: PaymentMethod | undefined;
4
- defaultPaymentMethodPlugin: PluginData | undefined;
5
- paymentMethodAllowedPlugins: PluginData[] | undefined;
6
- }) => {
7
- selectorPaymentMethodPlugin: PluginData | undefined;
8
- setSelectorPaymentMethodPlugin: import("react").Dispatch<import("react").SetStateAction<PluginData | undefined>>;
9
- };
10
- export default usePaymentMethodSelectorPlugin;
@@ -1,3 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare function useRemovePaymentMethod(paymentPlugins: PluginData[], apiHost: string, token?: string, accountId?: string, onRemovePaymentMethod?: () => void, onError?: (message: string) => void): (data: any) => Promise<void>;
3
- export default useRemovePaymentMethod;
@@ -1,6 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare function useSetDefaultPaymentMethod(paymentPlugins: PluginData[], apiHost: string, token?: string, accountId?: string, onError?: (message: string) => void, onSuccess?: () => void): {
3
- setDefaultPaymentMethod: (data: any) => Promise<void>;
4
- loading: boolean;
5
- };
6
- export default useSetDefaultPaymentMethod;
@@ -1,10 +0,0 @@
1
- import { PaymentMethod, PluginData } from '@bunnyapp/common';
2
- export type PaymentContextValues = {
3
- onClickCancel?: () => void;
4
- accountId?: string;
5
- overrideToken?: string;
6
- storedPaymentMethods?: PaymentMethod[];
7
- defaultPaymentMethod?: PaymentMethod;
8
- customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
9
- };
10
- export declare const PaymentContext: import("react").Context<PaymentContextValues>;
@@ -1,13 +0,0 @@
1
- import { FormattedInvoice, Invoice, PluginData, Quote } from '@bunnyapp/common';
2
- declare const CheckoutFooter: ({ quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, plugin, paymentHoldOptions, }: {
3
- quote?: Quote;
4
- invoice?: FormattedInvoice | Invoice;
5
- onPaymentSuccess?: (response: any) => void;
6
- onPaymentHoldSuccess?: (response: any) => void;
7
- plugin: PluginData | undefined;
8
- paymentHoldOptions?: {
9
- payToAccept?: boolean;
10
- amountToHold?: number;
11
- };
12
- }) => import("react/jsx-runtime").JSX.Element | null;
13
- export default CheckoutFooter;
@@ -1,2 +0,0 @@
1
- declare const LargeCardIcon: () => import("react/jsx-runtime").JSX.Element;
2
- export default LargeCardIcon;
@@ -1,4 +0,0 @@
1
- declare const PlusIcon: ({ color }: {
2
- color: string;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
- export default PlusIcon;
@@ -1,7 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare const PaymentMethodDetails: ({ onFail, plugin, onSavePaymentMethod, }: {
3
- onFail: (error: any) => void;
4
- plugin: PluginData;
5
- onSavePaymentMethod: (response: any) => void;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default PaymentMethodDetails;
@@ -1,7 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare const PaymentMethodSelector: ({ paymentMethodAllowedPlugins, onSelect, value, }: {
3
- onSelect: (paymentPlugin?: PluginData) => void;
4
- paymentMethodAllowedPlugins?: PluginData[];
5
- value?: PluginData | null;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default PaymentMethodSelector;
@@ -1,6 +0,0 @@
1
- declare const SavePaymentMethodFooter: ({ isSaving, onSave, noPadding, }: {
2
- isSaving: boolean;
3
- onSave: () => void;
4
- noPadding?: boolean;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default SavePaymentMethodFooter;
@@ -1,7 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare const PaymentMethodForm: ({ plugin, onFail, onSavePaymentMethod, }: {
3
- plugin: PluginData;
4
- onFail: (error: any) => void;
5
- onSavePaymentMethod: (response: any) => void;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default PaymentMethodForm;
@@ -1,10 +0,0 @@
1
- import { PaymentMethod, PluginData } from "@bunnyapp/common";
2
- declare const usePaymentMethodSelectorPlugin: ({ defaultPaymentMethod, defaultPaymentMethodPlugin, paymentMethodAllowedPlugins, }: {
3
- defaultPaymentMethod: PaymentMethod | undefined;
4
- defaultPaymentMethodPlugin: PluginData | undefined;
5
- paymentMethodAllowedPlugins: PluginData[] | undefined;
6
- }) => {
7
- selectorPaymentMethodPlugin: PluginData | undefined;
8
- setSelectorPaymentMethodPlugin: import("react").Dispatch<import("react").SetStateAction<PluginData | undefined>>;
9
- };
10
- export default usePaymentMethodSelectorPlugin;
@@ -1,3 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare function useRemovePaymentMethod(paymentPlugins: PluginData[], apiHost: string, token?: string, accountId?: string, onRemovePaymentMethod?: () => void, onError?: (message: string) => void): (data: any) => Promise<void>;
3
- export default useRemovePaymentMethod;
@@ -1,6 +0,0 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- declare function useSetDefaultPaymentMethod(paymentPlugins: PluginData[], apiHost: string, token?: string, accountId?: string, onError?: (message: string) => void, onSuccess?: () => void): {
3
- setDefaultPaymentMethod: (data: any) => Promise<void>;
4
- loading: boolean;
5
- };
6
- export default useSetDefaultPaymentMethod;
@@ -1,10 +0,0 @@
1
- import { PaymentMethod, PluginData } from '@bunnyapp/common';
2
- export type PaymentContextValues = {
3
- onClickCancel?: () => void;
4
- accountId?: string;
5
- overrideToken?: string;
6
- storedPaymentMethods?: PaymentMethod[];
7
- defaultPaymentMethod?: PaymentMethod;
8
- customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
9
- };
10
- export declare const PaymentContext: import("react").Context<PaymentContextValues>;