PaperTiger.Resources.ConfirmationToken (PaperTiger v1.1.2)

Copy Markdown View Source

Handles ConfirmationToken retrieval and test-helper creation.

Summary

Functions

Consumes a ConfirmationToken for an intent confirmation.

Creates a test-mode ConfirmationToken.

Retrieves a ConfirmationToken by ID.

Functions

consume(token_id, intent_field, intent_id)

@spec consume(String.t(), :payment_intent | :setup_intent, String.t()) ::
  {:ok, map(), map()}
  | {:error, :confirmation_token_not_found, String.t()}
  | {:error, :confirmation_token_used}
  | {:error, :missing_payment_method}
  | {:error, :payment_method_not_found, String.t()}

Consumes a ConfirmationToken for an intent confirmation.

create_test_helper(conn)

@spec create_test_helper(Plug.Conn.t()) :: Plug.Conn.t()

Creates a test-mode ConfirmationToken.

retrieve(conn, id)

@spec retrieve(Plug.Conn.t(), String.t()) :: Plug.Conn.t()

Retrieves a ConfirmationToken by ID.