Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,12 @@ Create

.. code:: python

import hashlib
from pybutton import Client

client = Client('sk-XXX')

hashed_email = hashlib.sha256('user@example.com'.lower().strip()).hexdigest()

response = client.orders.create({
'total': 50,
Expand All @@ -181,8 +184,8 @@ Create
'btn_ref': 'srctok-XXX',
'customer': {
'id': 'mycustomer-1234',
'email_sha256': hashlib.sha256("user@example.com".lower().strip()).hexdigest()
}
'email_sha256': hashed_email,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we want these trailing commas?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a part of our python style guide, just staying idiomatic with the repo

},
})

print(response)
Expand Down