Class: MockChargebee::Webhook

Inherits:
Object
  • Object
show all
Defined in:
lib/mock_chargebee/webhook.rb

Instance Method Summary collapse

Constructor Details

#initialize(event_type, event_attributes = {}, content_attributes = {}) ⇒ Webhook

Returns a new instance of Webhook.



3
4
5
6
7
# File 'lib/mock_chargebee/webhook.rb', line 3

def initialize(event_type, event_attributes = {}, content_attributes = {})
  @event_type = event_type
  @event_attributes = event_attributes.stringify_keys
  @content_attributes = content_attributes.stringify_keys
end

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
# File 'lib/mock_chargebee/webhook.rb', line 9

def call
  Validations::Webhooks::EventAttributes.validate_allowed(event_attributes)

  event_attributes.merge!("content" => content_attributes)
  response = fixture.deep_merge(event_attributes)

  response.to_json
end