-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adiciona endpoint de lotes de exportação, métodos para captura de cob…
…rança e desarquivamento de clientes (#16)
- Loading branch information
Showing
15 changed files
with
518 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Notas das versões | ||
|
||
|
||
## [v0.0.6 - 11/09/2019](https://github.com/vindi/vindi-ruby/releases/tag/v0.0.6) | ||
- Adiciona endpoint de lotes de exportação | ||
- Adiciona método para captura de uma cobrança | ||
- Adiciona método para desarquivamento de clientes | ||
|
||
## [v0.0.5 - 26/04/2019](https://github.com/vindi/vindi-ruby/releases/tag/v0.0.5) | ||
|
||
|
||
## [v0.0.4 - 25/04/2019](https://github.com/vindi/vindi-ruby/releases/tag/v0.0.4) | ||
|
||
|
||
## [v0.0.3 - 23/04/2019](https://github.com/vindi/vindi-ruby/releases/tag/v0.0.3) | ||
|
||
|
||
## [v0.0.2 - 23/04/2019](https://github.com/vindi/vindi-ruby/releases/tag/v0.0.2) | ||
|
||
|
||
## [v0.0.1 - 23/04/2019](https://github.com/vindi/vindi-ruby/releases/tag/v0.0.1) | ||
- Versão Inicial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ module Customer | |
def list_customers(options = {}) | ||
get('customers', options)[:customers] | ||
end | ||
|
||
# Get a single customer from a merchant | ||
# | ||
# @param customer_id [Integer] ID of the customer | ||
|
@@ -24,9 +24,9 @@ def customer(customer_id, options = {}) | |
end | ||
|
||
# Create a customer for a merchant vindi | ||
# | ||
# | ||
# @option options [Hash] :options customer attributes | ||
# @see https://vindi.github.io/api-docs/dist/#!/customers/POST_version_customers_format | ||
# @see https://vindi.github.io/api-docs/dist/#!/customers/POST_version_customers_format | ||
# @return [Hash] The customer created | ||
# @example Create a customer for a merchant vindi | ||
# client.create_customer(name: 'John Doe', email: '[email protected]') | ||
|
@@ -56,6 +56,19 @@ def update_customer(customer_id, options = {}) | |
def delete_customer(customer_id, options = {}) | ||
delete("customers/#{customer_id}", options)[:customer] | ||
end | ||
|
||
|
||
# Unarchive a customer from merchant vindi | ||
# | ||
# @params customer_id [Integer] ID of the customer | ||
# @option options [Hash] :options customer attributes | ||
# | ||
# @see https://vindi.github.io/api-docs/dist/#!/customers/POST_version_customers_id_unarchive_format | ||
# @example Unarchive customer #2 | ||
# client.unarchive_customer(2) | ||
def unarchive_customer(customer_id, options = {}) | ||
post("customers/#{customer_id}/unarchive", options)[:customer] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module Vindi | ||
module Rest | ||
|
||
# Methods for the export_batches API | ||
# @see https://vindi.github.io/api-docs/dist/#!/export_batches | ||
module ExportBatch | ||
|
||
# List export batches for the authenticate user | ||
# @option options [Integer] :page (1) Page number. | ||
# @option options [Integer] :merchant Merchant account | ||
# @return [Array<Hash>] A list of export batches for a merchant. | ||
# @example Get all export batches from merchant vindi | ||
def list_export_batches(options = {}) | ||
get('export_batches', options)[:export_batches] | ||
end | ||
|
||
# Get a single export batch from a merchant | ||
# | ||
# @param export_batch_id [Integer] ID of the export batch | ||
# @return [Hash] The export batch you requested, if it exists | ||
# @see https://vindi.github.io/api-docs/dist/#!/export_batches/GET_version_export_batches_id_format | ||
# @example Get export batch #154 from vindi | ||
# client.export_batch(154) | ||
def export_batch(export_batch_id, options = {}) | ||
get("export_batches/#{export_batch_id}", options)[:export_batch] | ||
end | ||
|
||
# Create an export batch for a merchant vindi | ||
# | ||
# @option options [Hash] :options export_batch attributes | ||
# @see https://vindi.github.io/api-docs/dist/#!/export_batches/POST_version_export_batches_format | ||
# @return [Hash] The export batch created | ||
# @example Create an export batch for a merchant vindi | ||
# client.create_export_batch({ "payment_method_code": 2, "payment_company_code": "itau" }) | ||
def create_export_batch(options = {}) | ||
post('export_batches', options)[:export_batch] | ||
end | ||
|
||
|
||
# Approve an export batch for a merchant vindi | ||
# | ||
# @option options [Hash] :options export_batch attributes | ||
# @see https://vindi.github.io/api-docs/dist/#!/export_batches/POST_version_export_batches_id_approve_format | ||
# @return [Hash] The export batch approved | ||
# @example Approve an export batch for a merchant vindi | ||
# client.approve_export_batch(2) | ||
def approve_export_batch(export_batch_id, options = {}) | ||
post("export_batches/#{export_batch_id}/approve", options)[:export_batch] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
spec/cassettes/vindi/rest/customers/unarchive_customer.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
spec/cassettes/vindi/rest/export_batches/approve_export_batch.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
spec/cassettes/vindi/rest/export_batches/create_export_batch.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.