From b26ca62349df7c97813c44475221273a3dfec8fe Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 22 Jul 2020 20:15:12 +0530 Subject: exchange refund API: don't return refund fees --- core/api-exchange.rst | 5 ----- 1 file changed, 5 deletions(-) (limited to 'core') diff --git a/core/api-exchange.rst b/core/api-exchange.rst index 484533c7..4be71fa6 100644 --- a/core/api-exchange.rst +++ b/core/api-exchange.rst @@ -1419,9 +1419,4 @@ Refunds // explicitly as the client might otherwise be confused by clock skew as to // which signing key was used. exchange_pub: EddsaPublicKey; - - // Refund fee charged by the exchange for the given coin. - // must be smaller than the refund amount. - refund_fee: Amount; - } -- cgit v1.2.3 From 2eeefb197b860ffee00ae6b1aa676e07c1677dee Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 22 Jul 2020 20:52:11 +0530 Subject: refund API improvements --- core/api-merchant.rst | 73 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 20 deletions(-) (limited to 'core') diff --git a/core/api-merchant.rst b/core/api-merchant.rst index 35dc2ff7..4fcec23a 100644 --- a/core/api-merchant.rst +++ b/core/api-merchant.rst @@ -1090,23 +1090,55 @@ Payment processing // List of refund responses about the coins that the wallet // requested an abort for. In the same order as the 'coins' // from the original request. - refunds: RefundResult[]; + // The rtransaction_id is implied to be 0. + refunds: MerchantAbortPayRefundStatus[]; } - .. ts:def:: RefundResult + .. ts:def:: MerchantAbortPayRefundStatus - // RefundResult differs from RefundDetail as in this case we - // can generate a substantially shorter response. - interface RefundResult { - // HTTP status of the request to the exchange. - exchange_http_status: Integer; + type MerchantAbortPayRefundStatus = + | MerchantAbortPayRefundSuccessStatus + | MerchantAbortPayRefundFailureStatus; - // The full reply from the exchange. Note only actually - // a if the \exchange_http_status\ is 200, otherwise - // the error message as defined by the refund API. For - // aborts, the \rtransaction_id\ is always 0. - exchange_reply: RefundSuccess; + .. ts:def:: MerchantAbortPayRefundFailureStatus + // Details about why a refund failed. + interface MerchantAbortPayRefundFailureStatus { + // Used as tag for the sum type RefundStatus sum type. + success: false; + + // HTTP status of the exchange request, must NOT be 200. + exchange_status: Integer; + + // Taler error code from the exchange reply, if available. + exchange_code?: Integer; + + // If available, HTTP reply from the exchange. + exchange_reply?: Object; + } + + .. ts:def:: MerchantAbortPayRefundSuccessStatus + + // Additional details needed to verify the refund confirmation signature + // (``h_contract_terms`` and ``merchant_pub``) are already known + // to the wallet and thus not included. + interface RefundConfirmation { + // Used as tag for the sum type MerchantCoinRefundStatus sum type. + success: true; + + // HTTP status of the exchange request, 200 (integer) required for refund confirmations. + exchange_status: 200; + + // the EdDSA :ref:`signature` (binary-only) with purpose + // `TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND` using a current signing key of the + // exchange affirming the successful refund + exchange_sig: EddsaSignature; + + // public EdDSA key of the exchange that was used to generate the signature. + // Should match one of the exchange's signing keys from /keys. It is given + // explicitly as the client might otherwise be confused by clock skew as to + // which signing key was used. + exchange_pub: EddsaPublicKey; } @@ -1343,7 +1375,7 @@ Payment processing refund_amount: Amount; // Successful refunds for this payment, empty array for none. - refunds: RefundStatus[]; + refunds: MerchantCoinRefundStatus[]; // Public key of the merchant. merchant_pub: EddsaPublicKey; @@ -1366,15 +1398,16 @@ Payment processing } - .. ts:def:: RefundStatus + .. ts:def:: MerchantCoinRefundStatus - type RefundStatus = RefundFailure | RefundConfirmation + type MerchantCoinRefundStatus = + | MerchantCoinRefundSuccessStatus + | MerchantCoinRefundFailureStatus; - - .. ts:def:: RefundFailure + .. ts:def:: MerchantCoinRefundFailureStatus // Details about why a refund failed. - interface RefundFailure { + interface MerchantCoinRefundFailureStatus { // Used as tag for the sum type RefundStatus sum type. success: false; @@ -1399,13 +1432,13 @@ Payment processing } - .. ts:def:: RefundConfirmation + .. ts:def:: MerchantCoinRefundSuccessStatus // Additional details needed to verify the refund confirmation signature // (``h_contract_terms`` and ``merchant_pub``) are already known // to the wallet and thus not included. interface RefundConfirmation { - // Used as tag for the sum type RefundStatus sum type. + // Used as tag for the sum type MerchantCoinRefundStatus sum type. success: true; // HTTP status of the exchange request, 200 (integer) required for refund confirmations. -- cgit v1.2.3 From 8b8544dcc8e27bcc24b90903e26a351843dfb0e1 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 22 Jul 2020 21:38:17 +0530 Subject: rename --- core/api-merchant.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/api-merchant.rst b/core/api-merchant.rst index 4fcec23a..86390681 100644 --- a/core/api-merchant.rst +++ b/core/api-merchant.rst @@ -1122,7 +1122,7 @@ Payment processing // Additional details needed to verify the refund confirmation signature // (``h_contract_terms`` and ``merchant_pub``) are already known // to the wallet and thus not included. - interface RefundConfirmation { + interface MerchantAbortPayRefundSuccessStatus { // Used as tag for the sum type MerchantCoinRefundStatus sum type. success: true; -- cgit v1.2.3