From df48100198297b993ad47f25cf4584536a9d507a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 22 Oct 2017 17:54:48 +0200 Subject: bump API version, fix minor issue in tip spec --- api-merchant.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'api-merchant.rst') diff --git a/api-merchant.rst b/api-merchant.rst index 3dbc33cf..639d1795 100644 --- a/api-merchant.rst +++ b/api-merchant.rst @@ -42,14 +42,14 @@ The Frontend HTTP API triggered by a "402 Payment Required" response, it will issue a GET request to the proposal URL and show the proposal to the user. The "402 Payment Required" trigger instructs the wallet whether or - not to provide the optional `nonce` parameter. + not to provide the optional `nonce` parameter. **Request:** :query nonce: Any string value. This value will be included in the proposal, so that when the wallet receives the proposal it can easily check whether it was the genuine receiver of the proposal it got. - This value is needed to avoid having multiple customers pay for + This value is needed to avoid having multiple customers pay for the same proposal, which might be bad if the number of goods that can be shipped is limited. @@ -250,7 +250,7 @@ The following API are made available by the merchant's `backend` to the merchant The request body is a `RefundRequest`_ object. **Response** - + :status 200 OK: The refund amount has been increased, the backend responds with a `RefundConfirmation`_ :status 400 Bad request: @@ -281,9 +281,9 @@ The following API are made available by the merchant's `backend` to the merchant // that the purpose is set to zero. However, this value // is not meant to be soon verified by the frontend, but // could be showed in court. - sig: EddsaSignature + sig: EddsaSignature } - + .. http:get:: /refund Shows the refund situation about a transaction @@ -299,11 +299,11 @@ The following API are made available by the merchant's `backend` to the merchant .. _RefundLookup: .. code-block:: tsref - + interface RefundLookup { // Coin from which the refund is going to be taken - coin_pub: EddsaPublicKey; + coin_pub: EddsaPublicKey; // Refund amount taken from coin_pub refund_amount: Amount; @@ -333,7 +333,7 @@ The following API are made available by the merchant's `backend` to the merchant The request body is a `TipCreateRequest`_ object. **Response** - + :status 200 OK: A tip has been created. The backend responds with a `TipCreateConfirmation`_ :status 412 Precondition Failed: @@ -344,7 +344,7 @@ The following API are made available by the merchant's `backend` to the merchant interface TipCreateRequest { // Amount that the customer should be tipped - refund: Amount; + amount: Amount; // Merchant instance issuing the request instance: string; @@ -379,7 +379,7 @@ The following API are made available by the merchant's `backend` to the merchant The request body is a `TipPickupRequest`_ object. **Response** - + :status 200 OK: A tip is being returned. The backend responds with a `TipResponse`_ :status 401 Unauthorized: @@ -411,7 +411,7 @@ The following API are made available by the merchant's `backend` to the merchant // coin's blinded public key coin_ev: CoinEnvelope; - + } .. _TipResponse: @@ -425,7 +425,7 @@ The following API are made available by the merchant's `backend` to the merchant reserve_sigs: EddsaSignature[]; } - + .. http:get:: /track/transfer Provides deposits associated with a given wire transfer. @@ -433,9 +433,9 @@ The following API are made available by the merchant's `backend` to the merchant **Request** :query wtid: raw wire transfer identifier identifying the wire transfer (a base32-encoded value) - :query wire_method: name of the wire transfer method used for the wire transfer + :query wire_method: name of the wire transfer method used for the wire transfer :query exchange: base URI of the exchange that made the wire transfer - :query instance: (optional) identificative token of the merchant `instance `_ which is being tracked. + :query instance: (optional) identificative token of the merchant `instance `_ which is being tracked. **Response:** @@ -672,7 +672,7 @@ The following API are made available by the merchant's `backend` to the merchant A typical usage is to firstly call this API without `start` and `date` parameter, then fetch the oldest `row_id` from the results, and then keep calling the API by using the oldest row ID as `start` parameter. This way we simply "scroll" results from the youngest to the oldest, `delta` entries at time. - + **Response** :status 200 OK: The response is a JSON `array` of `TransactionHistory`_. The array is sorted such that entry `i` is younger than entry `i+1`. -- cgit v1.2.3 From b483058f436cfdab7718e87bd65eb8cc4f5adbd1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 22 Oct 2017 18:49:28 +0200 Subject: spec /tip-enable API, remove unnecessary instance from /tip-pickup --- api-merchant.rst | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'api-merchant.rst') diff --git a/api-merchant.rst b/api-merchant.rst index 639d1795..ee9238cb 100644 --- a/api-merchant.rst +++ b/api-merchant.rst @@ -322,6 +322,38 @@ The following API are made available by the merchant's `backend` to the merchant } +.. http:post:: /tip-enable + + Enable tipping by telling the backend that a reserve was created with funds for tipping. + + **Request** + + The request body is a `TipEnable`_ object. Note that if an existing, + non-expired reserve is credited, the credits are added and the + expiration time is updated to the max of the expiration times. + + **Response** + + :status 200 OK: + A reserve with credit for tipping has been created. The response is empty. + + .. _TipEnable: + .. code-block:: tsref + + interface TipEnable { + // Amount that was credited to the reserve + credit: Amount; + + // Expiration time for the reserve + expiration: Timestamp; + + // Private key of the reserve + reserve_priv: ReservePrivateKeyP; + + // Unique ID for the wire transfer, used to detect duplicate credits + credit_uuid: HashCode; + } + .. http:post:: /tip-authorize Authorize a tip that can be picked up by the customer's wallet by POSTing to `/tip-pickup`. Note that this is simply the authorization step the back office has to trigger first. The frontend must return the tip's identifier (and exchange URL) via a "402 Payment Required" response to the wallet. @@ -394,9 +426,6 @@ The following API are made available by the merchant's `backend` to the merchant interface TipPickupRequest { - // Merchant instance issuing the request - instance: string; - // Identifier of the tip. tip_id: HashCode; -- cgit v1.2.3 From c34524651e97324f5c48e96f2f49db8395573246 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 1 Nov 2017 12:17:17 +0100 Subject: minor fixes to protocol spec --- api-merchant.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'api-merchant.rst') diff --git a/api-merchant.rst b/api-merchant.rst index ee9238cb..2a20dba3 100644 --- a/api-merchant.rst +++ b/api-merchant.rst @@ -368,6 +368,8 @@ The following API are made available by the merchant's `backend` to the merchant :status 200 OK: A tip has been created. The backend responds with a `TipCreateConfirmation`_ + :status 404 Not Found: + The instance is unknown to the backend. :status 412 Precondition Failed: The tip amount requested exceeds the available reserve balance for tipping. @@ -393,7 +395,7 @@ The following API are made available by the merchant's `backend` to the merchant tip_id: HashCode; // Expiration time for obtaining the tip - tip_expiration: Timestamp; + expiration: Timestamp; // URI of the exchange from where the tip can be withdrawn exchange_uri: String; -- cgit v1.2.3 From a8f4c3e8ecc4f6740613b550aef52da0a3efcfbe Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 1 Nov 2017 12:35:35 +0100 Subject: minor fixes to protocol spec --- api-merchant.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api-merchant.rst') diff --git a/api-merchant.rst b/api-merchant.rst index 2a20dba3..21e257dc 100644 --- a/api-merchant.rst +++ b/api-merchant.rst @@ -369,7 +369,7 @@ The following API are made available by the merchant's `backend` to the merchant :status 200 OK: A tip has been created. The backend responds with a `TipCreateConfirmation`_ :status 404 Not Found: - The instance is unknown to the backend. + The instance is unknown to the backend, expired or was never enabled. :status 412 Precondition Failed: The tip amount requested exceeds the available reserve balance for tipping. -- cgit v1.2.3 From b8e656ca832da0ade6d465269185440b91370796 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Wed, 15 Nov 2017 13:21:22 +0100 Subject: remove outdated note --- api-merchant.rst | 4 ---- exts/__pycache__/tsref.cpython-35.pyc | Bin 7463 -> 7453 bytes 2 files changed, 4 deletions(-) (limited to 'api-merchant.rst') diff --git a/api-merchant.rst b/api-merchant.rst index 21e257dc..be3767ac 100644 --- a/api-merchant.rst +++ b/api-merchant.rst @@ -358,8 +358,6 @@ The following API are made available by the merchant's `backend` to the merchant Authorize a tip that can be picked up by the customer's wallet by POSTing to `/tip-pickup`. Note that this is simply the authorization step the back office has to trigger first. The frontend must return the tip's identifier (and exchange URL) via a "402 Payment Required" response to the wallet. - Note that tipping is not yet implemented! - **Request** The request body is a `TipCreateRequest`_ object. @@ -406,8 +404,6 @@ The following API are made available by the merchant's `backend` to the merchant Handle request from wallet to pick up a tip. - Note that tipping is not yet implemented! - **Request** The request body is a `TipPickupRequest`_ object. diff --git a/exts/__pycache__/tsref.cpython-35.pyc b/exts/__pycache__/tsref.cpython-35.pyc index b209b4b6..bbfb48dc 100644 Binary files a/exts/__pycache__/tsref.cpython-35.pyc and b/exts/__pycache__/tsref.cpython-35.pyc differ -- cgit v1.2.3 From 95077e83925e9e5696501e3bb47ee9efb1fa1214 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 30 Nov 2017 11:21:54 +0100 Subject: properly document TALER_SIGNATURE_MERCHANT_REFUND_OK --- api-common.rst | 11 +++++++++++ api-merchant.rst | 8 +++----- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'api-merchant.rst') diff --git a/api-common.rst b/api-common.rst index b9acd5cc..1526d7ef 100644 --- a/api-common.rst +++ b/api-common.rst @@ -724,6 +724,17 @@ within the struct TALER_AmountNBO refund_fee; }; + struct TALER_MerchantRefundConfirmationPS { + /** + * purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND_OK + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + /** + * Hash of the order ID (a string), hashed without the 0-termination. + */ + struct GNUNET_HashCode h_order_id; + }; + .. _TALER_PaybackRequestPS: .. sourcecode:: c diff --git a/api-merchant.rst b/api-merchant.rst index be3767ac..996bbb32 100644 --- a/api-merchant.rst +++ b/api-merchant.rst @@ -277,10 +277,8 @@ The following API are made available by the merchant's `backend` to the merchant .. code-block:: tsref interface RefundConfirmation { - // Merchant signature over the hashed order id. Note - // that the purpose is set to zero. However, this value - // is not meant to be soon verified by the frontend, but - // could be showed in court. + // Merchant signature over the hashed order id. + // The purpose is `TALER_SIGNATURE_MERCHANT_REFUND_OK`. sig: EddsaSignature } @@ -367,7 +365,7 @@ The following API are made available by the merchant's `backend` to the merchant :status 200 OK: A tip has been created. The backend responds with a `TipCreateConfirmation`_ :status 404 Not Found: - The instance is unknown to the backend, expired or was never enabled. + The instance is unknown to the backend, expired or was never enabled. :status 412 Precondition Failed: The tip amount requested exceeds the available reserve balance for tipping. -- cgit v1.2.3