zoho_books 0.0.7.4 → 0.0.7.6

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: 4c9ff8052084c2a615195079da65d686f4d791ec4602d3c57d84c80f37e8f99c
4
- data.tar.gz: a7fa9c18e1b69b2e70e4d8c17bd56c9a8be772e252e265f2965599497ec85203
3
+ metadata.gz: 79421c4d03ccd34a3f432588ca683e7fdf6293837367c5b38e62bdad8db4a3d7
4
+ data.tar.gz: 062d84d3147e2f9f74cce73aec394b762c01081fed46ca6fc09dc00872d08255
5
5
  SHA512:
6
- metadata.gz: d8e353ce5f4acd04808922137f72f8c954dd3cd58f2ec2840dc2e9c4270864b86a85fd31b64efb0eb7bf41a055e3b6712dbb1f9e8f3e34d2def7561b3e4ee8e2
7
- data.tar.gz: c00ea75bd3015b915aeca4cad650754cf105316dbd0d94fceec5d720eb6423fd2fb7e618307647d3202a444a6ca00c85dfbf4a44d1689f4725efef16fa2f4e36
6
+ metadata.gz: f9d1a7acef2169bb7199d4f928ef4af0e334ab507ea580e52f0bc3239469622f0efdf415a675a0f69e50aba4826034a2a22f7baf1b0249ca09b478c9ac2591c1
7
+ data.tar.gz: 32313219e7e4786476c666c162a6b3b27873da81aaf141863e8ff49c1d8478d2ba5530121dd065e8c6092d2a7c3fa7fd4c7a96dc5daf12653a7248229e9dab38
@@ -6,8 +6,8 @@ module ZohoBooks
6
6
  BASE_URL = 'https://www.zohoapis.eu/books/v3'
7
7
 
8
8
  class Connection
9
- def self.get(url)
10
- response = HTTParty.get(url, headers:)
9
+ def self.get(url, stream_body = false)
10
+ response = HTTParty.get(url, headers:, stream_body:)
11
11
 
12
12
  return ZohoBooks::Error.new(response.code, response['error']) if response.code != 200
13
13
 
@@ -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,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ZohoBooks
4
+ module Invoices
5
+ class Pdf
6
+ def self.get(invoice_ids)
7
+ ZohoBooks::Connection.get("#{BASE_URL}/invoices/pdf?organization_id=#{ZohoBooks.config.organization_id}&invoice_ids=#{invoice_ids.join(',')}", true)
8
+ end
9
+ end
10
+ end
11
+ 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,5 +13,7 @@ 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'
17
+ require 'zoho_books/invoices/pdf'
16
18
  require 'zoho_books/payment'
17
19
  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.4
4
+ version: 0.0.7.6
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-10 00:00:00.000000000 Z
13
+ date: 2024-07-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -42,6 +42,8 @@ files:
42
42
  - lib/zoho_books/estimate.rb
43
43
  - lib/zoho_books/estimates/template.rb
44
44
  - lib/zoho_books/invoice.rb
45
+ - lib/zoho_books/invoices/pdf.rb
46
+ - lib/zoho_books/invoices/status.rb
45
47
  - lib/zoho_books/item.rb
46
48
  - lib/zoho_books/payment.rb
47
49
  - lib/zoho_books/tax.rb
@@ -49,7 +51,7 @@ homepage: https://rubygems.org/gems/zoho_books
49
51
  licenses:
50
52
  - MIT
51
53
  metadata: {}
52
- post_install_message:
54
+ post_install_message:
53
55
  rdoc_options: []
54
56
  require_paths:
55
57
  - lib
@@ -64,8 +66,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
66
  - !ruby/object:Gem::Version
65
67
  version: '0'
66
68
  requirements: []
67
- rubygems_version: 3.1.6
68
- signing_key:
69
+ rubygems_version: 3.4.19
70
+ signing_key:
69
71
  specification_version: 4
70
72
  summary: Zoho Books API wrapper
71
73
  test_files: []