summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-12-06 13:02:31 +0100
committerChristian Grothoff <christian@grothoff.org>2022-12-06 13:02:31 +0100
commit3036b21e51fb494886acf903e135d2115340bd35 (patch)
tree1adebd986f0577c95c2bfbd86c0feeca87447194 /core
parent6567bd869fd123989553211fd09b3b5702fa0948 (diff)
parent18bad641fd92c3ff692c60d127126f450b7a2b14 (diff)
downloaddocs-3036b21e51fb494886acf903e135d2115340bd35.tar.gz
docs-3036b21e51fb494886acf903e135d2115340bd35.tar.bz2
docs-3036b21e51fb494886acf903e135d2115340bd35.zip
Merge branch 'master' of git+ssh://git.taler.net/docs
Diffstat (limited to 'core')
-rw-r--r--core/api-bank-access.rst21
-rw-r--r--core/api-merchant.rst296
-rw-r--r--core/api-wire.rst2
3 files changed, 259 insertions, 60 deletions
diff --git a/core/api-bank-access.rst b/core/api-bank-access.rst
index a33cbdbb..82578391 100644
--- a/core/api-bank-access.rst
+++ b/core/api-bank-access.rst
@@ -81,7 +81,7 @@ name and account password, at least in the GNU Taler demo bank implementation.
}
-.. http:POST:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals
+.. http:post:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals
Create a withdrawal operation, resulting in a ``taler://withdraw`` URI.
@@ -107,7 +107,7 @@ name and account password, at least in the GNU Taler demo bank implementation.
}
-.. http:GET:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals/${withdrawal_id}
+.. http:get:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals/${withdrawal_id}
Query the status of a withdrawal operation.
@@ -143,7 +143,7 @@ name and account password, at least in the GNU Taler demo bank implementation.
}
-.. http:POST:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals/${withdrawal_id}/abort
+.. http:post:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals/${withdrawal_id}/abort
Abort a withdrawal operation. Has no effect on an already aborted withdrawal operation.
@@ -151,7 +151,7 @@ name and account password, at least in the GNU Taler demo bank implementation.
:http:statuscode:`409 Conflict`: The reserve operation has been confirmed previously and can't be aborted.
-.. http:POST:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals/${withdrawal_id}/confirm
+.. http:post:: ${BANK_API_BASE_URL}/accounts/${account_name}/withdrawals/${withdrawal_id}/confirm
Confirm a withdrawal operation. Has no effect on an already confirmed withdrawal operation.
This call is responsible of wiring the funds to the exchange.
@@ -169,7 +169,7 @@ name and account password, at least in the GNU Taler demo bank implementation.
Transactions
------------
-.. http:GET:: ${BANK_API_BASE_URL}/accounts/${account_name}/transactions
+.. http:get:: ${BANK_API_BASE_URL}/accounts/${account_name}/transactions
Retrieve a subset of transactions related to $account_name. Without
query parameters, it returns the last 5 transactions.
@@ -187,7 +187,7 @@ Transactions
transactions: BankAccountTransactionInfo[];
}
-.. http:GET:: ${BANK_API_BASE_URL}/accounts/${account_name}/transactions/${transaction_id}
+.. http:get:: ${BANK_API_BASE_URL}/accounts/${account_name}/transactions/${transaction_id}
**Response**
@@ -218,7 +218,7 @@ Transactions
}
-.. http:POST:: ${BANK_API_BASE_URL}/accounts/${account_name}/transactions
+.. http:post:: ${BANK_API_BASE_URL}/accounts/${account_name}/transactions
Create a new transaction where the bank account with the label ``account_name`` is **debited**.
@@ -247,11 +247,16 @@ Transactions
:http:statuscode:`400 Bad Request`:
the request was invalid or the payto://-URI used unacceptable features.
+.. http:delete:: ${BANK_API_BASE_URL}/accounts/${account_name}
+
+ Delete the bank account (and the customer entry) from the database.
+ Note, customer usernames and bank accounts have the same value.
+
----------------------
Registration (Testing)
----------------------
-.. http:POST:: ${BANK_API_BASE_URL}/testing/register
+.. http:post:: ${BANK_API_BASE_URL}/testing/register
Create a new bank account. This endpoint should be disabled for most deployments, but is useful
for automated testing / integration tests.
diff --git a/core/api-merchant.rst b/core/api-merchant.rst
index 552ee77c..55a4da06 100644
--- a/core/api-merchant.rst
+++ b/core/api-merchant.rst
@@ -16,6 +16,7 @@
@author Marcello Stanisci
@author Florian Dold
@author Christian Grothoff
+ @author Priscilla Huang
.. _merchant-api:
@@ -2972,7 +2973,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.
@@ -2982,19 +2983,19 @@ Adding templates
.. http:post:: [/instances/$INSTANCE]/private/templates
- This is used to create a template.
+ This is used to create a template.
- **Request:**
+ **Request:**
- The request must be a `TemplateAddDetails`.
+ The request must be a `TemplateAddDetails`.
- **Response:**
+ **Response:**
- :http:statuscode:`204 No content`:
- The creation of the template is successful.
- :http:statuscode:`404 Not found`:
- The merchant instance is unknown or it is not in our data.
+ :http:statuscode:`204 No content`:
+ The creation of the template is successful.
+ :http:statuscode:`404 Not found`:
+ The merchant instance is unknown or it is not in our data.
.. ts:def:: TemplateAddDetails
@@ -3045,21 +3046,21 @@ Editing templates
.. http:patch:: [/instances/$INSTANCE]/private/templates/$TEMPLATE_ID
- This is used to update a template.
+ This is used to update a template.
- **Request:**
+ **Request:**
- The request must be a `TemplatePatchDetails`.
+ The request must be a `TemplatePatchDetails`.
- **Response:**
+ **Response:**
- :http:statuscode:`204 No content`:
- The templates has successfully modified.
- :http:statuscode:`404 Not found`:
- The templates(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.
+ :http:statuscode:`204 No content`:
+ The template has successfully modified.
+ :http:statuscode:`404 Not found`:
+ 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.
.. ts:def:: TemplatePatchDetails
@@ -3086,14 +3087,14 @@ Inspecting template
.. http:get:: [/instances/$INSTANCE]/private/templates
- This is used to return the list of all the templates.
+ This is used to return the list of all the templates.
- **Response:**
+ **Response:**
- :http:statuscode:`200 OK`:
+ :http:statuscode:`200 OK`:
The backend has successfully returned all the templates. Returns a `TemplateSummaryResponse`.
- :http:statuscode:`404 Not found`:
+ :http:statuscode:`404 Not found`:
The backend has does not know about the instance.
@@ -3107,7 +3108,7 @@ Inspecting template
-The `TemplatesEntry` object describes a template. It has the following structure:
+ The `TemplatesEntry` object describes a template. It has the following structure:
@@ -3127,16 +3128,16 @@ The `TemplatesEntry` object describes a template. It has the following structure
.. http:get:: [/instances/$INSTANCE]/private/templates/$TEMPLATE_ID
- This is used to obtain detailed information about a specific template.
+ This is used to obtain detailed information about a specific template.
- **Response:**
+ **Response:**
- :http:statuscode:`200 OK`:
- The backend has successfully returned the detailed information about a specific template.
- Returns a `TemplateDetails`.
- :http:statuscode:`404 Not found`:
- The template(ID) is unknown to the backend.
+ :http:statuscode:`200 OK`:
+ The backend has successfully returned the detailed information about a specific template.
+ Returns a `TemplateDetails`.
+ :http:statuscode:`404 Not found`:
+ The template(ID) is unknown to the backend.
.. ts:def:: TemplateDetails
@@ -3162,14 +3163,14 @@ Removing template
.. http:delete:: [/instances/$INSTANCE]/private/templates/$TEMPLATE_ID
- This is used to delete information about a template.
+ This is used to delete information about a template.
- **Response:**
+ **Response:**
- :http:statuscode:`204 No content`:
- The backend has successfully deleted the template.
- :http:statuscode:`404 Not found`:
- The backend does not know the instance or the template.
+ :http:statuscode:`204 No content`:
+ The backend has successfully deleted the template.
+ :http:statuscode:`404 Not found`:
+ The backend does not know the instance or the template.
@@ -3178,25 +3179,25 @@ Using template
.. http:post:: [/instances/$INSTANCES]/templates/$TEMPLATE_ID
- This using template can be modified by everyone and will be used to create order.
+ This using template can be modified by everyone and will be used to create order.
- **Request:**
+ **Request:**
- The request must be a `UsingTemplateDetails` and we accept JSON application and URL encoded.
+ The request must be a `UsingTemplateDetails` and we accept JSON application and URL encoded.
- **Response:**
+ **Response:**
- :http:statuscode:`200 OK`:
- The using template is successful. Returns a `UsingTemplateResponse`.
- :http:statuscode:`302 Found`:
- The client should go to the indicated location. Only returned if the content type was HTML. The target site may allow the client to pay his order.
- :http:statuscode:`404 Not found`:
- The merchant instance is unknown or the template is unknown.
+ :http:statuscode:`200 OK`:
+ The using template is successful. Returns a `UsingTemplateResponse`.
+ :http:statuscode:`302 Found`:
+ The client should go to the indicated location. Only returned if the content type was HTML. The target site may allow the client to pay his order.
+ :http:statuscode:`404 Not found`:
+ The merchant instance is unknown or the template is unknown.
- .. ts:def:: UsingTemplateDetails
+ .. ts:def:: UsingTemplateDetails
interface UsingTemplateDetails {
@@ -3205,19 +3206,210 @@ Using template
// The amount entered by the customer.
amount?: Amount;
- }
+ }
- .. ts:def:: UsingTemplateResponse
+ .. ts:def:: UsingTemplateResponse
interface UsingTemplateResponse {
// 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 confirmation to the merchant. It can be send with a SMS, email or with another method. It 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
+
+ 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
+ http_method: 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 webhook. 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
+ http_method: 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
+ http_method: string;
+
+ // Header template of the webhook
+ header_template?: string;
+
+ // Body template by the webhook
+ body_template?: string;
+
+ }
+
+
+Removing webhook
+-----------------
+
+.. 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 webhook.
+
+ :http:statuscode:`404 Not found`:
+ The webhook(ID) or the instance is unknown to the backend.
+
+
+
------------------
The Contract Terms
------------------
diff --git a/core/api-wire.rst b/core/api-wire.rst
index 63373f68..34c0a0fc 100644
--- a/core/api-wire.rst
+++ b/core/api-wire.rst
@@ -327,6 +327,8 @@ Wire Transfer Test APIs
Endpoints in this section are only used for integration tests and never
exposed by bank gateways in production.
+.. _twg-admin-add-incoming:
+
.. http:post:: ${BASE_URL}/admin/add-incoming
Simulate a transfer from a customer to the exchange. This API is *not*