diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-09 03:33:05 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-09 03:33:05 +0100 |
commit | 12447106f6c29ffdb2e5d4ee7fd3abe09a1d117d (patch) | |
tree | 73974b66d351be2420d8fe3bd1627889b39535d3 /api-merchant.rst | |
parent | ad183309a3e159371e3a8dc04da9a8497c68aefa (diff) | |
parent | fd0e5260107f6c418659808b2620484332afd774 (diff) | |
download | docs-12447106f6c29ffdb2e5d4ee7fd3abe09a1d117d.tar.gz docs-12447106f6c29ffdb2e5d4ee7fd3abe09a1d117d.tar.bz2 docs-12447106f6c29ffdb2e5d4ee7fd3abe09a1d117d.zip |
fix typo
Diffstat (limited to 'api-merchant.rst')
-rw-r--r-- | api-merchant.rst | 81 |
1 files changed, 55 insertions, 26 deletions
diff --git a/api-merchant.rst b/api-merchant.rst index abee1d52..6330f3c8 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. @@ -255,7 +255,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: @@ -282,13 +282,11 @@ 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. - sig: EddsaSignature + // Merchant signature over the hashed order id. + // The purpose is `TALER_SIGNATURE_MERCHANT_REFUND_OK`. + sig: EddsaSignature } - + .. http:get:: /refund Shows the refund situation about a transaction @@ -310,14 +308,18 @@ The following API are made available by the merchant's `backend` to the merchant .. _RefundLookup: .. code-block:: tsref +<<<<<<< HEAD interface RefundLookupResponse { refund_permissions: RefundPermission[]; } interface RefundPermission { +======= + interface RefundLookup { +>>>>>>> fd0e5260107f6c418659808b2620484332afd774 // 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; @@ -336,20 +338,52 @@ 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. - Note that tipping is not yet implemented! - **Request** The request body is a `TipCreateRequest`_ object. **Response** - + :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. :status 412 Precondition Failed: The tip amount requested exceeds the available reserve balance for tipping. @@ -358,7 +392,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; @@ -375,7 +409,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; @@ -386,14 +420,12 @@ 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. **Response** - + :status 200 OK: A tip is being returned. The backend responds with a `TipResponse`_ :status 401 Unauthorized: @@ -408,9 +440,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; @@ -425,7 +454,7 @@ The following API are made available by the merchant's `backend` to the merchant // coin's blinded public key coin_ev: CoinEnvelope; - + } .. _TipResponse: @@ -439,7 +468,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. @@ -447,9 +476,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 <https://docs.taler.net/operate-merchant.html#instances-lab>`_ which is being tracked. + :query instance: (optional) identificative token of the merchant `instance <https://docs.taler.net/operate-merchant.html#instances-lab>`_ which is being tracked. **Response:** @@ -686,7 +715,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`. |