Sha256: 69470cfd87ffa7218d027d7fb76e9c40575b4e6760811f376714bee12f2adb9f

Contents?: true

Size: 1.2 KB

Versions: 9

Compression:

Stored size: 1.2 KB

Contents

#!/usr/bin/env ruby
require "bundler/setup"
require "atrium"
require "pry"
require "yaml"

def load_settings
  if ::File.exist?("tmp/settings.yml")
    puts "=> Using key and ID in tmp/settings.yml ¬"
    ::YAML.safe_load(::File.read("tmp/settings.yml"))
  else
    settings = {}
    puts "What is your MX-API-KEY?"
    settings[:mx_api_key] = gets.chomp

    puts "What is your Client ID?"
    settings[:mx_client_id] = gets.chomp

    puts "Would you like to save API key and client ID for future use?"
    case gets.chomp
    when /y/i
      ::File.open("tmp/settings.yml", "w") { |f| f.write(settings.to_yaml) }
      puts "Settings written to tmp/settings.yml ¬"
      settings
    when /n/i
      puts "One-time use settings ¬"
      settings
    end
  end
end

settings = load_settings
settings.each { |k, v| puts "\t#{k}: #{v}" }

::Atrium.configure do |config|
  config.mx_client_id = settings[:mx_client_id]
  config.mx_api_key = settings[:mx_api_key]
end

## Example flow
#
# 1. Create a User
# 2. Read that user data via GUID
# 3. List Institutions
# 4. Get credentials for institution
# 5. Create member on user
# 6. Check member aggregation status
# 7. Read other user data (accounts, members, transactions)
#

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
atrium-ruby-1.3.2 bin/demo
atrium-ruby-1.3.0 bin/demo
atrium-ruby-1.2.3 bin/demo
atrium-ruby-1.2.1 bin/demo
atrium-ruby-1.2.0 bin/demo
atrium-ruby-1.1.0 bin/demo
atrium-ruby-1.0.2 bin/demo
atrium-ruby-1.0.1 bin/demo
atrium-ruby-0.5.0 bin/demo