@openhive-eu/payment 0.0.0-beta.2 → 0.0.0-beta.4

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.
@@ -0,0 +1,5 @@
1
+ import type { PayClientInterface } from "~/lib/pay-client";
2
+ declare const PayClientContext: import("react").Context<PayClientInterface | undefined>;
3
+ declare const PayClientProvider: import("react").Provider<PayClientInterface | undefined>;
4
+ declare const usePayClient: () => PayClientInterface | undefined;
5
+ export { PayClientContext, PayClientProvider, usePayClient };
@@ -1,9 +1,8 @@
1
1
  import React from "react";
2
- import { OpenPay } from "~/lib/openpay";
3
- declare const OpenPayProvider: ({ token, children, }: {
2
+ import { type PayClientInterface } from "~/lib/pay-client";
3
+ declare const PayProvider: ({ token, children, }: {
4
4
  token?: string;
5
5
  children: React.ReactNode;
6
6
  }) => import("react/jsx-runtime").JSX.Element;
7
- declare const useOpenPay: () => OpenPay;
8
- declare const usePayEvent: (eventName: string, callback: (event: CustomEvent) => void) => null;
9
- export { OpenPayProvider, useOpenPay, usePayEvent };
7
+ declare const usePay: () => PayClientInterface;
8
+ export { PayProvider, usePay };
@@ -1,5 +1,5 @@
1
1
  import type { Currency, RequestToPay } from "~/lib/api-client";
2
- declare function PaymentWidgetBase({ defaultAmount, readOnlyAmount, defaultReference, customer, onClose, onSuccess, currency, }: {
2
+ declare function PaymentWidgetBase({ defaultAmount, readOnlyAmount, defaultReference, customer, onClose, onRequestToPay, currency, }: {
3
3
  defaultAmount?: string;
4
4
  maxAmount?: number;
5
5
  readOnlyAmount?: boolean;
@@ -12,7 +12,7 @@ declare function PaymentWidgetBase({ defaultAmount, readOnlyAmount, defaultRefer
12
12
  phone?: string;
13
13
  };
14
14
  onClose?: () => void;
15
- onSuccess?: (requestToPay: RequestToPay) => void;
15
+ onRequestToPay?: (requestToPay: RequestToPay) => void;
16
16
  }): import("react/jsx-runtime").JSX.Element;
17
17
  declare const PaymentWidget: (props: React.ComponentProps<typeof PaymentWidgetBase>) => import("react/jsx-runtime").JSX.Element;
18
18
  export { PaymentWidget };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./app.css";
2
- import { OpenPayProvider } from "./components/openpay-provider";
2
+ import { PayProvider } from "./components/pay-provider";
3
3
  import type { RequestToPay } from "./lib/api-client";
4
- declare const Root: ({ onClose, onSuccess, customer, maxAmount, readOnlyAmount, defaultAmount, defaultReference, ...props }: Omit<React.ComponentProps<typeof OpenPayProvider>, "children"> & {
4
+ declare const Root: ({ onClose, onRequestToPay, customer, maxAmount, readOnlyAmount, defaultAmount, defaultReference, ...props }: Omit<React.ComponentProps<typeof PayProvider>, "children"> & {
5
5
  onClose?: () => void;
6
- onSuccess?: (requestToPay: RequestToPay) => void;
6
+ onRequestToPay?: (requestToPay: RequestToPay) => Promise<void>;
7
7
  customer: {
8
8
  name?: string;
9
9
  email?: string;
@@ -14,4 +14,5 @@ declare const Root: ({ onClose, onSuccess, customer, maxAmount, readOnlyAmount,
14
14
  readOnlyAmount?: boolean;
15
15
  defaultReference?: string;
16
16
  }) => import("react/jsx-runtime").JSX.Element;
17
- export default Root;
17
+ export { PayClientProvider } from "./components/pay-client-provider";
18
+ export { Root as PaymentWidget };