bukku_rails 0.1.0 → 0.1.4
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.
- checksums.yaml +4 -4
- data/README.md +35 -32
- data/lib/bukku.rb +5 -5
- data/lib/bukku_rails/version.rb +1 -1
- data/lib/bukku_test.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df23a6a528a26b6ee952178ab0f4ecc1695b788e205044c5a373fd807df81c1d
|
|
4
|
+
data.tar.gz: 858aa3808ea2089f9c5854ad02a823ec5ba13b678c3c033daacb6494896fac92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e61943b4520221cf4286a2cb8cc426e074cdfc5eeeb270f1548d84d2dc7ec285ed0caccffad3847aa7fa65d4c15d4e60a0dee25209c007d81f9751b70cd72d20
|
|
7
|
+
data.tar.gz: a1b401386099562ee80bbd86717aa39b9132a55842c69627758e1c454c3ec4ee279fe1a642773feabdeebcfd2e26e226ae0e62c33e32885e757b736183070895
|
data/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# BukkuRails
|
|
2
2
|
|
|
3
|
-
Use Rails methods to interact with your data in [Bukku](https://bukku.my/) accounting software.
|
|
3
|
+
Use Rails methods to interact with your data in [Bukku](https://bukku.my/) accounting software.
|
|
4
4
|
|
|
5
|
-
Take a look at [Bukku's API](https://developers.bukku.my) to know what data you can extract from Bukku.
|
|
5
|
+
Take a look at [Bukku's API](https://developers.bukku.my) to know what data you can extract from Bukku.
|
|
6
6
|
|
|
7
|
-
> As of December 2, 2025, the gem only handles **GET** request. If you require other request, fork the gem and write it and then send us a Pull Request.
|
|
7
|
+
> As of December 2, 2025, the gem only handles **GET** request. If you require other request, fork the gem and write it and then send us a Pull Request.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -14,36 +14,17 @@ Add the gen into your Gemfile like so:
|
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
-
You will need 2 things - your **subdomain** and **API Token**.
|
|
17
|
+
You will need 2 things - your **subdomain** and **API Token**.
|
|
18
18
|
|
|
19
|
-
You can get these after you login into your Bukku account, Control Panel -> Integrations -> Turn ON API Access.
|
|
19
|
+
You can get these after you login into your Bukku account, Control Panel -> Integrations -> Turn ON API Access.
|
|
20
20
|
|
|
21
|
-
Note: Bukku offers 2 type of access - Staging and Production. You can [email Bukku](mailto:dev@bukku.my) for a Staging account which will be great to test your Rails app if it is extracting the correct data from Bukku. Once you are satisfied you can then use access the Production server where your actual data lives.
|
|
21
|
+
Note: Bukku offers 2 type of access - Staging and Production. You can [email Bukku](mailto:dev@bukku.my) for a Staging account which will be a great way to test your Rails app to see if it is extracting the correct data from Bukku's staging server (exactly the same app but at their staging server). Once you are satisfied you can then use access the Production server where your actual data lives.
|
|
22
22
|
|
|
23
|
-
**Bukku Rails** provides usage for both access. For Staging use the `BukkuTest` class and actual
|
|
24
|
-
|
|
25
|
-
### Setup
|
|
26
|
-
For Staging
|
|
27
|
-
```ruby
|
|
28
|
-
# Initialize the client
|
|
29
|
-
client = BukkuTest.new(
|
|
30
|
-
token: "your_bukku_api_token",
|
|
31
|
-
domain: "your_company_subdomain"
|
|
32
|
-
)
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
For Production
|
|
36
|
-
```ruby
|
|
37
|
-
# Initialize the client
|
|
38
|
-
client = Bukku.new(
|
|
39
|
-
token: "your_bukku_api_token",
|
|
40
|
-
domain: "your_company_subdomain"
|
|
41
|
-
)
|
|
42
|
-
```
|
|
23
|
+
**Bukku Rails** provides usage for both access. For Staging use the `BukkuTest` class and actual Production simply use `Bukku` class. Then you can use any of the methods listed in the table below:
|
|
43
24
|
|
|
44
25
|
### Available Methods
|
|
45
26
|
|
|
46
|
-
Just like in Rails the methods follow the singular and plural expression. Methods with arguments are normally plural, while methods without arguments are singular methods calls.
|
|
27
|
+
Just like in Rails the methods follow the singular and plural expression. Methods with arguments are normally plural, while methods without arguments are singular methods calls.
|
|
47
28
|
|
|
48
29
|
#### Sales
|
|
49
30
|
|
|
@@ -114,30 +95,52 @@ Just like in Rails the methods follow the singular and plural expression. Method
|
|
|
114
95
|
|
|
115
96
|
| HTTP Method | Ruby Method | Endpoint |
|
|
116
97
|
|------------|-------------|----------|
|
|
117
|
-
| GET | `
|
|
118
|
-
| GET | `
|
|
119
|
-
| GET | `
|
|
120
|
-
| GET | `
|
|
98
|
+
| GET | `get_journal_entries(**kwargs)` | `/journal_entries` |
|
|
99
|
+
| GET | `get_journal_entry(id)` | `/journal_entries/:id` |
|
|
100
|
+
| GET | `get_accounts(**kwargs)` | `/accounts` |
|
|
101
|
+
| GET | `get_account(id)` | `/accounts/:id` |
|
|
121
102
|
|
|
122
103
|
### Examples
|
|
123
104
|
|
|
105
|
+
To use the gem you will need to initialize a client first. Either choose a Bukku's Staging or Production server to test your app.
|
|
106
|
+
|
|
107
|
+
For Staging at <https://api.bukku.fyi>
|
|
108
|
+
|
|
109
|
+
```ruby
|
|
110
|
+
client = BukkuTest.new(
|
|
111
|
+
token: "your_bukku_api_token",
|
|
112
|
+
domain: "your_company_subdomain"
|
|
113
|
+
)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
For Production at <https://api.bukku.my>
|
|
117
|
+
|
|
118
|
+
```ruby
|
|
119
|
+
client = Bukku.new(
|
|
120
|
+
token: "your_bukku_api_token",
|
|
121
|
+
domain: "your_company_subdomain"
|
|
122
|
+
)
|
|
123
|
+
```
|
|
124
|
+
|
|
124
125
|
**Fetch all invoices:**
|
|
126
|
+
|
|
125
127
|
```ruby
|
|
126
128
|
invoices = client.get_invoices
|
|
127
129
|
```
|
|
128
130
|
|
|
129
131
|
**Fetch invoices with date filters or parameters:**
|
|
130
132
|
To know more on what Query Parameters is acceptable head to [Bukku API page](https://developers.bukku.my)
|
|
133
|
+
|
|
131
134
|
```ruby
|
|
132
135
|
invoices = client.get_invoices(date_from: "2025-11-01", date_to: "2025-11-30")
|
|
133
136
|
```
|
|
134
137
|
|
|
135
138
|
**Fetch a specific invoice:**
|
|
139
|
+
|
|
136
140
|
```ruby
|
|
137
141
|
invoice = client.get_invoice(123)
|
|
138
142
|
```
|
|
139
143
|
|
|
140
|
-
|
|
141
144
|
## Contributing
|
|
142
145
|
|
|
143
146
|
Bug reports and pull requests are welcome on GitHub at <https://github.com/stopar/bukku_rails>.
|
data/lib/bukku.rb
CHANGED
|
@@ -193,20 +193,20 @@ class Bukku < Client
|
|
|
193
193
|
|
|
194
194
|
## ACCOUNTING
|
|
195
195
|
# Journal Entries
|
|
196
|
-
def
|
|
196
|
+
def get_journal_entries(**kwargs)
|
|
197
197
|
get '/journal_entries', query: kwargs
|
|
198
198
|
end
|
|
199
199
|
|
|
200
|
-
def
|
|
200
|
+
def get_journal_entry(id)
|
|
201
201
|
get "/journal_entries/#{id}"
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
# Account
|
|
205
|
-
def
|
|
206
|
-
get '/accounts'
|
|
205
|
+
def get_accounts(**kwargs)
|
|
206
|
+
get '/accounts', query: kwargs
|
|
207
207
|
end
|
|
208
208
|
|
|
209
|
-
def
|
|
209
|
+
def get_account(id)
|
|
210
210
|
get "/accounts/#{id}"
|
|
211
211
|
end
|
|
212
212
|
end
|
data/lib/bukku_rails/version.rb
CHANGED
data/lib/bukku_test.rb
CHANGED
|
@@ -193,20 +193,20 @@ class BukkuTest < Client
|
|
|
193
193
|
|
|
194
194
|
## ACCOUNTING
|
|
195
195
|
# Journal Entries
|
|
196
|
-
def
|
|
196
|
+
def get_journal_entries(**kwargs)
|
|
197
197
|
get '/journal_entries', query: kwargs
|
|
198
198
|
end
|
|
199
199
|
|
|
200
|
-
def
|
|
200
|
+
def get_journal_entry(id)
|
|
201
201
|
get "/journal_entries/#{id}"
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
# Account
|
|
205
|
-
def
|
|
206
|
-
get '/accounts'
|
|
205
|
+
def get_accounts(**kwargs)
|
|
206
|
+
get '/accounts', query: kwargs
|
|
207
207
|
end
|
|
208
208
|
|
|
209
|
-
def
|
|
209
|
+
def get_account(id)
|
|
210
210
|
get "/accounts/#{id}"
|
|
211
211
|
end
|
|
212
212
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bukku_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Muzaffar Ariff
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-12-
|
|
11
|
+
date: 2025-12-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Use Rails conventions to call Bukku API requests.
|
|
14
14
|
email:
|