Skip to content

Commit a185630

Browse files
committed
Release v1.5.0
1 parent ae44e14 commit a185630

File tree

15 files changed

+148
-20
lines changed

15 files changed

+148
-20
lines changed

.gitignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
.idea
2-
xolphin-api-python.iml
3-
test.py
4-
*.pyc
5-
dist
6-
xolphin_api.egg-info
1+
build/
2+
dist/
3+
xolphin_api.egg-info/
4+
.idea/
5+
*.py~

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
4+
## [1.5.0] - 2017-03-09
5+
### Added
6+
- Compatability with Xolphin REST Api v1.5.0
7+
- Request Notes: You are able to get all and send your own request notes
8+
- Certificate Requests: If there are open request notes for the customer, a new field 'requiresAction' will be set in the CertificateRequest object
9+
- Certificate Requests: You can now send a language parameter with the request, which will be used for (eg) the Subscriber Agreement
10+
- Certificate Requests: A new field 'brandValidation' is added, which is used to indicate if the request is being held for review due to specific brand names
11+
12+
### Fixed
13+
- Ability to upload files

README.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,32 @@ Request certificate
8181
request = client.request().send(ccr)
8282
print(request.id)
8383
84+
Create a note
85+
~~~~~~~~~~~~~
86+
87+
.. code:: python
88+
89+
result = client.request().send_note(1234, 'My message')
90+
print(result.message);
91+
92+
Get list of notes
93+
~~~~~~~~~~~~~~~~~
94+
95+
.. code:: python
96+
97+
result = client.request().get_notes(1234)
98+
for note in result:
99+
print(note.messageBody);
100+
101+
Send a "Comodo Subscriber Agreement" email
102+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103+
104+
.. code:: python
105+
106+
//currently available languages: en, de, fr, nl
107+
result = client.request().send_ComodoSA(124, 'test@example.com')
108+
print(result.message);
109+
84110
Certificate
85111
~~~~~~~~~~~
86112

readme.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ for request in requests:
4747
print(request.id, request.product.id)
4848
```
4949

50-
### Getting request by ID
50+
#### Getting request by ID
5151

5252
```python
5353
request = client.request().get(961992637)
5454
print(request.product.brand)
5555
```
5656

57-
### Request certificate
57+
#### Request certificate
5858

5959
```python
6060
ccr = client.request().create(24, 1, 'csr string', 'EMAIL')
@@ -66,6 +66,8 @@ ccr.approver_email = 'email@domain.com'
6666
ccr.zipcode = '123456'
6767
ccr.city = 'City'
6868
ccr.company = 'Company'
69+
# currently available languages: en, de, fr, nl
70+
ccr.language = 'en'
6971
ccr.subject_alternative_names.append('test1.domain.com')
7072
ccr.subject_alternative_names.append('test2.domain.com')
7173
ccr.dcv.append({
@@ -78,6 +80,31 @@ request = client.request().send(ccr)
7880
print(request.id)
7981
```
8082

83+
#### Create a note
84+
85+
```python
86+
result = client.request().send_note(1234, 'My message')
87+
print(result.message);
88+
```
89+
90+
#### Get list of notes
91+
92+
```python
93+
result = client.request().get_notes(1234)
94+
95+
for note in result:
96+
print(note.messageBody);
97+
```
98+
99+
#### Send a "Comodo Subscriber Agreement" email
100+
101+
```python
102+
//currently available languages: en, de, fr, nl
103+
result = client.request().send_ComodoSA(124, 'test@example.com')
104+
print(result.message);
105+
```
106+
107+
81108
### Certificate
82109

83110
#### Certificates list and expirations

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def read(*paths):
1212

1313
setup(
1414
name='xolphin-api',
15-
version='1.1.0',
15+
version='1.5.0',
1616
author='Xolphin',
1717
author_email='info@xolphin.com',
1818
license='MIT',

xolphin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from __future__ import absolute_import
55

66
__author__ = 'Xolphin'
7-
__version__ = '1.0.0'
7+
__version__ = '1.5.0'
88

99
from .client import Client
1010
#from .errors import TwinglyException
@@ -14,4 +14,4 @@
1414
#from .parser import Parser
1515
#from .post import Post
1616
#from .query import Query
17-
#from .result import Result
17+
#from .result import Result

xolphin/certificate_requests/create_certificate_request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def __init__(self, product, years, csr, dcv_type):
2020
self.approver_phone = ''
2121
self.kvk = ''
2222
self.reference = ''
23+
self.language = ''
2324

2425
def toDict(self):
2526
result = {
@@ -43,5 +44,6 @@ def toDict(self):
4344
if self.approver_phone != '': result['approverPhone'] = self.approver_phone
4445
if self.kvk != '': result['kvk'] = self.kvk
4546
if self.reference != '': result['reference'] = self.reference
47+
if self.language != '': result['language'] = self.language
4648

4749
return result

xolphin/certificate_requests/reissue_certificate_request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def __init__(self, csr, dcv_type):
1818
self.approver_phone = ''
1919
self.kvk = ''
2020
self.reference = ''
21+
self.language = ''
2122

2223
def toDict(self):
2324
result = {
@@ -39,5 +40,6 @@ def toDict(self):
3940
if self.approver_phone != '': result['approverPhone'] = self.approver_phone
4041
if self.kvk != '': result['kvk'] = self.kvk
4142
if self.reference != '': result['reference'] = self.reference
43+
if self.language != '': result['language'] = self.language
4244

4345
return result

xolphin/certificate_requests/renew_certificate_request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def __init__(self, product, years, csr, dcv_type):
2020
self.approver_phone = ''
2121
self.kvk = ''
2222
self.reference = ''
23+
self.language = ''
2324

2425
def toDict(self):
2526
result = {
@@ -43,5 +44,6 @@ def toDict(self):
4344
if self.approver_phone != '': result['approverPhone'] = self.approver_phone
4445
if self.kvk != '': result['kvk'] = self.kvk
4546
if self.reference != '': result['reference'] = self.reference
47+
if self.language != '': result['language'] = self.language
4648

4749
return result

xolphin/client.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@
1818

1919
class Client(object):
2020
BASE_URL = 'https://api.xolphin.com/v1/'
21-
VERSION = '1.1'
21+
BASE_URL_TEST = 'https://test-api.xolphin.com/v1/'
22+
VERSION = '1.5.0'
23+
24+
def __init__(self, username, password, test = False):
25+
26+
if(test):
27+
self.url = self.BASE_URL_TEST
28+
else:
29+
self.url = self.BASE_URL
2230

23-
def __init__(self, username, password):
2431
self.username = username
2532
self.password = password
2633

@@ -34,14 +41,14 @@ def __init__(self, username, password):
3441
#self._session.verify = False
3542

3643
def get(self, method, data={}):
37-
response = self._session.get("%s%s" % (Client.BASE_URL, method), params=data)
44+
response = self._session.get("%s%s" % (self.url, method), params=data)
3845
if 200 <= response.status_code < 300:
3946
return json.loads(response.content.decode('utf-8'))
4047
else:
4148
raise Exception(response.content)
4249

4350
def download(self, method, data={}):
44-
response = self._session.get("%s%s" % (Client.BASE_URL, method), params=data)
51+
response = self._session.get("%s%s" % (self.url, method), params=data)
4552
if 200 <= response.status_code < 300:
4653
return response
4754
else:
@@ -51,10 +58,10 @@ def post(self, method, data={}):
5158
payload = {}
5259
for k in data:
5360
if k == 'document':
54-
payload[k] = ('document.pdf', str(data[k]), 'application/pdf')
61+
payload[k] = (data['description'], data[k], 'application/pdf')
5562
else:
5663
payload[k] = (None, str(data[k]))
57-
response = self._session.post("%s%s" % (Client.BASE_URL, method), files=payload)
64+
response = self._session.post("%s%s" % (self.url, method), files=payload)
5865
if 200 <= response.status_code < 300:
5966
return json.loads(response.content.decode('utf-8'))
6067
else:

0 commit comments

Comments
 (0)