Class: Payola::Retriever

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

Class Method Summary collapse

Class Method Details

.call(params) ⇒ Object



122
123
124
125
126
127
# File 'lib/payola.rb', line 122

def self.call(params)
  return nil if StripeWebhook.exists?(stripe_id: params[:id])
  StripeWebhook.create!(stripe_id: params[:id])
  event = Stripe::Event.retrieve(params[:id], { api_key: Payola.secret_key })
  Payola.event_filter.call(event)
end