Skip to content

Commit

Permalink
Merge pull request #133 from square/release/38.1.1.20240717
Browse files Browse the repository at this point in the history
Generated PR for Release: 38.1.1.20240717
  • Loading branch information
jessdelacruzsantos authored Jul 17, 2024
2 parents a0ae86f + f482279 commit 0b28dfb
Show file tree
Hide file tree
Showing 51 changed files with 973 additions and 945 deletions.
7 changes: 5 additions & 2 deletions doc/api/apple-pay.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ an Apple Pay enabled domain.
This endpoint provides an easy way for platform developers to bulk activate
Apple Pay on the Web with Square for merchants using their platform.

Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will only receive critical security updates until it is retired on October 31, 2022.
You must migrate your payment form code to the Web Payments SDK to continue using your domain for Apple Pay. For more information on migrating to the Web Payments SDK, see [Migrate to the Web Payments SDK](https://developer.squareup.com/docs/web-payments/migrate).
Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The
current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association,
and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your
domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding
long-lived caches that might not keep in sync with the correct file version.

To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay).

Expand Down
20 changes: 11 additions & 9 deletions doc/api/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ end

# Update Invoice

Updates an invoice by modifying fields, clearing fields, or both. For most updates, you can use a sparse
`Invoice` object to add fields or change values and use the `fields_to_clear` field to specify fields to clear.
However, some restrictions apply. For example, you cannot change the `order_id` or `location_id` field and you
must provide the complete `custom_fields` list to update a custom field. Published invoices have additional restrictions.
Updates an invoice. This endpoint supports sparse updates, so you only need
to specify the fields you want to change along with the required `version` field.
Some restrictions apply to updating invoices. For example, you cannot change the
`order_id` or `location_id` field.

```ruby
def update_invoice(invoice_id:,
Expand Down Expand Up @@ -310,14 +310,16 @@ body = {
:payment_requests => [
{
:uid => '2da7964f-f3d2-4f43-81e8-5aa220bf3355',
:tipping_enabled => false
:tipping_enabled => false,
:reminders => [
{},
{},
{}
]
}
]
},
:idempotency_key => '4ee82288-0910-499e-ab4c-5d0071dad1be',
:fields_to_clear => [
'payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders'
]
:idempotency_key => '4ee82288-0910-499e-ab4c-5d0071dad1be'
}


Expand Down
4 changes: 2 additions & 2 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2024-06-04'` |
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2024-07-17'` |
| `custom_url` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
| `environment` | `string` | The API environment. <br> **Default: `production`** |
| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
Expand All @@ -25,7 +25,7 @@ The API client can be initialized as follows:

```ruby
client = Square::Client.new(
square_version: '2024-06-04',
square_version: '2024-07-17',
bearer_auth_credentials: BearerAuthCredentials.new(
access_token: 'AccessToken'
),
Expand Down
13 changes: 8 additions & 5 deletions doc/models/update-invoice-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ Describes a `UpdateInvoice` request.
| --- | --- | --- | --- |
| `invoice` | [`Invoice Hash`](../../doc/models/invoice.md) | Required | Stores information about an invoice. You use the Invoices API to create and manage<br>invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). |
| `idempotency_key` | `String` | Optional | A unique string that identifies the `UpdateInvoice` request. If you do not<br>provide `idempotency_key` (or provide an empty string as the value), the endpoint<br>treats each request as independent.<br><br>For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).<br>**Constraints**: *Maximum Length*: `128` |
| `fields_to_clear` | `Array<String>` | Optional | The list of fields to clear.<br>For examples, see [Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). |
| `fields_to_clear` | `Array<String>` | Optional | The list of fields to clear. Although this field is currently supported, we<br>recommend using null values or the `remove` field when possible. For examples, see<br>[Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). |

## Example (as JSON)

```json
{
"fields_to_clear": [
"payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders"
],
"idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be",
"invoice": {
"payment_requests": [
{
"reminders": null,
"tipping_enabled": false,
"uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355"
}
Expand All @@ -47,7 +45,12 @@ Describes a `UpdateInvoice` request.
"sublocality": "sublocality6"
}
}
}
},
"fields_to_clear": [
"fields_to_clear1",
"fields_to_clear2",
"fields_to_clear3"
]
}
```

24 changes: 14 additions & 10 deletions lib/square/api/apple_pay_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ class ApplePayApi < BaseApi
# This endpoint provides an easy way for platform developers to bulk
# activate
# Apple Pay on the Web with Square for merchants using their platform.
# Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will
# only receive critical security updates until it is retired on October 31,
# 2022.
# You must migrate your payment form code to the Web Payments SDK to
# continue using your domain for Apple Pay. For more information on
# migrating to the Web Payments SDK, see [Migrate to the Web Payments
# SDK](https://developer.squareup.com/docs/web-payments/migrate).
# Note: You will need to host a valid domain verification file on your
# domain to support Apple Pay. The
# current version of this file is always available at
# https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchan
# tid-domain-association,
# and should be hosted at
# `.well_known/apple-developer-merchantid-domain-association` on your
# domain. This file is subject to change; we strongly recommend checking
# for updates regularly and avoiding
# long-lived caches that might not keep in sync with the correct file
# version.
# To learn more about the Web Payments SDK and how to add Apple Pay, see
# [Take an Apple Pay
# Payment](https://developer.squareup.com/docs/web-payments/apple-pay).
Expand All @@ -34,9 +38,9 @@ def register_domain(body:)
.body_serializer(proc do |param| param.to_json unless param.nil? end)
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end
end
Expand Down
18 changes: 9 additions & 9 deletions lib/square/api/bank_accounts_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def list_bank_accounts(cursor: nil,
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand All @@ -53,9 +53,9 @@ def get_bank_account_by_v1_id(v1_bank_account_id:)
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand All @@ -74,9 +74,9 @@ def get_bank_account(bank_account_id:)
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/square/api/base_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class BaseApi
attr_accessor :config, :http_call_back

def self.user_agent
'Square-Ruby-SDK/38.1.0.20240604 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
'Square-Ruby-SDK/38.1.1.20240717 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
end

def self.user_agent_parameters
Expand Down
66 changes: 33 additions & 33 deletions lib/square/api/booking_custom_attributes_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def list_booking_custom_attribute_definitions(limit: nil,
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand All @@ -59,9 +59,9 @@ def create_booking_custom_attribute_definition(body:)
.body_serializer(proc do |param| param.to_json unless param.nil? end)
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand All @@ -86,9 +86,9 @@ def delete_booking_custom_attribute_definition(key:)
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand Down Expand Up @@ -119,9 +119,9 @@ def retrieve_booking_custom_attribute_definition(key:,
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand Down Expand Up @@ -153,9 +153,9 @@ def update_booking_custom_attribute_definition(key:,
.body_serializer(proc do |param| param.to_json unless param.nil? end)
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand All @@ -182,9 +182,9 @@ def bulk_delete_booking_custom_attributes(body:)
.body_serializer(proc do |param| param.to_json unless param.nil? end)
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand All @@ -211,9 +211,9 @@ def bulk_upsert_booking_custom_attributes(body:)
.body_serializer(proc do |param| param.to_json unless param.nil? end)
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand Down Expand Up @@ -259,9 +259,9 @@ def list_booking_custom_attributes(booking_id:,
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand Down Expand Up @@ -293,9 +293,9 @@ def delete_booking_custom_attribute(booking_id:,
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand Down Expand Up @@ -340,9 +340,9 @@ def retrieve_booking_custom_attribute(booking_id:,
.header_param(new_parameter('application/json', key: 'accept'))
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end

Expand Down Expand Up @@ -381,9 +381,9 @@ def upsert_booking_custom_attribute(booking_id:,
.body_serializer(proc do |param| param.to_json unless param.nil? end)
.auth(Single.new('global')))
.response(new_response_handler
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.deserializer(APIHelper.method(:json_deserialize))
.is_api_response(true)
.convertor(ApiResponse.method(:create)))
.execute
end
end
Expand Down
Loading

0 comments on commit 0b28dfb

Please sign in to comment.