Payzum (Payzum v0.1.0)

Copy Markdown View Source

Official Elixir SDK for the Payzum crypto payment API.

{:ok, client} = Payzum.new(System.fetch_env!("PAYZUM_API_KEY"))

{:ok, invoice} =
  Payzum.Payments.create(client, %{
    price_amount: "49.99",
    price_currency: "usd",
    pay_currency: "all",
    order_id: "ORDER-12345"
  })

# Redirect the buyer to invoice["invoice_url"].

And in the webhook endpoint, against the RAW body:

{:ok, verifier} = Payzum.Webhooks.new(System.fetch_env!("PAYZUM_WEBHOOK_SECRET"))
{:ok, payload} = Payzum.Webhooks.verify_payment_ipn(verifier, raw_body, headers)

The dangerous parts — signature verification, exact decimals, the retry policy — are owned here so integrators do not implement them differently.

Summary

Functions

health(client)

See Payzum.Client.health/1.

new(api_key, opts \\ [])

See Payzum.Client.new/2.

sandbox(api_key, opts \\ [])

See Payzum.Client.sandbox/2.

version()

The SDK version, mirrored in the User-Agent.

webhooks(secret, opts \\ [])

See Payzum.Client.webhooks/2.