mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
catch card error during subscription create
This commit is contained in:
parent
786f72ad2f
commit
88e6c3967d
1 changed files with 6 additions and 1 deletions
|
@ -39,7 +39,12 @@ post '/supporter/update' do
|
|||
customer.sources.create source: params[:stripe_token]
|
||||
end
|
||||
|
||||
begin
|
||||
subscription = customer.subscriptions.create plan: plan_type
|
||||
rescue Stripe::CardError => e
|
||||
flash[:error] = "Error: #{Rack::Utils.escape_html e.message}"
|
||||
redirect '/supporter'
|
||||
end
|
||||
|
||||
site.plan_ended = false
|
||||
site.plan_type = plan_type
|
||||
|
|
Loading…
Add table
Reference in a new issue