-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subscription endDate changed from integer to string, no longer works with twig date filter #340
Comments
Actually, wait, I think |
Yep, |
Currently, we're mapping I will take a look. |
Ok, let us know. Timestamp (int) is far more useful as it can be manipulated into any date string users require, whereas the string format is prone to error due to |
We just released Stripe Payments v4.1.0 (Craft3) and v5.1.0(Craft4) with a fix to this issue. If there is an error it will return the date as comes from Stripe |
@iamkeir you can access to original stripe's data from: |
Sorry I wanted to say In PHP $subscription->data['canceled_at']; or in Twig: {{ subscription.data.canceled_at }}
{{ subscription.data.current_period_end }} You will be able to get the dates as timestamps if you need them |
Description
We recently updated the Stripe Payments plugin from a very old version and now the subscription
endDate
seems to return astring
instead of aninteger
, unlikecancel_at
which is still an integer (looks like epoch integer).As such, if you have a date string such as "22/12/24",
date('d/m/Y')
fails as it is getting muddled by which part of the string is month and which is day (and 22 is too large for month), and it throws:Is this something that could have changed in some updates? Or maybe on the Stripe side? Ideally it would be an integer as strings are unreliable for this reason.
Additional info
The text was updated successfully, but these errors were encountered: