Windcave / Payment Express REST API

Windcave Rest API is a simple rest based API allowing merchants full integration to all payment express / windcave cloud based services.

Current implementation of the gem includes the following features:

Current implementation only allows interacting with these endpoints and parsing data to ruby formats correctly but it doesnt cater for different validations on certain object types.

Installation

Add this line to your application's Gemfile:

gem 'windcave_rest'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install windcave_rest

Usage

Session Create API

You may create a new session using this request.

@api_instance = WindcaveRest::SessionsApi.new

@create_session_options = { 
  body: WindcaveRest::CreateSessionRequest.new(
    type: "purchase",
    amount: "5.05",
    currency: "AUD",
    merchant_reference: "ORDER_1",
    methods: ["card"],
    store_card: true, # optional
    stored_card_indicator: "single", # optional
  )
}

@response = @api_instance.sessions_create(@create_session_options)

Session GET API

You can use this request to query any existing session for the transaction outcome.

@session_id = "ID of the session from previous step"
@api_instance = WindcaveRest::SessionsApi.new
@response = @api_instance.sessions_get(@session_id)

Transaction create API

Transactions are records of processed standard financial requests including; purchase, refund, auth, complete, validate and void.

@api_instance = WindcaveRest::TransactionsApi.new

@card_id = "Tokenised card ID that you can get from session GET API"

@create_transaction_options = {
    type: "purchase",
    amount: "5.0.5",
    currency: get_currency,
    merchant_reference: "ORDER_1",
    card_id: @card_id
}

@response = @api_instance.transactions_create(@create_transaction_options)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/reinteractive/windcave_rest. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the WindcaveRest project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.