Skip to content

Commit

Permalink
Merge pull request #75 from ManishNarayan/manishn/add_download_pdf_en…
Browse files Browse the repository at this point in the history
…dpoints

add pdf endpoint to invoice and payments
  • Loading branch information
lockstep-rakesh authored May 21, 2024
2 parents 208cb28 + 6e69b70 commit 48d9eae
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
lockstep_rails (0.3.82)
lockstep_rails (0.3.83)
rails

GEM
Expand Down
5 changes: 5 additions & 0 deletions app/models/lockstep/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ class Lockstep::Invoice < Lockstep::ApiRecord
scope :einvoices, -> { where(is_e_invoice: true).include_object(:customer, :lines, :attachments) }
scope :received_einvoices, -> { einvoices.where(invoice_type_code: 'AP Invoice') }
scope :sent_einvoices, -> { einvoices.where(invoice_type_code: 'AR Invoice') }

def download_pdf
response = resource.get "#{id}/pdf"
response.body
end
end
5 changes: 5 additions & 0 deletions app/models/lockstep/payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ def create
result = post_result(resp)
end
end

def download_pdf
response = resource.get "#{id}/pdf"
response.body
end
end
2 changes: 1 addition & 1 deletion lib/lockstep_rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module LockstepRails
VERSION = '0.3.82'
VERSION = '0.3.83'
end

0 comments on commit 48d9eae

Please sign in to comment.