conekta_ex v1.0.1 ConektaEx.StructList

Struct for Conekta representation of lists. Pagination

Link to this section Summary

Functions

Request a ‘next_page_url’ from ConektaEx.StructList

Request a ‘previous_page_url’ from ConektaEx.StructList

Link to this section Functions

Link to this function request_next(struct_list, limit)

Request a ‘next_page_url’ from ConektaEx.StructList

Examples

iex> request_next(struct_list_with_ok_url, 1)
{:ok, %HTTPoison.Response{}}

iex> request_next(struct_list_with_ok_url, 100000)
{:error, %ConektaEx.Error{}}

# this response means either Conekta returned a
# bad url or is not returning one at all in this
# case check 'has_more' first.
iex> request_next(struct_list_with_nil_url, 1)
raise "request error, nxdomain"
Link to this function request_previous(struct_list, limit)

Request a ‘previous_page_url’ from ConektaEx.StructList

Examples

iex> request_previous(struct_list_with_ok_url, 1)
{:ok, %HTTPoison.Response{}}

iex> request_previous(struct_list_with_ok_url, 100000)
{:error, %ConektaEx.Error{}}

# this response means either Conekta returned a
# bad url or is not returning one at all in this
# case check 'has_more' first.
iex> request_previous(struct_list_with_nil_url, 1)
raise "request error, nxdomain"