This commit is contained in:
adueck 2022-10-15 09:36:10 +05:00
parent f681213114
commit d77bc84d79
2 changed files with 2 additions and 3 deletions

View File

@ -81,8 +81,7 @@ paymentRouter.post("/create-checkout-session", async (req, res, next) => {
} }
try { try {
const prices = await stripe.prices.list({ const prices = await stripe.prices.list({
lookup_keys: [req.body.productId], expand: ['data.product'],
expand: ['data.product'],
}); });
const session = await stripe.checkout.sessions.create({ const session = await stripe.checkout.sessions.create({
billing_address_collection: 'auto', billing_address_collection: 'auto',

View File

@ -63,7 +63,7 @@
<% if (user.tester) { %> <% if (user.tester) { %>
<p>Upgrade to Student account for Wordlist features</p> <p>Upgrade to Student account for Wordlist features</p>
<form action="/payment/create-checkout-session" method="POST"> <form action="/payment/create-checkout-session" method="POST">
<input type="hidden" name="productId" value="prod_McF18BoMSgnLcQ" /> <!-- <input type="hidden" name="productId" value="prod_McF18BoMSgnLcQ" /> -->
<button class="btn btn-sm btn-secondary" type="submit">Upgrade Account</button> <button class="btn btn-sm btn-secondary" type="submit">Upgrade Account</button>
</form> </form>
<!-- <form action="/payment/create-checkout-session" method="POST"> <!-- <form action="/payment/create-checkout-session" method="POST">