laundry 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ #Laundry Changelog
2
+
3
+ - **v0.0.2**
4
+ - Silenced debug log output.
5
+ - Added changelog.
6
+ - A bug fix (60ccb34c8bf383175e601c1a7e70942ae06cb79a).
7
+
8
+ - **v0.0.1**
9
+ Initial "release".
data/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  #Laundry [![Build Status](https://secure.travis-ci.org/supapuerco/laundry.png)](http://travis-ci.org/supapuerco/laundry) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/supapuerco/laundry)
2
2
 
3
- TODO: Write a gem description
3
+ Have you ever wanted to use [ACH Direct](http://www.achdirect.com)'s [Payments Gateway](http://paymentsgateway.com) SOAP API? Neither did anyone. However, with this little gem you should be able to interact with it without going too terribly nuts.
4
4
 
5
- merchant = Laundry::PaymentsGateway::Merchant.new(id: '12345', api_login_id: 'abcd', api_password: 'secret')
6
- merchant.clients.find(10).accounts.create!
5
+ The basic idea is to have a somewhat ActiveRecord-y syntax to making payments, updating client information, etc.
7
6
 
8
7
  [View the Rdoc](http://rdoc.info/github/supapuerco/laundry/master/frames)
9
8
 
@@ -23,7 +22,44 @@ Or install it yourself as:
23
22
 
24
23
  ## Usage
25
24
 
26
- TODO: Write usage instructions here
25
+ First, set up your merchant **account details**, possibly in a Rails initializer. (You're not limited to this singleton thing, but it's pretty useful if you just have one account.)
26
+
27
+ ```ruby
28
+ Laundry::PaymentsGateway::Merchant.default_merchant({
29
+ id: '123456',
30
+ api_login_id: 'abc123',
31
+ api_password: 'secretsauce',
32
+ transaction_password: 'moneymoneymoney'
33
+ })
34
+ ```
35
+
36
+ In development? You should probably **sandbox** this baby:
37
+
38
+ ```ruby
39
+ Laundry.sandboxed = !Rails.env.production?
40
+ ```
41
+
42
+ Then you can **find a client**:
43
+
44
+ ```ruby
45
+ client = Laundry::PaymentsGateway::Merchant.default_merchant.clients.find(10)
46
+ ```
47
+
48
+ Create a **bank account**:
49
+
50
+ ```ruby
51
+ client.accounts.create!({
52
+ acct_holder_name: user.name,
53
+ ec_account_number: '12345678912345689',
54
+ ec_account_trn: '123457890',
55
+ ec_account_type: "CHECKING"
56
+ })
57
+ ```
58
+
59
+ **Send some money**:
60
+ ```ruby
61
+ account.debit_cents 1250
62
+ ```
27
63
 
28
64
  ## Contributing
29
65
 
@@ -31,4 +67,4 @@ TODO: Write usage instructions here
31
67
  2. Create your feature branch (`git checkout -b my-new-feature`)
32
68
  3. Commit your changes (`git commit -am 'Add some feature'`)
33
69
  4. Push to the branch (`git push origin my-new-feature`)
34
- 5. Create new Pull Request
70
+ 5. Create a new Pull Request
@@ -20,7 +20,7 @@ module Laundry
20
20
  end
21
21
 
22
22
  def method_missing(id, *args)
23
- return record[id.to_sym] if record.has_key? id.to_sym
23
+ return record[id.to_sym] if record.try(:has_key?, id.to_sym)
24
24
  super
25
25
  end
26
26
 
@@ -1,3 +1,3 @@
1
1
  module Laundry
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/laundry.rb CHANGED
@@ -1,6 +1,13 @@
1
1
  require "laundry/version"
2
2
  require 'savon'
3
3
 
4
+ # Don't log Laundry xmls to STDOUT.
5
+ Savon.configure do |config|
6
+ config.log = false
7
+ config.log_level = :error
8
+ HTTPI.log = false
9
+ end
10
+
4
11
  module Laundry
5
12
 
6
13
  @@sandboxed = true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: laundry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -35,6 +35,7 @@ extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
37
  - .gitignore
38
+ - CHANGELOG.md
38
39
  - Gemfile
39
40
  - LICENSE
40
41
  - README.md
@@ -69,7 +70,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
70
  version: '0'
70
71
  segments:
71
72
  - 0
72
- hash: 1235405825976968960
73
+ hash: 2170319772523828423
73
74
  required_rubygems_version: !ruby/object:Gem::Requirement
74
75
  none: false
75
76
  requirements:
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
79
  version: '0'
79
80
  segments:
80
81
  - 0
81
- hash: 1235405825976968960
82
+ hash: 2170319772523828423
82
83
  requirements: []
83
84
  rubyforge_project:
84
85
  rubygems_version: 1.8.24