taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

get-sessions-SESSION_ID.rst (1899B)


      1 .. http:get:: [/instances/$INSTANCE]/sessions/$SESSION_ID?fulfillment_url=$URL
      2 
      3   Query the payment status for a session and fulfillment URL.
      4   This endpoint is for Web shops,
      5   Paivana and other integrations (like JavaScript from inside the customer's
      6   browser) that need an unauthenticated way to query a payment status where
      7   they do not know the order ID because they *only* know the session ID they
      8   passed into the template mechanism.  Here, the "$SESSION_ID" is an arbitrary
      9   string, the semantics of which are left to the application. However, it must
     10   match the "$SESSION_ID" passed to the template mechanism.
     11 
     12   Since protocol **v25**.
     13 
     14   **Request:**
     15 
     16   :query fulfillment_url=URL: *Mandatory.* Specifies the fulfillment URL
     17     for which the order must be valid.
     18   :query timeout_ms=NUMBER: *Optional.*  If specified, the merchant backend will
     19     wait up to ``timeout_ms`` milliseconds for completion of the payment before
     20     sending the HTTP response.  A client must never rely on this behavior, as the
     21     merchant backend may return a response immediately.
     22 
     23   **Response:**
     24 
     25   :http:statuscode:`200 OK`:
     26     The response is a `GetSessionStatusPaidResponse`. Returned if an
     27     order that paid for the respective session exists and was paid.
     28   :http:statuscode:`202 Accepted`:
     29     The response is a `GetSessionStatusUnpaidResponse`.  Returned if an
     30     order that paid for the respective session exists,
     31     but not yet paid.
     32   :http:statuscode:`404 Not found`:
     33     The merchant backend is unaware of an order matching the given session.
     34 
     35   **Details:**
     36 
     37   .. ts:def:: GetSessionStatusPaidResponse
     38 
     39     interface GetSessionStatusPaidResponse {
     40 
     41       // Order ID of the paid order.
     42       order_id: string;
     43 
     44     }
     45 
     46   .. ts:def:: GetSessionStatusUnpaidResponse
     47 
     48     interface GetSessionStatusUnpaidResponse {
     49 
     50       // Order ID of the unpaid order.
     51       order_id: string;
     52 
     53     }