{"action":"created","issue":{"url":"https://api.github.com/repos/kavdev/dj-stripe/issues/307","repository_url":"https://api.github.com/repos/kavdev/dj-stripe","labels_url":"https://api.github.com/repos/kavdev/dj-stripe/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/kavdev/dj-stripe/issues/307/comments","events_url":"https://api.github.com/repos/kavdev/dj-stripe/issues/307/events","html_url":"https://github.com/kavdev/dj-stripe/issues/307","id":152352096,"number":307,"title":"Release 1.0.0","user":{"login":"kavdev","id":4859329,"avatar_url":"https://avatars1.githubusercontent.com/u/4859329?v=3","gravatar_id":"","url":"https://api.github.com/users/kavdev","html_url":"https://github.com/kavdev","followers_url":"https://api.github.com/users/kavdev/followers","following_url":"https://api.github.com/users/kavdev/following{/other_user}","gists_url":"https://api.github.com/users/kavdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kavdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavdev/subscriptions","organizations_url":"https://api.github.com/users/kavdev/orgs","repos_url":"https://api.github.com/users/kavdev/repos","events_url":"https://api.github.com/users/kavdev/events{/privacy}","received_events_url":"https://api.github.com/users/kavdev/received_events","type":"User","site_admin":false},"labels":[{"id":52242102,"url":"https://api.github.com/repos/kavdev/dj-stripe/labels/please%20help","name":"please help","color":"f7c6c7","default":false},{"id":203807466,"url":"https://api.github.com/repos/kavdev/dj-stripe/labels/task","name":"task","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/kavdev/dj-stripe/milestones/3","html_url":"https://github.com/kavdev/dj-stripe/milestone/3","labels_url":"https://api.github.com/repos/kavdev/dj-stripe/milestones/3/labels","id":1203614,"number":3,"title":"1.0.0","description":"API updates to 2015-07-28","creator":{"login":"kavdev","id":4859329,"avatar_url":"https://avatars1.githubusercontent.com/u/4859329?v=3","gravatar_id":"","url":"https://api.github.com/users/kavdev","html_url":"https://github.com/kavdev","followers_url":"https://api.github.com/users/kavdev/followers","following_url":"https://api.github.com/users/kavdev/following{/other_user}","gists_url":"https://api.github.com/users/kavdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kavdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavdev/subscriptions","organizations_url":"https://api.github.com/users/kavdev/orgs","repos_url":"https://api.github.com/users/kavdev/repos","events_url":"https://api.github.com/users/kavdev/events{/privacy}","received_events_url":"https://api.github.com/users/kavdev/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":31,"state":"open","created_at":"2015-07-11T23:32:00Z","updated_at":"2017-03-10T08:48:06Z","due_on":null,"closed_at":null},"comments":50,"created_at":"2016-05-01T19:01:22Z","updated_at":"2017-03-13T02:11:15Z","closed_at":null,"body":"## Overview\r\n\r\nIt's almost here! We've made significant changes to the codebase and are now compliant with stripe API version **2016-03-07**.\r\n\r\nI want to give a huge thanks to all of our contributors for their help in making this happen, especially Bill Huneke (@wahuneke) for his impressive design work.\r\n\r\nAlmost all methods now mimic the parameters of those same methods in the stripe API. Note that some methods do not have some parameters implemented. This is intentional. That being said, expect all method signatures to be different than those in previous versions of dj-stripe.\r\n\r\nAt this point, you should be able to check out the 162 branch and start playing around. I'm not yet fully confident in saying that the public api won't change. I'll update this when I get further along in testing.\r\n## A few things to get excited for\r\n- Multiple subscription support (finally)\r\n- Multiple sources support (currently limited to Cards)\r\n- Full model documentation\r\n- Objects that come through webhooks are now tied to the API version set in dj-stripe. No more errors if dj-stripe falls behind the newest stripe API version.\r\n- Any create/update action on an object automatically syncs the object.\r\n## What still needs to be done\r\n- ~~**Testing**. I'm almost done fixing the tests.~~ DONE!\r\n- **Documentation**. Our original documentation was not very helpful, but it covered the important bits. It will be very out of date after this update and will need to be rewritten. If you feel like helping, we could use all the help we can get to get this pushed out asap.\r\n- **Master sync re-write**. This sounds scary, but really isn't. The current management methods run sync methods on Customer that aren't very helpful and are due for removal. My plan is to write something that first updates local data (via `api_retrieve` and `sync_from_stripe_data`) and then pulls all objects from Stripe and populates the local database with any records that don't already exist there.\r\n- **Plan settings/models dynamic**. We have a plan and just need to implement it. See [the comment below](https://github.com/kavdev/dj-stripe/issues/307#issuecomment-267739842).\r\n## Significant changes (mostly backwards-incompatible)\r\n\r\nI kept a log of everything that changed. I believe this is everything; if you notice something I've missed, let me know and I'll add it. I'll go through and double-check before we officially release.\r\n#### VIEWS/TEMPLATES/EMAIL TEMPLATES/ADMIN PAGES/CONTRIB PACKAGES\r\n- All dj-stripe views, templates, email templates, admin pages, and contrib packages (django rest framework) do not support multiple subscriptions at this time.\r\n- `AccountView` no longer provides `subscription` in context. Use `{{ customer.subscription }}`\r\n- `ConfirmFormView` now takes in `plan_id` instead of `plan` as a url argument for clarity.\r\n#### SETTINGS\r\n- The `STRIPE_API_VERSION` setting is no longer taken into account. See #116.\r\n- The `PLAN_CHOICES`, `PLAN_LIST`, and `PAYMENT_PLANS` objects are removed. Use Plan.objects.all() instead.\r\n- The `plan_from_stripe_id` function is removed. Use Plan.objects.get(stripe_id=<stripe_id>)\r\n#### SYNCING\r\n- sync_plans no longer takes an api_key\r\n- sync methods no longer take a `cu` parameter\r\n- All sync methods are now private. We're in the process of building a better syncing mechanism.\r\n#### UTILITIES\r\n- dj-stripe decorators now take a plan argument. If you're passing in a custom test function to `subscriber_passes_pay_test`, be sure to account for this new argument.\r\n#### MIXINS\r\n- The context provided by dj-stripe's mixins has changed. `PaymentsContextMixin` now provides `STRIPE_PUBLIC_KEY` and `plans` (changed to `Plan.objects.all()`). `SubscriptionMixin` now provides `customer` and `is_plans_plural`.\r\n#### MIDDLEWARE\r\n- dj-stripe middleware doesn't support multiple subscriptions.\r\n#### SIGNALS\r\n- Local custom signals are deprecated in favor of Stripe webhooks:\r\n  - `cancelled` -> WEBHOOK_SIGNALS[\"customer.subscription.deleted\"]\r\n  - `card_changed` -> WEBHOOK_SIGNALS[\"customer.source.updated\"]\r\n  - `subscription_made` -> WEBHOOK_SIGNALS[\"customer.subscription.created\"]\r\n#### WEBHOOK EVENTS\r\n- The Event Handlers designed by @wahuneke are the new way to handle events that come through webhooks. Definitely take a look at `event_handlers.py` and `webhooks.py`.\r\n#### Exceptions\r\n- `SubscriptionUpdateFailure` and `SubscriptionCancellationFailure` exceptions are removed. There should no longer be a case where they would have been useful. Catch native stripe errors in their place instead.\r\n#### MODELS\r\n\r\nCharge\r\n- `Charge.charge_created` -> `Charge.stripe_timestamp`\r\n- `Charge.card_last_4` and `Charge.card_kind` are removed. Use `Charge.source.last4` and `Charge.source.brand` (if the source is a Card)\r\n- `Charge.invoice` is no longer a foreign key to the Invoice model. `Invoice` now has a OneToOne relationship with `Charge`. (`Charge.invoice` will still work, but will no longer be represented in the database).\r\n\r\nCustomer\r\n- dj-stripe now supports test mode and live mode Customer objects concurrently (See #440). As a result, the ``<subscriber_model>.customer`` OneToOne reverse relationship is no longer a thing. You should now instead add a ``customer`` property to your subscriber model that checks whether you're in live or test mode (see djstripe.settings.STRIPE_LIVE_MODE as an example) and grabs the customer from ``<subscriber_model>.djstripe_customers`` with a simple ``livemode=`` filter.\r\n- Customer no longer has a `current_subscription` property. We've added a `subscription` property that should suit your needs.\r\n- With the advent of multiple subscriptions, the behavior of `Customer.subscribe()` has changed. Before, `calling subscribe()` when a customer was already subscribed to a plan would switch the customer to the new plan with an option to prorate. Now calling `subscribe()` simply subscribes that customer to a new plan in addition to it's current subsription. Use `Subscription.update()` to change a subscription's plan instead.\r\n- `Customer.cancel_subscription()` is removed. Use `Subscription.cancel()` instead.\r\n- The `Customer.update_plan_quantity()` method is removed. Use `Subscription.update()` instead.\r\n- `CustomerManager` is now `SubscriptionManager` and works on the `Subscription` model instead of the `Customer` model.\r\n- `Customer.has_valid_card()` is now `Customer.has_valid_source()`.\r\n- `Customer.update_card()` now takes an id. If the id is not supplied, the default source is updated.\r\n- `Customer.stripe_customer` property is removed. Use `Customer.api_retrieve()` instead.\r\n- The `at_period_end` parameter of `Customer.cancel_subscription()` now actually follows the [DJSTRIPE_PRORATION_POLICY](http://dj-stripe.readthedocs.org/en/latest/settings.html#djstripe-proration-policy-false) setting.\r\n- `Customer.card_fingerprint`, `Customer.card_last_4`, `Customer.card_kind`, `Customer.card_exp_month`, `Customer.card_exp_year` are all removed. Check `Customer.default_source` (if it's a Card) or one of the sources in `Customer.sources` (again, if it's a Card) instead.\r\n- The `invoice_id` parameter of `Customer.add_invoice_item` is now named `invoice` and can be either an Invoice object or the stripe_id of an Invoice.\r\n\r\nEvent\r\n- `Event.kind` -> `Event.type`\r\n- Removed `Event.validated_message`. Just check if the event is valid - no need to double check (we do that for you)\r\n\r\nTransfer\r\n- Removed `Transfer.update_status()`\r\n- Removed `Transfer.event`\r\n- `TransferChargeFee` is removed. It hasn't been used in a while due to a broken API version. Use `Transfer.fee_details` instead.\r\n- Any fields that were in `Transfer.summary` no longer exist and are therefore deprecated (unused but not removed from the database). Because of this, `TransferManager` now only aggregates `total_sum`\r\n\r\nInvoice\r\n- `Invoice.attempts` -> `Invoice.attempt_count`\r\n- InvoiceItems are no longer created when Invoices are synced. You must now sync InvoiceItems directly.\r\n\r\nInvoiceItem\r\n- Removed `InvoiceItem.line_type`\r\n\r\nPlan\r\n- Plan no longer has a `stripe_plan` property. Use`api_retrieve()`` instead.\r\n- `Plan.currency` no longer uses choices. Use the `get_supported_currency_choices()` utility and create your own custom choices list instead.\r\n- Plan interval choices are now in `Plan.INTERVAL_TYPE_CHOICES``\r\n\r\nSubscription\r\n- `Subscription.is_period_current()` now checks for a current trial end if the current period has ended. This change means subscriptions extended with `Subscription.extend()` will now be seen as valid.\r\n#### MIGRATIONS\r\n\r\nWe'll sync your current records with Stripe in a migration. It will take a while, but it's the only way we can ensure data integrity. There were some fields for which we needed to temporarily add placeholder defaults, so just make sure you have a customer with ID 1 and a plan with ID 1 and you shouldn't run into any issues (create dummy values for these if need be and delete them after the migration).\r\n# BIG HUGE NOTE - DON'T OVERLOOK THIS\r\n### Subscription and InvoiceItem migration is not possible because old records don't have Stripe IDs (so we can't sync them). Our approach is to delete all local subscription and invoiceitem objects and re-sync them from Stripe.\r\n### We 100% recommend you create a backup of your database before performing this upgrade.\r\n"},"comment":{"url":"https://api.github.com/repos/kavdev/dj-stripe/issues/comments/285999565","html_url":"https://github.com/kavdev/dj-stripe/issues/307#issuecomment-285999565","issue_url":"https://api.github.com/repos/kavdev/dj-stripe/issues/307","id":285999565,"user":{"login":"kavdev","id":4859329,"avatar_url":"https://avatars1.githubusercontent.com/u/4859329?v=3","gravatar_id":"","url":"https://api.github.com/users/kavdev","html_url":"https://github.com/kavdev","followers_url":"https://api.github.com/users/kavdev/followers","following_url":"https://api.github.com/users/kavdev/following{/other_user}","gists_url":"https://api.github.com/users/kavdev/gists{/gist_id}","starred_url":"https://api.github.com/users/kavdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavdev/subscriptions","organizations_url":"https://api.github.com/users/kavdev/orgs","repos_url":"https://api.github.com/users/kavdev/repos","events_url":"https://api.github.com/users/kavdev/events{/privacy}","received_events_url":"https://api.github.com/users/kavdev/received_events","type":"User","site_admin":false},"created_at":"2017-03-13T02:11:15Z","updated_at":"2017-03-13T02:11:15Z","body":"@jleclanche: That's a solid addition to the roadmap. Thanks for all the shiny new contributions!\r\n\r\n> In the future though, I should advise: don't wait so long to release new versions :)\r\n\r\nHaha no kidding. We were on track for a release at one point, but then work, completing uni, etc. slowed things down. Then I decided to switch from consulting work to working on a few startups full+ time and dj-stripe went to the backburner. Luckily things are opening up a bit again, especially now that that 20% time policy is in effect."}}
{"actor":{"display_login":"kavdev"}}