kliment/pymill — pull request #25 by sk7 (2014-02-25 14:16:46+00:00)
Title: fix list of accepted events in new_webhook

problem: only last event in the event list was accepted by the paymill server when calling `new_webhook`

simple example:

```
url = "http://mydomain.example/secret_webhook/"
WEBHOOK_EVENTS = (
u'chargeback.executed',
u'refund.created',
# etc....
u'app.merchant.app.disabled'
)
paymill.new_webhook(url, self.WEBHOOK_EVENTS)
```
this should register all events to the webhook at `url` but it only registered the last event `app.merchant.app.disabled`. This is because `requests` (the http library used by pymill) builds a POST request that looks like this:

```
POST /v2/webhooks?url=https%3A%2F%2Fmydomain.example%2Fsecret_webhook%2F&event_types=chargeback.executed&event_types=refund.created&event_types=app.merchant.app.disabled HTTP/1.1
```

but it should like this:

```
POST /v2/webhooks?url=https%3A%2F%2Fmydomain.example%2Fsecret_webhook%2F&event_types[]=chargeback.executed&event_types[]=refund.created&event_types[]=app.merchant.app.disabled HTTP/1.1
```

notice the `[]` after the param name

This is also documented: https://paymill.com/en-gb/documentation-3/reference/api-reference/#create-new-url-webhook

This fix should be done at a lower level, maybe in `_api_call` or even in the requests library. my pull request fixes this issue for me in `new_webhook`. I wonder why nobody noticed this before. I'm using requests v2.2.1