omise v0.3.1 Omise.Document
Provides Document API interfaces.
Summary
Types
Functions
Specs
create(String.t, Keyword.t) ::
{:ok, t} |
{:error, Omise.Error.t}
Upload a document.
Returns {:ok, document}
if the request is successful, {:error, error}
otherwise.
Request Parameter:
file
- (required) The file to upload. Valid files include PNG and JPG images and PDF files. The uploaded file should also includes metadata such as filename and content type.
Examples
Omise.Document.create("disputes/dspt_test_4zgf15h89w8t775kcm8", file: "pictures/screenshot.jpg")
Specs
destroy(String.t, String.t) ::
{:ok, t} |
{:error, Omise.Error.t}
Destroy a document.
Returns {:ok, document}
if the request is successful, {:error, error}
otherwise.
Examples
Omise.Document.destroy("disputes/dspt_test_4zgf15h89w8t775kcm8", "docu_test_55a1e900ys2srz0xu2r")
Specs
list(String.t, Keyword.t) ::
{:ok, Omise.List.t} |
{:error, Omise.Error.t}
List all documents.
Returns {:ok, documents}
if the request is successful, {:error, error}
otherwise.
Query Parameters:
offset
- (optional, default: 0) The offset of the first record returned.limit
- (optional, default: 20, maximum: 100) The maximum amount of records returned.from
- (optional, default: 1970-01-01T00:00:00Z, format: ISO 8601) The UTC date and time limiting the beginning of returned records.to
- (optional, default: current UTC Datetime, format: ISO 8601) The UTC date and time limiting the end of returned records.
Examples
Omise.Document.list("disputes/dspt_test_53f77r87n5czrdwldvz")
Omise.Document.list("disputes/dspt_test_53f77r87n5czrdwldvz", offset: 2)
Specs
retrieve(String.t, String.t) ::
{:ok, t} |
{:error, Omise.Error.t}
Retrieve a document.
Returns {:ok, document}
if the request is successful, {:error, error}
otherwise.
Examples
Omise.Document.retrieve("disputes/dspt_test_51yfnnpsxajeybpytm4", "docu_test_55a1e900ys2srz0xu2r")