Contents

preparePeerPushCredit#

Check an incoming peer push payment. The payment is identified either by a taler://pay-push/ URI received from the sender or by the transactionId of an existing peer-push-credit transaction.

Request:

The request body must be a PreparePeerPushCreditRequest object. Either talerUri or transactionId must be specified.

Response:

On success, the result is a PreparePeerPushCreditResponse object, carrying the contract terms and the amounts the wallet would receive, so that the user can review the payment before accepting it with confirmPeerPushCredit.

Side effects:

Fetches the contract and purse status from the exchange over the network and creates an incoming peer push payment transaction in dialog state.

Expected errors:

The caller can handle the following errors inline: WALLET_PEER_CONTRACT_NOT_FOUND, WALLET_PEER_PUSH_CREDIT_PURSE_GONE, WALLET_TALER_URI_MALFORMED, WALLET_TRANSACTION_NOT_FOUND.

Details:

Calling the operation again with the same talerUri or with the resulting transactionId returns the state of the existing transaction instead of fetching the contract again.

// Either talerUri or transactionId must be specified.
interface PreparePeerPushCreditRequest {
  talerUri?: string;
  transactionId?: string;

  progressToken?: string;
}
interface PreparePeerPushCreditResponse {
  contractTerms: PeerContractTerms;
  amountRaw: AmountString;
  amountEffective: AmountString;

  transactionId: TransactionIdStr;

  // State of the existing or newly created transaction.
  txState: TransactionState;

  exchangeBaseUrl: string;

  scopeInfo: ScopeInfo;

  // Deprecated.
  amount: AmountString;
}
// Contract terms between two wallets (as opposed to a merchant and
// wallet).
interface PeerContractTerms {
  amount: AmountString;
  summary: string;
  icon_id?: string;
  purse_expiration: TalerProtocolTimestamp;
}