get-paivana-cookie.rst (1880B)
1 .. ts:op:: getPaivanaCookie 2 3 Redeem a successfully paid Paivana transaction for an access cookie. 4 5 The payment transaction referenced by ``transactionId`` must have 6 completed successfully, and the ``paivana`` redemption metadata must 7 match the one returned by :ts:op:`preparePayForPaivana` for that 8 transaction. The wallet redeems the paid order at the Paivana 9 endpoint of the protected resource and returns the access cookie; the 10 client can then request the resource with this cookie. Error codes 11 with the ``PAIVANA_`` prefix are reported by the Paivana server and 12 forwarded by the wallet. 13 14 **Request:** 15 16 The ``args`` must be a `GetPaivanaCookieRequest` object. 17 18 **Response:** 19 20 On success, the result is a `GetPaivanaCookieResult` object. 21 22 **Side effects:** 23 24 Redeems the paid Paivana transaction for an access cookie via an 25 HTTP POST to the resource server. 26 27 **Expected errors:** 28 29 The caller can handle the following errors inline: 30 ``WALLET_CORE_API_BAD_REQUEST``, ``WALLET_TRANSACTION_NOT_FOUND``, 31 ``WALLET_REQUEST_TRANSACTION_STATE_UNSUPPORTED``, 32 ``WALLET_RECEIVED_MALFORMED_RESPONSE``, ``WALLET_NETWORK_ERROR``, 33 ``WALLET_HTTP_REQUEST_THROTTLED``, 34 ``WALLET_HTTP_REQUEST_GENERIC_TIMEOUT``, ``PAIVANA_PAYMENT_MISSING``, 35 ``PAIVANA_BACKEND_REFUSED``, ``PAIVANA_ORDER_UNKNOWN``, 36 ``PAIVANA_BACKEND_ERROR``, ``PAIVANA_GET_ORDER_FAILED``, 37 ``PAIVANA_WRONG_ORDER``, ``PAIVANA_TOO_LATE``, 38 ``PAIVANA_INVALID_TARGET``. 39 40 .. ts:def:: GetPaivanaCookieRequest 41 42 interface GetPaivanaCookieRequest { 43 // Transaction identifier of the paid Paivana payment. 44 transactionId: TransactionIdStr; 45 46 paivana: PaivanaRedemption; 47 } 48 49 .. ts:def:: GetPaivanaCookieResult 50 51 interface GetPaivanaCookieResult { 52 // Plain Cookie request-header value, without Set-Cookie 53 // attributes. 54 cookie: string; 55 }