Class: Wbase::WebhookAdaptor

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/wbase/stripe_webhooks_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ WebhookAdaptor

Returns a new instance of WebhookAdaptor.



29
30
31
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 29

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



27
28
29
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 27

def params
  @params
end

Instance Method Details

#createdObject



37
38
39
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 37

def created
  Time.at(params['created'])
end

#external_idObject



33
34
35
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 33

def external_id
  params['id']
end

#to_hObject



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/controllers/wbase/stripe_webhooks_controller.rb', line 41

def to_h
  {
    external_id: external_id,
    object: params['object'],
    api_version: params['api_version'],
    created: created,
    data: params['data'],
    livemode: params['livemode'],
    pending_webhooks: params['pending_webhooks'],
    external_type: params['type'],
    external_request: params['request']
  }
end