commit 2111c93933d951f7dce32a5e2c3e4bf4f84b60d3
parent ac497f189fb09521c0d4682e9f8496fcfc642ffa
Author: Emmanuel Benoist <emmanuel.benoist@bfh.ch>
Date: Tue, 22 Apr 2025 18:08:01 +0200
Adding some notes about the REST demonstration
Diffstat:
1 file changed, 108 insertions(+), 1 deletion(-)
diff --git a/presentations/2025-eurodig/slides/slides-EuroDIG2025.tex b/presentations/2025-eurodig/slides/slides-EuroDIG2025.tex
@@ -366,7 +366,9 @@ for Android, ...):
-\section{Create a merchant account}
+\section{Manipulate merchant backend}
+\subsection{Using Single Page Application}
+
\begin{frame}
\frametitle{Create a merchant account and your first order}
@@ -394,10 +396,115 @@ for Android, ...):
\end{column}
\end{columns}
+
+\end{frame}
+
+\subsection{Using RESTfull API}
+
+\begin{frame}[containsverbatim]
+ \frametitle{Use Rest API}
+
+ \begin{block}{Connect from your program}
+ \begin{itemize}
+ \item RESTfull interface
+ \item CRUD functionalities
+ \item Interfacable with any system
+ \end{itemize}
+ \end{block}
+
+\begin{verbatim}
+curl --request GET \
+--url https://backend.demo.taler.net/instances/sandbox/private/products \
+--header 'Authorization: Bearer secret-token:sandbox' \
+--header 'User-Agent: yourApp/0.0.1'
+
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile,fragile]
+ \frametitle{Insert a new order}
+ \begin{block}{Create an order for the product 1}
+
+ \end{block}
+\begin{verbatim}
+curl --request POST \
+ --url https://backend.demo.taler.net/instances/sandbox/private/orders \
+ --header 'Authorization: Bearer secret-token:sandbox' \
+ --header 'Content-Type: application/json' \
+ --header 'User-Agent: yourApp/0.0.1' \
+ --data '{"order":{ \
+ "version": 0, \
+ "amount": "KUDOS:10", \
+ "summary": "Test for EuroDIG", \
+ "fulfillment_message": "Thank you"\
+ }}'
+
+
+curl --request POST \
+ --url https://backend.demo.taler.net/instances/sandbox/private/products \
+ --header 'Authorization: Bearer secret-token:sandbox' \
+ --header 'Content-Type: application/json' \
+ --header 'User-Agent: yourApp/0.0.1' \
+ --data '{"address":{},"description_i18n":{},
+ "taxes":[],"next_restock":{"t_s":"never"},
+ "price":"KUDOS:5","product_id":"0001-2",
+ "description":"Cryptography course",
+ "unit":"piece","total_stock":-1}'
+
+
+curl --request POST \
+ --url https://backend.demo.taler.net/instances/sandbox/private/orders \
+ --header 'Authorization: Bearer secret-token:sandbox' \
+ --header 'Content-Type: application/json' \
+ --header 'User-Agent: yourApp/0.0.1' \
+ --data '{"order":{
+ "amount": "KUDOS:10",
+ "summary": "Test for EuroDIG",
+ "fulfillment_message": "Thank you"}}'
+
+
+curl --request POST \
+ --url https://backend.demo.taler.net/instances/sandbox/private/orders \
+ --header 'Authorization: Bearer secret-token:sandbox' \
+ --header 'Content-Type: application/json' \
+ --header 'User-Agent: yourApp/0.0.1' \
+ --data '{"order":{
+ "amount": "KUDOS:10",
+ "summary": "Test for EuroDIG",
+ "fulfillment_message": "Thank you"},
+ "create_token":false}'
+
+\end{verbatim}
+
+ Got the message as a response:
+\begin{verbatim}
+{
+ "order_id": "2025.112-0080M3T5162RE",
+ "token": "YTRXG5FQ8WTAC3PWRCMT4GMYA4"
+}%
+
+{
+ "order_id": "2025.112-02CDQQYASFPPY"
+}%
+
+\end{verbatim}
\end{frame}
+\begin{frame}
+ \frametitle{Generate the payment URL}
+
+ \begin{block}{URL : "https://"+Host +"/orders/" + payment ID}
+\begin{verbatim}
+https://backend.demo.taler.net/instances/sandbox/private/orders/2025.112-02CDQQYASFPPY
+\end{verbatim}
+\begin{verbatim}
+taler://pay/backend.demo.taler.net/instances/sandbox/private/2025.112-02CDQQYASFPPY
+\end{verbatim}
+
+ \end{block}
+\end{frame}
\section{Questions et réponses}