Module: PactasItero::Default
- Defined in:
- lib/pactas_itero/default.rb
Overview
Default configuration options for Client
Constant Summary collapse
- SANDBOX_API_ENDPOINT =
"https://sandbox.billwerk.com"
- PRODUCTION_API_ENDPOINT =
"https://app.billwerk.com"
- PRODUCTION =
false
- USER_AGENT =
"Pactas.Itero Ruby Gem #{PactasItero::VERSION}"
- MEDIA_TYPE =
"application/json"
- MIDDLEWARE =
Faraday::RackBuilder.new do |builder| builder.request :json builder.use PactasItero::Response::RaiseError builder.response :rashify builder.request :url_encoded builder.response :json, content_type: /\bjson$/ builder.adapter Faraday.default_adapter end
Class Method Summary collapse
- .api_endpoint ⇒ Object
- .bearer_token ⇒ Object
- .client_id ⇒ Object
- .client_secret ⇒ Object
- .default_media_type ⇒ Object
- .legal_entity_id ⇒ Object
- .middleware ⇒ Object
- .options ⇒ Object
- .production ⇒ Object
- .production_api_endpoint ⇒ Object
- .sandbox_api_endpoint ⇒ Object
- .user_agent ⇒ Object
Class Method Details
.api_endpoint ⇒ Object
35 36 37 |
# File 'lib/pactas_itero/default.rb', line 35 def api_endpoint ENV["PACTAS_ITERO_ENDPOINT"] end |
.bearer_token ⇒ Object
59 60 61 |
# File 'lib/pactas_itero/default.rb', line 59 def bearer_token ENV["PACTAS_ITERO_BEARER_TOKEN"] end |
.client_id ⇒ Object
51 52 53 |
# File 'lib/pactas_itero/default.rb', line 51 def client_id ENV["PACTAS_ITERO_CLIENT_ID"] end |
.client_secret ⇒ Object
55 56 57 |
# File 'lib/pactas_itero/default.rb', line 55 def client_secret ENV["PACTAS_ITERO_CLIENT_SECRET"] end |
.default_media_type ⇒ Object
63 64 65 |
# File 'lib/pactas_itero/default.rb', line 63 def default_media_type ENV["PACTAS_ITERO_CLIENT_DEFAULT_MEDIA_TYPE"] || MEDIA_TYPE end |
.legal_entity_id ⇒ Object
75 76 77 |
# File 'lib/pactas_itero/default.rb', line 75 def legal_entity_id ENV["PACTAS_ITERO_LEGAL_ENTITY_ID"] end |
.middleware ⇒ Object
67 68 69 |
# File 'lib/pactas_itero/default.rb', line 67 def middleware MIDDLEWARE end |
.options ⇒ Object
31 32 33 |
# File 'lib/pactas_itero/default.rb', line 31 def PactasItero::Configurable.keys.to_h { |key| [key, send(key)] } end |
.production ⇒ Object
47 48 49 |
# File 'lib/pactas_itero/default.rb', line 47 def production PRODUCTION end |
.production_api_endpoint ⇒ Object
43 44 45 |
# File 'lib/pactas_itero/default.rb', line 43 def production_api_endpoint PRODUCTION_API_ENDPOINT end |
.sandbox_api_endpoint ⇒ Object
39 40 41 |
# File 'lib/pactas_itero/default.rb', line 39 def sandbox_api_endpoint SANDBOX_API_ENDPOINT end |
.user_agent ⇒ Object
71 72 73 |
# File 'lib/pactas_itero/default.rb', line 71 def user_agent ENV["PACTAS_ITERO_USER_AGENT"] || USER_AGENT end |