Payzum.HttpcTransport (Payzum v0.1.0)

Copy Markdown View Source

The default transport: :httpc, which ships with OTP.

Zero runtime dependencies is a smaller supply-chain surface, which matters more in a payment SDK than a fluent HTTP client. Redirects are never followed: a redirect on an authenticated call would replay the API key at whatever host it names.

Summary

Functions

Send one request through :httpc.

A transport function, ready to be handed to Payzum.Client.

Functions

send_request(request, ca_file \\ nil)

@spec send_request(Payzum.Request.t(), String.t() | nil) ::
  {:ok, Payzum.Response.t()} | {:error, Exception.t()}

Send one request through :httpc.

transport(opts \\ [])

@spec transport(keyword()) :: (Payzum.Request.t() ->
                           {:ok, Payzum.Response.t()} | {:error, Exception.t()})

A transport function, ready to be handed to Payzum.Client.

:ca_file lets the caller trust its own bundle — a corporate proxy, or a test harness. Verification is never disabled.