#atul - timestamps
1 messages · Page 1 of 1 (latest)
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/
Epoch and unix timestamp converter for developers. Date and time function syntax reference for various programming languages.
A lot of modern languages have some utility to convert from a human readable timestamp to a unix timestamp
My function to change to date is correct as i have verified it
Do not forget that Stripe timestamps uses "second" precision and not millisec
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
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?
What time value are you passing here?
await stripe.subscriptions.del('sub_1LZaXRSApUbhYhpH95yzIZtp')
Can you try that call again and send me the request ID (req_123) from when you get that error message? https://stripe.com/docs/api/request_ids
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Just help me out
I want to cancel subscription
and subscription should stop after billing period is end
I want to help you out, that is why I need this request ID to see what went wrong
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
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
cancel_at_period_end does not exist for the subscription delete call. You should be making the update call https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at_period_end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Unfortunately we don't offer calls on this server. Is that explanation unclear?
I am hitting this
stripe.subscriptions.del('sub_1LZbGTSApUbhYhpHnO9HU5XQ', {at_period_endce: true});
Right, and that parameter does not exist for our subscription deletion endpoint https://stripe.com/docs/api/subscriptions/cancel
StripeInvalidRequestError: Received unknown parameter: at_period_end
If you switch del to update , that call should work
stripe.subscriptions.del('sub_1LZbGTSApUbhYhpHnO9HU5XQ', {at_period_end: true});
Can you try?
stripe.subscriptions.update('sub_1LZbGTSApUbhYhpHnO9HU5XQ', {at_period_end: true});