app/controllers/registrar/payments_controller.rb
# connect invoice and transaction
# both back and IPN
connect invoice and transaction
both back and IPN
connect invoice and transaction both back and IPN
def back
    @bank_link = BankLink::Response.new(params[:bank], params)
    if @bank_link.valid? && @bank_link.ok?
      @bank_link.complete_payment
      if @bank_link.invoice.binded?
        flash[:notice] = t(:pending_applied)
      else
        flash[:alert]  = t(:something_wrong)
      end
    else
      flash[:alert] = t(:something_wrong)
    end
    redirect_to registrar_invoice_path(@bank_link.invoice)
  end
def back @bank_link = BankLink :: Response . new ( params [ :bank ] , params ) if @bank_link . valid? && @bank_link . ok? @bank_link . complete_payment if @bank_link . invoice . binded? flash [ :notice ] = t ( :pending_applied ) else flash [ :alert ] = t ( :something_wrong ) end else flash [ :alert ] = t ( :something_wrong ) end redirect_to registrar_invoice_path ( @bank_link . invoice ) end
connect invoice and transaction
both back and IPN
connect invoice and transaction both back and IPN