RailsCasts Pro episodes are now free!

Learn more or hide this

David Rodríguez's Profile

GitHub User: deivid-rodriguez

Site: nipanipa.com

Comments by David Rodríguez

Avatar

I was getting this error because my app was in sandbox mode and I was using real users. Once I created test users and use them instead, it started working.

Avatar

Yes, Paypal sandbox site has changed. But it is pretty much the same functionality. In case some configured this with the old sandbox and is trying to use it now, getting the error

This invoice has already been paid.

I solved this temporarily by changing

:invoice => id

with

:invoice => id + 1000

in the paypal_url method.

Avatar

Hi @dedek, you code looks ok to me. Just make sure you are actually instantiating a task in your controller, something like this

class ProjectsController

  def new
    @project = Project.new
    @project.tasks.build
  end

  ...
end

Good luck!