{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/cashier/issues/203","labels_url":"https://api.github.com/repos/laravel/cashier/issues/203/labels{/name}","comments_url":"https://api.github.com/repos/laravel/cashier/issues/203/comments","events_url":"https://api.github.com/repos/laravel/cashier/issues/203/events","html_url":"https://github.com/laravel/cashier/issues/203","id":108557114,"number":203,"title":"Trial Issue","user":{"login":"beeseenmedia","id":9390360,"avatar_url":"https://avatars.githubusercontent.com/u/9390360?v=3","gravatar_id":"","url":"https://api.github.com/users/beeseenmedia","html_url":"https://github.com/beeseenmedia","followers_url":"https://api.github.com/users/beeseenmedia/followers","following_url":"https://api.github.com/users/beeseenmedia/following{/other_user}","gists_url":"https://api.github.com/users/beeseenmedia/gists{/gist_id}","starred_url":"https://api.github.com/users/beeseenmedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beeseenmedia/subscriptions","organizations_url":"https://api.github.com/users/beeseenmedia/orgs","repos_url":"https://api.github.com/users/beeseenmedia/repos","events_url":"https://api.github.com/users/beeseenmedia/events{/privacy}","received_events_url":"https://api.github.com/users/beeseenmedia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-27T19:53:26Z","updated_at":"2015-09-27T20:01:19Z","closed_at":null,"body":"According to the documentation in Laravel 5.1 it says that for a subscription will automatically set a trial if it is set in the stripe dashboard.\r\n\r\nIn my case I use the following code\r\n$user->subscription('monthly')->create(null, ['email' => $user->email, 'description'=> $user->name]);\r\n\r\nThe issue is that when I do this, it updates the table and in doing so it sets the trial_ends_at but also sets stripe_active to 1.\r\n\r\nStripe allows for a \"grace\" period where it doesnt automatically send the cancel Webhook but retries every few days to charge the credit card, after the 3rd try it sends the cancelation Webhook.\r\n\r\nWhat ends up happening is that $user->subscribed() return true until the Trial Period + Grace period is over.  The reasons seems to be that $user->subscribed() checks $this->stripeActive() which remains true until stripe tries to charge multiple times (couple of days, up to a week).\r\n\r\nI think I can manage by settings a trial period of (actual trial period - grace period) on the dashboard, but this is not optimal.\r\n\r\n![sample](https://cloud.githubusercontent.com/assets/9390360/10124887/a48acf80-652f-11e5-9572-de51ee72dd7c.png)\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/cashier/issues/comments/143590957","html_url":"https://github.com/laravel/cashier/issues/203#issuecomment-143590957","issue_url":"https://api.github.com/repos/laravel/cashier/issues/203","id":143590957,"user":{"login":"beeseenmedia","id":9390360,"avatar_url":"https://avatars.githubusercontent.com/u/9390360?v=3","gravatar_id":"","url":"https://api.github.com/users/beeseenmedia","html_url":"https://github.com/beeseenmedia","followers_url":"https://api.github.com/users/beeseenmedia/followers","following_url":"https://api.github.com/users/beeseenmedia/following{/other_user}","gists_url":"https://api.github.com/users/beeseenmedia/gists{/gist_id}","starred_url":"https://api.github.com/users/beeseenmedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beeseenmedia/subscriptions","organizations_url":"https://api.github.com/users/beeseenmedia/orgs","repos_url":"https://api.github.com/users/beeseenmedia/repos","events_url":"https://api.github.com/users/beeseenmedia/events{/privacy}","received_events_url":"https://api.github.com/users/beeseenmedia/received_events","type":"User","site_admin":false},"created_at":"2015-09-27T20:01:19Z","updated_at":"2015-09-27T20:01:19Z","body":"perhaps this may be a solution, please advise.\r\n\r\nprotected function handleInvoicePaymentFailed(array $payload)\r\n    {\r\n        $billable = $this->getBillable($payload['lines']['customer']);\r\n\r\n        if(!$billable->onTrial())\r\n        {\r\n            $customer['data']['object']['customer']  = $payload['lines']['customer'];\r\n            $this->handleCustomerSubscriptionDeleted($customer);\r\n        }\r\n\r\n    }"}}