Story#107571572 - banklinks workflow fixes

This commit is contained in:
Vladimir Krylov 2015-11-16 10:59:26 +02:00
parent a54a15cea4
commit fc5dbd3523
3 changed files with 9 additions and 5 deletions

View file

@ -20,16 +20,16 @@ class Registrar::PaymentsController < RegistrarController
# both back and IPN
def back
@bank_link = BankLink::Response.new(params[:bank], params)
if @bank_link.valid?
if @bank_link.valid? && @bank_link.ok?
@bank_link.complete_payment
if @bank_link.invoice.binded?
flash[:notice] = t(:pending_applieds)
flash[:notice] = t(:pending_applied)
else
flash[:error] = t(:something_wrong)
flash[:alert] = t(:something_wrong)
end
else
flash[:error] = t(:something_wrong)
flash[:alert] = t(:something_wrong)
end
redirect_to registrar_invoice_path(@bank_link.invoice)
end