@usethrottle/payment-methods 0.1.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.
@@ -0,0 +1,33 @@
1
+ interface SavedCard {
2
+ id: string;
3
+ methodType: string;
4
+ cardBrand: string | null;
5
+ cardLastFour: string | null;
6
+ cardExpMonth: number | null;
7
+ cardExpYear: number | null;
8
+ isDefault: boolean;
9
+ }
10
+ interface EmbedPayload {
11
+ embedToken: string;
12
+ checkoutSessionId: string;
13
+ amount: number;
14
+ currency: string;
15
+ gr4vyId: string;
16
+ merchantAccountId?: string;
17
+ environment: 'sandbox' | 'production';
18
+ hostedUrl?: string;
19
+ embedUrl?: string;
20
+ }
21
+ interface MintedClientToken {
22
+ token: string;
23
+ expiresAt: string;
24
+ }
25
+ interface PaymentMethodsTheme {
26
+ colorPrimary?: string;
27
+ colorText?: string;
28
+ colorBorder?: string;
29
+ borderRadius?: string;
30
+ }
31
+ declare const DEFAULT_BASE_URL = "https://api.usethrottle.dev";
32
+
33
+ export { DEFAULT_BASE_URL as D, type EmbedPayload as E, type MintedClientToken as M, type PaymentMethodsTheme as P, type SavedCard as S };
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@usethrottle/payment-methods",
3
+ "version": "0.1.0",
4
+ "description": "Drop-in saved-card wallet (list, add, set default, remove) for Throttle storefronts — headless core + React component.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./server": {
16
+ "types": "./dist/server.d.ts",
17
+ "import": "./dist/server.js",
18
+ "require": "./dist/server.cjs"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "README.md",
24
+ "CLAUDE.md"
25
+ ],
26
+ "dependencies": {
27
+ "@gr4vy/embed-react": "^2.38.0",
28
+ "@usethrottle/errors": "^1.0.0"
29
+ },
30
+ "peerDependencies": {
31
+ "react": ">=18",
32
+ "react-dom": ">=18"
33
+ },
34
+ "devDependencies": {
35
+ "@testing-library/react": "^16.1.0",
36
+ "@types/react": "^19.1.0",
37
+ "@vitejs/plugin-react": "^4.3.4",
38
+ "jsdom": "^25.0.1",
39
+ "react": "^19.1.0",
40
+ "react-dom": "^19.1.0",
41
+ "tsup": "^8.0.0",
42
+ "typescript": "^5.7.0",
43
+ "vitest": "^2.1.9"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "engines": {
49
+ "node": ">=20"
50
+ },
51
+ "scripts": {
52
+ "build": "tsup",
53
+ "dev": "tsup --watch",
54
+ "test": "vitest run",
55
+ "typecheck": "tsc --noEmit"
56
+ }
57
+ }