Skip to content

Commit

Permalink
cleanup and updates for 0.8 release
Browse files Browse the repository at this point in the history
  • Loading branch information
doughsay committed Feb 16, 2019
1 parent 506d170 commit e21ac28
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.7.4-otp-21
erlang 21.2.2
elixir 1.8.1-otp-21
erlang 21.2.5
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: elixir

otp_release:
- 20.3
- 21.0
- 20
- 21

elixir:
- 1.6
- 1.7
- "1.7"
- "1.8"

cache:
directories:
Expand Down
62 changes: 43 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,80 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased][]

## [0.8.0][] - 2019-02-15

### Added

- Added a simple IPN router builder

## [0.7.0][] - 2019-01-04

### Changed
- Update ex_money version to allow 3.1.

- Update ex_money version to allow 3.1.

## [0.6.0][] - 2018-11-14

### Added
- Configurable hackney recv_timeout with a default of 60 seconds.

- Configurable hackney recv_timeout with a default of 60 seconds.

## [0.5.1][] - 2018-11-12

### Fixed
- Overly restrictive dialyzer typespecs

- Overly restrictive dialyzer typespecs

## [0.5.0][] - 2018-07-31

### Added
- Payee API function: get_payee_invoices_changed_since_timestamp
- Payer API function: get_payee_invoices_list_details

- Payee API function: get_payee_invoices_changed_since_timestamp
- Payer API function: get_payee_invoices_list_details

### Changed
- Many function return values were changed:
- Error maps are structs now. e.g. `%{error_code: "...", error_message: "..."}` is now `%Tipalti.ClientError{error_code: "...", error_message: "..."}`
- A new `Tipalti.RequestError` struct will be returned for HTTP request errors
- `Payee.get_extended_payee_details_list/1` now returns `{:ok, [Tipalti.PayeeExtended.t()]}`
- `Payee.get_payee_details/1` now returns `{:ok, Tipalti.Payee.t()}`
- `Payee.payee_payable/2` now returns `{:ok, true}` or `{:ok, false, reason}`
- `Payee.payee_payment_method/1` now returns `{:ok, String.t()}`
- Any function that used to return `{:ok, :ok}` now just returns `:ok`
- `Payer.create_or_update_invoices` now returns the list of responses directly instead of wrapped in a map
- refer to the documentation for any additional details

- Many function return values were changed:
- Error maps are structs now. e.g. `%{error_code: "...", error_message: "..."}` is now `%Tipalti.ClientError{error_code: "...", error_message: "..."}`
- A new `Tipalti.RequestError` struct will be returned for HTTP request errors
- `Payee.get_extended_payee_details_list/1` now returns `{:ok, [Tipalti.PayeeExtended.t()]}`
- `Payee.get_payee_details/1` now returns `{:ok, Tipalti.Payee.t()}`
- `Payee.payee_payable/2` now returns `{:ok, true}` or `{:ok, false, reason}`
- `Payee.payee_payment_method/1` now returns `{:ok, String.t()}`
- Any function that used to return `{:ok, :ok}` now just returns `:ok`
- `Payer.create_or_update_invoices` now returns the list of responses directly instead of wrapped in a map
- refer to the documentation for any additional details

## [0.4.0][] - 2018-05-05

### Added
- Support passing in preferredPayerEntity parameter in setup iframe

- Support passing in preferredPayerEntity parameter in setup iframe

## [0.3.0][] - 2018-06-12

### Updated
- Updated several dependencies, including upgrading to tesla 1.0

- Updated several dependencies, including upgrading to tesla 1.0

## [0.2.0][] - 2018-05-03

### Added
- Payer function CreateOrUpdateInvoices ([docs](https://hexdocs.pm/tipalti/Tipalti.API.Payer.html#create_or_update_invoices/0))

- Payer function CreateOrUpdateInvoices ([docs](https://hexdocs.pm/tipalti/Tipalti.API.Payer.html#create_or_update_invoices/0))

## 0.1.0 - 2018-04-26

### Initial release

[Unreleased]: https://github.com/peek-travel/tipalti-elixir/compare/0.7.0...HEAD
[Unreleased]: https://github.com/peek-travel/tipalti-elixir/compare/0.8.0...HEAD
[0.8.0]: https://github.com/peek-travel/tipalti-elixir/compare/0.7.0...0.8.0
[0.7.0]: https://github.com/peek-travel/tipalti-elixir/compare/0.6.0...0.7.0
[0.6.0]: https://github.com/peek-travel/tipalti-elixir/compare/0.5.1...0.6.0
[0.5.1]: https://github.com/peek-travel/tipalti-elixir/compare/0.5.0...0.5.1
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This library includes:

* Payee and Payer SOAP API clients
* iFrame integration helpers
* IPN Router builder

> **NOTE**: Not all API functions have been implemented yet; this library is a work in progress.
Expand Down
3 changes: 3 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use Mix.Config

config :ex_money,
default_cldr_backend: TestCldr

config :tipalti,
payer: "MyPayer",
mode: :sandbox,
Expand Down
1 change: 1 addition & 0 deletions coveralls.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"skip_files": [
"test",
"lib/sweet_xml",
"lib/tipalti/api/soap/client",
"lib/tipalti/ipn/client"
Expand Down
5 changes: 5 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule Tipalti.MixProject do
source_url: "https://github.com/peek-travel/tipalti-elixir",
version: @version,
elixir: "~> 1.6",
elixirc_paths: elixirc_paths(Mix.env()),
description: description(),
package: package(),
deps: deps(),
Expand All @@ -29,6 +30,10 @@ defmodule Tipalti.MixProject do
]
end

# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]

# Run "mix help compile.app" to learn about applications.
def application do
[
Expand Down
18 changes: 8 additions & 10 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
%{
"abnf2": {:hex, :abnf2, "0.1.4", "9a424cfe94556c0e3e58b02326c39383b170dde4777913fcbdbdfcd2f1b0a97f", [:mix], [], "hexpm"},
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"},
"certifi": {:hex, :certifi, "2.4.2", "75424ff0f3baaccfd34b1214184b6ef616d89e420b258bb0a5ea7d7bc628f7f0", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"},
"cldr_utils": {:hex, :cldr_utils, "2.0.5", "eba0f4cc86861b74f2c1180fe7f6fa25f9e9a3b06365fa7468213c9ec3fd392c", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm"},
"credo": {:hex, :credo, "1.0.2", "88bc918f215168bf6ce7070610a6173c45c82f32baa08bdfc80bf58df2d103b6", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"decimal": {:hex, :decimal, "1.6.0", "bfd84d90ff966e1f5d4370bdd3943432d8f65f07d3bab48001aebd7030590dcc", [:mix], [], "hexpm"},
"dialyxir": {:hex, :dialyxir, "1.0.0-rc.4", "71b42f5ee1b7628f3e3a6565f4617dfb02d127a0499ab3e72750455e986df001", [:mix], [{:erlex, "~> 0.1", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm"},
"earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"},
"erlex": {:hex, :erlex, "0.1.6", "c01c889363168d3fdd23f4211647d8a34c0f9a21ec726762312e08e083f3d47e", [:mix], [], "hexpm"},
"ex_cldr": {:hex, :ex_cldr, "2.2.0", "983c4e6983f111f55ab219bf0e0772e37a53cef4012b278dfd3c2309ceb74337", [:mix], [{:cldr_utils, "~> 2.0", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.13", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm"},
"ex_cldr_currencies": {:hex, :ex_cldr_currencies, "2.0.0", "e91ee2cf81144cb308b2bf025c2877f38fc713475931efcd55885e149c2ae36f", [:mix], [{:ex_cldr, "~> 2.0", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
"ex_cldr_numbers": {:hex, :ex_cldr_numbers, "2.1.0", "ae7364223bea04e56d7f93b444e02b82c74c0d4230ab269b9688e3c0a5765ff1", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:ex_cldr, "~> 2.1", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_currencies, "~> 2.0", [hex: :ex_cldr_currencies, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.19.2", "6f4081ccd9ed081b6dc0bd5af97a41e87f5554de469e7d76025fba535180565f", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"ex_money": {:hex, :ex_money, "3.1.0", "4f08ec9107427e255255ffe3a6e5489b5b7aecef414712845a0c6529b12c46ff", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:ex_cldr, "~> 2.0", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_numbers, "~> 2.0", [hex: :ex_cldr_numbers, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm"},
"excoveralls": {:hex, :excoveralls, "0.10.3", "b090a3fbcb3cfa136f0427d038c92a9051f840953ec11b40ee74d9d4eac04d1e", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"erlex": {:hex, :erlex, "0.2.1", "cee02918660807cbba9a7229cae9b42d1c6143b768c781fa6cee1eaf03ad860b", [:mix], [], "hexpm"},
"ex_cldr": {:hex, :ex_cldr, "2.2.4", "0d0bf12955d2cc8dd63c250eda895d1427381c1d1f3e5e3857ac9dc3da9cdf7a", [:mix], [{:cldr_utils, "~> 2.0", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.13", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm"},
"ex_cldr_currencies": {:hex, :ex_cldr_currencies, "2.1.2", "522d5d1642141b6ba1a50f8b37b9f7f65f459a51ca80c3fd4ed7345694416765", [:mix], [{:ex_cldr, "~> 2.0", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
"ex_cldr_numbers": {:hex, :ex_cldr_numbers, "2.1.1", "3374472e2356366b96dc29ac8b69e279a6b008b5f52973be86865cce91298c35", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:ex_cldr, "~> 2.1", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_currencies, "~> 2.0", [hex: :ex_cldr_currencies, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"ex_money": {:hex, :ex_money, "3.2.4", "c7a734926c18e3110badb20cd97c0c5caf0f220e8f867441b179f6987f6cd75c", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:ex_cldr, "~> 2.0", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_numbers, "~> 2.0", [hex: :ex_cldr_numbers, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm"},
"excoveralls": {:hex, :excoveralls, "0.10.5", "7c912c4ec0715a6013647d835c87cde8154855b9b84e256bc7a63858d5f284e3", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"hackney": {:hex, :hackney, "1.15.0", "287a5d2304d516f63e56c469511c42b016423bcb167e61b611f6bad47e3ca60e", [:rebar3], [{:certifi, "2.4.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
"inch_ex": {:hex, :inch_ex, "1.0.1", "1f0af1a83cec8e56f6fc91738a09c838e858db3d78ef5f2ec040fe4d5a62dabf", [:mix], [{:poison, "~> 1.5 or ~> 2.0 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"},
"inch_ex": {:hex, :inch_ex, "2.0.0", "24268a9284a1751f2ceda569cd978e1fa394c977c45c331bb52a405de544f4de", [:mix], [{:bunt, "~> 0.2", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"inflex": {:hex, :inflex, "1.10.0", "8366a7696e70e1813aca102e61274addf85d99f4a072b2f9c7984054ea1b9d29", [:mix], [], "hexpm"},
"jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"},
"makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"},
Expand All @@ -29,7 +28,6 @@
"parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm"},
"plug": {:hex, :plug, "1.7.2", "d7b7db7fbd755e8283b6c0a50be71ec0a3d67d9213d74422d9372effc8e87fd1", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}], "hexpm"},
"plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"},
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.4", "f0eafff810d2041e93f915ef59899c923f4568f4585904d010387ed74988e77b", [:make, :mix, :rebar3], [], "hexpm"},
"tesla": {:hex, :tesla, "1.2.1", "864783cc27f71dd8c8969163704752476cec0f3a51eb3b06393b3971dc9733ff", [:mix], [{:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm"},
Expand Down
2 changes: 0 additions & 2 deletions test/support/mocks.ex

This file was deleted.

6 changes: 6 additions & 0 deletions test/support/test_cldr.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
defmodule TestCldr do
use Cldr,
default_locale: "en",
locales: ["en"],
providers: [Cldr.Number]
end
9 changes: 3 additions & 6 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
ExUnit.start()

Mox.defmock(IPNClientMock, for: Tipalti.IPN.Client.Behavior)
Mox.defmock(BodyReaderMock, for: BodyReader)

Application.put_env(:tipalti, :system_time_module, SystemTimeMock)
Application.put_env(:tipalti, :api_client_module, ClientMock)
Application.put_env(:tipalti, :ipn_client_module, IPNClientMock)
Application.put_env(:tipalti, :ipn_body_reader, BodyReaderMock)

{:ok, files} = File.ls("./test/support")

Enum.each(files, fn file ->
Code.require_file("support/#{file}", __DIR__)
end)

0 comments on commit e21ac28

Please sign in to comment.