Class: Pay::PaymentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pay/payments_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject

Intents on a Stripe Connect account are linked with ?stripe_account=acct_123 The back link only follows a same-host URL or a path, so it can't be used for an open redirect



7
8
9
10
11
12
# File 'app/controllers/pay/payments_controller.rb', line 7

def show
  @payment = Payment.from_id(params[:id], stripe_account: params[:stripe_account].presence)
  @redirect_to = url_from(params[:back]) || root_path
rescue Pay::Error => e
  redirect_to root_path, alert: e.message
end