zoho_books 0.0.7.3 → 0.0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 766e7bea493b0b9616512f830f7258a5800d4429e850e48450e5871e887cb016
4
- data.tar.gz: 00a4c47693b40e197f5cda077f75b41ea4b92af1dfded2bed9bad2fc3d082d52
3
+ metadata.gz: b9bc470280669c75462a3f68a79beb2509e6d977b096769e1ffd18593215204c
4
+ data.tar.gz: 05fee8dff70d647e5ed28fefc5a1214251c8f992b6d2c9319fa88cdccea57e06
5
5
  SHA512:
6
- metadata.gz: c9f73789fa91ac06390b98462ed37da27945615959135c9296b20c16cf7dbc26e9c438b41f88b8c8bac62c1025d7d17807103b7667f8285ad8b2fe844b9e2b01
7
- data.tar.gz: 0c67a8029c50efb3f50a124a6929dff865bcebe7cd40755edf12f7c957aae5b5f345a1d32ae82ee7487516d5d35125c3a6dd62ac43c6fc6e8e0dfeca8acfbccc
6
+ metadata.gz: 6d9d883889fabacac8491560a07431dc5969a5211cbca85b206dc3b60fc7ae7b40050578da050182da96781973c7042dc18cae06fddb4122d066e7ce17d5b30a
7
+ data.tar.gz: f69404a90d41577fc8e1a92269ffba0afbe27faee2164cf09c7aacc38bf847e40880d2a02aee49cf27845bb2157336e8bf872a230186fd04aeb3c80c26d6f3c2
@@ -17,7 +17,7 @@ module ZohoBooks
17
17
  def self.post(url, body)
18
18
  response = HTTParty.post(url, body:, headers:)
19
19
 
20
- return render_error(response) if response.code != 201
20
+ return render_error(response) unless [200, 201].include?(response.code)
21
21
 
22
22
  response
23
23
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+
5
+ module ZohoBooks
6
+ class CreditNote
7
+ def self.list(opts = {})
8
+ query = opts.map { |k, v| "#{k}=#{v}" }.join('&')
9
+ ZohoBooks::Connection.get("#{BASE_URL}/creditnotes?organization_id=#{ZohoBooks.config.organization_id}&#{query}")
10
+ end
11
+
12
+ def self.get(id, _opts = {})
13
+ query = _opts.map { |k, v| "#{k}=#{v}" }.join('&')
14
+ ZohoBooks::Connection.get("#{BASE_URL}/creditnotes/#{id}?organization_id=#{ZohoBooks.config.organization_id}&#{query}")
15
+ end
16
+
17
+ def self.create(body, _opts = {})
18
+ ZohoBooks::Connection.post("#{BASE_URL}/creditnotes?organization_id=#{ZohoBooks.config.organization_id}",
19
+ body.to_json)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ZohoBooks
4
+ module Invoices
5
+ class Status
6
+ def self.update(id)
7
+ ZohoBooks::Connection.post("#{BASE_URL}/invoices/#{id}/status/sent?organization_id=#{ZohoBooks.config.organization_id}", {}.to_json)
8
+ end
9
+ end
10
+ end
11
+ end
data/lib/zoho_books.rb CHANGED
@@ -13,4 +13,6 @@ require 'zoho_books/estimate'
13
13
  require 'zoho_books/estimates/template'
14
14
  require 'zoho_books/tax'
15
15
  require 'zoho_books/invoice'
16
+ require 'zoho_books/invoices/status'
16
17
  require 'zoho_books/payment'
18
+ require 'zoho_books/credit_note'
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoho_books
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7.3
4
+ version: 0.0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - PapaLoup
8
8
  - Raphtml
9
9
  - theobcl
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-11-07 00:00:00.000000000 Z
13
+ date: 2023-11-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -37,10 +37,12 @@ files:
37
37
  - lib/zoho_books/config.rb
38
38
  - lib/zoho_books/connection.rb
39
39
  - lib/zoho_books/contact.rb
40
+ - lib/zoho_books/credit_note.rb
40
41
  - lib/zoho_books/error.rb
41
42
  - lib/zoho_books/estimate.rb
42
43
  - lib/zoho_books/estimates/template.rb
43
44
  - lib/zoho_books/invoice.rb
45
+ - lib/zoho_books/invoices/status.rb
44
46
  - lib/zoho_books/item.rb
45
47
  - lib/zoho_books/payment.rb
46
48
  - lib/zoho_books/tax.rb
@@ -48,7 +50,7 @@ homepage: https://rubygems.org/gems/zoho_books
48
50
  licenses:
49
51
  - MIT
50
52
  metadata: {}
51
- post_install_message:
53
+ post_install_message:
52
54
  rdoc_options: []
53
55
  require_paths:
54
56
  - lib
@@ -63,8 +65,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
65
  - !ruby/object:Gem::Version
64
66
  version: '0'
65
67
  requirements: []
66
- rubygems_version: 3.1.6
67
- signing_key:
68
+ rubygems_version: 3.4.10
69
+ signing_key:
68
70
  specification_version: 4
69
71
  summary: Zoho Books API wrapper
70
72
  test_files: []