@madpilot makes

Eway Rebill and Managed Payments for ActiveMerchant

If you are an Australian Rails developer and have had to deal with online payments, chances are you’ve dealt with Eway. ActiveMerchant has supported Eway for single transactions for a while, but if you have had to deal with rebilling, you may have been at a loss.

I’ve just forked ActiveMerchant and added support for the new Eway Rebill and Managed Payments SOAP API (Obviously, you’ll need soap4r). It’s on github. Very sparse instructions are here. The Rebill API might still need some work, as I ended up concentrating on the Managed Payments API, as that is actually more flexible.

Some background: When using the Rebill API, you tell Eway who you are billing, and when to bill them, and it takes care of the rest. The Managed Payments API on the other hand has Eway storing the users credit card details, and when you need to charge the client, you send a request via the API.

The problem I see with the Rebill API is there is no easy way to check if a payment has failed, other than pulling out ALL the past transactions and checking, where as Managed Payments will give you an immediate response, at the expense of having to maintain your own scheduled task/cron job.

Let me know if it works for you!


  1. Excellent... I'll be pulling this into the SaaS Rails Kit shortly. :)

  2. We managed to get rebill working on a project a few weeks ago. Thanks for sharing the code!

    Sadly, we just discovered after moving the app to a passenger stack it breaks with the smart spawning method in passenger. Looks like httpclient that's part of soap4r trips up. Conservative spawning fixes it but there goes the memory benefits of passenger.
  3. I'm having some trouble getting the customer creation working.

    I've setup the gateway thusly:

    >> GATEWAY.inspect

    => "#:managed, :password=>"test123", :login=>"87654321", :username=>"test@eway.com.au"}>"

    When I try to create a customer I'm seeing:

    >> customer = GATEWAY.create_customer({:email => 'top@hat.com', :last_name => 'asdasd', :first_name => 'asdasdas'})

    ArgumentError: wrong number of arguments (1 for 2)

    from (irb):40:in `create_customer'

    from (irb):40

    It wants the CC details for the first argument then the customer details. This seems to be working differently to the tests you've got in the eway_managed_test.rb

    I tried running the tests but there was no :eway_rebill fixtures in the fixtures file.

    Any thoughts?


  4. Hello All,

    I have some trouble while using eway rebill account. My requirement is that I have to display a payment history in the my account also history should comes from the database.

    How I will be do this?. paypal provide IPN for this. In eway, Is there any way to do the same?


  5. Ranjeet: Don't user rebill, use managed payments.

    That way, you can trigger a payment using a cronjob, and save whatever you need in your database.

    It doesn't help you with manual payment done through the eway interface. You can poll the recent payments from eway, but they don't provide an IPN style post back.
  6. Martin: The rebill stuff is incomplete. I ended up using managed payments. As an aside, it seems the test API may be broken at the moment.

    I have to email eway about this.

Leave a comment