taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

check-peer-push-debit.rst (2389B)


      1 .. ts:op:: checkPeerPushDebit
      2   :deprecated:
      3 
      4   This operation is **deprecated**.  Use
      5   :ts:op:`checkPeerPushDebitV2` instead.
      6 
      7   Check if initiating a peer push payment is possible based on the
      8   funds in the wallet.  Unlike the V2 operation, an insufficient
      9   balance is reported via the
     10   ``WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE`` error instead of a
     11   typed result.
     12 
     13   **Request:**
     14 
     15   The request body must be a `CheckPeerPushDebitRequest` object.
     16 
     17   **Response:**
     18 
     19   On success, the result is a `CheckPeerPushDebitOkResponse` object.
     20 
     21   **Side effects:**
     22 
     23   May refresh the selected exchange's key material over the network.
     24 
     25   **Expected errors:**
     26 
     27   The caller can handle the following errors inline:
     28   ``WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE`` (also reported
     29   when no exchange can serve the payment),
     30   ``WALLET_CORE_API_BAD_REQUEST``.
     31 
     32 .. ts:def:: CheckPeerPushDebitRequest
     33 
     34   interface CheckPeerPushDebitRequest {
     35     // Preferred exchange to use for the p2p payment.
     36     exchangeBaseUrl?: string;
     37 
     38     // Instructed amount.
     39     amount: AmountString;
     40 
     41     // Restrict the scope of funds that can be spent via the given
     42     // scope info.
     43     restrictScope?: ScopeInfo;
     44 
     45     progressToken?: string;
     46   }
     47 
     48 .. ts:def:: CheckPeerPushDebitOkResponse
     49 
     50   interface CheckPeerPushDebitOkResponse {
     51     type: "ok";
     52 
     53     amountRaw: AmountString;
     54 
     55     amountEffective: AmountString;
     56 
     57     // Exchange base URL.
     58     exchangeBaseUrl: string;
     59 
     60     // Maximum expiration date, based on how close the coins used for
     61     // the payment are to expiry.  The value is based on when the
     62     // wallet would typically refresh the coins on its own, leaving
     63     // enough time to get a refund for the push payment and refresh
     64     // the coin.
     65     maxExpirationDate: TalerProtocolTimestamp;
     66 
     67     // Default expiration: the default given by the exchange
     68     // (or 1 week if the exchange does not specify it), capped so
     69     // that the purse does not outlive the coins' maxExpirationDate.
     70     defaultExpiration: TalerProtocolDuration;
     71 
     72     // Opaque description of the values reviewed by the caller.
     73     // Passing this back to initiatePeerPushDebit makes wallet-core
     74     // reject the operation when coin selection, fees or the selected
     75     // exchange changed in the meantime.  Optional for compatibility
     76     // with older wallet-core implementations.
     77     peerPushDebitQuote?: string;
     78   }