You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,15 @@ This open-source project was sponsored by:
22
22
## Table of Contents
23
23
24
24
-[Installing the library](#installing-the-library)
25
-
-[Getting Started - Generating Token](#getting-started---generating-token)
25
+
-[Getting Started - Generating Tokens](#getting-started---generating-tokens)
26
+
-[Getting Started - Decoding a Token](#getting-started---decoding-a-token)
26
27
27
28
28
29
## Installing the library
29
30
30
31
You can install the library by running `pip install openpaygo` or adding `openpaygo` in your requirements.txt file and running `pip install -r requirements.txt`.
31
32
32
-
## Getting Started - Generating Token
33
+
## Getting Started - Generating Tokens
33
34
34
35
You can use the `generate_token()` function to generate an OpenPAYGOToken Token. The function takes the following parameters, and they should match the configuration in the hardware of the device:
35
36
@@ -48,7 +49,7 @@ The function returns the `updated_count` as a number as well as the `token` as a
48
49
**Example 1 - Add 7 days:**
49
50
50
51
```
51
-
from openpaygo.optoken import generate_token
52
+
from openpaygo import generate_token
52
53
from myexampleproject import device_getter
53
54
54
55
# We get a device with the parameters we need from our database, this will be specific to your project
@@ -68,7 +69,7 @@ device.save() # We save the new count that we set for the device
68
69
**Example 2 - Disable PAYG (unlock forever):**
69
70
70
71
```
71
-
from openpaygo.optoken import generate_token, TokenType
72
+
from openpaygo import generate_token, TokenType
72
73
73
74
...
74
75
@@ -109,7 +110,7 @@ The function will raise a `ValueError` if the key is in the wrong format, but wi
109
110
**Example:**
110
111
111
112
```
112
-
from openpaygo.optoken import decode_token
113
+
from openpaygo import decode_token
113
114
114
115
# We assume the users enters a token and that the device state is saved in my_device_state
0 commit comments