@payconductor/react 1.1.0 → 1.2.0

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 (40) hide show
  1. package/README.md +253 -253
  2. package/dist/esm/three-ds.d.ts +1 -1
  3. package/dist/esm/tokenizer.d.ts +1 -1
  4. package/dist/index.cjs.js +49 -49
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.d.ts +12 -11
  7. package/dist/index.es.js +1318 -1308
  8. package/dist/index.es.js.map +1 -1
  9. package/dist/payconductor/constants.d.ts +31 -31
  10. package/dist/payconductor/hooks/index.d.ts +7 -7
  11. package/dist/payconductor/hooks/use-element.d.ts +30 -30
  12. package/dist/payconductor/hooks/use-payconductor.d.ts +6 -6
  13. package/dist/payconductor/hooks/use-three-ds.d.ts +13 -13
  14. package/dist/payconductor/hooks/use-tokenizer.d.ts +11 -11
  15. package/dist/payconductor/iframe/constants.d.ts +8 -8
  16. package/dist/payconductor/iframe/types.d.ts +464 -464
  17. package/dist/payconductor/internal.d.ts +11 -11
  18. package/dist/payconductor/loader.d.ts +1 -1
  19. package/dist/payconductor/payconductor-element.d.ts +5 -5
  20. package/dist/payconductor/payconductor-three-ds.d.ts +5 -5
  21. package/dist/payconductor/payconductor.d.ts +17 -17
  22. package/dist/payconductor/three-ds/api.d.ts +12 -12
  23. package/dist/payconductor/three-ds/browser.d.ts +13 -13
  24. package/dist/payconductor/three-ds/handler.d.ts +11 -11
  25. package/dist/payconductor/three-ds/index.d.ts +3 -1
  26. package/dist/payconductor/three-ds/providers/index.d.ts +6 -6
  27. package/dist/payconductor/three-ds/providers/mercado-pago.d.ts +9 -9
  28. package/dist/payconductor/three-ds/providers/pagarme.d.ts +9 -9
  29. package/dist/payconductor/three-ds/providers/pagseguro.d.ts +7 -7
  30. package/dist/payconductor/three-ds/providers/payconductor.d.ts +7 -7
  31. package/dist/payconductor/three-ds/types.d.ts +93 -78
  32. package/dist/payconductor/tokenizer/api.d.ts +26 -26
  33. package/dist/payconductor/tokenizer/handler.d.ts +9 -9
  34. package/dist/payconductor/tokenizer/index.d.ts +1 -1
  35. package/dist/payconductor/tokenizer/providers/index.d.ts +6 -6
  36. package/dist/payconductor/tokenizer/providers/mercado-pago.d.ts +6 -6
  37. package/dist/payconductor/tokenizer/types.d.ts +50 -50
  38. package/dist/payconductor/types.d.ts +42 -42
  39. package/dist/payconductor/utils.d.ts +6 -6
  40. package/package.json +58 -58
@@ -1,42 +1,42 @@
1
- import { PayConductorConfig, PaymentMethod, PaymentResult } from './iframe/types';
2
-
3
- export * from './iframe/types';
4
- export type ConfirmPaymentOptions = {
5
- orderId: string;
6
- returnUrl?: string;
7
- };
8
- export type SubmitResult = {
9
- error?: {
10
- message: string;
11
- code?: string;
12
- type?: "validation_error" | "payment_error";
13
- };
14
- paymentMethod?: PaymentMethod;
15
- };
16
- export type PayConductorApi = {
17
- confirmPayment: (options: ConfirmPaymentOptions) => Promise<PaymentResult>;
18
- validate: (data: unknown) => Promise<boolean>;
19
- reset: () => Promise<void>;
20
- getSelectedPaymentMethod: () => PaymentMethod | null;
21
- };
22
- export type PayConductorFrame = {
23
- iframe: HTMLIFrameElement | Element | unknown | null;
24
- iframeUrl?: string;
25
- error: string | null;
26
- };
27
- export type PayConductorContextValue = {
28
- frame: PayConductorFrame | null;
29
- config: PayConductorConfig | null;
30
- api: PayConductorApi;
31
- selectedPaymentMethod?: PaymentMethod | null;
32
- };
33
- export type PayConductorState = {
34
- isLoaded: boolean;
35
- error: string | null;
36
- iframeUrl: string;
37
- selectedPaymentMethod: PaymentMethod | null;
38
- };
39
- export type PendingRequest = {
40
- resolve: (value: unknown) => void;
41
- reject: (error: unknown) => void;
42
- };
1
+ import { PayConductorConfig, PaymentMethod, PaymentResult } from './iframe/types';
2
+
3
+ export * from './iframe/types';
4
+ export type ConfirmPaymentOptions = {
5
+ orderId: string;
6
+ returnUrl?: string;
7
+ };
8
+ export type SubmitResult = {
9
+ error?: {
10
+ message: string;
11
+ code?: string;
12
+ type?: "validation_error" | "payment_error";
13
+ };
14
+ paymentMethod?: PaymentMethod;
15
+ };
16
+ export type PayConductorApi = {
17
+ confirmPayment: (options: ConfirmPaymentOptions) => Promise<PaymentResult>;
18
+ validate: (data: unknown) => Promise<boolean>;
19
+ reset: () => Promise<void>;
20
+ getSelectedPaymentMethod: () => PaymentMethod | null;
21
+ };
22
+ export type PayConductorFrame = {
23
+ iframe: HTMLIFrameElement | Element | unknown | null;
24
+ iframeUrl?: string;
25
+ error: string | null;
26
+ };
27
+ export type PayConductorContextValue = {
28
+ frame: PayConductorFrame | null;
29
+ config: PayConductorConfig | null;
30
+ api: PayConductorApi;
31
+ selectedPaymentMethod?: PaymentMethod | null;
32
+ };
33
+ export type PayConductorState = {
34
+ isLoaded: boolean;
35
+ error: string | null;
36
+ iframeUrl: string;
37
+ selectedPaymentMethod: PaymentMethod | null;
38
+ };
39
+ export type PendingRequest = {
40
+ resolve: (value: unknown) => void;
41
+ reject: (error: unknown) => void;
42
+ };
@@ -1,6 +1,6 @@
1
- import { PayConductorConfig } from './iframe/types';
2
- export declare const SKELETON_STYLE_ID = "payconductor-skeleton-style";
3
- export declare const SKELETON_CSS = "\n\t@keyframes payconductor-shimmer {\n\t 0% { background-position: -200% 0; }\n\t 100% { background-position: 200% 0; }\n\t}\n\t.payconductor-skeleton {\n\t background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);\n\t background-size: 200% 100%;\n\t animation: payconductor-shimmer 1.5s infinite linear;\n\t border-radius: 4px;\n\t width: 100%;\n\t}\n";
4
- export declare function buildIframeUrl(config: PayConductorConfig): string;
5
- export declare function generateRequestId(): string;
6
- export declare function isValidOrigin(origin: string, allowedOrigins: string[]): boolean;
1
+ import { PayConductorConfig } from './iframe/types';
2
+ export declare const SKELETON_STYLE_ID = "payconductor-skeleton-style";
3
+ export declare const SKELETON_CSS = "\n\t@keyframes payconductor-shimmer {\n\t 0% { background-position: -200% 0; }\n\t 100% { background-position: 200% 0; }\n\t}\n\t.payconductor-skeleton {\n\t background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);\n\t background-size: 200% 100%;\n\t animation: payconductor-shimmer 1.5s infinite linear;\n\t border-radius: 4px;\n\t width: 100%;\n\t}\n";
4
+ export declare function buildIframeUrl(config: PayConductorConfig): string;
5
+ export declare function generateRequestId(): string;
6
+ export declare function isValidOrigin(origin: string, allowedOrigins: string[]): boolean;
package/package.json CHANGED
@@ -1,58 +1,58 @@
1
- {
2
- "name": "@payconductor/react",
3
- "version": "1.1.0",
4
- "description": "React SDK for PayConductor",
5
- "type": "module",
6
- "main": "dist/index.cjs.js",
7
- "module": "dist/index.es.js",
8
- "types": "dist/index.d.ts",
9
- "files": [
10
- "dist"
11
- ],
12
- "scripts": {
13
- "build": "tsc -b && vite build",
14
- "build:watch": "vite build --watch",
15
- "dev": "vite build --watch"
16
- },
17
- "exports": {
18
- ".": {
19
- "import": "./dist/index.es.js",
20
- "require": "./dist/index.cjs.js",
21
- "types": "./dist/index.d.ts"
22
- }
23
- },
24
- "repository": {
25
- "type": "git",
26
- "url": "http://github.com/payconductor-ai/payconductor-sdk-web"
27
- },
28
- "bugs": {
29
- "url": "https://github.com/payconductor-ai/payconductor-sdk-web/issues"
30
- },
31
- "homepage": "https://github.com/payconductor-ai/payconductor-sdk-web#readme",
32
- "license": "MIT",
33
- "author": "PayConductor",
34
- "keywords": [
35
- "payconductor",
36
- "payment",
37
- "gateway",
38
- "react",
39
- "sdk",
40
- "checkout"
41
- ],
42
- "publishConfig": {
43
- "access": "public"
44
- },
45
- "peerDependencies": {
46
- "react": ">=16.8.0",
47
- "react-dom": ">=16.8.0"
48
- },
49
- "devDependencies": {
50
- "@types/react": "^18.0.0",
51
- "@types/react-dom": "^18.0.0",
52
- "react": "^18.0.0",
53
- "react-dom": "^18.0.0",
54
- "typescript": "^5.0.0",
55
- "vite": "^5.0.0",
56
- "vite-plugin-dts": "^3.9.0"
57
- }
58
- }
1
+ {
2
+ "name": "@payconductor/react",
3
+ "version": "1.2.0",
4
+ "description": "React SDK for PayConductor",
5
+ "type": "module",
6
+ "main": "dist/index.cjs.js",
7
+ "module": "dist/index.es.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc -b && vite build",
14
+ "build:watch": "vite build --watch",
15
+ "dev": "vite build --watch"
16
+ },
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/index.es.js",
20
+ "require": "./dist/index.cjs.js",
21
+ "types": "./dist/index.d.ts"
22
+ }
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "http://github.com/payconductor-ai/payconductor-sdk-web"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/payconductor-ai/payconductor-sdk-web/issues"
30
+ },
31
+ "homepage": "https://github.com/payconductor-ai/payconductor-sdk-web#readme",
32
+ "license": "MIT",
33
+ "author": "PayConductor",
34
+ "keywords": [
35
+ "payconductor",
36
+ "payment",
37
+ "gateway",
38
+ "react",
39
+ "sdk",
40
+ "checkout"
41
+ ],
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "peerDependencies": {
46
+ "react": ">=16.8.0",
47
+ "react-dom": ">=16.8.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/react": "^18.0.0",
51
+ "@types/react-dom": "^18.0.0",
52
+ "react": "^18.0.0",
53
+ "react-dom": "^18.0.0",
54
+ "typescript": "^5.0.0",
55
+ "vite": "^5.0.0",
56
+ "vite-plugin-dts": "^3.9.0"
57
+ }
58
+ }