Contents

preparePayForUriV2#

Prepare to make a payment based on a taler://pay/ URI.

Creates a payment transaction for the order identified by the URI, or reuses the existing transaction if the wallet already knows the order. The contract terms are then downloaded and processed by the transaction. Use getChoicesForPayment to inspect the payable choices and confirmPay to confirm the payment.

Request:

The args must be a PreparePayRequest object.

Response:

On success, the result is a PreparePayV2Result object.

Side effects:

The operation itself is deliberately local-only: it creates (or reuses) the payment transaction record in the wallet database and wakes the transaction’s background task. Claiming the order and downloading the contract terms from the merchant happen asynchronously as part of the transaction’s processing; the transaction moves to dialog state once the contract terms have been downloaded.

Expected errors:

The caller can handle the following errors inline: WALLET_INVALID_TALER_PAY_URI.

Errors from claiming the order and downloading the contract terms (such as WALLET_MERCHANT_ORDER_NOT_FOUND, WALLET_ORDER_ALREADY_CLAIMED, WALLET_ORDER_ALREADY_PAID, WALLET_CONTRACT_TERMS_MALFORMED or WALLET_CONTRACT_TERMS_UNSUPPORTED) do not fail this operation; they are reported as the last error of the payment transaction.

interface PreparePayRequest {
  // The taler://pay/ URI to pay.
  talerPayUri: string;
}
interface PreparePayV2Result {
  // Transaction identifier of the payment transaction.
  transactionId: TransactionIdStr;
}