mints 0.0.27 → 0.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/lib/client.rb +287 -385
- data/lib/contact/config/appointments.rb +201 -0
- data/lib/contact/config/config.rb +7 -0
- data/lib/contact/content/content.rb +7 -0
- data/lib/contact/content/conversations.rb +121 -0
- data/lib/contact/ecommerce/ecommerce.rb +12 -0
- data/lib/contact/ecommerce/order_items.rb +19 -0
- data/lib/contact/ecommerce/order_items_groups.rb +95 -0
- data/lib/contact/ecommerce/orders.rb +133 -0
- data/lib/contact.rb +57 -607
- data/lib/errors.rb +4 -2
- data/lib/generators/mints_assets_controller.rb +4 -1
- data/lib/generators/mints_config.yml.erb +0 -2
- data/lib/generators/mints_contact_controller.rb +4 -1
- data/lib/generators/mints_files_generator.rb +16 -13
- data/lib/generators/mints_link.rb +9 -6
- data/lib/generators/mints_public_controller.rb +4 -1
- data/lib/generators/mints_user_controller.rb +3 -0
- data/lib/generators/short_link_controller.rb +4 -1
- data/lib/mints/controllers/admin_base_controller.rb +5 -3
- data/lib/mints/controllers/base_api_controller.rb +6 -4
- data/lib/mints/controllers/base_controller.rb +5 -3
- data/lib/mints/controllers/concerns/mints_clients.rb +4 -2
- data/lib/mints/controllers/concerns/read_config_file.rb +3 -1
- data/lib/mints/controllers/contact_api_controller.rb +12 -10
- data/lib/mints/controllers/public_api_controller.rb +10 -8
- data/lib/mints/controllers/user_api_controller.rb +11 -9
- data/lib/mints/helpers/contact_auth_helper.rb +3 -1
- data/lib/mints/helpers/mints_helper.rb +39 -38
- data/lib/mints/helpers/proxy_controllers_methods.rb +24 -24
- data/lib/mints/helpers/user_auth_helper.rb +5 -3
- data/lib/mints.rb +12 -10
- data/lib/pub.rb +75 -93
- data/lib/user/config/api_keys.rb +63 -61
- data/lib/user/config/appointments.rb +217 -215
- data/lib/user/config/attribute_groups.rb +74 -72
- data/lib/user/config/attributes.rb +83 -81
- data/lib/user/config/calendars.rb +88 -86
- data/lib/user/config/config.rb +31 -63
- data/lib/user/config/public_folders.rb +105 -104
- data/lib/user/config/relationships.rb +135 -132
- data/lib/user/config/roles.rb +76 -79
- data/lib/user/config/seeds.rb +52 -51
- data/lib/user/config/system_settings.rb +50 -49
- data/lib/user/config/tags.rb +57 -59
- data/lib/user/config/taxonomies.rb +115 -119
- data/lib/user/config/teams.rb +69 -68
- data/lib/user/config/users.rb +72 -71
- data/lib/user/contacts/contacts.rb +21 -20
- data/lib/user/content/assets.rb +275 -280
- data/lib/user/content/content.rb +236 -235
- data/lib/user/content/content_instances.rb +138 -138
- data/lib/user/content/content_templates.rb +105 -103
- data/lib/user/content/conversations.rb +195 -193
- data/lib/user/content/dam.rb +85 -80
- data/lib/user/content/forms.rb +231 -233
- data/lib/user/content/message_templates.rb +154 -151
- data/lib/user/content/messages.rb +89 -87
- data/lib/user/content/pages.rb +84 -82
- data/lib/user/content/stories.rb +101 -101
- data/lib/user/content/story_templates.rb +90 -88
- data/lib/user/content/story_versions.rb +117 -117
- data/lib/user/crm/companies.rb +106 -106
- data/lib/user/crm/contacts.rb +287 -292
- data/lib/user/crm/crm.rb +21 -19
- data/lib/user/crm/deals.rb +105 -103
- data/lib/user/crm/favorites.rb +16 -13
- data/lib/user/crm/segments.rb +123 -123
- data/lib/user/crm/users.rb +22 -20
- data/lib/user/crm/workflow_step_objects.rb +86 -84
- data/lib/user/crm/workflow_steps.rb +47 -45
- data/lib/user/crm/workflows.rb +67 -65
- data/lib/user/ecommerce/ecommerce.rb +29 -27
- data/lib/user/ecommerce/item_prices.rb +84 -81
- data/lib/user/ecommerce/locations.rb +162 -160
- data/lib/user/ecommerce/order_items_groups.rb +110 -106
- data/lib/user/ecommerce/order_statuses.rb +26 -24
- data/lib/user/ecommerce/orders.rb +253 -246
- data/lib/user/ecommerce/price_lists.rb +70 -68
- data/lib/user/ecommerce/product_templates.rb +101 -99
- data/lib/user/ecommerce/product_variations.rb +124 -120
- data/lib/user/ecommerce/products.rb +162 -159
- data/lib/user/ecommerce/skus.rb +87 -85
- data/lib/user/ecommerce/taxes.rb +81 -79
- data/lib/user/ecommerce/variant_options.rb +68 -66
- data/lib/user/ecommerce/variant_values.rb +71 -69
- data/lib/user/helpers/helpers.rb +104 -101
- data/lib/user/helpers/object_activities.rb +80 -78
- data/lib/user/helpers/object_folders.rb +78 -76
- data/lib/user/helpers/user_folders.rb +79 -77
- data/lib/user/marketing/marketing.rb +116 -113
- data/lib/user/profile/profile.rb +96 -103
- data/lib/user.rb +32 -41
- metadata +50 -43
- data/lib/user/config/importers.rb +0 -184
@@ -1,169 +1,172 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Products
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Product
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Update product variations config.
|
9
|
+
# Update config of product variations of a product.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# product_id:: (Integer) -- Product id.
|
13
|
+
# data:: (Hash) -- Data to be submitted.
|
14
|
+
#
|
15
|
+
def update_product_variations_config(product_id, data)
|
16
|
+
# TODO: Method doesnt work, research use
|
17
|
+
@client.raw('post', "/ecommerce/products/update-variations-config/#{product_id}", nil, data_transform(data))
|
18
|
+
end
|
19
|
+
|
20
|
+
# === Get product support data.
|
21
|
+
# Get support data used in products.
|
22
|
+
#
|
23
|
+
# ==== Example
|
24
|
+
# @data = @mints_user.get_products_support_data
|
25
|
+
def get_products_support_data
|
26
|
+
@client.raw('get', '/ecommerce/products/support-data')
|
27
|
+
end
|
5
28
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
29
|
+
# === Delete product.
|
30
|
+
# Delete a product.
|
31
|
+
#
|
32
|
+
# ==== Parameters
|
33
|
+
# id:: (Integer) -- Product id.
|
34
|
+
#
|
35
|
+
def delete_product(id)
|
36
|
+
@client.raw('delete', "/ecommerce/products/#{id}")
|
37
|
+
end
|
16
38
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
39
|
+
# === Publish product.
|
40
|
+
# Publish a product.
|
41
|
+
#
|
42
|
+
# ==== Parameters
|
43
|
+
# id:: (Integer) -- Product id.
|
44
|
+
# data:: (Hash) -- Data to be submitted.
|
45
|
+
#
|
46
|
+
# ==== Example
|
47
|
+
# data = {
|
48
|
+
# title: 'New Publish'
|
49
|
+
# }
|
50
|
+
# @data = @mints_user.publish_product(2, data)
|
51
|
+
def publish_product(id, data)
|
52
|
+
@client.raw('put', "/ecommerce/products/#{id}/publish", nil, data_transform(data))
|
53
|
+
end
|
25
54
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
# data:: (Hash) -- Data to be submitted.
|
42
|
-
#
|
43
|
-
# ==== Example
|
44
|
-
# data = {
|
45
|
-
# "title": "New Publish"
|
46
|
-
# }
|
47
|
-
# @data = @mints_user.publish_product(2, data)
|
48
|
-
def publish_product(id, data)
|
49
|
-
@client.raw("put", "/ecommerce/products/#{id}/publish", nil, data_transform(data))
|
50
|
-
end
|
55
|
+
# === Schedule product.
|
56
|
+
# Schedule a product.
|
57
|
+
#
|
58
|
+
# ==== Parameters
|
59
|
+
# id:: (Integer) -- Product id.
|
60
|
+
# data:: (Hash) -- Data to be submitted.
|
61
|
+
#
|
62
|
+
# ==== Example
|
63
|
+
# data = {
|
64
|
+
# scheduled_at: '1970-01-01 00:00:00'
|
65
|
+
# }
|
66
|
+
# @data = @mints_user.schedule_product(2, data)
|
67
|
+
def schedule_product(id, data)
|
68
|
+
@client.raw('put', "/ecommerce/products/#{id}/schedule", nil, data_transform(data))
|
69
|
+
end
|
51
70
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
# @data = @mints_user.schedule_product(2, data)
|
64
|
-
def schedule_product(id, data)
|
65
|
-
@client.raw("put", "/ecommerce/products/#{id}/schedule", nil, data_transform(data))
|
66
|
-
end
|
71
|
+
# === Get product variant options config.
|
72
|
+
# Get variant options config used in a product.
|
73
|
+
#
|
74
|
+
# ==== Parameters
|
75
|
+
# id:: (Integer) -- Product id.
|
76
|
+
#
|
77
|
+
# ==== Example
|
78
|
+
# @data = @mints_user.get_product_variant_options_config(1)
|
79
|
+
def get_product_variant_options_config(id)
|
80
|
+
@client.raw('get', "/ecommerce/products/#{id}/variant-options-config")
|
81
|
+
end
|
67
82
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
83
|
+
# === Revert published product.
|
84
|
+
# Revert a published product.
|
85
|
+
#
|
86
|
+
# ==== Parameters
|
87
|
+
# id:: (Integer) -- Product id.
|
88
|
+
#
|
89
|
+
# ==== Example
|
90
|
+
# @data = @mints_user.revert_published_product(2)
|
91
|
+
def revert_published_product(id)
|
92
|
+
@client.raw('get', "/ecommerce/products/#{id}/revert-published-data")
|
93
|
+
end
|
79
94
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
# "fields": "id"
|
105
|
-
# }
|
106
|
-
# @data = @mints_user.get_products(options)
|
107
|
-
#
|
108
|
-
# ==== Third Example
|
109
|
-
# options = {
|
110
|
-
# "fields": "id"
|
111
|
-
# }
|
112
|
-
# @data = @mints_user.get_products(options, false)
|
113
|
-
def get_products(options = nil, use_post = true)
|
114
|
-
return get_query_results("/ecommerce/products", options, use_post)
|
115
|
-
end
|
95
|
+
# === Get products.
|
96
|
+
# Get a collection of products.
|
97
|
+
#
|
98
|
+
# ==== Parameters
|
99
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
100
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
101
|
+
#
|
102
|
+
# ==== First Example
|
103
|
+
# @data = @mints_user.get_products
|
104
|
+
#
|
105
|
+
# ==== Second Example
|
106
|
+
# options = {
|
107
|
+
# fields: 'id'
|
108
|
+
# }
|
109
|
+
# @data = @mints_user.get_products(options)
|
110
|
+
#
|
111
|
+
# ==== Third Example
|
112
|
+
# options = {
|
113
|
+
# fields: 'id'
|
114
|
+
# }
|
115
|
+
# @data = @mints_user.get_products(options, false)
|
116
|
+
def get_products(options = nil, use_post = true)
|
117
|
+
get_query_results('/ecommerce/products', options, use_post)
|
118
|
+
end
|
116
119
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
120
|
+
# === Get product.
|
121
|
+
# Get a product info.
|
122
|
+
#
|
123
|
+
# ==== Parameters
|
124
|
+
# id:: (Integer) -- Product id.
|
125
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
126
|
+
#
|
127
|
+
# ==== First Example
|
128
|
+
# @data = @mints_user.get_product(3)
|
129
|
+
#
|
130
|
+
# ==== Second Example
|
131
|
+
# options = {
|
132
|
+
# fields: "slug"
|
133
|
+
# }
|
134
|
+
# @data = @mints_user.get_product(3, options)
|
135
|
+
def get_product(id, options = nil)
|
136
|
+
@client.raw('get', "/ecommerce/products/#{id}", options)
|
137
|
+
end
|
135
138
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
139
|
+
# === Create product.
|
140
|
+
# Create a product with data.
|
141
|
+
#
|
142
|
+
# ==== Parameters
|
143
|
+
# data:: (Hash) -- Data to be submitted.
|
144
|
+
#
|
145
|
+
# ==== Example
|
146
|
+
# data = {
|
147
|
+
# title: 'New Product',
|
148
|
+
# slug: 'new-product',
|
149
|
+
# sku_prefix: 'sku_prefix'
|
150
|
+
# }
|
151
|
+
# @data = @mints_user.create_product(data)
|
152
|
+
def create_product(data, options = nil)
|
153
|
+
@client.raw('post', '/ecommerce/products/', options, data_transform(data))
|
154
|
+
end
|
152
155
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
end
|
156
|
+
# === Update product.
|
157
|
+
# Update a product info.
|
158
|
+
#
|
159
|
+
# ==== Parameters
|
160
|
+
# id:: (Integer) -- Product id.
|
161
|
+
# data:: (Hash) -- Data to be submitted.
|
162
|
+
#
|
163
|
+
# ==== Example
|
164
|
+
# data = {
|
165
|
+
# title: 'New Product Modified',
|
166
|
+
# slug: 'new-product'
|
167
|
+
# }
|
168
|
+
# @data = @mints_user.update_product(9, data)
|
169
|
+
def update_product(id, data, options = nil)
|
170
|
+
@client.raw('put', "/ecommerce/products/#{id}", options, data_transform(data))
|
171
|
+
end
|
172
|
+
end
|
data/lib/user/ecommerce/skus.rb
CHANGED
@@ -1,88 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Skus
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Sku
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get skus.
|
9
|
+
# Get a collection of skus.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
13
|
+
#
|
14
|
+
# ==== First Example
|
15
|
+
# @data = @mints_user.get_skus
|
16
|
+
#
|
17
|
+
# ==== Second Example
|
18
|
+
# options = {
|
19
|
+
# fields: 'sku'
|
20
|
+
# }
|
21
|
+
# @data = @mints_user.get_skus(options)
|
22
|
+
def get_skus(options = nil)
|
23
|
+
@client.raw('get', '/ecommerce/skus', options)
|
24
|
+
end
|
25
|
+
|
26
|
+
# === Get sku.
|
27
|
+
# Get a sku info.
|
28
|
+
#
|
29
|
+
# ==== Parameters
|
30
|
+
# id:: (Integer) -- Sku id.
|
31
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
32
|
+
#
|
33
|
+
# ==== First Example
|
34
|
+
# @data = @mints_user.get_sku(1)
|
35
|
+
#
|
36
|
+
# ==== Second Example
|
37
|
+
# options = {
|
38
|
+
# fields: 'title, sku'
|
39
|
+
# }
|
40
|
+
# @data = @mints_user.get_sku(1, options)
|
41
|
+
def get_sku(id, options = nil)
|
42
|
+
@client.raw('get', "/ecommerce/skus/#{id}", options)
|
43
|
+
end
|
44
|
+
|
45
|
+
# === Create sku.
|
46
|
+
# Create a sku with data.
|
47
|
+
#
|
48
|
+
# ==== Parameters
|
49
|
+
# data:: (Hash) -- Data to be submitted.
|
50
|
+
#
|
51
|
+
# ==== Example
|
52
|
+
# data = {
|
53
|
+
# sku: 'NEW-SKU',
|
54
|
+
# title: 'New Sku',
|
55
|
+
# slug: 'new-sku',
|
56
|
+
# product_id: 1
|
57
|
+
# }
|
58
|
+
# @data = @mints_user.create_sku(data)
|
59
|
+
def create_sku(data)
|
60
|
+
@client.raw('post', '/ecommerce/skus', nil, data_transform(data))
|
61
|
+
end
|
5
62
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
@client.raw("get", "/ecommerce/skus", options)
|
22
|
-
end
|
23
|
-
|
24
|
-
# === Get sku.
|
25
|
-
# Get a sku info.
|
26
|
-
#
|
27
|
-
# ==== Parameters
|
28
|
-
# id:: (Integer) -- Sku id.
|
29
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
30
|
-
#
|
31
|
-
# ==== First Example
|
32
|
-
# @data = @mints_user.get_sku(1)
|
33
|
-
#
|
34
|
-
# ==== Second Example
|
35
|
-
# options = {
|
36
|
-
# "fields": "title, sku"
|
37
|
-
# }
|
38
|
-
# @data = @mints_user.get_sku(1, options)
|
39
|
-
def get_sku(id, options = nil)
|
40
|
-
@client.raw("get", "/ecommerce/skus/#{id}", options)
|
41
|
-
end
|
63
|
+
# === Update sku.
|
64
|
+
# Update a sku info.
|
65
|
+
#
|
66
|
+
# ==== Parameters
|
67
|
+
# id:: (Integer) -- Sku id.
|
68
|
+
# data:: (Hash) -- Data to be submitted.
|
69
|
+
#
|
70
|
+
# ==== Example
|
71
|
+
# data = {
|
72
|
+
# sku: 'NEW-SKU-XXXIX'
|
73
|
+
# }
|
74
|
+
# @data = @mints_user.update_sku(531, data)
|
75
|
+
def update_sku(id, data)
|
76
|
+
@client.raw('put', "/ecommerce/skus/#{id}", nil, data_transform(data))
|
77
|
+
end
|
42
78
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
# }
|
56
|
-
# @data = @mints_user.create_sku(data)
|
57
|
-
def create_sku(data)
|
58
|
-
@client.raw("post", "/ecommerce/skus", nil, data_transform(data))
|
59
|
-
end
|
60
|
-
|
61
|
-
# === Update sku.
|
62
|
-
# Update a sku info.
|
63
|
-
#
|
64
|
-
# ==== Parameters
|
65
|
-
# id:: (Integer) -- Sku id.
|
66
|
-
# data:: (Hash) -- Data to be submitted.
|
67
|
-
#
|
68
|
-
# ==== Example
|
69
|
-
# data = {
|
70
|
-
# "sku": "NEW-SKU-XXXXXY"
|
71
|
-
# }
|
72
|
-
# @data = @mints_user.update_sku(531, data)
|
73
|
-
def update_sku(id, data)
|
74
|
-
@client.raw("put", "/ecommerce/skus/#{id}", nil, data_transform(data))
|
75
|
-
end
|
76
|
-
|
77
|
-
# === Delete sku.
|
78
|
-
# Delete a sku.
|
79
|
-
#
|
80
|
-
# ==== Parameters
|
81
|
-
# id:: (Integer) -- Sku id.
|
82
|
-
#
|
83
|
-
# ==== Example
|
84
|
-
# @data = @mints_user.delete_sku(531)
|
85
|
-
def delete_sku(id)
|
86
|
-
@client.raw("delete", "/ecommerce/skus/#{id}")
|
87
|
-
end
|
88
|
-
end
|
79
|
+
# === Delete sku.
|
80
|
+
# Delete a sku.
|
81
|
+
#
|
82
|
+
# ==== Parameters
|
83
|
+
# id:: (Integer) -- Sku id.
|
84
|
+
#
|
85
|
+
# ==== Example
|
86
|
+
# @data = @mints_user.delete_sku(531)
|
87
|
+
def delete_sku(id)
|
88
|
+
@client.raw('delete', "/ecommerce/skus/#{id}")
|
89
|
+
end
|
90
|
+
end
|
data/lib/user/ecommerce/taxes.rb
CHANGED
@@ -1,82 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Taxes
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
##
|
5
|
+
# == Taxes
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get taxes.
|
9
|
+
# Get a collection of taxes.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
13
|
+
#
|
14
|
+
# ==== First Example
|
15
|
+
# @data = @mints_user.get_taxes
|
16
|
+
#
|
17
|
+
# ==== Second Example
|
18
|
+
# options = { fields: 'title' }
|
19
|
+
# @data = @mints_user.get_taxes(options)
|
20
|
+
def get_taxes(options = nil)
|
21
|
+
@client.raw('get', '/ecommerce/taxes', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
# === Get tax.
|
25
|
+
# Get a tax info.
|
26
|
+
#
|
27
|
+
# ==== Parameters
|
28
|
+
# id:: (Integer) -- Tax id.
|
29
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
30
|
+
#
|
31
|
+
# ==== First Example
|
32
|
+
# @data = @mints_user.get_tax(1)
|
33
|
+
#
|
34
|
+
# ==== Second Example
|
35
|
+
# options = { fields: 'title' }
|
36
|
+
# @data = @mints_user.get_tax(1, options)
|
37
|
+
def get_tax(id, options = nil)
|
38
|
+
@client.raw('get', "/ecommerce/taxes/#{id}", options)
|
39
|
+
end
|
40
|
+
|
41
|
+
# === Create tax.
|
42
|
+
# Create a tax with data.
|
43
|
+
#
|
44
|
+
# ==== Parameters
|
45
|
+
# data:: (Hash) -- Data to be submitted.
|
46
|
+
#
|
47
|
+
# ==== Example
|
48
|
+
# data = {
|
49
|
+
# title: 'New Tax',
|
50
|
+
# tax_percentage: 100
|
51
|
+
# }
|
52
|
+
# @data = @mints_user.create_tax(data)
|
53
|
+
def create_tax(data)
|
54
|
+
@client.raw('post', '/ecommerce/taxes', nil, data_transform(data))
|
55
|
+
end
|
5
56
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
57
|
+
# === Update tax.
|
58
|
+
# Update a tax info.
|
59
|
+
#
|
60
|
+
# ==== Parameters
|
61
|
+
# id:: (Integer) -- Tax id.
|
62
|
+
# data:: (Hash) -- Data to be submitted.
|
63
|
+
#
|
64
|
+
# ==== Example
|
65
|
+
# data = {
|
66
|
+
# tax_percentage: 10
|
67
|
+
# }
|
68
|
+
# @data = @mints_user.update_tax(11, data)
|
69
|
+
def update_tax(id, data)
|
70
|
+
@client.raw('put', "/ecommerce/taxes/#{id}", nil, data_transform(data))
|
71
|
+
end
|
21
72
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
# @data = @mints_user.get_tax(1, options)
|
35
|
-
def get_tax(id, options = nil)
|
36
|
-
@client.raw("get", "/ecommerce/taxes/#{id}", options)
|
37
|
-
end
|
38
|
-
|
39
|
-
# === Create tax.
|
40
|
-
# Create a tax with data.
|
41
|
-
#
|
42
|
-
# ==== Parameters
|
43
|
-
# data:: (Hash) -- Data to be submitted.
|
44
|
-
#
|
45
|
-
# ==== Example
|
46
|
-
# data = {
|
47
|
-
# "title": "New Tax",
|
48
|
-
# "tax_percentage": 100
|
49
|
-
# }
|
50
|
-
# @data = @mints_user.create_tax(data)
|
51
|
-
def create_tax(data)
|
52
|
-
@client.raw("post", "/ecommerce/taxes", nil, data_transform(data))
|
53
|
-
end
|
54
|
-
|
55
|
-
# === Update tax.
|
56
|
-
# Update a tax info.
|
57
|
-
#
|
58
|
-
# ==== Parameters
|
59
|
-
# id:: (Integer) -- Tax id.
|
60
|
-
# data:: (Hash) -- Data to be submitted.
|
61
|
-
#
|
62
|
-
# ==== Example
|
63
|
-
# data = {
|
64
|
-
# "tax_percentage": 10
|
65
|
-
# }
|
66
|
-
# @data = @mints_user.update_tax(11, data)
|
67
|
-
def update_tax(id, data)
|
68
|
-
@client.raw("put", "/ecommerce/taxes/#{id}", nil, data_transform(data))
|
69
|
-
end
|
70
|
-
|
71
|
-
# === Delete tax.
|
72
|
-
# Delete a tax.
|
73
|
-
#
|
74
|
-
# ==== Parameters
|
75
|
-
# id:: (Integer) -- Tax id.
|
76
|
-
#
|
77
|
-
# ==== Example
|
78
|
-
# @data = @mints_user.delete_tax(11)
|
79
|
-
def delete_tax(id)
|
80
|
-
@client.raw("delete", "/ecommerce/taxes/#{id}")
|
81
|
-
end
|
82
|
-
end
|
73
|
+
# === Delete tax.
|
74
|
+
# Delete a tax.
|
75
|
+
#
|
76
|
+
# ==== Parameters
|
77
|
+
# id:: (Integer) -- Tax id.
|
78
|
+
#
|
79
|
+
# ==== Example
|
80
|
+
# @data = @mints_user.delete_tax(11)
|
81
|
+
def delete_tax(id)
|
82
|
+
@client.raw('delete', "/ecommerce/taxes/#{id}")
|
83
|
+
end
|
84
|
+
end
|