Module: Axn::Webhooks::Outbound::Envelope

Defined in:
lib/axn/webhooks/outbound/envelope.rb

Overview

Builds the Standard Webhooks message body and its idempotency id. The body is fixed at emit time (part of the dedup identity); the SIGNATURE is recomputed per delivery attempt (see Deliver), so this carries no signing concern.

Class Method Summary collapse

Class Method Details

.build(id:, type:, data:, now: Time.now) ⇒ Object



17
18
19
# File 'lib/axn/webhooks/outbound/envelope.rb', line 17

def build(id:, type:, data:, now: Time.now)
  JSON.generate(id:, timestamp: now.to_i, type: type.to_s, data:)
end

.new_idObject



15
# File 'lib/axn/webhooks/outbound/envelope.rb', line 15

def new_id = "msg_#{SecureRandom.uuid}"