Skip to content

Commit 882199a

Browse files
Release 4.2.0
1 parent 3c34eb7 commit 882199a

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,39 @@ payment_page_url = transaction_payment_page_service.payment_page_url(space_id=sp
108108
# redirect your customer to this payment_page_url
109109
```
110110

111+
### Integrating Webhook Payload Signing Mechanism into webhook callback handler
112+
113+
The HTTP request which is sent for a state change of an entity now includes an additional field `state`, which provides information about the update of the monitored entity's state. This enhancement is a result of the implementation of our webhook encryption mechanism.
114+
115+
Payload field `state` provides direct information about the state update of the entity, making additional API calls to retrieve the entity state redundant.
116+
117+
#### ⚠️ Warning: Generic Pseudocode
118+
119+
> **The provided pseudocode is intentionally generic and serves to illustrate the process of enhancing your API to leverage webhook payload signing. It is not a complete implementation.**
120+
>
121+
> Please ensure that you adapt and extend this code to meet the specific needs of your application, including appropriate security measures and error handling.
122+
For a detailed webhook payload signing mechanism understanding we highly recommend referring to our comprehensive
123+
[Webhook Payload Signing Documentation](https://app-wallee.com/doc/webhooks#_webhook_payload_signing_mechanism).
124+
125+
```python
126+
@app.route('/webhook/callback', methods=['POST'])
127+
def handle_webhook():
128+
request_payload = request.data.decode('utf-8')
129+
signature = request.headers.get('x-signature')
130+
131+
if not signature:
132+
# Make additional API call to retrieve the entity state
133+
# ...
134+
else:
135+
if webhook_encryption_service().is_content_valid(signature_header=signature, content_to_verify=request_payload):
136+
# Parse request_payload to extract 'state' value
137+
# Process entity's state change
138+
# ...
139+
140+
# Process the received webhook data
141+
# ...
142+
143+
```
111144

112145
## License
113146

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
long_description = fh.read()
77

88
NAME = "wallee"
9-
VERSION = "4.1.0"
9+
VERSION = "4.2.0"
1010

1111
REQUIRES = [
1212
"certifi >= 14.05.14",

wallee/api_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
Python SDK
66
7-
OpenAPI spec version: 4.1.0
7+
OpenAPI spec version: 4.2.0
88
99
"""
1010

@@ -67,7 +67,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
6767
self.default_headers[header_name] = header_value
6868
self.cookie = cookie
6969
# Set default User-Agent.
70-
self.user_agent = 'wallee/4.1.0/python'
70+
self.user_agent = 'wallee/4.2.0/python'
7171

7272
def __del__(self):
7373
if self._pool is not None:
@@ -106,7 +106,7 @@ def __call_api(
106106

107107
# predefined default headers
108108
default_headers = {
109-
'x-meta-sdk-version': '4.1.0',
109+
'x-meta-sdk-version': '4.2.0',
110110
'x-meta-sdk-language': 'python',
111111
'x-meta-sdk-provider': 'wallee',
112112
'x-meta-sdk-language-version': platform.python_version()

wallee/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,6 @@ def to_debug_report(self):
262262
return "Python SDK Debug Report:\n"\
263263
"OS: {env}\n"\
264264
"Python Version: {pyversion}\n"\
265-
"Version of the API: 4.1.0\n"\
266-
"SDK Package Version: 4.1.0".\
265+
"Version of the API: 4.2.0\n"\
266+
"SDK Package Version: 4.2.0".\
267267
format(env=sys.platform, pyversion=sys.version)

0 commit comments

Comments
 (0)