recurly v0.1.4 Recurly.Adjustment
Module for handling adjustments in Recurly. See the developer docs on adjustments for more details
Summary
Functions
Generates the path to create an adjustment for given the account code
Creates an adjustment from a changeset
Finds a adjustment given a adjustment uuid. Returns the adjustment or an error
Generates the path to find an adjustment given the uuid
Creates a stream of adjustments on a given account
Functions
Generates the path to create an adjustment for given the account code.
Parameters
account_code
String account code
Creates an adjustment from a changeset.
Parameters
changeset
Keyword list changesetaccount_code
String account code of associated account
Examples
alias Recurly.ValidationError
case Recurly.Adjustment.create([unit_amount_in_cents: 100, currency: "USD"], "myaccountcode") do
{:ok, adjustment} ->
# created the adjustment
{:error, %ValidationError{errors: errors}} ->
# will give you a list of validation errors
end
Finds a adjustment given a adjustment uuid. Returns the adjustment or an error.
Parameters
uuid
String adjustment uuid
Examples
alias Recurly.NotFoundError
case Recurly.Adjustment.find("uuid") do
{:ok, adjustment} ->
# Found the adjustment
{:error, %NotFoundError{}} ->
# 404 adjustment was not found
end
Generates the path to find an adjustment given the uuid.
Parameters
uuid
String uuid
Creates a stream of adjustments on a given account.
Parameters
account_code
String account code of associated accountoptions
Keyword list of the request options. See options in the adjustment list section of the docs
Examples
See Recurly.Resource.stream/3
for more detailed examples of
working with resource streams.
# stream of adjustments sorted from most recently updated to least recently updated
stream = Recurly.Adjustment.stream("myaccountcode", sort: :updated_at)