@openhive-eu/payment 0.0.0-beta.1

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,9 @@
1
+ import type { paths, components } from "./gen/api-schema";
2
+ declare let accessToken: string | undefined;
3
+ declare const setAccessToken: (token: string) => void;
4
+ declare const client: import("openapi-fetch").Client<paths, `${string}/${string}`>;
5
+ type RequestToPay = components["schemas"]["Payment.CreatePaymentInput"];
6
+ type Currency = components["schemas"]["Payment.CreatePaymentInput"]["currency"];
7
+ type Method = components["schemas"]["Payment.CreatePaymentInput"]["method"];
8
+ export { setAccessToken, accessToken, client };
9
+ export type { RequestToPay, Currency, Method };
@@ -0,0 +1,12 @@
1
+ import { type CountryCode } from "libphonenumber-js/core";
2
+ export type { CountryCode };
3
+ export declare const countries: {
4
+ code: CountryCode;
5
+ dial: string;
6
+ flag: string;
7
+ }[];
8
+ export declare const DEFAULT_COUNTRY_CODE: {
9
+ code: CountryCode;
10
+ dial: string;
11
+ flag: string;
12
+ };
@@ -0,0 +1,4 @@
1
+ import { type CountryCode } from "libphonenumber-js/min";
2
+ export declare function validateEmail(v: string): boolean;
3
+ export declare function formatNational(country: CountryCode, v: string): string;
4
+ export declare function validateNational(country: CountryCode, v: string): boolean;
@@ -0,0 +1,35 @@
1
+ import { client } from "./api-client";
2
+ import type { paths } from "./gen/api-schema";
3
+ type OpenPayEvent = {
4
+ eventName: string;
5
+ callback: (event: any) => void;
6
+ };
7
+ type OpenPayParams = {
8
+ apiClient: typeof client;
9
+ };
10
+ declare class OpenPay {
11
+ private apiClient;
12
+ private events;
13
+ constructor(params: OpenPayParams);
14
+ setToken: (newToken?: string) => void;
15
+ subscribe: (eventName: string, detail: any) => void;
16
+ unsubscribe: (eventName: string) => void;
17
+ getPaymentMethods: () => Promise<{
18
+ name: string;
19
+ code: string;
20
+ provider: string;
21
+ description: string;
22
+ logoUrl: string;
23
+ }[]>;
24
+ requestToPay: (requestToPay: paths["/api/v1/payment-sessions"]["post"]["requestBody"]["content"]["application/json"]) => Promise<{
25
+ Uuid?: string | null;
26
+ status?: "pending" | "succeeded" | "failed" | "expired" | "canceled";
27
+ partner?: "stripe" | "fintecture" | "adyen";
28
+ partnerSessionId?: string | null;
29
+ errorCode?: string | null;
30
+ errorMessage?: string | null;
31
+ } | undefined>;
32
+ setConfig: (newParams: Partial<OpenPayParams>) => void;
33
+ }
34
+ export { OpenPay };
35
+ export type { OpenPayEvent, OpenPayParams };
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@openhive-eu/payment",
3
+ "version": "0.0.0-beta.1",
4
+ "private": false,
5
+ "description": "",
6
+ "license": "ISC",
7
+ "author": "sylvain",
8
+ "type": "module",
9
+ "main": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "scripts": {
15
+ "dev": "vite",
16
+ "build": "vite build && tsc -p tsconfig.json --emitDeclarationOnly",
17
+ "lint": "eslint .",
18
+ "preview": "vite preview",
19
+ "gen-api-types": "npx openapi-typescript http://localhost:14004/api/v1/docs.json -o ./app/lib/gen/api-schema.d.ts",
20
+ "prepublishOnly": "yarn gen-api-types && yarn build"
21
+ },
22
+ "dependencies": {
23
+ "@radix-ui/react-label": "^2.1.8",
24
+ "@radix-ui/react-radio-group": "^1.3.8",
25
+ "@radix-ui/react-select": "^2.2.6",
26
+ "@radix-ui/react-separator": "^1.1.8",
27
+ "@radix-ui/react-slot": "^1.2.4",
28
+ "@vitejs/plugin-react": "^5.1.1",
29
+ "class-variance-authority": "^0.7.1",
30
+ "clsx": "^2.1.1",
31
+ "isbot": "^5.1.31",
32
+ "libphonenumber-js": "^1.12.26",
33
+ "lucide-react": "^0.552.0",
34
+ "openapi-fetch": "^0.15.0",
35
+ "react-error-boundary": "^6.1.0",
36
+ "swr": "^2.3.6",
37
+ "tailwind-merge": "^3.3.1",
38
+ "tw-animate-css": "^1.4.0",
39
+ "vite-tsconfig-paths": "^5.1.4"
40
+ },
41
+ "devDependencies": {
42
+ "@eslint/js": "^9.39.1",
43
+ "@react-router/dev": "^7.9.2",
44
+ "@tailwindcss/vite": "^4.1.17",
45
+ "@types/node": "^24.10.0",
46
+ "@vitejs/plugin-react-swc": "^4.2.1",
47
+ "eslint": "^9.39.1",
48
+ "eslint-plugin-react-hooks": "^7.0.1",
49
+ "eslint-plugin-react-refresh": "^0.4.24",
50
+ "globals": "^16.5.0",
51
+ "openapi-typescript": "^7.10.1",
52
+ "tailwindcss": "^4.1.17",
53
+ "tw-animate-css": "^1.4.0",
54
+ "typescript-eslint": "^8.46.3",
55
+ "vite-tsconfig-paths": "^5.1.4"
56
+ },
57
+ "peerDependencies": {
58
+ "react": "^18.2.0",
59
+ "react-dom": "^18.2.0"
60
+ },
61
+ "style": "dist/index.css"
62
+ }