Skip to content
Snippets Groups Projects

Fixed dataformat. Moved transactions list onto voucher.

Merged Ruben.Havre requested to merge bugfix/fix-dataformat into master
All threads resolved!
Files
13
+ 19
18
@@ -4,25 +4,12 @@ Client for doing HTTP requests to the SETRA api
```python
from setra_client import SetraClient
from setra_client.models import Batch, Multi, Transaction, Voucher
from setra_client.models import Batch, Transaction, Voucher
c = SetraClient(url='https://example.com',
client = SetraClient(url='https://example.com',
headers={'X-Gravitee-API-Key': 'c-d-a-b'})
batch = Batch.from_dict({
"client": 1,
"batchid": 2,
"period": 3,
"interface": 4,
"vouchertype": 5,
"batchid_interface": 6
})
vouchers = [Voucher.from_dict({
"batchid": 1,
"voucherno_interface": 2,
"exref": 3,
"voucherno": 4
})]
transactions = [Transaction.from_dict({
"voucherid": 1,
"account": 1,
@@ -44,8 +31,22 @@ transactions = [Transaction.from_dict({
"extinvref": 1
})]
multi = Multi(batch=batch, vouchers=vouchers, transactions=transactions)
response = c.post_multi(multi)
vouchers = [Voucher.from_dict({
"exref": 3,
"voucherno": 4,
"transactions": transactions
})]
batch = Batch.from_dict({
"client": 1,
"batchid": 2,
"period": 3,
"interface": 4,
"vouchertype": 5,
"vouchers": vouchers
})
response = client.post_new_batch(batch)
```
Running tests
Loading