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
+119-2Lines changed: 119 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,130 @@ An Open Payments server runs two sub-systems, a resource server which exposes AP
21
21
22
22
## Local development
23
23
24
-
### Dependencies
25
-
26
24
- Python >= 3.11
25
+
26
+
To install python visit [Python Download](https://www.python.org/downloads/)
27
+
27
28
- Poetry
29
+
To install poetry visit [Poetry Documentation](https://python-poetry.org/docs/).
28
30
29
31
### Installation
30
32
33
+
1. Activate your virtual emvironment. No need to create one, Poetry creates one.
34
+
Read [managing environments in Poetry](https://python-poetry.org/docs/managing-environments/).
35
+
36
+
2. Install the dependencies in the poetry.lock
37
+
31
38
```
32
39
> poetry install
33
40
```
41
+
42
+
## Usage
43
+
44
+
To use this SDK, you will first need to install it in your project. Currently, you will need to build from source but once it is hosted on PyPi you will be able to install it with `pip`.
45
+
46
+
```bash
47
+
python3 -m pip install open-payments-python-sdk #currently not setup
The client is to be created after you have created a key pair and have obtained the `kid` and `private_key`
87
+
88
+
Some helper functions have been created to ease key pair creation. A class called `KeyManager` has been created and it provides functions to create a key pair and load a private key from UTF-8 string. It also returns an object that has information to be registered at the AS when registering the public key.
89
+
90
+
```python
91
+
import json
92
+
from open_payments_sdk.gnap_utils.keys import KeyManager
public_key = private_key.public_key() # derive public key from private key
113
+
```
114
+
115
+
## Wallets
116
+
117
+
You can use the created client to interact with the resource server. In this case we will use it to interact with a wallet address to get the wallet address details and jwks.json
You can use the created client to request a grant from the authorization server. In this case we will use it to request a grant for an incoming payment resource. Check the [fixtures](./tests/conftest.py) file to see the request body.
0 commit comments