8000 Update README.rst (#24) · button/button-client-python@73cc25e · GitHub
[go: up one dir, main page]

Skip to content

Commit 73cc25e

Browse files
author
Will Myers
authored
Update README.rst (#24)
1 parent 08c00f2 commit 73cc25e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ Create
169169

170170
.. code:: python
171171
172+
import hashlib
172173
from pybutton import Client
173174
174175
client = Client('sk-XXX')
176+
177+
hashed_email = hashlib.sha256('user@example.com'.lower().strip()).hexdigest()
175178
176179
response = client.orders.create({
177180
'total': 50,
@@ -181,8 +184,8 @@ Create
181184
'btn_ref': 'srctok-XXX',
182185
'customer': {
183186
'id': 'mycustomer-1234',
184-
'email_sha256': hashlib.sha256("user@example.com".lower().strip()).hexdigest()
185-
}
187+
'email_sha256': hashed_email,
188+
},
186189
})
187190
188191
print(response)

0 commit comments

Comments
 (0)
0