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.



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

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

Instance Method Details

#createdObject



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

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

#external_idObject



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

def external_id
  params['id']
end

#to_hObject



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

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