RazorpayEx

Hex.pm Hex Docs License Coverage Status

An Elixir client for the Razorpay API, providing a clean and intuitive interface for integrating Razorpay payments into your Elixir applications.

Features

Installation

The package can be installed by adding razorpay_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:razorpay_ex, "~> 0.4.0"}
  ]
end

Requirements

These are the minimum versions supported by httpoison 3.x and its hackney 4.x HTTP backend.

Verifying a payment

Checkout callbacks are signed with your key secret. Verify the signature before fulfilling an order:

if RazorpayEx.Utility.verify_payment_signature(params) do
  fulfil_order(params["razorpay_order_id"])
else
  # tampered or replayed callback
  :invalid_signature
end

Webhooks are signed with your webhook secret over the raw request body:

RazorpayEx.Webhook.verify(raw_body, signature, webhook_secret)

Production notes

License MIT License - see LICENSE file for details.

Disclaimer This library is not officially supported by Razorpay. It's a community-maintained project modeled after the official Ruby SDK.