{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/cashier/issues/319","repository_url":"https://api.github.com/repos/laravel/cashier","labels_url":"https://api.github.com/repos/laravel/cashier/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/laravel/cashier/issues/319/comments","events_url":"https://api.github.com/repos/laravel/cashier/issues/319/events","html_url":"https://github.com/laravel/cashier/issues/319","id":168614085,"number":319,"title":"onTrial() - replace Carbon::today() with Carbon::now()","user":{"login":"sebzap","id":12527892,"avatar_url":"https://avatars.githubusercontent.com/u/12527892?v=3","gravatar_id":"","url":"https://api.github.com/users/sebzap","html_url":"https://github.com/sebzap","followers_url":"https://api.github.com/users/sebzap/followers","following_url":"https://api.github.com/users/sebzap/following{/other_user}","gists_url":"https://api.github.com/users/sebzap/gists{/gist_id}","starred_url":"https://api.github.com/users/sebzap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebzap/subscriptions","organizations_url":"https://api.github.com/users/sebzap/orgs","repos_url":"https://api.github.com/users/sebzap/repos","events_url":"https://api.github.com/users/sebzap/events{/privacy}","received_events_url":"https://api.github.com/users/sebzap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-01T10:24:00Z","updated_at":"2016-10-05T16:32:18Z","closed_at":null,"body":"Currently following line is used to determine whether a subscription is on a trial.\r\n\r\n`return Carbon::today()->lt($this->trial_ends_at);`\r\n\r\nHowever using `Carbon::now()` would be more accurate, because in the current version the onTrial method keeps returning true until the next day. This leads to problems. For example if you cancel the subscription after the trial has actually ended (but onTrial still returns true), the line `$this->ends_at = $this->trial_ends_at;` will be executed, which will lead to the immediate cancellation of the subscription rather than the cancellation at the periods end. (However the user has already payed for the period because the trial has ended in stripe.)\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/cashier/issues/comments/251727377","html_url":"https://github.com/laravel/cashier/issues/319#issuecomment-251727377","issue_url":"https://api.github.com/repos/laravel/cashier/issues/319","id":251727377,"user":{"login":"Francismori7","id":520647,"avatar_url":"https://avatars.githubusercontent.com/u/520647?v=3","gravatar_id":"","url":"https://api.github.com/users/Francismori7","html_url":"https://github.com/Francismori7","followers_url":"https://api.github.com/users/Francismori7/followers","following_url":"https://api.github.com/users/Francismori7/following{/other_user}","gists_url":"https://api.github.com/users/Francismori7/gists{/gist_id}","starred_url":"https://api.github.com/users/Francismori7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Francismori7/subscriptions","organizations_url":"https://api.github.com/users/Francismori7/orgs","repos_url":"https://api.github.com/users/Francismori7/repos","events_url":"https://api.github.com/users/Francismori7/events{/privacy}","received_events_url":"https://api.github.com/users/Francismori7/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T16:32:18Z","updated_at":"2016-10-05T16:32:18Z","body":"This depends the use case. Some people will allow until the end of the day for the subscription to be canceled, some want it to end at the second the payment cycle is done. My solution would be to override the ends_at column to use Stripe's returned data instead of the one by cashier."}}
{"actor":{"display_login":"Francismori7"}}