File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 2
2
AUTH_BASE_URL = " https://localhost:8000/api/auth"
3
3
4
4
CHECKOUT_SUCCESS_URL = " https://localhost:3000/confirmation"
5
+
6
+ # Define whether to connect to Polar's `sandbox` environment
7
+ SANDBOX = " true"
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ export const {
12
12
POLAR_WEBHOOK_SECRET ,
13
13
CHECKOUT_SUCCESS_URL ,
14
14
AUTH_BASE_URL ,
15
+ SANDBOX ,
15
16
} = process . env ;
16
17
17
18
export const isDevEnv = NODE_ENV === "development" ;
18
19
export const isProdEnv = NODE_ENV === "production" ;
20
+ export const isSandbox = SANDBOX === "true" ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
19
19
SKIP_AUTH ,
20
20
isDevEnv ,
21
21
isProdEnv ,
22
+ isSandbox ,
22
23
} from "lib/config/env.config" ;
23
24
import { dbPool as db } from "lib/db/db" ;
24
25
import { users } from "lib/drizzle/schema" ;
@@ -93,7 +94,7 @@ app.get(
93
94
Checkout ( {
94
95
accessToken : POLAR_ACCESS_TOKEN ,
95
96
successUrl : CHECKOUT_SUCCESS_URL ,
96
- server : isDevEnv ? "sandbox" : "production" ,
97
+ server : isSandbox ? "sandbox" : "production" ,
97
98
} ) ,
98
99
) ;
99
100
@@ -107,7 +108,7 @@ app.get(
107
108
108
109
return customerId ;
109
110
} ,
110
- server : isDevEnv ? "sandbox" : "production" ,
111
+ server : isSandbox ? "sandbox" : "production" ,
111
112
} ) ,
112
113
) ;
113
114
You can’t perform that action at this time.
0 commit comments