prepare-peer-pull-debit.rst (1856B)
1 .. ts:op:: preparePeerPullDebit 2 3 Prepare for an incoming peer pull payment: another wallet requests 4 to be paid by this wallet. The request is identified either by a 5 ``taler://pay-pull/`` URI received from the other party or by the 6 ``transactionId`` of an existing peer-pull-debit transaction. 7 8 **Request:** 9 10 The request body must be a `PreparePeerPullDebitRequest` object. 11 Either ``talerUri`` or ``transactionId`` must be specified. 12 13 **Response:** 14 15 On success, the result is a `PreparePeerPullDebitResponse` object, 16 carrying the contract terms and the amounts, so that the user can 17 review the request before paying with :ts:op:`confirmPeerPullDebit`. 18 19 **Side effects:** 20 21 Fetches the contract and purse status from the exchange over the 22 network and creates a peer pull debit transaction in dialog state. 23 24 **Expected errors:** 25 26 The caller can handle the following errors inline: 27 ``WALLET_PEER_CONTRACT_NOT_FOUND``, 28 ``WALLET_PEER_PULL_DEBIT_PURSE_GONE``, 29 ``WALLET_PEER_PULL_DEBIT_ALREADY_PAID``, 30 ``WALLET_PEER_PULL_PAYMENT_INSUFFICIENT_BALANCE``, 31 ``WALLET_TALER_URI_MALFORMED``, ``WALLET_TRANSACTION_NOT_FOUND``. 32 33 .. ts:def:: PreparePeerPullDebitRequest 34 35 // Either talerUri or transactionId must be specified. 36 interface PreparePeerPullDebitRequest { 37 talerUri?: string; 38 transactionId?: string; 39 40 progressToken?: string; 41 } 42 43 .. ts:def:: PreparePeerPullDebitResponse 44 45 interface PreparePeerPullDebitResponse { 46 contractTerms: PeerContractTerms; 47 48 amountRaw: AmountString; 49 amountEffective: AmountString; 50 51 transactionId: TransactionIdStr; 52 53 // State of the existing or newly created transaction. 54 txState: TransactionState; 55 56 exchangeBaseUrl: string; 57 58 scopeInfo: ScopeInfo; 59 60 // Deprecated: redundant field with bad name, will be removed soon. 61 amount: AmountString; 62 }