#Monimolimnion

1 messages ยท Page 1 of 1 (latest)

atomic hingeBOT
stray dust
#

๐Ÿ‘‹ happy to help

#

I'm not familiar with Sveltekit but what seems to be the issue?

west inlet
#

hi

#

i'll bombard you with some code to set the scene

#

client side I have made a wrapper for Stripe for my checkout screen

stray dust
west inlet
#

I would if I knew what it was... essentially I hit my server endpoint that should create a new checkout session, but nothing happens

#

no errors

#
const session = await stripe.checkout.sessions.create({
            mode: "payment",
            payment_method_types: ['card'],
            line_items: lineItems,
            success_url: `http://localhost:5173/checkout/success`,
            cancel_url: 'http://localhost:5173/checkout/details'
        });

        console.log(session)
        await goto(307, session.url)
#

the session does not log

stray dust
#

is this node.js code?

west inlet
#

I believe so

stray dust
west inlet
#

I have @stripe/stripe-js and stripe installed

west inlet
#

400 errors abound

#

what's up with this?

#
 "line_items": {
    "0": {
      "description": "My Event",
      "quantity": "1",
      "id": "1"
,
      "amount": "222000.00"
    },
    "1": {
      "description": "Delegate",
      "quantity": "1",
      "id": "6b284965-09b6-47ac-b4c7-7fe75f972ac9",
      "amount": "222000.00"
    },
#

the error is that it doesn't like the "id": "1" , but it's fine with the UUID in the second line item

stray dust
#

you can't put id and amount

west inlet
#

great, got that working, thanks

#

the session is created successfully, but now my app won't redirect to the checkout page ๐Ÿค”

thorn pike
#

Hi ๐Ÿ‘‹ jumping in as my teammate needed to step away. Can you share more details? Are you seeing errors being thrown?

west inlet
#

no

#

I'm logging the session and it's creating fine now, with a nice URL that I can navigate to manually

#

in my server endpoint I'm running goto(session.url)

#

but I'm probably using it wrong

thorn pike
#

Sorry, I'm not familiar with that framework and can't provide guidance on how to use it specifically.

west inlet
#

ok