Class: Endicia::Request

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/endicia_ruby/request.rb

Direct Known Subclasses

Label, Refund

Constant Summary collapse

ENDICIA_API_HOSTS =
{
  test: 'https://www.envmgr.com',
  sandbox: 'https://elstestserver.endicia.com',
  production: 'https://LabelServer.Endicia.com',
}

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Request

Pass a hash of options with: {

credentials: {
  AccountID: '2500334',
  RequesterID: 'lxxx',
  PassPhrase: 'endicia.com',
},
environment: 'test' # or 'production' or 'sandbox'

}

Or if using Rails, create an endicia.yml in Rails.root/config/ in this format: development: &development

credentials:
  AccountID: youraccountid
  RequesterID: lxxx
  PassPhrase: endicia.com
environment: sandbox

test:

<<: *development

staging:

<<: *development

production:

credentials:
  AccountID: youraccountid
  RequesterID: lsfx
  PassPhrase: yourpassword
environment: production

If both an endicia.yml file is present and a hash of options is passed, any values in the hash take precedence



61
62
63
# File 'lib/endicia_ruby/request.rb', line 61

def initialize(options = {})
  @options = load_options_from_config_file.deep_merge(options)
end