Paddle.License (paddlex v0.1.0) View Source

License

Link to this section Summary

Functions

Generate a Paddle-framework license

Link to this section Types

Specs

t() :: %Paddle.License{expires_at: Date.t(), license_code: String.t()}

Link to this section Functions

Specs

generate(params) :: {:ok, t()} | {:error, Paddle.Error.t()}
when params: %{
       :product_id => number(),
       :allowed_uses => integer(),
       optional(:expires_at) => Date.t()
     }

Generate a Paddle-framework license

Examples

params = %{
  product_id: 1234,
  allowed_uses: 10,
  expires_at: ~D[2018-10-10]
}
Paddle.License.generate(params) 
{:ok, %Paddle.License{
    license_code: "2DEDF6A4-86420251-0927C417-43523113-CA22C29B",
    expires_at: ~D[2018-10-10]
}}