bukku_rails 0.1.4 → 0.1.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.
- checksums.yaml +4 -4
- data/README.md +44 -26
- data/lib/bukku_rails/version.rb +1 -1
- data/lib/client.rb +6 -0
- 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: 155357b4ca282d160dcb92f22b77c6ceed853d4df539470838b02846809af42a
|
|
4
|
+
data.tar.gz: e59657c28be7b60904edb9dda405435d7b8216a61610f0c3f5603b0fcd02137f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27e5a345e5dd38ba2e2a5d05d5d52d6f3fd83ac9815be509df718ee08ecba3cd14227f8fc09d818985171f6b23c8d98b02f3201a930b392dfdc59399ca12c1a0
|
|
7
|
+
data.tar.gz: 41a28319db712943fb2181c7793d7eb674414b071cf7632a04cfae617603605b09467608864f19b3f1820db8e42041187c6b21dd714d25658f2060a4a31c42f7
|
data/README.md
CHANGED
|
@@ -8,9 +8,19 @@ Take a look at [Bukku's API](https://developers.bukku.my) to know what data you
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Rails
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Add the gem into your Gemfile like so:
|
|
14
|
+
|
|
15
|
+
`gem "bukku_rails"`
|
|
16
|
+
|
|
17
|
+
### Ruby
|
|
18
|
+
|
|
19
|
+
1. Install the gem `gem install bukku_rails`
|
|
20
|
+
|
|
21
|
+
2. Test the gem standalone `irb -r bukku_rails`
|
|
22
|
+
|
|
23
|
+
3. If your satisfied with the gem usage you can include the gem in your `Gemfile` of your app.
|
|
14
24
|
|
|
15
25
|
## Usage
|
|
16
26
|
|
|
@@ -18,9 +28,17 @@ You will need 2 things - your **subdomain** and **API Token**.
|
|
|
18
28
|
|
|
19
29
|
You can get these after you login into your Bukku account, Control Panel -> Integrations -> Turn ON API Access.
|
|
20
30
|
|
|
21
|
-
Note: Bukku offers 2 type of access
|
|
31
|
+
Note: Bukku offers 2 type of access:
|
|
32
|
+
|
|
33
|
+
1. *Staging* - For testing your app. 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).
|
|
34
|
+
|
|
35
|
+
2. *Production* - Your actual Bukku data, where all your data lives.
|
|
36
|
+
|
|
37
|
+
**Bukku Rails** provides usage for both access, under 2 different classes:
|
|
38
|
+
|
|
39
|
+
1. *Staging* use the `BukkuTest` class, like so `client = BukkuTest.new(domain: "sub-domain", token: "token-from-bukku-fyi")`
|
|
22
40
|
|
|
23
|
-
|
|
41
|
+
2. *Production* use `Bukku` class, like so `client = Bukku.new(domain: "sub-domain", token: "token-from-bukku-my")`
|
|
24
42
|
|
|
25
43
|
### Available Methods
|
|
26
44
|
|
|
@@ -30,74 +48,74 @@ Just like in Rails the methods follow the singular and plural expression. Method
|
|
|
30
48
|
|
|
31
49
|
| HTTP Method | Ruby Method | Endpoint |
|
|
32
50
|
|------------|-------------|----------|
|
|
33
|
-
| GET | `get_sales_quotes(
|
|
51
|
+
| GET | `get_sales_quotes(query-parameters)` | `/sales/quotes` |
|
|
34
52
|
| GET | `get_sales_quote(id)` | `/sales/quotes/:id` |
|
|
35
|
-
| GET | `get_sales_orders(
|
|
53
|
+
| GET | `get_sales_orders(query-parameters)` | `/sales/orders` |
|
|
36
54
|
| GET | `get_sales_order(id)` | `/sales/orders/:id` |
|
|
37
|
-
| GET | `get_delivery_orders(
|
|
55
|
+
| GET | `get_delivery_orders(query-parameters)` | `/sales/delivery_orders` |
|
|
38
56
|
| GET | `get_delivery_order(id)` | `/sales/delivery_orders/:id` |
|
|
39
|
-
| GET | `get_invoices(
|
|
57
|
+
| GET | `get_invoices(query-parameters)` | `/sales/invoices` |
|
|
40
58
|
| GET | `get_invoice(id)` | `/sales/invoices/:id` |
|
|
41
|
-
| GET | `get_sales_credit_notes(
|
|
59
|
+
| GET | `get_sales_credit_notes(query-parameters)` | `/sales/credit_notes` |
|
|
42
60
|
| GET | `get_sales_credit_note(id)` | `/sales/credit_notes/:id` |
|
|
43
|
-
| GET | `get_sales_payments(
|
|
61
|
+
| GET | `get_sales_payments(query-parameters)` | `/sales/payments` |
|
|
44
62
|
| GET | `get_sales_payment(id)` | `/sales/payments/:id` |
|
|
45
|
-
| GET | `get_sales_refunds(
|
|
63
|
+
| GET | `get_sales_refunds(query-parameters)` | `/sales/refunds` |
|
|
46
64
|
| GET | `get_sales_refund(id)` | `/sales/refunds/:id` |
|
|
47
65
|
|
|
48
66
|
#### Purchases
|
|
49
67
|
|
|
50
68
|
| HTTP Method | Ruby Method | Endpoint |
|
|
51
69
|
|------------|-------------|----------|
|
|
52
|
-
| GET | `get_purchase_orders(
|
|
70
|
+
| GET | `get_purchase_orders(query-parameters)` | `/purchases/orders` |
|
|
53
71
|
| GET | `get_purchase_order(id)` | `/purchases/orders/:id` |
|
|
54
|
-
| GET | `get_received_notes(
|
|
72
|
+
| GET | `get_received_notes(query-parameters)` | `/purchases/goods_received_notes` |
|
|
55
73
|
| GET | `get_received_note(id)` | `/purchases/goods_received_notes/:id` |
|
|
56
|
-
| GET | `get_bills(
|
|
74
|
+
| GET | `get_bills(query-parameters)` | `/purchases/bills` |
|
|
57
75
|
| GET | `get_bill(id)` | `/purchases/bills/:id` |
|
|
58
|
-
| GET | `get_purchases_credit_notes(
|
|
76
|
+
| GET | `get_purchases_credit_notes(query-parameters)` | `/purchases/credit_notes` |
|
|
59
77
|
| GET | `get_purchases_credit_note(id)` | `/purchases/credit_notes/:id` |
|
|
60
|
-
| GET | `get_purchases_payments(
|
|
78
|
+
| GET | `get_purchases_payments(query-parameters)` | `/purchases/payments` |
|
|
61
79
|
| GET | `get_purchases_payments(id)` | `/purchases/payments/:id` |
|
|
62
|
-
| GET | `get_purchases_refunds(
|
|
80
|
+
| GET | `get_purchases_refunds(query-parameters)` | `/purchases/refunds` |
|
|
63
81
|
| GET | `get_purchases_refund(id)` | `/purchases/refunds/:id` |
|
|
64
82
|
|
|
65
83
|
#### Banking
|
|
66
84
|
|
|
67
85
|
| HTTP Method | Ruby Method | Endpoint |
|
|
68
86
|
|------------|-------------|----------|
|
|
69
|
-
| GET | `get_banking_incomes(
|
|
87
|
+
| GET | `get_banking_incomes(query-parameters)` | `/banking/incomes` |
|
|
70
88
|
| GET | `get_banking_income(id)` | `/banking/incomes/:id` |
|
|
71
|
-
| GET | `get_banking_expenses(
|
|
89
|
+
| GET | `get_banking_expenses(query-parameters)` | `/banking/expenses` |
|
|
72
90
|
| GET | `get_banking_expense(id)` | `/banking/expenses/:id` |
|
|
73
|
-
| GET | `get_transfers(
|
|
91
|
+
| GET | `get_transfers(query-parameters)` | `/banking/transfers` |
|
|
74
92
|
| GET | `get_transfer(id)` | `/banking/transfers/:id` |
|
|
75
93
|
|
|
76
94
|
#### Contacts
|
|
77
95
|
|
|
78
96
|
| HTTP Method | Ruby Method | Endpoint |
|
|
79
97
|
|------------|-------------|----------|
|
|
80
|
-
| GET | `get_contacts(
|
|
98
|
+
| GET | `get_contacts(query-parameters)` | `/contacts` |
|
|
81
99
|
| GET | `get_contact(id)` | `/contacts/:id` |
|
|
82
|
-
| GET | `get_contact_groups(
|
|
100
|
+
| GET | `get_contact_groups(query-parameters)` | `/contacts/groups` |
|
|
83
101
|
| GET | `get_contact_group(id)` | `/contacts/groups/:id` |
|
|
84
102
|
|
|
85
103
|
#### Products
|
|
86
104
|
|
|
87
105
|
| HTTP Method | Ruby Method | Endpoint |
|
|
88
106
|
|------------|-------------|----------|
|
|
89
|
-
| GET | `get_products(
|
|
107
|
+
| GET | `get_products(query-parameters)` | `/products` |
|
|
90
108
|
| GET | `get_product(id)` | `/products/:id` |
|
|
91
|
-
| GET | `get_product_groups(
|
|
109
|
+
| GET | `get_product_groups(query-parameters)` | `/products/groups` |
|
|
92
110
|
| GET | `get_product_group(id)` | `/products/groups/:id` |
|
|
93
111
|
|
|
94
112
|
#### Accounting
|
|
95
113
|
|
|
96
114
|
| HTTP Method | Ruby Method | Endpoint |
|
|
97
115
|
|------------|-------------|----------|
|
|
98
|
-
| GET | `get_journal_entries(
|
|
116
|
+
| GET | `get_journal_entries(query-parameters)` | `/journal_entries` |
|
|
99
117
|
| GET | `get_journal_entry(id)` | `/journal_entries/:id` |
|
|
100
|
-
| GET | `get_accounts(
|
|
118
|
+
| GET | `get_accounts(query-parameters)` | `/accounts` |
|
|
101
119
|
| GET | `get_account(id)` | `/accounts/:id` |
|
|
102
120
|
|
|
103
121
|
### Examples
|
data/lib/bukku_rails/version.rb
CHANGED
data/lib/client.rb
CHANGED
|
@@ -37,6 +37,12 @@ class Client
|
|
|
37
37
|
|
|
38
38
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
39
39
|
http.use_ssl = uri.instance_of?(URI::HTTPS)
|
|
40
|
+
|
|
41
|
+
# Add the 2 lines below because development keeps on failing SSL CRL checks
|
|
42
|
+
# Check this article for explanation: https://dev.to/madhuhari188/how-we-solved-unable-to-get-certificate-crl-in-rails-a-debugging-story-2pna
|
|
43
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
44
|
+
http.verify_callback = ->(_preverify_ok, _store_ctx) { true }
|
|
45
|
+
|
|
40
46
|
# Uncomment below for debuging purpose to see the payload that was sent.
|
|
41
47
|
# http.set_debug_output($stdout)
|
|
42
48
|
|
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.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Muzaffar Ariff
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Use Rails conventions to call Bukku API requests.
|
|
14
14
|
email:
|