prepare-pay-for-uri-v2.rst (1807B)
1 .. ts:op:: preparePayForUriV2 2 3 Prepare to make a payment based on a ``taler://pay/`` URI. 4 5 Creates a payment transaction for the order identified by the URI, or 6 reuses the existing transaction if the wallet already knows the order. 7 The contract terms are then downloaded and processed by the 8 transaction. Use :ts:op:`getChoicesForPayment` to inspect the payable 9 choices and :ts:op:`confirmPay` to confirm the payment. 10 11 **Request:** 12 13 The ``args`` must be a `PreparePayRequest` object. 14 15 **Response:** 16 17 On success, the result is a `PreparePayV2Result` object. 18 19 **Side effects:** 20 21 The operation itself is deliberately local-only: it creates (or 22 reuses) the payment transaction record in the wallet database and 23 wakes the transaction's background task. Claiming the order and 24 downloading the contract terms from the merchant happen 25 asynchronously as part of the transaction's processing; the 26 transaction moves to dialog state once the contract terms have been 27 downloaded. 28 29 **Expected errors:** 30 31 The caller can handle the following errors inline: 32 ``WALLET_INVALID_TALER_PAY_URI``. 33 34 Errors from claiming the order and downloading the contract terms 35 (such as ``WALLET_MERCHANT_ORDER_NOT_FOUND``, 36 ``WALLET_ORDER_ALREADY_CLAIMED``, ``WALLET_ORDER_ALREADY_PAID``, 37 ``WALLET_CONTRACT_TERMS_MALFORMED`` or 38 ``WALLET_CONTRACT_TERMS_UNSUPPORTED``) do not fail this operation; 39 they are reported as the last error of the payment transaction. 40 41 .. ts:def:: PreparePayRequest 42 43 interface PreparePayRequest { 44 // The taler://pay/ URI to pay. 45 talerPayUri: string; 46 } 47 48 .. ts:def:: PreparePayV2Result 49 50 interface PreparePayV2Result { 51 // Transaction identifier of the payment transaction. 52 transactionId: TransactionIdStr; 53 }