gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-docs] branch master updated: webhook


From: gnunet
Subject: [taler-docs] branch master updated: webhook
Date: Fri, 25 Nov 2022 11:47:14 +0100

This is an automated email from the git hooks/post-receive script.

priscilla-huang pushed a commit to branch master
in repository docs.

The following commit(s) were added to refs/heads/master by this push:
     new 2179ee1  webhook
2179ee1 is described below

commit 2179ee1d9742011875c52ddf21d52334e895f2d3
Author: priscilla <priscilla.huang@efrei.net>
AuthorDate: Fri Nov 25 05:46:32 2022 -0500

    webhook
---
 core/api-merchant.rst | 199 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 195 insertions(+), 4 deletions(-)

diff --git a/core/api-merchant.rst b/core/api-merchant.rst
index 552ee77..1469c81 100644
--- a/core/api-merchant.rst
+++ b/core/api-merchant.rst
@@ -2972,7 +2972,7 @@ Checking tip status
 Template
 --------
 
-The templates is a backend feature that is used to create an order. We use the 
template to have some static information that cannot be changed by the customer.
+The template is a backend feature that is used to create an order. We use the 
template to have some static information that cannot be changed by the customer.
 The template is private and allows us to be flexible. The private template 
allows for greater security and allows us to have a minimum information we need 
for each store.
 
 
@@ -3054,9 +3054,9 @@ Editing templates
    **Response:**
 
    :http:statuscode:`204 No content`:
-     The templates has successfully modified.
+     The template has successfully modified.
    :http:statuscode:`404 Not found`:
-     The templates(ID) is unknown to the backend.
+     The template(ID) is unknown to the backend.
    :http:statuscode:`409 Conflict`:
      The provided information is inconsistent with the current state of the 
template. Changes made is the same with
      another store.
@@ -3214,10 +3214,201 @@ Using template
 
        // After enter the request. The user will be pay with a taler URL.
        taler_url: string;
-       
    }
 
 
+
+
+
+
+
+--------
+Webhooks
+--------
+
+The webhook is a backend feature that is used to send a sms to the merchant. 
This sms will confirm that the
+customer paid the merchant. It will show the date and the price the customer 
paid.
+
+
+
+Adding webhooks
+---------------
+
+.. http:post:: [/instances/$INSTANCES]/private/webhooks/$WEBHOOK_ID
+
+  This is used to create a webhook.
+
+  **Request:**
+
+  The request must be a `WebhookAddDetails`.
+
+  **Response:**
+
+  :http:statuscode:`204 No content`:
+    The creation of the webhook is successsful.
+
+  :http:statuscode:`404 Not found`:
+    The merchant instance is unknowm or it not in our data.
+
+  .. ts:def:: WebhookAddDetails
+
+    interface WebhookAddDetails {
+
+      // Webhook ID to use.
+      webhook_id: string;
+
+      // The event of the webhook: why the webhook is used.
+      event_type: string;
+
+      // URL of the webhook where the customer will be redirected.
+      url: string;
+
+      // Method used by the webhook
+      methods: string;
+
+      // Header template of the webhook
+      header_template?: string;
+
+      // Body template by the webhook
+      body_template?: string;
+
+   }
+
+
+Editing webhooks
+----------------
+
+.. http:patch:: [/instances/$INSTANCES]/private/webhooks/$WEBHOOK_ID
+
+  This is used to update a webhook.
+
+  **Request:**
+
+  The request must be a `WebhookPatchDetails`.
+
+  **Response:**
+
+  :http:statuscode:`204 No content`:
+     The webhook has successfully modified.
+  :http:statuscode:`404 Not found`:
+     The webhook(ID) is unknown to the backend.
+  :http:statuscode:`409 Conflict`:
+     The provided information is inconsistent with the current state of the 
template. Changes made is the same with another store.
+
+  .. ts:def:: WebhookPatchDetails
+
+    interface WebhookPatchDetails {
+
+      // The event of the webhook: why the webhook is used.
+      event_type: string;
+
+      // URL of the webhook where the customer will be redirected.
+      url: string;
+
+      // Method used by the webhook
+      methods: string;
+
+      // Header template of the webhook
+      header_template?: string;
+
+      // Body template by the webhook
+      body_template?: string;
+
+   }
+
+
+
+Inspecting webhook
+------------------
+
+.. http:get:: [/instances/$INSTANCES]/private/webhooks
+
+   This is used to return the list of all the webhooks.
+
+   **Response:**
+
+  :http:statuscode:`200 OK`:
+    The backend has successfully returned all the webhooks. Returns a 
`WebhookSummaryResponse`.
+
+  :http:statuscode:`404 Not found`:
+    The backend has does not know about the instance.
+
+  .. ts:def:: WebhookSummaryResponse
+
+    interface WebhookSummaryResponse {
+
+      // List of webhooks that are present in our backend.
+      webhooks_list: WebhookEntry[];
+
+   }
+
+  The WebhookEntry object describes a webhook. It has the following structure:
+
+  .. ts:def:: WebhookEntry
+
+    interface WebhookEntry {
+
+      // Webhook identifier, as found in the webhook.
+      webhook_id: string;
+
+      // The event of the webhook: why the webhook is used.
+      event_type: string;
+
+   }
+
+
+.. http:get:: [/instances/$INSTANCES]/private/webhooks/$WEBHOOK_ID
+
+   This is used to obtain detailed information about apecific template.
+
+   **Response:**
+
+  :http:statuscode:`200 OK`:
+    The backend has successfully returned the detailed information about a 
specific webhook. Returns a `Webhookdetails`.
+
+  :http:statuscode:`404 Not found`:
+    The webhook(ID) is unknown to the backend.
+
+
+  .. ts:def:: WebhookDetails
+
+    interface WebhookDetails {
+
+      // The event of the webhook: why the webhook is used.
+      event_type: string;
+
+      // URL of the webhook where the customer will be redirected.
+      url: string;
+
+      // Method used by the webhook
+      methods: string;
+
+      // Header template of the webhook
+      header_template?: string;
+
+      // Body template by the webhook
+      body_template?: string;
+
+   }
+
+
+Removing template
+-----------------
+
+.. http:delete:: [/instances/$INSTANCES]/private/webhooks/$WEBHOOK_ID
+
+   This is used to delete information about a webhook.
+
+   **Response:**
+
+  :http:statuscode:`204 No content`:
+    The backend has successfully deleted the template.
+
+  :http:statuscode:`404 Not found`:
+    The webhook(ID) or the instance is unknown to the backend.
+
+
+
 ------------------
 The Contract Terms
 ------------------

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]