diff --git a/CHANGELOG.md b/CHANGELOG.md index fa7a61f..579a235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased][] +- No changes + +## [0.10.0][] + +### Fixed + +- Make `can_approve` and `is_paid_manually` fields from Payer API required to match Tipalti specification + +### Updated + +- Updates on Tipalti documentation urls ## [0.9.0][] - 2021-05-20 ### Updated @@ -121,7 +132,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Initial release -[Unreleased]: https://github.com/peek-travel/tipalti-elixir/compare/0.9.0...HEAD +[Unreleased]: https://github.com/peek-travel/tipalti-elixir/compare/0.10.0...HEAD + +[0.10.0]: https://github.com/peek-travel/tipalti-elixir/compare/0.9.0...0.10.0 [0.9.0]: https://github.com/peek-travel/tipalti-elixir/compare/0.8.6...0.9.0 diff --git a/README.md b/README.md index 9a892d3..fcac6ee 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![CI Status](https://github.com/peek-travel/tipalti-elixir/workflows/CI/badge.svg)](https://github.com/peek-travel/tipalti-elixir/actions) [![codecov](https://codecov.io/gh/peek-travel/tipalti-elixir/branch/master/graph/badge.svg)](https://codecov.io/gh/peek-travel/tipalti-elixir) -[![SourceLevel](https://app.sourcelevel.io/github/peek-travel/tipalti-elixir.svg)](https://app.sourcelevel.io/github/peek-travel/tipalti-elixir) [![Hex.pm Version](https://img.shields.io/hexpm/v/tipalti.svg?style=flat)](https://hex.pm/packages/tipalti) [![Inline docs](http://inch-ci.org/github/peek-travel/tipalti-elixir.svg)](http://inch-ci.org/github/peek-travel/tipalti-elixir) [![License](https://img.shields.io/hexpm/l/tipalti.svg)](LICENSE.md) diff --git a/lib/tipalti/api/payer.ex b/lib/tipalti/api/payer.ex index 8129432..79d2bcf 100644 --- a/lib/tipalti/api/payer.ex +++ b/lib/tipalti/api/payer.ex @@ -84,8 +84,8 @@ defmodule Tipalti.API.Payer do required(:date) => String.t(), required(:idap) => Tipalti.idap(), required(:subject) => String.t(), - optional(:can_approve) => boolean(), - optional(:is_paid_manually) => boolean(), + required(:can_approve) => boolean(), + required(:is_paid_manually) => boolean(), optional(:ap_account_number) => String.t(), optional(:approvers) => [invoice_approver()], optional(:currency) => String.t(), @@ -107,7 +107,7 @@ defmodule Tipalti.API.Payer do Returns a list of invoice responses for each invoice, indicating if it succeeded and what the errors were if it didn't. - See for details. + See for details. ## Parameters @@ -155,7 +155,7 @@ defmodule Tipalti.API.Payer do ## Examples - iex> create_or_update_invoices([%{idap: "somepayee", ref_code: "testinvoice1", due_date: "2018-05-01", date: "2018-06-01", subject: "test invoice 1", currency: "USD", line_items: [%{amount: "100.00", description: "test line item"}]}, %{idap: "somepayee", ref_code: "testinvoice2", due_date: "2018-06-01", date: "2018-05-01", subject: "test invoice 2", currency: "USD", line_items: [%{amount: "100.00", description: "test line item"}]}]) + iex> create_or_update_invoices([%{idap: "somepayee", can_approve: false, is_paid_manually: false, ref_code: "testinvoice1", due_date: "2018-05-01", date: "2018-06-01", subject: "test invoice 1", currency: "USD", line_items: [%{amount: "100.00", description: "test line item"}]}, %{idap: "somepayee", ref_code: "testinvoice2", due_date: "2018-06-01", date: "2018-05-01", subject: "test invoice 2", currency: "USD", line_items: [%{amount: "100.00", description: "test line item"}]}]) {:ok, [ %{ @@ -173,7 +173,7 @@ defmodule Tipalti.API.Payer do iex> custom_fields = [%{key: "foo", value: "bar"}] ...> line_items = [%{amount: "100.00", description: "test line item", custom_fields: custom_fields}] ...> approvers = [%{name: "Mr. Approver", email: "approver@example.com", order: 1}] - ...> invoice = %{idap: "somepayee", ref_code: "testinvoice", due_date: "2018-06-01", date: "2018-05-01", subject: "test invoice", currency: "USD", line_items: line_items, custom_fields: custom_fields, approvers: approvers} + ...> invoice = %{idap: "somepayee", can_approve: false, is_paid_manually: false, ref_code: "testinvoice", due_date: "2018-06-01", date: "2018-05-01", subject: "test invoice", currency: "USD", line_items: line_items, custom_fields: custom_fields, approvers: approvers} ...> create_or_update_invoices([invoice]) {:ok, [%{error_message: nil, ref_code: "testinvoice", succeeded: true}]} """ diff --git a/mix.exs b/mix.exs index c4e54b2..7aca93b 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Tipalti.MixProject do use Mix.Project - @version "0.9.0" + @version "0.10.0" def project do [ diff --git a/test/requests/create_or_update_invoices_custom_req.xml b/test/requests/create_or_update_invoices_custom_req.xml index 8d3ae95..696b620 100644 --- a/test/requests/create_or_update_invoices_custom_req.xml +++ b/test/requests/create_or_update_invoices_custom_req.xml @@ -23,12 +23,14 @@ + false foo bar + false USD diff --git a/test/requests/create_or_update_invoices_req.xml b/test/requests/create_or_update_invoices_req.xml index 41ea3f7..d42b47c 100644 --- a/test/requests/create_or_update_invoices_req.xml +++ b/test/requests/create_or_update_invoices_req.xml @@ -17,6 +17,8 @@ test line item + false + false USD test invoice 1