From a76dc6a4c66ed9ecce34ba84e6bfe2b910660b2c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Jul 2017 03:41:07 +0200 Subject: fix outdated fields and names --- api-common.rst | 23 ++++++++--------------- api-exchange.rst | 18 ++++-------------- api-merchant.rst | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/api-common.rst b/api-common.rst index 1e7cbf8e..b9acd5cc 100644 --- a/api-common.rst +++ b/api-common.rst @@ -481,11 +481,10 @@ within the * purpose.purpose = TALER_SIGNATURE_WALLET_COIN_DEPOSIT */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_proposal_data; + struct GNUNET_HashCode h_contract_terms; struct GNUNET_HashCode h_wire; struct GNUNET_TIME_AbsoluteNBO timestamp; struct GNUNET_TIME_AbsoluteNBO refund_deadline; - uint64_t transaction_id; struct TALER_AmountNBO amount_with_fee; struct TALER_AmountNBO deposit_fee; struct TALER_MerchantPublicKeyP merchant; @@ -500,9 +499,8 @@ within the * purpose.purpose = TALER_SIGNATURE_WALLET_CONFIRM_DEPOSIT */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_proposal_data; + struct GNUNET_HashCode h_contract_terms; struct GNUNET_HashCode h_wire; - uint64_t transaction_id; struct GNUNET_TIME_AbsoluteNBO timestamp; struct GNUNET_TIME_AbsoluteNBO refund_deadline; struct TALER_AmountNBO amount_without_fee; @@ -615,9 +613,8 @@ within the * purpose.purpose = TALER_SIGNATURE_MASTER_SEPA_DETAILS || TALER_SIGNATURE_MASTER_TEST_DETAILS */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_proposal_data; + struct GNUNET_HashCode h_contract_terms; struct GNUNET_HashCode h_wire; - uint64_t transaction_id; struct TALER_MerchantPublicKeyP merchant; struct TALER_CoinSpendPublicKeyP coin_pub; }; @@ -626,9 +623,8 @@ within the .. sourcecode:: c struct TALER_WireDepositDetailP { - struct GNUNET_HashCode h_proposal_data; + struct GNUNET_HashCode h_contract_terms; struct GNUNET_TIME_AbsoluteNBO execution_time; - uint64_t transaction_id; struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_AmountNBO deposit_value; struct TALER_AmountNBO deposit_fee; @@ -679,7 +675,7 @@ within the * purpose.purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_proposal_data; + struct GNUNET_HashCode h_contract_terms; }; .. _TALER_ContractPS: @@ -690,10 +686,9 @@ within the * purpose.purpose = TALER_SIGNATURE_MERCHANT_CONTRACT */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - uint64_t transaction_id; struct TALER_AmountNBO total_amount; struct TALER_AmountNBO max_fee; - struct GNUNET_HashCode h_proposal_data; + struct GNUNET_HashCode h_contract_terms; struct TALER_MerchantPublicKeyP merchant_pub; }; @@ -706,10 +701,9 @@ within the */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; struct GNUNET_HashCode h_wire; - struct GNUNET_HashCode h_proposal_data; + struct GNUNET_HashCode h_contract_terms; struct TALER_WireTransferIdentifierRawP wtid; struct TALER_CoinSpendPublicKeyP coin_pub; - uint64_t transaction_id; struct GNUNET_TIME_AbsoluteNBO execution_time; struct TALER_AmountNBO coin_contribution; }; @@ -722,8 +716,7 @@ within the * purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - struct GNUNET_HashCode h_proposal_data; - uint64_t transaction_id; + struct GNUNET_HashCode h_contract_terms; struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_MerchantPublicKeyP merchant; uint64_t rtransaction_id; diff --git a/api-exchange.rst b/api-exchange.rst index dd9dbd6d..af9e1999 100644 --- a/api-exchange.rst +++ b/api-exchange.rst @@ -610,7 +610,7 @@ denomination. // SHA-512 hash of the contact of the merchant with the customer. Further // details are never disclosed to the exchange. - h_proposal_data: HashCode; + h_contract_terms: HashCode; // `coin's public key `_, both ECDHE and EdDSA. coin_pub: CoinPublicKey; @@ -631,9 +631,6 @@ denomination. // the merchant, in case of successful payment. pay_deadline: Timestamp; - // 64-bit transaction id for the transaction between merchant and customer - transaction_id: number; - // EdDSA `public key of the merchant `_, so that the client can identify the // merchant for refund requests. merchant_pub: EddsaPublicKey; @@ -732,7 +729,7 @@ denomination. // Hash over the proposal data of the contract that // is being paid (if type is "DEPOSIT") or refunded (if // `type` is "REFUND"); otherwise absent. - h_proposal_data?: HashCode; + h_contract_terms?: HashCode; // Refund transaction ID. Only present if `type` is // "REFUND" @@ -1225,11 +1222,7 @@ typically also view the balance.) interface TrackTransferDetail { // SHA-512 hash of the contact of the merchant with the customer. - h_proposal_data: HashCode; - - // 64-bit transaction id for the transaction between merchant and - // customer - transaction_id: number; + h_contract_terms: HashCode; // coin's public key, both ECDHE and EdDSA. coin_pub: CoinPublicKey; @@ -1272,14 +1265,11 @@ typically also view the balance.) H_wire: HashCode; // SHA-512 hash of the contact of the merchant with the customer. - h_proposal_data: HashCode; + h_contract_terms: HashCode; // coin's public key, both ECDHE and EdDSA. coin_pub: CoinPublicKey; - // 64-bit transaction id for the transaction between merchant and customer - transaction_id: number; - // the EdDSA public key of the merchant, so that the client can identify // the merchant for refund requests. merchant_pub: EddsaPublicKey; diff --git a/api-merchant.rst b/api-merchant.rst index 7bfe85fa..58f7f11c 100644 --- a/api-merchant.rst +++ b/api-merchant.rst @@ -117,7 +117,7 @@ The Frontend HTTP API The error codes and data sent to the wallet are a mere copy of those gotten from the exchange when attempting to pay. The section about :ref:`deposit ` explains them in detail. -.. http:post:: fulfillment_url +.. http:get:: fulfillment_url URL that shows the product after it has been purchased. Going to the a fulfillment URL before the payment was completed must trigger the payment process. @@ -139,12 +139,17 @@ The Frontend HTTP API (and therefore not spending additional money). -.. http:post:: refund_url +.. http:get:: refund_url Although this POST is issued by the merchant UI, wallets are supposed to catch its response. In the successful case, this response will have a `402 Payment Required` status code, and a `X-Taler-Refund-Url` header containing the refund data URL. +.. http:POST:: user_tipping_url + + URL that the customer's wallet can post coin planchets to, and will receive withdraw + permissions in return. + ------------------------------ The Merchant Backend HTTP API ------------------------------ @@ -313,6 +318,44 @@ The following API are made available by the merchant's `backend` to the merchant merchant_sig: EddsaSignature; } + +.. http:post:: /tip + + Authorize a tip that can be picked up by the customer's wallet by POSTing to `/tip`. + + **Request** + + The request body is a `TipCreateRequest`_ object. + + **Response** + + :status 200 OK: + The refund amount has been increased, the backend responds with a `TipCreateConfirmation`_ + :status 400 Bad request: + The refund amount is not consistent: it is not bigger than the previous one. + + .. _RefundRequest: + .. code-block:: tsref + + interface RefundRequest { + // Amount that the customer should be tipped + refund: Amount; + + // Human-readable refund justification + reason: string; + + // Merchant instance issuing the request + instance: string; + } + + .. _TipCreateConfirmation: + .. code-block:: tsref + + interface TipCreateConfirmation { + // Identifier for the tip authorization + tip_id: string; + } + .. http:get:: /track/transfer Provides deposits associated with a given wire transfer. -- cgit v1.2.3