Astrada TypeScript SDK
    Preparing search index...

    Class CardSubscriptionApi

    Hierarchy (View Summary)

    Index
    configuration: Configuration
    middleware: Middleware[]

    The middleware of this instance; protected so hand-written subclasses can pass it on.

    • Works in the sandbox only (https://api.sandbox.astrada.co), for clearing test data between runs. Production has no delete call: there you deactivate card subscriptions with PATCH. Deletes a card subscription and the data it owns, and cannot be undone. When it is the last subscription on its card, the card, cardholder, stored token and transactions are removed as well. The call returns when the delete has finished: 204 when it is done, 502 when a step failed. Retrying a failed delete is always safe: completed steps are skipped on replay. Delete card subscription (sandbox only)

      Parameters

      Returns Promise<void>

    • Works in the sandbox only (https://api.sandbox.astrada.co), for clearing test data between runs. Production has no delete call: there you deactivate card subscriptions with PATCH. Deletes a card subscription and the data it owns, and cannot be undone. When it is the last subscription on its card, the card, cardholder, stored token and transactions are removed as well. The call returns when the delete has finished: 204 when it is done, 502 when a step failed. Retrying a failed delete is always safe: completed steps are skipped on replay. Delete card subscription (sandbox only)

      Parameters

      Returns Promise<ApiResponse<void>>

    • Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json

      Parameters

      • mime: string

        MIME (Multipurpose Internet Mail Extensions)

      Returns boolean

      True if the given MIME is JSON, false otherwise.

    • Sends the request. Network errors and timeouts (while waiting for the answer or reading its body), 408, 429 and 5xx are retried for idempotent methods (see ConfigurationParameters.maxRetries). A 401 is retried once with a new token. Any other status outside 200 to 299 throws a ResponseError subclass. The body is read here, whole.

      Parameters

      Returns Promise<Response>