Class: Moneytree::Webhooks::StripeController

Inherits:
ApplicationController show all
Defined in:
app/controllers/moneytree/webhooks/stripe_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/moneytree/webhooks/stripe_controller.rb', line 6

def create
  case webhook_params.type
  when 'charge.succeeded'
    process_charge!
  when 'charge.refunded'
    process_refund!
  else
    puts "Unhandled event type: #{webhook_params.type}"
  end

  head :ok
end