@paynext/sdk 1.0.15 → 1.0.17
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
7b2276657273696f6e223a312c227073704964223a2230373434434444394536373533423346413835354439313837374235424543354538373137353142383032364444454638434644443639453337453234443142222c22637265617465644f6e223a313737393436353530393931357d
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,9 @@ export declare interface AttemptResult {
|
|
|
7
7
|
|
|
8
8
|
export declare enum CardType {
|
|
9
9
|
Visa = "visa",
|
|
10
|
-
Mastercard = "mastercard"
|
|
10
|
+
Mastercard = "mastercard",
|
|
11
|
+
Discover = "discover",
|
|
12
|
+
JCB = "jcb"
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export declare interface CheckoutError {
|
|
@@ -57,13 +59,18 @@ export declare interface CheckoutTranslate {
|
|
|
57
59
|
compact: {
|
|
58
60
|
button: string;
|
|
59
61
|
};
|
|
62
|
+
taxId: {
|
|
63
|
+
label: string;
|
|
64
|
+
error: {
|
|
65
|
+
required: string;
|
|
66
|
+
invalid: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
60
69
|
};
|
|
61
70
|
pix: {
|
|
62
|
-
button: string;
|
|
63
71
|
description: string;
|
|
64
72
|
taxId: {
|
|
65
73
|
label: string;
|
|
66
|
-
placeholder: string;
|
|
67
74
|
error: {
|
|
68
75
|
required: string;
|
|
69
76
|
invalid: string;
|
|
@@ -129,13 +136,18 @@ declare interface CheckoutTranslateOverrides {
|
|
|
129
136
|
compact?: {
|
|
130
137
|
button?: string;
|
|
131
138
|
};
|
|
139
|
+
taxId?: {
|
|
140
|
+
label?: string;
|
|
141
|
+
error?: {
|
|
142
|
+
required?: string;
|
|
143
|
+
invalid?: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
132
146
|
};
|
|
133
147
|
pix?: {
|
|
134
|
-
button?: string;
|
|
135
148
|
description?: string;
|
|
136
149
|
taxId?: {
|
|
137
150
|
label?: string;
|
|
138
|
-
placeholder?: string;
|
|
139
151
|
error?: {
|
|
140
152
|
required?: string;
|
|
141
153
|
invalid?: string;
|
|
@@ -440,6 +452,7 @@ declare enum PaymentStatus {
|
|
|
440
452
|
SETTLED = "SETTLED",
|
|
441
453
|
DECLINED = "DECLINED",
|
|
442
454
|
CANCELLED = "CANCELLED",
|
|
455
|
+
REFUNDED = "REFUNDED",
|
|
443
456
|
BLOCKED = "BLOCKED",
|
|
444
457
|
INCOMPLETE = "INCOMPLETE"
|
|
445
458
|
}
|
|
@@ -456,7 +469,7 @@ export declare class PayNextCheckout {
|
|
|
456
469
|
private assertReady;
|
|
457
470
|
mount(containerId: string, config: PayNextConfig): Promise<void>;
|
|
458
471
|
unmount(): Promise<void>;
|
|
459
|
-
static preload(envType:
|
|
472
|
+
static preload(envType: TEnvironment): Promise<void>;
|
|
460
473
|
}
|
|
461
474
|
|
|
462
475
|
export declare interface PayNextConfig {
|
|
@@ -472,6 +485,7 @@ export declare interface PayNextConfig {
|
|
|
472
485
|
returnUrl?: string;
|
|
473
486
|
onCheckoutLoaded?: (result: LoadedResult) => void;
|
|
474
487
|
onCheckoutAttempt?: (result: AttemptResult) => void;
|
|
488
|
+
beforeCheckoutAttempt?: (result: AttemptResult) => boolean | Promise<boolean>;
|
|
475
489
|
onCheckoutComplete?: (result: PaymentResult) => void;
|
|
476
490
|
onCheckoutFail?: (error: CheckoutError) => void;
|
|
477
491
|
}
|
|
@@ -495,7 +509,7 @@ export declare interface StylesConfig {
|
|
|
495
509
|
cssVariables?: CSSVariablesConfig;
|
|
496
510
|
}
|
|
497
511
|
|
|
498
|
-
export declare type TEnvironment = 'develop' | 'staging' | 'sandbox' | 'production';
|
|
512
|
+
export declare type TEnvironment = 'develop' | 'preview1' | 'preview2' | 'preview3' | 'staging' | 'sandbox' | 'production';
|
|
499
513
|
|
|
500
514
|
export declare type ThemeMode = 'light' | 'dark' | 'system';
|
|
501
515
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paynext/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "PayNext SDK - Payment processing with automatic CDN loading",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
@@ -33,19 +33,22 @@
|
|
|
33
33
|
],
|
|
34
34
|
"scripts": {
|
|
35
35
|
"type-check": "tsc --noEmit",
|
|
36
|
+
"types:worker": "wrangler types",
|
|
36
37
|
"format": "yarn type-check && yarn lint && yarn prettier",
|
|
37
38
|
"preview": "PREVIEW=true NODE_ENV=development vite --host",
|
|
38
39
|
"preview-host": "PREVIEW=true yarn build-preview && vite preview --host",
|
|
39
40
|
"preview:cdn": "yarn wrangler dev",
|
|
40
41
|
"build-preview": "PREVIEW=true yarn build",
|
|
41
42
|
"build": "tsc -b && vite build",
|
|
42
|
-
"build:cdn": "
|
|
43
|
+
"build:cdn": "yarn types:worker && node scripts/build-cdn.mjs",
|
|
43
44
|
"lint": "eslint .",
|
|
44
45
|
"analyze": "ANALYZE=true yarn build",
|
|
45
46
|
"pub": "yarn build && npm publish --scope=@paynext",
|
|
46
47
|
"pub-ts": "npm run build && npm version patch --no-git-tag-version && npm publish --access restricted",
|
|
47
48
|
"deploy:dev": "yarn build:cdn && yarn wrangler deploy --env='development'",
|
|
48
|
-
"deploy:prod": "yarn build:cdn && yarn wrangler deploy --env=''"
|
|
49
|
+
"deploy:prod": "yarn build:cdn && yarn wrangler deploy --env=''",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest"
|
|
49
52
|
},
|
|
50
53
|
"peerDependencies": {
|
|
51
54
|
"react": "^19.0.0",
|
|
@@ -60,8 +63,10 @@
|
|
|
60
63
|
}
|
|
61
64
|
},
|
|
62
65
|
"devDependencies": {
|
|
66
|
+
"@cloudflare/workers-types": "^4.20260426.1",
|
|
63
67
|
"@eslint/js": "^9.39.1",
|
|
64
68
|
"@evervault/js": "^2.9.0",
|
|
69
|
+
"@google-pay/button-element": "^3.2.1",
|
|
65
70
|
"@heroui/react": "^2.8.5",
|
|
66
71
|
"@paypal/paypal-js": "^8.4.2",
|
|
67
72
|
"@paypal/react-paypal-js": "^8.9.2",
|
|
@@ -74,13 +79,14 @@
|
|
|
74
79
|
"@vitejs/plugin-legacy": "^7.2.1",
|
|
75
80
|
"@vitejs/plugin-react": "^5.1.0",
|
|
76
81
|
"autoprefixer": "^10.4.22",
|
|
77
|
-
"braintree-web": "
|
|
82
|
+
"braintree-web": "3.140.0",
|
|
78
83
|
"credit-card-type": "^10.1.0",
|
|
79
84
|
"eslint": "^9.39.1",
|
|
80
85
|
"eslint-plugin-prettier": "^5.5.4",
|
|
81
86
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
82
87
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
83
88
|
"globals": "^16.5.0",
|
|
89
|
+
"json5": "^2.2.3",
|
|
84
90
|
"motion": "^12.23.24",
|
|
85
91
|
"prettier": "^3.6.2",
|
|
86
92
|
"prettier-plugin-tailwindcss": "^0.6.9",
|
|
@@ -97,6 +103,7 @@
|
|
|
97
103
|
"vite-plugin-dts": "^4.5.4",
|
|
98
104
|
"vite-plugin-static-copy": "^3.1.4",
|
|
99
105
|
"vite-plugin-svgr": "^4.5.0",
|
|
106
|
+
"vitest": "2.1.9",
|
|
100
107
|
"wrangler": "^4.46.0"
|
|
101
108
|
},
|
|
102
109
|
"browserslist": [
|