Project

eway_rapid

0.04
No release in over 3 years
Low commit activity in last 3 years
Easy online payments with eWAY and the eWAY Rapid Ruby gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 12.0

Runtime

~> 2.1.0
 Project Readme

eWAY Rapid Ruby Library

Latest Version on RubyGems Software License Build Status

A Ruby Gem to integrate with eWAY's Rapid Payment API.

Sign up with eWAY at:

For testing, get a free eWAY Partner account: https://www.eway.com.au/developers

Installation

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

Usage

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

Testing

All tests can be run by first installing all dependencies with bundle install then running bundle exec rake

Change log

Please see CHANGELOG for more information what has changed recently.

License

The MIT License (MIT). Please see License File for more information.