Skip to content

Commit

Permalink
[triv] README: code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergiusz Woźnicki committed Sep 25, 2013
1 parent 7078d83 commit 5f3e97a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ where CLIENT_ID is the id you will use to connect to the api
and CLIENT_NAME is a full name that will be use to identify all communications
between you and the MangoPay Team.

* Otherwise, call ```MangoPay.configure``` in your script as shown in the snippet below.

### Examples

```ruby
require 'mangopay'

# configuration (not required if Rails generator fired as above)
MangoPay.configure do |c|
c.preproduction = true
c.client_id = 'YOUR_CLIENT_ID'
c.client_passphrase = 'YOUR_CLIENT_PASSWORD'
end

# get some user by id
john = MangoPay::User.fetch(john_id) # => {FirstName"=>"John", "LastName"=>"Doe", ...}

Expand Down

0 comments on commit 5f3e97a

Please sign in to comment.