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