summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorpriscilla <priscilla.huang@efrei.net>2022-11-15 11:40:48 -0500
committerpriscilla <priscilla.huang@efrei.net>2022-11-15 11:45:19 -0500
commita112d096190fffa94572e5f660e0ef75f1834743 (patch)
treec0e294f6250b2af7a33c42b1ef5006eeee03e52f /core
parente8ba4a9850c38623c79e5faf94b8a45bc104e0e1 (diff)
downloaddocs-a112d096190fffa94572e5f660e0ef75f1834743.tar.gz
docs-a112d096190fffa94572e5f660e0ef75f1834743.tar.bz2
docs-a112d096190fffa94572e5f660e0ef75f1834743.zip
Update
Diffstat (limited to 'core')
-rw-r--r--core/api-merchant.rst61
1 files changed, 17 insertions, 44 deletions
diff --git a/core/api-merchant.rst b/core/api-merchant.rst
index 4d1df249..552ee77c 100644
--- a/core/api-merchant.rst
+++ b/core/api-merchant.rst
@@ -3031,9 +3031,9 @@ Adding templates
// Minimum age buyer must have (in years). Default is 0.
minimum_age: Integer;
- // The time that indicates the duration of the created order before it is deleted.
+ // The time the customer need to pay before his order will be deleted.
// It is deleted if the customer did not pay and if the duration is over.
- pay_duration: TimeLimit;
+ pay_duration: RelativeTime;
}
@@ -3173,75 +3173,48 @@ Removing template
-Dynamic template
+Using template
----------------
.. http:post:: [/instances/$INSTANCES]/templates/$TEMPLATE_ID
- This dynamic 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:**
- The request must be a `DynamicTemplateDetails`.
+ The request must be a `UsingTemplateDetails` and we accept JSON application and URL encoded.
**Response:**
:http:statuscode:`200 OK`:
- The creation of the dynamic template is successful. Returns a `DynamicTemplateResponse`.
- :http:statuscode:`202 Accepted`:
- If the user use a browser, he should be redirected to the provided locations to finish his order. The reponse will be an `RedirectTemplate`. After being redirected, it will returns `DynamicTemplateResponse`.
- If the user use the application Taler, he will not redirected to another location.
+ 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 it is not in our data.
-
-
- .. ts:def:: DynamicTemplateDetails
-
- interface DynamicTemplateDetails {
-
- // Subject of the template
- subject?: string;
-
- // The amount entered by the customer
- amount?: Amount;
- }
+ The merchant instance is unknown or the template is unknown.
- .. ts:def:: DynamicTemplateWebBrowser
+ .. ts:def:: UsingTemplateDetails
- interface DynamicTemplateWebBrowser {
+ interface UsingTemplateDetails {
// Subject of the template
subject?: string;
- // The amount entered by the customer
+ // The amount entered by the customer.
amount?: Amount;
-
- // The button the user needs to complete his order.
- button_url: RedirectTemplate;
-
}
- .. ts:def:: DynamicTemplateResponse
-
- interface DynamicTemplateResponse {
-
- // After enter the request. The user will be pay with QR code.
- public_qrcode: string;
-
- }
-
-
- .. ts:def:: RedirectTemplate
- interface RedirectTemplate {
+ .. ts:def:: UsingTemplateResponse
- // The user should go to the URL.
- // He will be redirected to finish his order and pay on it.
- public_url: string;
+ interface UsingTemplateResponse {
+ // After enter the request. The user will be pay with a taler URL.
+ taler_url: string;
+
}