Class: Tamara::Webhooks
- Inherits:
-
ApplicationService
- Object
- ApplicationService
- Tamara::Webhooks
- Includes:
- JsonSchemas::Webhook
- Defined in:
- lib/tamara/api/webhooks.rb
Constant Summary
Constants included from JsonSchemas::Webhook
JsonSchemas::Webhook::DISPUTE, JsonSchemas::Webhook::ORDER, JsonSchemas::Webhook::TYPES
Constants included from JsonSchemas::Validator
JsonSchemas::Validator::ERROR_MESSAGES
Class Method Summary collapse
Instance Method Summary collapse
Methods included from JsonSchemas::Validator
Methods inherited from ApplicationService
Methods included from Request
#api_token, #error_message, #handle_response_error, #headers, #parsed_response, #response_body, #response_status
Constructor Details
This class inherits a constructor from Tamara::ApplicationService
Class Method Details
.register(type:, events:, url:, headers: {}, opts: {}) ⇒ Object
5 6 7 |
# File 'lib/tamara/api/webhooks.rb', line 5 def self.register(type:, events:, url:, headers: {}, opts: {}) new(type: type, events: events, url: url, headers: headers, opts: opts).call end |
Instance Method Details
#call_api ⇒ Object
9 10 11 |
# File 'lib/tamara/api/webhooks.rb', line 9 def call_api ::Faraday.post(url, api_params.to_json, headers) end |
#url ⇒ Object
13 14 15 |
# File 'lib/tamara/api/webhooks.rb', line 13 def url Tamara.webhooks_uri end |