square.rb 34.1.0.20231213 → 35.0.0.20240118
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/square/api/base_api.rb +1 -1
- data/lib/square/api/customers_api.rb +1 -1
- data/lib/square/api/invoices_api.rb +65 -0
- data/lib/square/client.rb +2 -2
- data/lib/square/configuration.rb +1 -1
- 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: 249614d84c1818c028f583951e3fa380f1533985909801204a1ee94eb0a91733
|
4
|
+
data.tar.gz: 4ae2b2cceb63628934b529fff05bd58f2cd27d8f22ae10a44ec26e0bc40f087d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ebdb416a8041d2d70a9d8108ce432ec26f2558bc67589a5f5e5625625f4366f4998d20575e0a8ac9e872b11a37133180ee6b27d7fffc9147674ff89a638f05e
|
7
|
+
data.tar.gz: 8fe1a39713a031a36023433a9a84c7492654a28adbd1c02a5130513cfd936336ad2c9c7d53ec707623498f8fc4bc3972bd9a2c45756664d2b628350c45b0ee45
|
data/LICENSE
CHANGED
data/lib/square/api/base_api.rb
CHANGED
@@ -4,7 +4,7 @@ module Square
|
|
4
4
|
attr_accessor :config, :http_call_back
|
5
5
|
|
6
6
|
def self.user_agent
|
7
|
-
'Square-Ruby-SDK/
|
7
|
+
'Square-Ruby-SDK/35.0.0.20240118 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.user_agent_parameters
|
@@ -177,7 +177,7 @@ module Square
|
|
177
177
|
# Updates a customer profile. This endpoint supports sparse updates, so only
|
178
178
|
# new or changed fields are required in the request.
|
179
179
|
# To add or update a field, specify the new value. To remove a field,
|
180
|
-
# specify `null`
|
180
|
+
# specify `null`
|
181
181
|
# (recommended) or specify an empty string (string fields only).
|
182
182
|
# As a best practice, include the `version` field in the request to enable
|
183
183
|
# [optimistic
|
@@ -171,6 +171,71 @@ module Square
|
|
171
171
|
.execute
|
172
172
|
end
|
173
173
|
|
174
|
+
# Uploads a file and attaches it to an invoice. This endpoint accepts HTTP
|
175
|
+
# multipart/form-data file uploads
|
176
|
+
# with a JSON `request` part and a `file` part. The `file` part must be a
|
177
|
+
# `readable stream` that contains a file
|
178
|
+
# in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF.
|
179
|
+
# Invoices can have up to 10 attachments with a total file size of 25 MB.
|
180
|
+
# Attachments can be added only to invoices
|
181
|
+
# in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state.
|
182
|
+
# @param [String] invoice_id Required parameter: The ID of the
|
183
|
+
# [invoice](entity:Invoice) to attach the file to.
|
184
|
+
# @param [CreateInvoiceAttachmentRequest] request Optional parameter:
|
185
|
+
# Represents a
|
186
|
+
# [CreateInvoiceAttachment]($e/Invoices/CreateInvoiceAttachment) request.
|
187
|
+
# @param [File | UploadIO] image_file Optional parameter: Example:
|
188
|
+
# @return [CreateInvoiceAttachmentResponse Hash] response from the API call
|
189
|
+
def create_invoice_attachment(invoice_id:,
|
190
|
+
request: nil,
|
191
|
+
image_file: nil)
|
192
|
+
new_api_call_builder
|
193
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
194
|
+
'/v2/invoices/{invoice_id}/attachments',
|
195
|
+
'default')
|
196
|
+
.template_param(new_parameter(invoice_id, key: 'invoice_id')
|
197
|
+
.should_encode(true))
|
198
|
+
.multipart_param(new_parameter(StringIO.new(request.to_json), key: 'request')
|
199
|
+
.default_content_type('application/json; charset=utf-8'))
|
200
|
+
.multipart_param(new_parameter(image_file, key: 'image_file')
|
201
|
+
.default_content_type('image/jpeg'))
|
202
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
203
|
+
.auth(Single.new('global')))
|
204
|
+
.response(new_response_handler
|
205
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
206
|
+
.is_api_response(true)
|
207
|
+
.convertor(ApiResponse.method(:create)))
|
208
|
+
.execute
|
209
|
+
end
|
210
|
+
|
211
|
+
# Removes an attachment from an invoice and permanently deletes the file.
|
212
|
+
# Attachments can be removed only
|
213
|
+
# from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID`
|
214
|
+
# state.
|
215
|
+
# @param [String] invoice_id Required parameter: The ID of the
|
216
|
+
# [invoice](entity:Invoice) to delete the attachment from.
|
217
|
+
# @param [String] attachment_id Required parameter: The ID of the
|
218
|
+
# [attachment](entity:InvoiceAttachment) to delete.
|
219
|
+
# @return [DeleteInvoiceAttachmentResponse Hash] response from the API call
|
220
|
+
def delete_invoice_attachment(invoice_id:,
|
221
|
+
attachment_id:)
|
222
|
+
new_api_call_builder
|
223
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
224
|
+
'/v2/invoices/{invoice_id}/attachments/{attachment_id}',
|
225
|
+
'default')
|
226
|
+
.template_param(new_parameter(invoice_id, key: 'invoice_id')
|
227
|
+
.should_encode(true))
|
228
|
+
.template_param(new_parameter(attachment_id, key: 'attachment_id')
|
229
|
+
.should_encode(true))
|
230
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
231
|
+
.auth(Single.new('global')))
|
232
|
+
.response(new_response_handler
|
233
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
234
|
+
.is_api_response(true)
|
235
|
+
.convertor(ApiResponse.method(:create)))
|
236
|
+
.execute
|
237
|
+
end
|
238
|
+
|
174
239
|
# Cancels an invoice. The seller cannot collect payments for
|
175
240
|
# the canceled invoice.
|
176
241
|
# You cannot cancel an invoice in the `DRAFT` state or in a terminal state:
|
data/lib/square/client.rb
CHANGED
@@ -4,7 +4,7 @@ module Square
|
|
4
4
|
attr_reader :config, :auth_managers
|
5
5
|
|
6
6
|
def sdk_version
|
7
|
-
'
|
7
|
+
'35.0.0.20240118'
|
8
8
|
end
|
9
9
|
|
10
10
|
def square_version
|
@@ -267,7 +267,7 @@ module Square
|
|
267
267
|
retry_methods: %i[get put], http_callback: nil,
|
268
268
|
environment: 'production',
|
269
269
|
custom_url: 'https://connect.squareup.com', access_token: '',
|
270
|
-
square_version: '
|
270
|
+
square_version: '2024-01-18', user_agent_detail: '',
|
271
271
|
additional_headers: {}, config: nil)
|
272
272
|
@config = if config.nil?
|
273
273
|
Configuration.new(connection: connection, adapter: adapter,
|
data/lib/square/configuration.rb
CHANGED
@@ -19,7 +19,7 @@ module Square
|
|
19
19
|
retry_methods: %i[get put], http_callback: nil,
|
20
20
|
environment: 'production',
|
21
21
|
custom_url: 'https://connect.squareup.com', access_token: '',
|
22
|
-
square_version: '
|
22
|
+
square_version: '2024-01-18', user_agent_detail: '',
|
23
23
|
additional_headers: {})
|
24
24
|
|
25
25
|
super connection: connection, adapter: adapter, timeout: timeout,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: square.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 35.0.0.20240118
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Square Developer Platform
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apimatic_core_interfaces
|