square.rb 34.1.0.20231213 → 35.0.1.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: 8e6e17f3caeb558fbb709ca37417727b67b44458f2df8a8175edb89916c87c9e
|
4
|
+
data.tar.gz: 6cce3f91ab0ae26ca93f5c39a68d16047fc41c3323d3ac3b0007994e1b7e24ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2bc97a99d5e9ea4fc67a9157e30e2f20f031a46262a1d6ae13a54a0ada39cdd770be9bccc37d09a7044786d4458bbcc4fe572079bc2e597a583e2cfb9ff3bef
|
7
|
+
data.tar.gz: 641f5e2bcdf3be3e7332223d8625b00e14580687058b87e8747178f1d74fe9c4f72bd270dede1eeaa7179163cc0fee2246ebc0fb6502682f2df9b4e20ccf93da
|
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.1.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.1.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.1.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-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apimatic_core_interfaces
|