Skip to content

Commit

Permalink
Merge branch 'release/0.0.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
kgathi2 committed May 30, 2015
2 parents 9a05f88 + 7b3b217 commit 5672b8d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export MPAYER_TOKEN=<Your token>
```

## Configurations
To configure credentials locally on you code use config block below. For Rails, put this in `config/initializers/mpayer.rb`
To configure credentials for your API calls on you code use config block below. For Rails, put this in `config/initializers/mpayer.rb`

```ruby
Mpayer.setup do |config|
Expand Down Expand Up @@ -67,6 +67,8 @@ clients = Mpayer::Client.find(123, fetch:false)
## Endpoints
Mpayer gem currently supports a few endpoint below

https://app.mpayer.co.ke/api/login

https://app.mpayer.co.ke/api/client

https://app.mpayer.co.ke/api/accounts
Expand All @@ -83,6 +85,17 @@ client = client.first
client.name #=> "CLark Kent"
```

### Login
Login give you your organisations settings and credentials.
YOu need to have set up t
```ruby
login = Mpayer.login
# defaults are picked from user:ENV['MPAYER_USER'],password:ENV['MPAYER_PASSWORD']

login = Mpayer.login(user:'james@bond.com', password: "bond..james bond")

```

### Client
```ruby
clients = Mpayer::Client.all
Expand Down
4 changes: 2 additions & 2 deletions lib/mpayer_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def setup
yield(configuration)
end

def login
Mpayer::Fetch.post('/login',{user: ENV['MPAYER_USER'],password:ENV['MPAYER_PASSWORD']})
def login(user:ENV['MPAYER_USER'],password:ENV['MPAYER_PASSWORD'])
Mpayer::Fetch.post('/login',{user: user,password:password})
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/mpayer_ruby/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Mpayer
VERSION = "0.0.11"
VERSION = "0.0.12"
end

0 comments on commit 5672b8d

Please sign in to comment.