Class: Ecko::Plugins::StripeCallbacksController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/ecko/plugins/stripe_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#intentObject



15
16
17
# File 'app/controllers/ecko/plugins/stripe_callbacks_controller.rb', line 15

def intent
  @intent ||= StripePaymentIntent.find_by(code: params[:state])
end

#successObject

This can be used to extend and run the payment success.



6
7
8
9
10
11
12
13
# File 'app/controllers/ecko/plugins/stripe_callbacks_controller.rb', line 6

def success
  raise Ecko::Plugins::Stripe::InvalidPaymentIntent if intent.nil?

  @message = intent.['success_message']
  Object.const_get(intent.['callback']).process(intent)

  view_response
end

#view_responseObject



19
# File 'app/controllers/ecko/plugins/stripe_callbacks_controller.rb', line 19

def view_response; end