#nikivi

1 messages · Page 1 of 1 (latest)

civic dockBOT
heady kraken
noble swift
#

Can you share the request id

heady kraken
#

this is coming from one of these sessions

#

i guess is the full unrolled link

noble swift
#

Don't do that

#

I wouldn't share a live payment link in here

#

Just share the id

heady kraken
#

9AQ8xQ9o2eSXa7mdQQ

#

?

noble swift
#

Should start with either ppage or cs_

#

Where are you seeing that unix date from 2021 exactly?

heady kraken
#

i do one of the payment links

#

in dev mode

#

to test my web hook

#

this webhook updates user table memberUntil

#

with the date until stripe is active for

#

i just got 2021 year for it though

#

which is very odd

#

test_a1uXY38YlREoCCw7dvCYfFC8sWswhIUEvlEwh37OPPB3zKw6YDYS627Jlg#fidkdWxOYHwnPyd1blpxYHZxWjFJcGJNQmdUMEZBTTRVa0FENHZtQDdGNCcpJ3VpbGtuQH11anZgYUxhJz8ncWB2cVo8RFQ9fVQ8ajdgVl1kMmhhVFQneCUl

noble swift
#

Which param specifically has the date from 2021?

#

I only see 2023 dates attached to that session

heady kraken
#
        const endDateInUnix = subscription.current_period_end
        console.log(endDateInUnix, "end date in unix!")
noble swift
#

Can you share the subscription id you're looking at then?

heady kraken
noble swift
#

That code isn't checking a session object...

heady kraken
#

im confused

#
        const subscription = await stripe.subscriptions.retrieve(
          checkoutSessionCompleted.subscription,
        )
        const endDateInUnix = subscription.current_period_end
        console.log(endDateInUnix, "end date in unix!")
#

oh i guess you meant this

#

const unixDate = "1699887786"

const timestamp = 1609459200 // replace with your Unix timestamp
const iso8601_format = new Date(timestamp * 1000).toISOString()
console.log(iso8601_format)

#

i run this to convert

#

maybe the code is wrong

#

seems js code is wrong

noble swift
#

Just paste the subscription id in here please

#

sub_

#

The one your code is checking

civic dockBOT
heady kraken
#

how do i get the id

#

i have payment live link

#

is everything in its url param

#

this?

noble swift
#

That's an open session

#

No subscription was created from it

#

Your code is clearly checking a subscription id

heady kraken
#
const timestamp = 1699887786
const iso8601_format = new Date(timestamp * 1000).toISOString()
console.log(iso8601_format)
noble swift
#

What subscription id is it checking?

#

sub_

#

Starts with that

heady kraken
#

im so confused

noble swift
#
          checkoutSessionCompleted.subscription,
        )```
#

what is the value of checkoutSessionCompleted.subscription

#

You're retrieving a subscription

#

I just need to know what that subscription id is

#

because there's not one attached to the session id you shared

heady kraken
#
Using vars defined in .dev.vars
Your worker has access to the following bindings:
- Vars:
  - LA_STRIPE_SECRET_KEY: "(hidden)"
  - LA_STRIPE_WEBHOOK_SECRET: "(hidden)"
  - EDGEDB_DSN: "(hidden)"
  - LOCAL: "(hidden)"
⎔ Starting local server...
service core:user:stripe: Uncaught ReferenceError: process is not defined
  at index.js:18023:16
✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
#

my stripe web hook server started crashing

#

1 sec

noble swift
#

one step at a time

#

just paste the subscription id first

heady kraken
#

sub_1O0ncx4soP2HpBfdIlWTbFVo

noble swift
#

Your code is doing something weird then

#

current_period_end is 1699890615

#

On that sub

#

Which is 2023-11-13 15:50:15 +0000

heady kraken
#

thank you for confirming