diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-07-10 10:37:25 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-07-10 10:37:25 +0200 |
commit | 3ebb5281bc62ca6231f6131e0601471d9ef03b8b (patch) | |
tree | 28037cedcb8383e5b32c8d11ae527612efb0609c /src/backend/taler-merchant-httpd.c | |
parent | c4b27ca9b9a5ef4291257e4a8b8f4bac56720b89 (diff) | |
download | merchant-3ebb5281bc62ca6231f6131e0601471d9ef03b8b.tar.gz merchant-3ebb5281bc62ca6231f6131e0601471d9ef03b8b.tar.bz2 merchant-3ebb5281bc62ca6231f6131e0601471d9ef03b8b.zip |
tip -> reward
Diffstat (limited to 'src/backend/taler-merchant-httpd.c')
-rw-r--r-- | src/backend/taler-merchant-httpd.c | 93 |
1 files changed, 74 insertions, 19 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index 1c8b80d0..1697268b 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -31,7 +31,7 @@ #include "taler-merchant-httpd_config.h" #include "taler-merchant-httpd_exchanges.h" #include "taler-merchant-httpd_get-orders-ID.h" -#include "taler-merchant-httpd_get-tips-ID.h" +#include "taler-merchant-httpd_get-rewards-ID.h" #include "taler-merchant-httpd_mhd.h" #include "taler-merchant-httpd_private-delete-account-ID.h" #include "taler-merchant-httpd_private-delete-instances-ID.h" @@ -54,8 +54,8 @@ #include "taler-merchant-httpd_private-get-orders-ID.h" #include "taler-merchant-httpd_private-get-reserves.h" #include "taler-merchant-httpd_private-get-reserves-ID.h" -#include "taler-merchant-httpd_private-get-tips-ID.h" -#include "taler-merchant-httpd_private-get-tips.h" +#include "taler-merchant-httpd_private-get-rewards-ID.h" +#include "taler-merchant-httpd_private-get-rewards.h" #include "taler-merchant-httpd_private-get-transfers.h" #include "taler-merchant-httpd_private-patch-webhooks-ID.h" #include "taler-merchant-httpd_private-patch-templates-ID.h" @@ -70,7 +70,7 @@ #include "taler-merchant-httpd_private-post-products.h" #include "taler-merchant-httpd_private-post-products-ID-lock.h" #include "taler-merchant-httpd_private-post-reserves.h" -#include "taler-merchant-httpd_private-post-reserves-ID-authorize-tip.h" +#include "taler-merchant-httpd_private-post-reserves-ID-authorize-reward.h" #include "taler-merchant-httpd_private-post-templates.h" #include "taler-merchant-httpd_private-post-transfers.h" #include "taler-merchant-httpd_private-post-webhooks.h" @@ -80,7 +80,7 @@ #include "taler-merchant-httpd_post-orders-ID-pay.h" #include "taler-merchant-httpd_post-using-templates.h" #include "taler-merchant-httpd_post-orders-ID-refund.h" -#include "taler-merchant-httpd_post-tips-ID-pickup.h" +#include "taler-merchant-httpd_post-rewards-ID-pickup.h" #include "taler-merchant-httpd_reserves.h" #include "taler-merchant-httpd_spa.h" #include "taler-merchant-httpd_statics.h" @@ -303,13 +303,13 @@ static void do_shutdown (void *cls) { (void) cls; - TMH_force_tip_resume (); + TMH_force_reward_resume (); TMH_force_ac_resume (); TMH_force_pc_resume (); TMH_force_kyc_resume (); TMH_force_rc_resume (); TMH_force_gorc_resume (); - TMH_force_tip_pickup_resume (); + TMH_force_reward_pickup_resume (); TMH_force_wallet_get_order_resume (); TMH_force_wallet_refund_order_resume (); { @@ -927,40 +927,75 @@ url_handler (void *cls, .method = MHD_HTTP_METHOD_DELETE, .handler = &TMH_private_delete_reserves_ID }, - /* POST /reserves/$ID/authorize-tip: */ + /* POST /reserves/$ID/authorize-reward: */ + { + .url_prefix = "/reserves/", + .url_suffix = "authorize-reward", + .have_id_segment = true, + .method = MHD_HTTP_METHOD_POST, + .handler = &TMH_private_post_reserves_ID_authorize_reward, + /* the body should be pretty small, allow 1 MB of upload + to set a conservative bound for sane wallets */ + .max_upload = 1024 * 1024 + }, + // FIXME: legacy API { .url_prefix = "/reserves/", .url_suffix = "authorize-tip", .have_id_segment = true, .method = MHD_HTTP_METHOD_POST, - .handler = &TMH_private_post_reserves_ID_authorize_tip, + .handler = &TMH_private_post_reserves_ID_authorize_reward, /* the body should be pretty small, allow 1 MB of upload to set a conservative bound for sane wallets */ .max_upload = 1024 * 1024 }, - /* POST /tips: */ + /* POST /rewards: */ + { + .url_prefix = "/rewards", + .method = MHD_HTTP_METHOD_POST, + .handler = &TMH_private_post_rewards, + /* the body should be pretty small, allow 1 MB of upload + to set a conservative bound for sane wallets */ + .max_upload = 1024 * 1024 + }, + // FIXME: legacy API { .url_prefix = "/tips", .method = MHD_HTTP_METHOD_POST, - .handler = &TMH_private_post_tips, + .handler = &TMH_private_post_rewards, /* the body should be pretty small, allow 1 MB of upload to set a conservative bound for sane wallets */ .max_upload = 1024 * 1024 }, - /* GET /tips: */ + /* GET /rewards: */ + { + .url_prefix = "/rewards", + .allow_deleted_instance = true, + .method = MHD_HTTP_METHOD_GET, + .handler = &TMH_private_get_rewards + }, + // FIXME: legacy API { .url_prefix = "/tips", .allow_deleted_instance = true, .method = MHD_HTTP_METHOD_GET, - .handler = &TMH_private_get_tips + .handler = &TMH_private_get_rewards }, - /* GET /tips/$ID: */ + /* GET /rewards/$ID: */ + { + .url_prefix = "/rewards/", + .method = MHD_HTTP_METHOD_GET, + .allow_deleted_instance = true, + .have_id_segment = true, + .handler = &TMH_private_get_rewards_ID + }, + // FIXME: legacy API { .url_prefix = "/tips/", .method = MHD_HTTP_METHOD_GET, .allow_deleted_instance = true, .have_id_segment = true, - .handler = &TMH_private_get_tips_ID + .handler = &TMH_private_get_rewards_ID }, /* GET /reserves: */ { @@ -1220,22 +1255,42 @@ url_handler (void *cls, .have_id_segment = true, .handler = &TMH_get_orders_ID }, - /* GET /tips/$ID: */ + /* GET /rewards/$ID: */ + { + .url_prefix = "/rewards/", + .method = MHD_HTTP_METHOD_GET, + .allow_deleted_instance = true, + .have_id_segment = true, + .handler = &TMH_get_rewards_ID + }, + // FIXME: legacy API { .url_prefix = "/tips/", .method = MHD_HTTP_METHOD_GET, .allow_deleted_instance = true, .have_id_segment = true, - .handler = &TMH_get_tips_ID + .handler = &TMH_get_rewards_ID + }, + /* POST /rewards/$ID/pickup: */ + { + .url_prefix = "/rewards/", + .method = MHD_HTTP_METHOD_POST, + .have_id_segment = true, + .allow_deleted_instance = true, + .url_suffix = "pickup", + .handler = &TMH_post_rewards_ID_pickup, + /* wallet may give us many coins to sign, allow 1 MB of upload + to set a conservative bound for sane wallets */ + .max_upload = 1024 * 1024 }, - /* POST /tips/$ID/pickup: */ + // FIXME: legacy API { .url_prefix = "/tips/", .method = MHD_HTTP_METHOD_POST, .have_id_segment = true, .allow_deleted_instance = true, .url_suffix = "pickup", - .handler = &TMH_post_tips_ID_pickup, + .handler = &TMH_post_rewards_ID_pickup, /* wallet may give us many coins to sign, allow 1 MB of upload to set a conservative bound for sane wallets */ .max_upload = 1024 * 1024 |