Repository: dj-stripe/dj-stripe

Issue:
Product webhook broken using API 2018-07-27
First I would like to extend my gratitude to all who contributed to this great project.
It seems that I cannot sync with Stripe product on creation, or manually.

```python
product = stripe.Product.create(
  name='An apple!',
  type='good',
  attributes=['volume', 'year'],
  description='Keeps the docker away for a year.',
  # if I insert a "statement_descriptor" here, Stripe will say it is not recognised attribute.
)
```
result in below:

> django.core.exceptions.FieldError: Required stripe field 'statement_descriptor' was not provided in Product data object.

I am new to the project. Could someone elaborate if this is indeed broken or am I doing something wrong?

Thank you.


Discussion:
On further investigation, it seems that there are two product types now - one is 'good', the other is 'service'.  'statement_descriptor' is only for the service type. In webhook listener, making this field optional would supposedly fix it.
@gotexis this error should already be fixed in the latest 1.2.2 release. Can you make sure you're on that one?
I am have upgraded to 1.2.2 and have added a Product under the Orders tab in the Stripe web portal.  On the webhook admin I am also getting the exception "Required stripe field 'statement_descriptor' was not provided in Product data object."  
As an FYI, I am also receiving this exception when creating a product on Stripe's dashboard (Dashboard -> Orders -> Product), although I cannot find a way to select the product "type" using stripe's dashboard when adding products... Also, creating a product using the django admin fails on the stripe side. 

As a side note, when I selected the product creation event in stripe's dashboard (Dashboard ->Developers->Events) and retry sending the webhook, it works. Django recognized the webhook, states it is vaild and that it was processed in the Webhook event triggers page, however the product does not show up in the django admin products page.

Using Django 2.0, djstripe 1.2.2

![image](https://user-images.githubusercontent.com/7564101/46586033-2f96df80-ca3e-11e8-9d31-962f83e6f99f.png)

![image](https://user-images.githubusercontent.com/7564101/46586019-024a3180-ca3e-11e8-9efa-90d69d10e136.png)


@drothroc Any chance you can test on master and report back?
I was trying to but am having trouble adding it to my requirement.txt. My project builds in docker and I can't seem to get a direct link to work...

Tried variations of 
`git+git:https://github.com/dj-stripe/dj-stripe.git@master#egg=dj-stripe`
`-e git:https://github.com/dj-stripe/dj-stripe.git@master#egg=dj-stripe`
`git+http://github.com/dj-stripe/dj-stripe.git@master#egg=dj-stripe`

I'm getting a command line error saying git may not be installed, which doesn't make sense to me. An example error.
```
Error [Errno 2] No such file or directory: 'git': 'git' while executing command git clone -q git:///https://github.com/dj-stripe/dj-stripe.git /src/dj-stripe
Cannot find command 'git' - do you have 'git' installed and in your PATH?
You are using pip version 18.0, however version 18.1 is available.
```

If you know how to add direct links to a `requirement.txt` that is being installed inside a docker container, I'll be more than happy to try out the master branch and see if I get the same dj-stripe error above. I'm lacking knowledge in this area...

Try `pip install https://github.com/dj-stripe/dj-stripe/archive/master.zip`
> As an FYI, I am also receiving this exception when creating a product on Stripe's dashboard (Dashboard -> Orders -> Product), although I cannot find a way to select the product "type" using stripe's dashboard when adding products... Also, creating a product using the django admin fails on the stripe side.

FYI @drothroc I think Order -> Products will always be type=good.

Billing -> Products  (ie products for subscriptions) are of type=service
I'm also seeing this issue on 1.2.3, and it's working correctly on master at 70f3e264424de4e2d90cef45aaf34abc8bad18a4 (using the OP's example code a product is created in admin by the webhook).

Resolving patch:
diff --git a/djstripe/models.py b/djstripe/models.py
--- a/djstripe/models.py
+++ b/djstripe/models.py
@@ -2784,13 +2784,13 @@ class Product(StripeObject):
     ))
 
     # Fields available to `service` only
-    statement_descriptor = StripeCharField(max_length=22, null=True, help_text=(
+    statement_descriptor = StripeCharField(stripe_required=False, max_length=22, help_text=(
         "Extra information about a product which will appear on your customer's "
         "credit card statement. In the case that multiple products are billed at "
         "once, the first statement descriptor will be used. "
         "Only available on products of type=`service`."
     ))
-    unit_label = StripeCharField(max_length=12, null=True)
+    unit_label = StripeCharField(stripe_required=False, max_length=12)
 
     def __str__(self):
         return self.name


Test patch: