#atul - timestamps

1 messages · Page 1 of 1 (latest)

royal surge
#

Hello, how are you creating these timestamps?

#

These time stamps represent the number of seconds since January 1 1970 UTC, so it sounds like your conversion math may not quite be right https://www.unixtimestamp.com/

#

A lot of modern languages have some utility to convert from a human readable timestamp to a unix timestamp

compact hatch
#

My function to change to date is correct as i have verified it

tranquil orchid
#

Do not forget that Stripe timestamps uses "second" precision and not millisec

compact hatch
#

I have created a new new product, new customer, and created subscription

#

Now i am cancelling the subscription

#

so i am getting invalid time value

#

so when i crossed checked the issue it was like all timestamp like created, have value of 1970

royal surge
#

As in when you get the value back from the API, it looks like it is 1970 in your code?

#

It sounds like you might be using a library that has higher than second precision. Can you send me the timestamp that you are getting back here?

compact hatch
#

okay thats fine

#

while cancelling subscription i am getting invalid time value

royal surge
#

What time value are you passing here?

compact hatch
#

await stripe.subscriptions.del('sub_1LZaXRSApUbhYhpH95yzIZtp')

royal surge
compact hatch
#

Just help me out

#

I want to cancel subscription

#

and subscription should stop after billing period is end

royal surge
#

I want to help you out, that is why I need this request ID to see what went wrong

compact hatch
#

await stripe.subscriptions.del('sub_1LZasrSApUbhYhpHA2cuhRBk', {cancel_at_period_end: true})

#

i want cancel_at_period_end to be true in response but i am getting false

royal surge
#

Can you run that code again and let me know when you have?

#

When I looked, I didn't see a request in your logs that passes that parameter. So I am not sure if that is not being passed as expected or if I missed the log

#

Ah there we go, I found it

compact hatch
#

can we connect

#

via call

royal surge
#

Unfortunately we don't offer calls on this server. Is that explanation unclear?

compact hatch
#

I am hitting this

#

stripe.subscriptions.del('sub_1LZbGTSApUbhYhpHnO9HU5XQ', {at_period_endce: true});

royal surge
compact hatch
#

StripeInvalidRequestError: Received unknown parameter: at_period_end

royal surge
#

If you switch del to update , that call should work

compact hatch
#

stripe.subscriptions.del('sub_1LZbGTSApUbhYhpHnO9HU5XQ', {at_period_end: true});

royal surge
#

Can you try?
stripe.subscriptions.update('sub_1LZbGTSApUbhYhpHnO9HU5XQ', {at_period_end: true});

compact hatch
#

I have one querry

#

ok

#

getting same error