commit 2e069122fdc72a1db83ed15ae8df6a2e4f199286
parent d313c1dd2b373ab29d24fad7279c2a7d3cbc4b47
Author: Sebastian <sebasjm@taler-systems.com>
Date: Tue, 12 May 2026 16:50:59 -0300
choices is an array not an obj
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/contrib/paywall.en.must b/contrib/paywall.en.must
@@ -17,6 +17,8 @@
const MERCHANT_BACKEND = '{{ merchant_backend }}';
const MERCHANT_TEMPLATE_ID = '{{ template_id }}';
const MAX_PICKUP_DELAY = {{ max_pickup_delay }}; // in seconds
+ const TEMPLATE_SUMMARY = '{{ sumary }}';
+ const TEMPLATE_CHOICES = '{{{ choices }}}';
const POLL_WAIT_MS = 30000;
</script>
<script>
diff --git a/src/backend/paivana-httpd_templates.c b/src/backend/paivana-httpd_templates.c
@@ -284,7 +284,7 @@ load_paywall (struct MHD_Connection *conn,
GNUNET_JSON_pack_string (
"summary",
t->summary)),
- GNUNET_JSON_pack_object_incref (
+ GNUNET_JSON_pack_array_steal (
"choices",
t->choices),
GNUNET_JSON_pack_uint64 (
@@ -373,7 +373,7 @@ parse_template (struct Template *t,
{
const char *regex = NULL;
const char *summary = NULL;
- const json_t *choices;
+ const json_t *choices = NULL;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("website_regex",
@@ -383,8 +383,8 @@ parse_template (struct Template *t,
GNUNET_JSON_spec_string ("summary",
&summary),
NULL),
- GNUNET_JSON_spec_object_const ("choices",
- &choices),
+ GNUNET_JSON_spec_array_const ("choices",
+ &choices),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_relative_time ("max_pickup_duration",
&t->max_pickup_delay),