refactor get user id from thing
This commit is contained in:
parent
943c301d9a
commit
d8396abd36
9
main.js
9
main.js
@ -68,8 +68,11 @@ async function register({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const session_id = await storageManager.getData("ncd-sub-session-id-" + user.id) || null;
|
const session_id = await storageManager.getData(`ncd-sub-session-id-${user.id}`);
|
||||||
const sub_plan = await storageManager.getData("ncd-sub-plan-" + user.id) || null;
|
const sub_plan = await storageManager.getData(`ncd-sub-plan-${user.id}`);
|
||||||
|
|
||||||
|
//const session_id = await storageManager.getData("ncd-sub-session-id-" + user.id) || null;
|
||||||
|
//const sub_plan = await storageManager.getData("ncd-sub-plan-" + user.id) || null;
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
status: "success",
|
status: "success",
|
||||||
@ -151,7 +154,7 @@ async function register({
|
|||||||
const INSTANCE_URL = "https://" + req.get('host');
|
const INSTANCE_URL = "https://" + req.get('host');
|
||||||
|
|
||||||
// For demonstration purposes, we're using the Checkout session to retrieve the customer ID.
|
// For demonstration purposes, we're using the Checkout session to retrieve the customer ID.
|
||||||
// Typically this is stored alongside the authenticated user in your database.
|
// Typically this is stored alongside the authenticated user in your database. (psql) users -> userID ->
|
||||||
const { session_id } = req.body;
|
const { session_id } = req.body;
|
||||||
const checkoutSession = await stripe.checkout.sessions.retrieve(session_id);
|
const checkoutSession = await stripe.checkout.sessions.retrieve(session_id);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user