This is a Rails application that mimics the interaction with the second version of the Dinero Mail IPN service. It is intended to be used in staing environments, becasue Dinero Mail doesn't provide a testing environment. It will work for development too.
- Clone this repo.
- Create a new application on Heroku
- Push the code.
- Run the migrations.
- Set the environment variable DINERO_MAIL_FAKE_IPN_NOTIFICATION_URL to point to your consumer application.
- Configure your consumer application to talk to the one you have just created.
Points 1 through 5 can be summarized as follows, 6 it's up to you:
$ git clone git://github.com/code54/dinero_mail_fake_ipn.git
$ cd dinero_mail_fake_ipn
$ heroku apps:create dinero-mail-ipn-consumer-app
$ git push heroku master
$ heroku run rake db:migrate
$ heroku config:set DINERO_MAIL_FAKE_IPN_NOTIFICATION_URL="http://staging.myapp.com/ipn"First, clone the repo, install the bundle and setup the database:
$ git clone git://github.com/code54/dinero_mail_fake_ipn.git
$ cd dinero_mail_fake_ipn
$ bundle install
$ rake db:setupThen start your server with something like:
$ DINERO_MAIL_FAKE_IPN_SCHEDULER="true" DINERO_MAIL_FAKE_IPN_NOTIFICATION_URL="http://localhost:3000" rails s --port 4000The DINERO_MAIL_FAKE_IPN_SCHEDULER environment variable tells the server to run the code that performs the operation's status transitions. Given that code is in an initializer, the environment variable needs to be set only for your server process. Otherwise, that code would be run everytime you connect to the console, perform a rake task, etc.
The DINERO_MAIL_FAKE_IPN_NOTIFICATION_URL environment variable tells the application where to send the IPN notifications. The value should be your application endpoint in charge of processing them.