A Ruby Gem to integrate with eWAY's Rapid Payment API.
# 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.new
transaction.customer = EwayRapid::Models::Customer.new
card_details = EwayRapid::Models::CardDetails.new
card_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_details
payment_details = EwayRapid::Models::PaymentDetails.new
payment_details.total_amount = 1000
transaction.payment_details = payment_details
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE
response = client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT, transaction)
if response.transaction_status.status?
puts "Success! ID: #{response.transaction_status.transaction_id.to_s}"
end
All 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.