Class: FluvPay::Webhooks::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/fluvpay/webhooks.rb

Overview

Evento de webhook já verificado e parseado, devolvido por verify_signature.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, delivery_id:, timestamp:, data:, raw:) ⇒ Event

Returns a new instance of Event.



45
46
47
48
49
50
51
# File 'lib/fluvpay/webhooks.rb', line 45

def initialize(type:, delivery_id:, timestamp:, data:, raw:)
  @type = type
  @delivery_id = delivery_id
  @timestamp = timestamp
  @data = data
  @raw = raw
end

Instance Attribute Details

#dataHash (readonly)

Returns objeto “data” do evento (ou o payload inteiro como fallback).

Returns:

  • (Hash)

    objeto “data” do evento (ou o payload inteiro como fallback).



41
42
43
# File 'lib/fluvpay/webhooks.rb', line 41

def data
  @data
end

#delivery_idString? (readonly)

Returns identificador da entrega (X-FluvPay-Delivery-Id).

Returns:

  • (String, nil)

    identificador da entrega (X-FluvPay-Delivery-Id).



37
38
39
# File 'lib/fluvpay/webhooks.rb', line 37

def delivery_id
  @delivery_id
end

#rawHash (readonly)

Returns payload completo parseado.

Returns:

  • (Hash)

    payload completo parseado.



43
44
45
# File 'lib/fluvpay/webhooks.rb', line 43

def raw
  @raw
end

#timestampString (readonly)

Returns timestamp cru recebido (X-FluvPay-Timestamp).

Returns:

  • (String)

    timestamp cru recebido (X-FluvPay-Timestamp).



39
40
41
# File 'lib/fluvpay/webhooks.rb', line 39

def timestamp
  @timestamp
end

#typeString? (readonly)

Returns tipo do evento (ex: “charge.paid”).

Returns:

  • (String, nil)

    tipo do evento (ex: “charge.paid”).



35
36
37
# File 'lib/fluvpay/webhooks.rb', line 35

def type
  @type
end