A Ruby Gem to integrate with eWAY's Rapid Payment API.
Sign up with eWAY at:
- Australia: https://www.eway.com.au/
- New Zealand: https://eway.io/nz/
For testing, get a free eWAY Partner account: https://www.eway.com.au/developers
The eWAY Ruby Gem requires Ruby 2.0.0 or better, it also requires the rest-client and json gems.
Add this line to your application's Gemfile:
gem'eway_rapid'And then execute:
$ bundle
Or install it yourself as:
$ gem install eway_rapid
See the eWAY Rapid API Reference for usage details.
A simple Direct payment:
require'eway_rapid'api_key='Rapid API Key'password='Rapid API Password'endpoint='sandbox'client=EwayRapid::RapidClient.new(api_key,password,endpoint)transaction=EwayRapid::Models::Transaction.newtransaction.customer=EwayRapid::Models::Customer.newcard_details=EwayRapid::Models::CardDetails.newcard_details.name='Ruby Dev'card_details.number='4444333322221111'card_details.expiry_month='05'card_details.expiry_year='22'card_details.cvn='123'transaction.customer.card_details=card_detailspayment_details=EwayRapid::Models::PaymentDetails.newpayment_details.total_amount=1000transaction.payment_details=payment_detailstransaction.transaction_type=EwayRapid::Enums::TransactionType::PURCHASEresponse=client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT,transaction)ifresponse.transaction_status.status?puts"Success! ID: #{response.transaction_status.transaction_id.to_s}"endAll tests can be run by first installing all dependencies with bundle install then running bundle exec rake
Please see CHANGELOG for more information what has changed recently.
The MIT License (MIT). Please see License File for more information.