diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-10-08 17:13:57 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-10-08 17:13:57 +0200 |
commit | 4ba07b54e4ea2ac75c408f795cd806409450bc29 (patch) | |
tree | a9fe35d75de203450ea1eb16a83c3f2bcc527c65 /src/exchange/taler-exchange-httpd_batch-deposit.c | |
parent | d3c509fcd91e5b7e430eda767108d961db196522 (diff) |
WIP: policy_*_fulfiment added and API changes
- policy_fulfilment table defined, handlers added
- policy_details_fulfilment table defined, handlers added
- TALER_extensions_serial_from_policy_details implemened
Diffstat (limited to 'src/exchange/taler-exchange-httpd_batch-deposit.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_batch-deposit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/exchange/taler-exchange-httpd_batch-deposit.c b/src/exchange/taler-exchange-httpd_batch-deposit.c index 17bbb2c1..d4a9666e 100644 --- a/src/exchange/taler-exchange-httpd_batch-deposit.c +++ b/src/exchange/taler-exchange-httpd_batch-deposit.c @@ -91,7 +91,7 @@ struct BatchDepositContext * deposit operation, possibly NULL! */ json_t *policy_details; - bool no_policy_details; + bool has_policy_details; /** * Hash over @e policy_details, might be all zero; @@ -174,7 +174,7 @@ again: &TEH_keys_exchange_sign_, &bdc->h_contract_terms, &bdc->h_wire, - bdc->no_policy_details ? NULL : &bdc->h_policy, + bdc->has_policy_details ? &bdc->h_policy : NULL, bdc->exchange_timestamp, bdc->wire_deadline, bdc->refund_deadline, @@ -474,7 +474,8 @@ parse_coin (struct MHD_Connection *connection, &dc->h_wire, &dc->h_contract_terms, &deposit->coin.h_age_commitment, - dc->no_policy_details ? NULL : &dc->h_policy, + dc->has_policy_details ? &dc->h_policy : + NULL, &deposit->coin.denom_pub_hash, dc->timestamp, &dc->merchant_pub, @@ -517,6 +518,7 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc, struct BatchDepositContext dc; json_t *coins; bool no_refund_deadline = true; + bool no_policy_details = true; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("merchant_payto_uri", &dc.payto_uri), @@ -531,7 +533,7 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc, GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_json ("policy", &dc.policy_details), - &dc.no_policy_details), + &no_policy_details), GNUNET_JSON_spec_timestamp ("timestamp", &dc.timestamp), GNUNET_JSON_spec_mark_optional ( @@ -562,6 +564,8 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc, return MHD_YES; /* failure */ } + dc.has_policy_details = ! no_policy_details; + /* validate merchant's wire details (as far as we can) */ { char *emsg; @@ -606,7 +610,7 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc, TALER_merchant_wire_signature_hash (dc.payto_uri, &dc.wire_salt, &dc.h_wire); - if (! dc.no_policy_details) + if (dc.has_policy_details) { TALER_deposit_policy_hash (dc.policy_details, &dc.h_policy); |