Contents

getPaivanaCookie#

Redeem a successfully paid Paivana transaction for an access cookie.

The payment transaction referenced by transactionId must have completed successfully, and the paivana redemption metadata must match the one returned by preparePayForPaivana for that transaction. The wallet redeems the paid order at the Paivana endpoint of the protected resource and returns the access cookie; the client can then request the resource with this cookie. Error codes with the PAIVANA_ prefix are reported by the Paivana server and forwarded by the wallet.

Request:

The args must be a GetPaivanaCookieRequest object.

Response:

On success, the result is a GetPaivanaCookieResult object.

Side effects:

Redeems the paid Paivana transaction for an access cookie via an HTTP POST to the resource server.

Expected errors:

The caller can handle the following errors inline: WALLET_CORE_API_BAD_REQUEST, WALLET_TRANSACTION_NOT_FOUND, WALLET_REQUEST_TRANSACTION_STATE_UNSUPPORTED, WALLET_RECEIVED_MALFORMED_RESPONSE, WALLET_NETWORK_ERROR, WALLET_HTTP_REQUEST_THROTTLED, WALLET_HTTP_REQUEST_GENERIC_TIMEOUT, PAIVANA_PAYMENT_MISSING, PAIVANA_BACKEND_REFUSED, PAIVANA_ORDER_UNKNOWN, PAIVANA_BACKEND_ERROR, PAIVANA_GET_ORDER_FAILED, PAIVANA_WRONG_ORDER, PAIVANA_TOO_LATE, PAIVANA_INVALID_TARGET.

interface GetPaivanaCookieRequest {
  // Transaction identifier of the paid Paivana payment.
  transactionId: TransactionIdStr;

  paivana: PaivanaRedemption;
}
interface GetPaivanaCookieResult {
  // Plain Cookie request-header value, without Set-Cookie
  // attributes.
  cookie: string;
}