Skip to content

agencyleroy/prinetti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prinetti

This gem is not yet completely finished so proceed at your own peril.

Getting Started

  • Install with rails generate prinetti
  • Configure config/initializers/prinetti.rb
Prinetti.configure do |config|
  # Print out requests and responses in the log
  config.debug           = true

  # How the address/customer is attached to the Order class
  config.address_method  = "address"
  config.customer_method = "customer"

  # Sender
  config.sender_name        = "Agency Leroy"
  config.sender_street      = "Eteläranta 6"
  config.sender_postcode    = "00120"
  config.sender_city        = "Helsinki"
  config.sender_country     = "FI"
  config.sender_phone       = "050 540 8656"
  config.sender_vatcode     = "1001001-1"

  # Credentials
  config.account         = ENV["PRINETTI_ACCOUNT"]
  config.source          = ENV["PRINETTI_SOURCE"]
  config.key             = ENV["PRINETTI_KEY"]
  config.contract        = ENV["PRINETTI_CONTRACT"]
end

Usage

# Initialize a new prinetti instance
prinetti = Prinetti::Label.new(order: Order.find(params[:id]))

# Get the pdf link
prinetti.pdf_link
# => "https://echannel.prinetti.net/getPdf.php?key=bc15630115c6715de5426c36c04792b9"

# Get the pdf file
prinetti.pdf_file
# => raw data

Credits

Agency Leroy

  • Joakim Runeberg

Tests

  • You're out of luck

Todo

  • Allow package alternatives

About

Ruby integration for the Itella Prinetti API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published