myob-api 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +24 -20
- data/lib/{myob/api.rb → myob-api.rb} +0 -0
- data/lib/myob/api/client.rb +1 -1
- data/lib/myob/api/version.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -24,27 +24,27 @@ If you've already got an OAuth access token, feel free to skip to API Client Set
|
|
24
24
|
|
25
25
|
The MYOB API uses 3 legged OAuth2. If you don't want to roll your own, or use the [OmniAuth strategy](https://github.com/davidlumley/omniauth-myob) you can authenticate using the `get_access_code_url` and `get_access_token` methods that [ghiculescu](https://github.com/ghiculescu) has provided like so:
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
class MYOBSessionController
|
28
|
+
def new
|
29
|
+
redirect_to myob_client.get_access_code_url
|
30
|
+
end
|
31
|
+
|
32
|
+
def create
|
33
|
+
@token = myob_client.get_access_token(params[:code])
|
34
|
+
@company_files = myob_client.company_file.all
|
35
|
+
# then show the user a view where they can log in to their company file
|
36
|
+
end
|
37
|
+
|
38
|
+
def myob_client
|
39
|
+
@api_client = Myob::Api::Client.new({
|
40
|
+
:consumer => {
|
41
|
+
:key => YOUR_CONSUMER_KEY,
|
42
|
+
:secret => YOUR_CONSUMER_SECRET,
|
43
|
+
},
|
44
|
+
})
|
45
|
+
end
|
30
46
|
end
|
31
47
|
|
32
|
-
def create
|
33
|
-
@token = myob_client.get_access_token(params[:code])
|
34
|
-
@company_files = myob_client.company_file.all
|
35
|
-
# then show the user a view where they can log in to their company file
|
36
|
-
end
|
37
|
-
|
38
|
-
def myob_client
|
39
|
-
@api_client = Myob::Api::Client.new({
|
40
|
-
:consumer => {
|
41
|
-
:key => YOUR_CONSUMER_KEY,
|
42
|
-
:secret => YOUR_CONSUMER_SECRET,
|
43
|
-
},
|
44
|
-
})
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
48
|
### API Client Setup
|
49
49
|
|
50
50
|
Create an api_client:
|
@@ -116,7 +116,7 @@ Return a list of all customers (a subset of contacts)
|
|
116
116
|
|
117
117
|
#### Employees
|
118
118
|
|
119
|
-
Return a list of all
|
119
|
+
Return a list of all employees
|
120
120
|
|
121
121
|
api_client.employee.all
|
122
122
|
|
@@ -135,3 +135,7 @@ Return a list of all customers (a subset of contacts)
|
|
135
135
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
136
136
|
4. Push to the branch (`git push origin my-new-feature`)
|
137
137
|
5. Create new Pull Request
|
138
|
+
|
139
|
+
|
140
|
+
[](https://bitdeli.com/free "Bitdeli Badge")
|
141
|
+
|
File without changes
|
data/lib/myob/api/client.rb
CHANGED
data/lib/myob/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myob-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|
@@ -71,7 +71,7 @@ files:
|
|
71
71
|
- LICENSE.txt
|
72
72
|
- README.md
|
73
73
|
- Rakefile
|
74
|
-
- lib/myob
|
74
|
+
- lib/myob-api.rb
|
75
75
|
- lib/myob/api/client.rb
|
76
76
|
- lib/myob/api/helpers.rb
|
77
77
|
- lib/myob/api/models/base.rb
|
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
segments:
|
98
98
|
- 0
|
99
|
-
hash:
|
99
|
+
hash: 3179972394825263714
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
none: false
|
102
102
|
requirements:
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
segments:
|
107
107
|
- 0
|
108
|
-
hash:
|
108
|
+
hash: 3179972394825263714
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
111
|
rubygems_version: 1.8.23
|