This commit is contained in:
parent
65002965a1
commit
f681213114
|
@ -81,7 +81,7 @@ paymentRouter.post("/create-checkout-session", async (req, res, next) => {
|
|||
}
|
||||
try {
|
||||
const prices = await stripe.prices.list({
|
||||
lookup_keys: [req.body.lookup_key],
|
||||
lookup_keys: [req.body.productId],
|
||||
expand: ['data.product'],
|
||||
});
|
||||
const session = await stripe.checkout.sessions.create({
|
||||
|
@ -92,6 +92,11 @@ paymentRouter.post("/create-checkout-session", async (req, res, next) => {
|
|||
// For metered billing, do not pass quantity
|
||||
quantity: 1,
|
||||
},
|
||||
{
|
||||
price: prices.data[1].id,
|
||||
// For metered billing, do not pass quantity
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
subscription_data: {
|
||||
metadata: {
|
||||
|
|
|
@ -63,13 +63,13 @@
|
|||
<% if (user.tester) { %>
|
||||
<p>Upgrade to Student account for Wordlist features</p>
|
||||
<form action="/payment/create-checkout-session" method="POST">
|
||||
<input type="hidden" name="priceId" value="price_1Lt0XdJnpCQCjf9pM9qqdyt6" />
|
||||
<button class="btn btn-sm btn-secondary" type="submit">$1/month</button>
|
||||
<input type="hidden" name="productId" value="prod_McF18BoMSgnLcQ" />
|
||||
<button class="btn btn-sm btn-secondary" type="submit">Upgrade Account</button>
|
||||
</form>
|
||||
<form action="/payment/create-checkout-session" method="POST">
|
||||
<!-- <form action="/payment/create-checkout-session" method="POST">
|
||||
<input type="hidden" name="priceId" value="price_1Lt0XdJnpCQCjf9pHk1MQqCC" />
|
||||
<button class="btn btn-sm btn-secondary mt-2" type="submit">$10/year</button>
|
||||
</form>
|
||||
</form> -->
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if (user.tester && user.level === "student") { %>
|
||||
|
|
Loading…
Reference in New Issue