Skip to content

Commit e2225d4

Browse files
committed
Improve Taler demo seeding
1 parent 9381314 commit e2225d4

3 files changed

Lines changed: 186 additions & 62 deletions

File tree

docker/taler/README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,30 @@ To seed for a specific company:
6868
docker compose exec -e TALER_DEMO_COMPANY_UUID=<company_uuid> application php artisan db:seed --class="Fleetbase\\Ledger\\Seeders\\Testing\\TalerDemoSeeder"
6969
```
7070

71-
The seeder creates an idempotent FleetOps-style payload, order, service quote,
72-
purchase rate, tracking number, core transaction, transaction items, and sent
73-
Ledger invoice in `KUDOS`. The order should appear in FleetOps Orders as
74-
`TALER-DEMO-KUDOS`. Open the seeded public payment link shown by the seeder:
71+
The default demo invoice amount is `KUDOS 0.50`. To seed a specific invoice
72+
amount, use a decimal `KUDOS` value:
73+
74+
```sh
75+
docker compose exec -e TALER_DEMO_COMPANY_UUID=<company_uuid> -e TALER_DEMO_AMOUNT=5.00 application php artisan db:seed --class="Fleetbase\\Ledger\\Seeders\\Testing\\TalerDemoSeeder"
76+
```
77+
78+
By default, each seeder run creates a fresh payable FleetOps-style payload,
79+
order, service quote, purchase rate, tracking number, core transaction,
80+
transaction items, and sent Ledger invoice in `KUDOS`. This lets you repeat the
81+
wallet checkout flow without reusing a Taler order that has already been paid.
82+
The order should appear in FleetOps Orders as `TALER-DEMO-KUDOS-<run_suffix>`.
83+
Open the seeded public payment link shown by the seeder:
7584

7685
```txt
7786
/~/invoice?id=<invoice_public_id>
7887
```
7988

89+
To intentionally update the same demo fixture, provide a stable run id:
90+
91+
```sh
92+
docker compose exec -e TALER_DEMO_COMPANY_UUID=<company_uuid> -e TALER_DEMO_RUN_ID=nlnet-demo-001 application php artisan db:seed --class="Fleetbase\\Ledger\\Seeders\\Testing\\TalerDemoSeeder"
93+
```
94+
8095
## Wallet notes
8196

8297
The local bank suggests the local exchange to wallets. To add KUDOS to the GNU

docker/taler/init-instance.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ webhook_payload="$(jq -n \
133133
url: $url,
134134
http_method: "POST",
135135
header_template: "Content-Type: application/json",
136-
body_template: "{\"order_id\":\"${order_id}\",\"event_type\":\"pay\"}"
136+
body_template: "{\"order_id\":\"${ORDER_ID}\",\"event_type\":\"pay\"}"
137137
}')"
138138

139139
webhook_response="$(api POST "/instances/${INSTANCE_ID}/private/webhooks" "${webhook_payload}" "${auth_header}")"

0 commit comments

Comments
 (0)