0.0
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for the Moolah.io Transaction API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.6
>= 0
~> 3.0.0

Runtime

~> 0.9.0
 Project Readme

Build Status

Moolah::Ruby

Wrapper API for Moolah's Transaction API (v2)

Installation

Add this line to your application's Gemfile:

gem 'moolah-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install moolah-ruby

Usage

Configuration:

require 'moolah'

Moolah.configure do |config|
  config.api_key = ENV['API_KEY']
  config.api_secret = ENV['API_SECRET'] # necessary for IPN response
  # config.endpoint = "https://api.moolah.io" # endpoint must not contain paths, "/v2" is included in API calls
end

Create a transaction:

moolah_client = Moolah::Client.new

# No IPN Response
response = moolah_client.create_transaction(coin: "bitcoin", currency: "USD", amount: "20", product: "Coingecko Pro")

# IPN Response
response = moolah_client.create_transaction(coin: "bitcoin", currency: "USD", amount: "20", product: "Coingecko Pro", ipn: "www.example.com/processed_payment", ipn_extra: "{ user_id: 1 }")

response[:status] # "success"
response[:guid] # "1234-1234-1234-1234"
response[:address] # "abcdefghijklmnopqrstuvwxyz"
# etc.

Query a transaction:

query_result = moolah_client.query_transaction(guid:"1234-1234-1234-1234")

query_result[:status] # "success"
query_result[:transaction][:tx][:coin] # "bitcoin"
# etc.

API Doc

Complete API documentation available at https://moolah.io/dashboard/merchant/api

Contributing

  1. Fork it ( https://github.com/coingecko/moolah-ruby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request