square_connect 2.20180712.0.224 → 2.20180712.1.228

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8424e079248e6b8b5d713d4320a3dc6b3b62752e6404bd06aa0dfaef2d9547bb
4
- data.tar.gz: 9cacd9f24ddc68055177b6e5377cf23a1b617c933f9d62cebf8675a12b55c6fe
3
+ metadata.gz: ba8e7fecfd07671097fe2a4a351e6a9505bbdec1cc153726db02392e2f8fa9bf
4
+ data.tar.gz: 124fa98d98aa3a71cb37be90c68e71e06c8e4e33475caa6cc00b90b0e16cb184
5
5
  SHA512:
6
- metadata.gz: 2a203c29512d28d02346aa01f0f436d3a8a8061bbf166db2cc1b2bda58248ae6b8a0bd2825be7f0de394402b69cd9392f121780854ee8b4b99d27f357b79c47c
7
- data.tar.gz: 2cb1f3ba3b33199eae0b569bb8cfbca9a974e0d0cb8bb4d5cf2786f5525f0149be745db9ccb2cf63023d8bb357eae590281428a9cfce782baa5dcf465de341c9
6
+ metadata.gz: 513a941f286a11a320e63ededa4689ef6343040306647dbc304b26436a94bb20098c4d0813b77c6ea366fe429da16f326c45cfa9f3194fa9a245875982cc51dd
7
+ data.tar.gz: ef77e4b9fb0e7c08badc98275161fc7b1a23f2f5b6714d18b81e964f88a717bc74acd0e7cb7dbc6e3a46f5217f80de77e3f40e585eb076c90ac2d010d03f0160
data/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## Version 2.20180712.1 (2018-08-02)
4
+
5
+ We have added MobileAuthorization API.
6
+
7
+ ### New endpoint: MobileAuthorization API
8
+
9
+ * `CreateMobileAuthorizationCode` endpoint — Generate a mobile authorization code for an instance of your application. Mobile authorization credentials permit an instance of your application to accept payments for a given location using the Square Reader SDK. Mobile authorization codes are one-time-use and expire shortly after being issued.
10
+
3
11
  ## Version 2.20180712.0 (2018-07-12)
4
12
 
5
13
  We introduce Square API versions. `Square-Version` is 2018-07-12 for this SDK.
data/README.md CHANGED
@@ -10,7 +10,7 @@ for the specification and template files we used to generate this.
10
10
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
11
11
 
12
12
  - API version: 2.0
13
- - Package version: 2.20180712.0
13
+ - Package version: 2.20180712.1
14
14
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
15
15
 
16
16
  For more information, please visit [https://squareup.com/developers](https://squareup.com/developers)
@@ -95,6 +95,7 @@ Class | Method | HTTP request | Description
95
95
  *SquareConnect::CustomersApi* | [**search_customers**](docs/CustomersApi.md#search_customers) | **POST** /v2/customers/search | SearchCustomers
96
96
  *SquareConnect::CustomersApi* | [**update_customer**](docs/CustomersApi.md#update_customer) | **PUT** /v2/customers/{customer_id} | UpdateCustomer
97
97
  *SquareConnect::LocationsApi* | [**list_locations**](docs/LocationsApi.md#list_locations) | **GET** /v2/locations | ListLocations
98
+ *SquareConnect::MobileAuthorizationApi* | [**create_mobile_authorization_code**](docs/MobileAuthorizationApi.md#create_mobile_authorization_code) | **POST** /mobile/authorization-code | CreateMobileAuthorizationCode
98
99
  *SquareConnect::OrdersApi* | [**batch_retrieve_orders**](docs/OrdersApi.md#batch_retrieve_orders) | **POST** /v2/locations/{location_id}/orders/batch-retrieve | BatchRetrieveOrders
99
100
  *SquareConnect::OrdersApi* | [**create_order**](docs/OrdersApi.md#create_order) | **POST** /v2/locations/{location_id}/orders | CreateOrder
100
101
  *SquareConnect::ReportingApi* | [**list_additional_recipient_receivable_refunds**](docs/ReportingApi.md#list_additional_recipient_receivable_refunds) | **GET** /v2/locations/{location_id}/additional-recipient-receivable-refunds | ListAdditionalRecipientReceivableRefunds
@@ -235,6 +236,8 @@ Class | Method | HTTP request | Description
235
236
  - [SquareConnect::CreateCustomerCardResponse](docs/CreateCustomerCardResponse.md)
236
237
  - [SquareConnect::CreateCustomerRequest](docs/CreateCustomerRequest.md)
237
238
  - [SquareConnect::CreateCustomerResponse](docs/CreateCustomerResponse.md)
239
+ - [SquareConnect::CreateMobileAuthorizationCodeRequest](docs/CreateMobileAuthorizationCodeRequest.md)
240
+ - [SquareConnect::CreateMobileAuthorizationCodeResponse](docs/CreateMobileAuthorizationCodeResponse.md)
238
241
  - [SquareConnect::CreateOrderRequest](docs/CreateOrderRequest.md)
239
242
  - [SquareConnect::CreateOrderRequestDiscount](docs/CreateOrderRequestDiscount.md)
240
243
  - [SquareConnect::CreateOrderRequestLineItem](docs/CreateOrderRequestLineItem.md)
data/docs/ApplePayApi.md CHANGED
@@ -12,7 +12,7 @@ Method | HTTP request | Description
12
12
 
13
13
  RegisterDomain
14
14
 
15
- Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide.
15
+ Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](/payments/sqpaymentform/overview) guide.
16
16
 
17
17
  ### Example
18
18
  ```ruby
@@ -2,7 +2,7 @@
2
2
 
3
3
  ### Description
4
4
 
5
- The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](https://docs.connect.squareup.com/articles/catalog-overview).
5
+ The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview).
6
6
 
7
7
  ## Properties
8
8
  Name | Type | Description | Notes
@@ -13,12 +13,12 @@ Name | Type | Description | Notes
13
13
  **customer_card_id** | **String** | The ID of the customer card on file to charge. Do not provide a value for this field if you provide a value for `card_nonce`. If you provide this value, you _must_ also provide a value for `customer_id`. | [optional]
14
14
  **delay_capture** | **BOOLEAN** | If `true`, the request will only perform an Auth on the provided card. You can then later perform either a Capture (with the [CaptureTransaction](#endpoint-capturetransaction) endpoint) or a Void (with the [VoidTransaction](#endpoint-voidtransaction) endpoint). Default value: `false` | [optional]
15
15
  **reference_id** | **String** | An optional ID you can associate with the transaction for your own purposes (such as to associate the transaction with an entity ID in your own database). This value cannot exceed 40 characters. | [optional]
16
- **note** | **String** | An optional note to associate with the transaction. This value cannot exceed 60 characters. | [optional]
16
+ **note** | **String** | | [optional]
17
17
  **customer_id** | **String** | The ID of the customer to associate this transaction with. This field is required if you provide a value for `customer_card_id`, and optional otherwise. | [optional]
18
18
  **billing_address** | [**Address**](Address.md) | The buyer's billing address. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor `shipping_address` is provided. | [optional]
19
19
  **shipping_address** | [**Address**](Address.md) | The buyer's shipping address, if available. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor `billing_address` is provided. | [optional]
20
20
  **buyer_email_address** | **String** | The buyer's email address, if available. This value is optional, but this transaction is ineligible for chargeback protection if it is not provided. | [optional]
21
- **order_id** | **String** | The ID of the order to associate with this transaction. If you provide this value, the `amount_money` value of your request must __exactly match__ the `total_money` value of the order's `order_amounts` field. | [optional]
22
- **additional_recipients** | [**Array<AdditionalRecipient>**](AdditionalRecipient.md) | The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `amount_money` value in you charge's request. The `location_id` must be the valid location of the app owner merchant. This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. This field is currently not supported in sandbox. | [optional]
21
+ **order_id** | **String** | The ID of the order to associate with this transaction. If you provide this value, the `amount_money` value of your request must __exactly match__ the value of the order's `total_money` field. | [optional]
22
+ **additional_recipients** | [**Array<AdditionalRecipient>**](AdditionalRecipient.md) | The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `amount_money` value in the charge request. The `location_id` must be the valid location of the app owner merchant. This field requires the `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. This field is currently not supported in sandbox. | [optional]
23
23
 
24
24
 
@@ -7,7 +7,7 @@ Defines the fields that are included in the request body of a request to the [Cr
7
7
  ## Properties
8
8
  Name | Type | Description | Notes
9
9
  ------------ | ------------- | ------------- | -------------
10
- **card_nonce** | **String** | A card nonce representing the credit card to link to the customer. Card nonces are generated by the `SqPaymentForm` that buyers enter their card information into. See [Embedding the payment form](/articles/adding-payment-form/) for more information. __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card. |
10
+ **card_nonce** | **String** | A card nonce representing the credit card to link to the customer. Card nonces are generated by the `SqPaymentForm` that buyers enter their card information into. See [Embedding the payment form](/payments/sqpaymentform/overview) for more information. __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card. |
11
11
  **billing_address** | [**Address**](Address.md) | Address information for the card on file. Only the `postal_code` field is required for payments in the US and Canada. | [optional]
12
12
  **cardholder_name** | **String** | The cardholder's name. | [optional]
13
13
 
@@ -0,0 +1,12 @@
1
+ # SquareConnect::CreateMobileAuthorizationCodeRequest
2
+
3
+ ### Description
4
+
5
+ Defines the body parameters that can be provided in a request to the [CreateMobileAuthorizationCode](#endpoint-createmobileauthorizationcode) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **location_id** | **String** | The Square location ID the authorization code should be tied to. | [optional]
11
+
12
+
@@ -0,0 +1,14 @@
1
+ # SquareConnect::CreateMobileAuthorizationCodeResponse
2
+
3
+ ### Description
4
+
5
+ Defines the fields that are included in the response body of a request to the [CreateMobileAuthorizationCode](#endpoint-createmobileauthorizationcode) endpoint.
6
+
7
+ ## Properties
8
+ Name | Type | Description | Notes
9
+ ------------ | ------------- | ------------- | -------------
10
+ **authorization_code** | **String** | Generated authorization code that connects a mobile application instance to a Square account. | [optional]
11
+ **expires_at** | **String** | The timestamp when `authorization_code` expires in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, e.g., \"2016-09-04T23:59:33.123Z\". | [optional]
12
+ **error** | [**Error**](Error.md) | An error object that provides details about how creation of authorization code failed. | [optional]
13
+
14
+
@@ -0,0 +1,61 @@
1
+ # SquareConnect::MobileAuthorizationApi
2
+
3
+ All URIs are relative to *https://connect.squareup.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_mobile_authorization_code**](MobileAuthorizationApi.md#create_mobile_authorization_code) | **POST** /mobile/authorization-code | CreateMobileAuthorizationCode
8
+
9
+
10
+ # **create_mobile_authorization_code**
11
+ > CreateMobileAuthorizationCodeResponse create_mobile_authorization_code(body)
12
+
13
+ CreateMobileAuthorizationCode
14
+
15
+ Generates code to authorize a mobile application to connect to a Square card reader Authorization codes are one-time-use and expire __60 minutes__ after being issued. __Important:__ The `Authorization` header you provide to this endpoint must have the following format: ``` Authorization: Bearer ACCESS_TOKEN ``` Replace `ACCESS_TOKEN` with a [valid production authorization credential](https://docs.connect.squareup.com/get-started#step-4-understand-the-different-application-credentials).
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'square_connect'
21
+ # setup authorization
22
+ SquareConnect.configure do |config|
23
+ # Configure OAuth2 access token for authorization: oauth2
24
+ config.access_token = 'YOUR ACCESS TOKEN'
25
+ end
26
+
27
+ api_instance = SquareConnect::MobileAuthorizationApi.new
28
+
29
+ body = SquareConnect::CreateMobileAuthorizationCodeRequest.new # CreateMobileAuthorizationCodeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
30
+
31
+
32
+ begin
33
+ #CreateMobileAuthorizationCode
34
+ result = api_instance.create_mobile_authorization_code(body)
35
+ p result
36
+ rescue SquareConnect::ApiError => e
37
+ puts "Exception when calling MobileAuthorizationApi->create_mobile_authorization_code: #{e}"
38
+ end
39
+ ```
40
+
41
+ ### Parameters
42
+
43
+ Name | Type | Description | Notes
44
+ ------------- | ------------- | ------------- | -------------
45
+ **body** | [**CreateMobileAuthorizationCodeRequest**](CreateMobileAuthorizationCodeRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
46
+
47
+ ### Return type
48
+
49
+ [**CreateMobileAuthorizationCodeResponse**](CreateMobileAuthorizationCodeResponse.md)
50
+
51
+ ### Authorization
52
+
53
+ [oauth2](../README.md#oauth2)
54
+
55
+ ### HTTP request headers
56
+
57
+ - **Content-Type**: application/json
58
+ - **Accept**: application/json
59
+
60
+
61
+
data/docs/OrdersApi.md CHANGED
@@ -68,7 +68,7 @@ Name | Type | Description | Notes
68
68
 
69
69
  CreateOrder
70
70
 
71
- Creates an [Order](#type-order) that can then be referenced as `order_id` in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order's `id` in the `order_id` field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-api-overview).
71
+ Creates an [Order](#type-order) that can then be referenced as `order_id` in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order's `id` in the `order_id` field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](/products/orders/overview).
72
72
 
73
73
  ### Example
74
74
  ```ruby
@@ -18,7 +18,7 @@ Method | HTTP request | Description
18
18
 
19
19
  CaptureTransaction
20
20
 
21
- Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
21
+ Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information.
22
22
 
23
23
  ### Example
24
24
  ```ruby
@@ -128,7 +128,7 @@ Name | Type | Description | Notes
128
128
 
129
129
  CreateRefund
130
130
 
131
- Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See [this article](https://squareup.com/help/us/en/article/5060) for more information on refund behavior.
131
+ Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See [this article](https://squareup.com/help/us/en/article/5060) for more information on refund behavior. *NOTE**: Card-present transactions with Interac credit cards **cannot be refunded using the Connect API**. Interac transactions must refunded in-person (e.g., dipping the card using POS app).
132
132
 
133
133
  ### Example
134
134
  ```ruby
@@ -365,7 +365,7 @@ Name | Type | Description | Notes
365
365
 
366
366
  VoidTransaction
367
367
 
368
- Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
368
+ Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information.
369
369
 
370
370
  ### Example
371
371
  ```ruby
@@ -70,6 +70,8 @@ require 'square_connect/models/create_customer_card_request'
70
70
  require 'square_connect/models/create_customer_card_response'
71
71
  require 'square_connect/models/create_customer_request'
72
72
  require 'square_connect/models/create_customer_response'
73
+ require 'square_connect/models/create_mobile_authorization_code_request'
74
+ require 'square_connect/models/create_mobile_authorization_code_response'
73
75
  require 'square_connect/models/create_order_request'
74
76
  require 'square_connect/models/create_order_request_discount'
75
77
  require 'square_connect/models/create_order_request_line_item'
@@ -211,6 +213,7 @@ require 'square_connect/api/catalog_api'
211
213
  require 'square_connect/api/checkout_api'
212
214
  require 'square_connect/api/customers_api'
213
215
  require 'square_connect/api/locations_api'
216
+ require 'square_connect/api/mobile_authorization_api'
214
217
  require 'square_connect/api/orders_api'
215
218
  require 'square_connect/api/reporting_api'
216
219
  require 'square_connect/api/transactions_api'
@@ -18,7 +18,7 @@ module SquareConnect
18
18
  end
19
19
 
20
20
  # RegisterDomain
21
- # Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide.
21
+ # Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](/payments/sqpaymentform/overview) guide.
22
22
  # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
23
23
  # @param [Hash] opts the optional parameters
24
24
  # @return [RegisterDomainResponse]
@@ -28,7 +28,7 @@ module SquareConnect
28
28
  end
29
29
 
30
30
  # RegisterDomain
31
- # Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide.
31
+ # Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](/payments/sqpaymentform/overview) guide.
32
32
  # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
33
33
  # @param [Hash] opts the optional parameters
34
34
  # @return [Array<(RegisterDomainResponse, Fixnum, Hash)>] RegisterDomainResponse data, response status code and response headers
@@ -0,0 +1,75 @@
1
+ =begin
2
+ #Square Connect API
3
+
4
+ OpenAPI spec version: 2.0
5
+ Contact: developers@squareup.com
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ =end
9
+
10
+ require "uri"
11
+
12
+ module SquareConnect
13
+ class MobileAuthorizationApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+
20
+ # CreateMobileAuthorizationCode
21
+ # Generates code to authorize a mobile application to connect to a Square card reader Authorization codes are one-time-use and expire __60 minutes__ after being issued. __Important:__ The `Authorization` header you provide to this endpoint must have the following format: ``` Authorization: Bearer ACCESS_TOKEN ``` Replace `ACCESS_TOKEN` with a [valid production authorization credential](https://docs.connect.squareup.com/get-started#step-4-understand-the-different-application-credentials).
22
+ # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [CreateMobileAuthorizationCodeResponse]
25
+ def create_mobile_authorization_code(body, opts = {})
26
+ data, _status_code, _headers = create_mobile_authorization_code_with_http_info(body, opts)
27
+ return data
28
+ end
29
+
30
+ # CreateMobileAuthorizationCode
31
+ # Generates code to authorize a mobile application to connect to a Square card reader Authorization codes are one-time-use and expire __60 minutes__ after being issued. __Important:__ The &#x60;Authorization&#x60; header you provide to this endpoint must have the following format: &#x60;&#x60;&#x60; Authorization: Bearer ACCESS_TOKEN &#x60;&#x60;&#x60; Replace &#x60;ACCESS_TOKEN&#x60; with a [valid production authorization credential](https://docs.connect.squareup.com/get-started#step-4-understand-the-different-application-credentials).
32
+ # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(CreateMobileAuthorizationCodeResponse, Fixnum, Hash)>] CreateMobileAuthorizationCodeResponse data, response status code and response headers
35
+ def create_mobile_authorization_code_with_http_info(body, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug "Calling API: MobileAuthorizationApi.create_mobile_authorization_code ..."
38
+ end
39
+ # verify the required parameter 'body' is set
40
+ fail ArgumentError, "Missing the required parameter 'body' when calling MobileAuthorizationApi.create_mobile_authorization_code" if body.nil?
41
+ # resource path
42
+ local_var_path = "/mobile/authorization-code".sub('{format}','json')
43
+
44
+ # query parameters
45
+ query_params = {}
46
+
47
+ # header parameters
48
+ header_params = {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
51
+ # HTTP header 'Content-Type'
52
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
53
+
54
+ header_params['Square-Version'] = "2018-07-12"
55
+
56
+ # form parameters
57
+ form_params = {}
58
+
59
+ # http body (model)
60
+ post_body = @api_client.object_to_http_body(body)
61
+ auth_names = ['oauth2']
62
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names,
68
+ :return_type => 'CreateMobileAuthorizationCodeResponse')
69
+ if @api_client.config.debugging
70
+ @api_client.config.logger.debug "API called: MobileAuthorizationApi#create_mobile_authorization_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
71
+ end
72
+ return data, status_code, headers
73
+ end
74
+ end
75
+ end
@@ -77,7 +77,7 @@ module SquareConnect
77
77
  end
78
78
 
79
79
  # CreateOrder
80
- # Creates an [Order](#type-order) that can then be referenced as `order_id` in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order's `id` in the `order_id` field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-api-overview).
80
+ # Creates an [Order](#type-order) that can then be referenced as `order_id` in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order's `id` in the `order_id` field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](/products/orders/overview).
81
81
  # @param location_id The ID of the business location to associate the order with.
82
82
  # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
83
83
  # @param [Hash] opts the optional parameters
@@ -88,7 +88,7 @@ module SquareConnect
88
88
  end
89
89
 
90
90
  # CreateOrder
91
- # Creates an [Order](#type-order) that can then be referenced as &#x60;order_id&#x60; in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order&#39;s &#x60;id&#x60; in the &#x60;order_id&#x60; field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-api-overview).
91
+ # Creates an [Order](#type-order) that can then be referenced as &#x60;order_id&#x60; in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order&#39;s &#x60;id&#x60; in the &#x60;order_id&#x60; field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](/products/orders/overview).
92
92
  # @param location_id The ID of the business location to associate the order with.
93
93
  # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
94
94
  # @param [Hash] opts the optional parameters
@@ -18,7 +18,7 @@ module SquareConnect
18
18
  end
19
19
 
20
20
  # CaptureTransaction
21
- # Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
21
+ # Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information.
22
22
  # @param location_id
23
23
  # @param transaction_id
24
24
  # @param [Hash] opts the optional parameters
@@ -29,7 +29,7 @@ module SquareConnect
29
29
  end
30
30
 
31
31
  # CaptureTransaction
32
- # Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a &#x60;delay_capture&#x60; value of &#x60;true&#x60;. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
32
+ # Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a &#x60;delay_capture&#x60; value of &#x60;true&#x60;. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information.
33
33
  # @param location_id
34
34
  # @param transaction_id
35
35
  # @param [Hash] opts the optional parameters
@@ -136,7 +136,7 @@ module SquareConnect
136
136
  end
137
137
 
138
138
  # CreateRefund
139
- # Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See [this article](https://squareup.com/help/us/en/article/5060) for more information on refund behavior.
139
+ # Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See [this article](https://squareup.com/help/us/en/article/5060) for more information on refund behavior. *NOTE**: Card-present transactions with Interac credit cards **cannot be refunded using the Connect API**. Interac transactions must refunded in-person (e.g., dipping the card using POS app).
140
140
  # @param location_id The ID of the original transaction&#39;s associated location.
141
141
  # @param transaction_id The ID of the original transaction that includes the tender to refund.
142
142
  # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@@ -148,7 +148,7 @@ module SquareConnect
148
148
  end
149
149
 
150
150
  # CreateRefund
151
- # Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See [this article](https://squareup.com/help/us/en/article/5060) for more information on refund behavior.
151
+ # Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See [this article](https://squareup.com/help/us/en/article/5060) for more information on refund behavior. *NOTE**: Card-present transactions with Interac credit cards **cannot be refunded using the Connect API**. Interac transactions must refunded in-person (e.g., dipping the card using POS app).
152
152
  # @param location_id The ID of the original transaction&#39;s associated location.
153
153
  # @param transaction_id The ID of the original transaction that includes the tender to refund.
154
154
  # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@@ -398,7 +398,7 @@ module SquareConnect
398
398
  end
399
399
 
400
400
  # VoidTransaction
401
- # Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
401
+ # Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information.
402
402
  # @param location_id
403
403
  # @param transaction_id
404
404
  # @param [Hash] opts the optional parameters
@@ -409,7 +409,7 @@ module SquareConnect
409
409
  end
410
410
 
411
411
  # VoidTransaction
412
- # Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a &#x60;delay_capture&#x60; value of &#x60;true&#x60;. See [Delayed capture transactions](/articles/delayed-capture-transactions/) for more information.
412
+ # Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a &#x60;delay_capture&#x60; value of &#x60;true&#x60;. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information.
413
413
  # @param location_id
414
414
  # @param transaction_id
415
415
  # @param [Hash] opts the optional parameters
@@ -30,7 +30,7 @@ module SquareConnect
30
30
  @config = config
31
31
 
32
32
  # Construct user agent string. Returns slightly different string for JRuby
33
- @user_agent = "Square-Connect-Ruby/2.20180712.0"
33
+ @user_agent = "Square-Connect-Ruby/2.20180712.1"
34
34
 
35
35
  @default_headers = {
36
36
  'Content-Type' => "application/json",
@@ -10,7 +10,7 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
10
10
  require 'date'
11
11
 
12
12
  module SquareConnect
13
- # The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](https://docs.connect.squareup.com/articles/catalog-overview).
13
+ # The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview).
14
14
  class CatalogObject
15
15
  # The type of this object. Each object type has expected properties expressed in a structured format within its corresponding `*_data` field below. See [CatalogObjectType](#type-catalogobjecttype) for all possible values.
16
16
  attr_accessor :type
@@ -30,7 +30,7 @@ module SquareConnect
30
30
  # An optional ID you can associate with the transaction for your own purposes (such as to associate the transaction with an entity ID in your own database). This value cannot exceed 40 characters.
31
31
  attr_accessor :reference_id
32
32
 
33
- # An optional note to associate with the transaction. This value cannot exceed 60 characters.
33
+ #
34
34
  attr_accessor :note
35
35
 
36
36
  # The ID of the customer to associate this transaction with. This field is required if you provide a value for `customer_card_id`, and optional otherwise.
@@ -45,10 +45,10 @@ module SquareConnect
45
45
  # The buyer's email address, if available. This value is optional, but this transaction is ineligible for chargeback protection if it is not provided.
46
46
  attr_accessor :buyer_email_address
47
47
 
48
- # The ID of the order to associate with this transaction. If you provide this value, the `amount_money` value of your request must __exactly match__ the `total_money` value of the order's `order_amounts` field.
48
+ # The ID of the order to associate with this transaction. If you provide this value, the `amount_money` value of your request must __exactly match__ the value of the order's `total_money` field.
49
49
  attr_accessor :order_id
50
50
 
51
- # The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `amount_money` value in you charge's request. The `location_id` must be the valid location of the app owner merchant. This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. This field is currently not supported in sandbox.
51
+ # The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `amount_money` value in the charge request. The `location_id` must be the valid location of the app owner merchant. This field requires the `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. This field is currently not supported in sandbox.
52
52
  attr_accessor :additional_recipients
53
53
 
54
54
 
@@ -12,7 +12,7 @@ require 'date'
12
12
  module SquareConnect
13
13
  # Defines the fields that are included in the request body of a request to the [CreateCustomerCard](#endpoint-createcustomercard) endpoint.
14
14
  class CreateCustomerCardRequest
15
- # A card nonce representing the credit card to link to the customer. Card nonces are generated by the `SqPaymentForm` that buyers enter their card information into. See [Embedding the payment form](/articles/adding-payment-form/) for more information. __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card.
15
+ # A card nonce representing the credit card to link to the customer. Card nonces are generated by the `SqPaymentForm` that buyers enter their card information into. See [Embedding the payment form](/payments/sqpaymentform/overview) for more information. __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card.
16
16
  attr_accessor :card_nonce
17
17
 
18
18
  # Address information for the card on file. Only the `postal_code` field is required for payments in the US and Canada.
@@ -0,0 +1,186 @@
1
+ =begin
2
+ #Square Connect API
3
+
4
+ OpenAPI spec version: 2.0
5
+ Contact: developers@squareup.com
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ =end
9
+
10
+ require 'date'
11
+
12
+ module SquareConnect
13
+ # Defines the body parameters that can be provided in a request to the [CreateMobileAuthorizationCode](#endpoint-createmobileauthorizationcode) endpoint.
14
+ class CreateMobileAuthorizationCodeRequest
15
+ # The Square location ID the authorization code should be tied to.
16
+ attr_accessor :location_id
17
+
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'location_id' => :'location_id'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'location_id' => :'String'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
40
+
41
+ if attributes.has_key?(:'location_id')
42
+ self.location_id = attributes[:'location_id']
43
+ end
44
+
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properies with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ return invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ return true
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(o)
63
+ return true if self.equal?(o)
64
+ self.class == o.class &&
65
+ location_id == o.location_id
66
+ end
67
+
68
+ # @see the `==` method
69
+ # @param [Object] Object to be compared
70
+ def eql?(o)
71
+ self == o
72
+ end
73
+
74
+ # Calculates hash code according to all attributes.
75
+ # @return [Fixnum] Hash code
76
+ def hash
77
+ [location_id].hash
78
+ end
79
+
80
+ # Builds the object from hash
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ # @return [Object] Returns the model itself
83
+ def build_from_hash(attributes)
84
+ return nil unless attributes.is_a?(Hash)
85
+ self.class.swagger_types.each_pair do |key, type|
86
+ if type =~ /\AArray<(.*)>/i
87
+ # check to ensure the input is an array given that the the attribute
88
+ # is documented as an array but the input is not
89
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
90
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
91
+ end
92
+ elsif !attributes[self.class.attribute_map[key]].nil?
93
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
94
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
95
+ end
96
+
97
+ self
98
+ end
99
+
100
+ # Deserializes the data based on type
101
+ # @param string type Data type
102
+ # @param string value Value to be deserialized
103
+ # @return [Object] Deserialized data
104
+ def _deserialize(type, value)
105
+ case type.to_sym
106
+ when :DateTime
107
+ DateTime.parse(value)
108
+ when :Date
109
+ Date.parse(value)
110
+ when :String
111
+ value.to_s
112
+ when :Integer
113
+ value.to_i
114
+ when :Float
115
+ value.to_f
116
+ when :BOOLEAN
117
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
118
+ true
119
+ else
120
+ false
121
+ end
122
+ when :Object
123
+ # generic object (usually a Hash), return directly
124
+ value
125
+ when /\AArray<(?<inner_type>.+)>\z/
126
+ inner_type = Regexp.last_match[:inner_type]
127
+ value.map { |v| _deserialize(inner_type, v) }
128
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
129
+ k_type = Regexp.last_match[:k_type]
130
+ v_type = Regexp.last_match[:v_type]
131
+ {}.tap do |hash|
132
+ value.each do |k, v|
133
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
134
+ end
135
+ end
136
+ else # model
137
+ temp_model = SquareConnect.const_get(type).new
138
+ temp_model.build_from_hash(value)
139
+ end
140
+ end
141
+
142
+ # Returns the string representation of the object
143
+ # @return [String] String presentation of the object
144
+ def to_s
145
+ to_hash.to_s
146
+ end
147
+
148
+ # to_body is an alias to to_hash (backward compatibility)
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_body
151
+ to_hash
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = self.send(attr)
160
+ next if value.nil?
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ # Outputs non-array value in the form of hash
167
+ # For object, use to_hash. Otherwise, just return the value
168
+ # @param [Object] value Any valid value
169
+ # @return [Hash] Returns the value in the form of hash
170
+ def _to_hash(value)
171
+ if value.is_a?(Array)
172
+ value.compact.map{ |v| _to_hash(v) }
173
+ elsif value.is_a?(Hash)
174
+ {}.tap do |hash|
175
+ value.each { |k, v| hash[k] = _to_hash(v) }
176
+ end
177
+ elsif value.respond_to? :to_hash
178
+ value.to_hash
179
+ else
180
+ value
181
+ end
182
+ end
183
+
184
+ end
185
+
186
+ end
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #Square Connect API
3
+
4
+ OpenAPI spec version: 2.0
5
+ Contact: developers@squareup.com
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ =end
9
+
10
+ require 'date'
11
+
12
+ module SquareConnect
13
+ # Defines the fields that are included in the response body of a request to the [CreateMobileAuthorizationCode](#endpoint-createmobileauthorizationcode) endpoint.
14
+ class CreateMobileAuthorizationCodeResponse
15
+ # Generated authorization code that connects a mobile application instance to a Square account.
16
+ attr_accessor :authorization_code
17
+
18
+ # The timestamp when `authorization_code` expires in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, e.g., \"2016-09-04T23:59:33.123Z\".
19
+ attr_accessor :expires_at
20
+
21
+ # An error object that provides details about how creation of authorization code failed.
22
+ attr_accessor :error
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'authorization_code' => :'authorization_code',
29
+ :'expires_at' => :'expires_at',
30
+ :'error' => :'error'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'authorization_code' => :'String',
38
+ :'expires_at' => :'String',
39
+ :'error' => :'Error'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
50
+
51
+ if attributes.has_key?(:'authorization_code')
52
+ self.authorization_code = attributes[:'authorization_code']
53
+ end
54
+
55
+ if attributes.has_key?(:'expires_at')
56
+ self.expires_at = attributes[:'expires_at']
57
+ end
58
+
59
+ if attributes.has_key?(:'error')
60
+ self.error = attributes[:'error']
61
+ end
62
+
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properies with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ return invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ authorization_code == o.authorization_code &&
84
+ expires_at == o.expires_at &&
85
+ error == o.error
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Fixnum] Hash code
96
+ def hash
97
+ [authorization_code, expires_at, error].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ self.class.swagger_types.each_pair do |key, type|
106
+ if type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
110
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
115
+ end
116
+
117
+ self
118
+ end
119
+
120
+ # Deserializes the data based on type
121
+ # @param string type Data type
122
+ # @param string value Value to be deserialized
123
+ # @return [Object] Deserialized data
124
+ def _deserialize(type, value)
125
+ case type.to_sym
126
+ when :DateTime
127
+ DateTime.parse(value)
128
+ when :Date
129
+ Date.parse(value)
130
+ when :String
131
+ value.to_s
132
+ when :Integer
133
+ value.to_i
134
+ when :Float
135
+ value.to_f
136
+ when :BOOLEAN
137
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
138
+ true
139
+ else
140
+ false
141
+ end
142
+ when :Object
143
+ # generic object (usually a Hash), return directly
144
+ value
145
+ when /\AArray<(?<inner_type>.+)>\z/
146
+ inner_type = Regexp.last_match[:inner_type]
147
+ value.map { |v| _deserialize(inner_type, v) }
148
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
149
+ k_type = Regexp.last_match[:k_type]
150
+ v_type = Regexp.last_match[:v_type]
151
+ {}.tap do |hash|
152
+ value.each do |k, v|
153
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
154
+ end
155
+ end
156
+ else # model
157
+ temp_model = SquareConnect.const_get(type).new
158
+ temp_model.build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ next if value.nil?
181
+ hash[param] = _to_hash(value)
182
+ end
183
+ hash
184
+ end
185
+
186
+ # Outputs non-array value in the form of hash
187
+ # For object, use to_hash. Otherwise, just return the value
188
+ # @param [Object] value Any valid value
189
+ # @return [Hash] Returns the value in the form of hash
190
+ def _to_hash(value)
191
+ if value.is_a?(Array)
192
+ value.compact.map{ |v| _to_hash(v) }
193
+ elsif value.is_a?(Hash)
194
+ {}.tap do |hash|
195
+ value.each { |k, v| hash[k] = _to_hash(v) }
196
+ end
197
+ elsif value.respond_to? :to_hash
198
+ value.to_hash
199
+ else
200
+ value
201
+ end
202
+ end
203
+
204
+ end
205
+
206
+ end
@@ -8,5 +8,5 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
8
8
  =end
9
9
 
10
10
  module SquareConnect
11
- VERSION = "2.20180712.0"
11
+ VERSION = "2.20180712.1"
12
12
  end
@@ -0,0 +1,44 @@
1
+ =begin
2
+ #Square Connect API
3
+
4
+ OpenAPI spec version: 2.0
5
+ Contact: developers@squareup.com
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+
13
+ # Unit tests for SquareConnect::MobileAuthorizationApi
14
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
15
+ # Please update as you see appropriate
16
+ describe 'MobileAuthorizationApi' do
17
+ before do
18
+ # run before each test
19
+ @instance = SquareConnect::MobileAuthorizationApi.new
20
+ end
21
+
22
+ after do
23
+ # run after each test
24
+ end
25
+
26
+ describe 'test an instance of MobileAuthorizationApi' do
27
+ it 'should create an instact of MobileAuthorizationApi' do
28
+ expect(@instance).to be_instance_of(SquareConnect::MobileAuthorizationApi)
29
+ end
30
+ end
31
+
32
+ # unit tests for create_mobile_authorization_code
33
+ # CreateMobileAuthorizationCode
34
+ # Generates code to authorize a mobile application to connect to a Square card reader Authorization codes are one-time-use and expire __60 minutes__ after being issued. __Important:__ The &#x60;Authorization&#x60; header you provide to this endpoint must have the following format: &#x60;&#x60;&#x60; Authorization: Bearer ACCESS_TOKEN &#x60;&#x60;&#x60; Replace &#x60;ACCESS_TOKEN&#x60; with a [valid production authorization credential](https://docs.connect.squareup.com/get-started#step-4-understand-the-different-application-credentials).
35
+ # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [CreateMobileAuthorizationCodeResponse]
38
+ describe 'create_mobile_authorization_code test' do
39
+ it "should work" do
40
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
41
+ end
42
+ end
43
+
44
+ end
@@ -0,0 +1,39 @@
1
+ =begin
2
+ #Square Connect API
3
+
4
+ OpenAPI spec version: 2.0
5
+ Contact: developers@squareup.com
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+ require 'date'
13
+
14
+ # Unit tests for SquareConnect::CreateMobileAuthorizationCodeRequest
15
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
16
+ # Please update as you see appropriate
17
+ describe 'CreateMobileAuthorizationCodeRequest' do
18
+ before do
19
+ # run before each test
20
+ @instance = SquareConnect::CreateMobileAuthorizationCodeRequest.new
21
+ end
22
+
23
+ after do
24
+ # run after each test
25
+ end
26
+
27
+ describe 'test an instance of CreateMobileAuthorizationCodeRequest' do
28
+ it 'should create an instact of CreateMobileAuthorizationCodeRequest' do
29
+ expect(@instance).to be_instance_of(SquareConnect::CreateMobileAuthorizationCodeRequest)
30
+ end
31
+ end
32
+ describe 'test attribute "location_id"' do
33
+ it 'should work' do
34
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
35
+ end
36
+ end
37
+
38
+ end
39
+
@@ -0,0 +1,51 @@
1
+ =begin
2
+ #Square Connect API
3
+
4
+ OpenAPI spec version: 2.0
5
+ Contact: developers@squareup.com
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+ require 'date'
13
+
14
+ # Unit tests for SquareConnect::CreateMobileAuthorizationCodeResponse
15
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
16
+ # Please update as you see appropriate
17
+ describe 'CreateMobileAuthorizationCodeResponse' do
18
+ before do
19
+ # run before each test
20
+ @instance = SquareConnect::CreateMobileAuthorizationCodeResponse.new
21
+ end
22
+
23
+ after do
24
+ # run after each test
25
+ end
26
+
27
+ describe 'test an instance of CreateMobileAuthorizationCodeResponse' do
28
+ it 'should create an instact of CreateMobileAuthorizationCodeResponse' do
29
+ expect(@instance).to be_instance_of(SquareConnect::CreateMobileAuthorizationCodeResponse)
30
+ end
31
+ end
32
+ describe 'test attribute "authorization_code"' do
33
+ it 'should work' do
34
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
35
+ end
36
+ end
37
+
38
+ describe 'test attribute "expires_at"' do
39
+ it 'should work' do
40
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
41
+ end
42
+ end
43
+
44
+ describe 'test attribute "error"' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
50
+ end
51
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: square_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.20180712.0.224
4
+ version: 2.20180712.1.228
5
5
  platform: ruby
6
6
  authors:
7
7
  - Square, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-12 00:00:00.000000000 Z
11
+ date: 2018-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -262,6 +262,8 @@ files:
262
262
  - docs/CreateCustomerCardResponse.md
263
263
  - docs/CreateCustomerRequest.md
264
264
  - docs/CreateCustomerResponse.md
265
+ - docs/CreateMobileAuthorizationCodeRequest.md
266
+ - docs/CreateMobileAuthorizationCodeResponse.md
265
267
  - docs/CreateOrderRequest.md
266
268
  - docs/CreateOrderRequestDiscount.md
267
269
  - docs/CreateOrderRequestLineItem.md
@@ -313,6 +315,7 @@ files:
313
315
  - docs/LocationStatus.md
314
316
  - docs/LocationType.md
315
317
  - docs/LocationsApi.md
318
+ - docs/MobileAuthorizationApi.md
316
319
  - docs/Money.md
317
320
  - docs/Order.md
318
321
  - docs/OrderLineItem.md
@@ -411,6 +414,7 @@ files:
411
414
  - lib/square_connect/api/checkout_api.rb
412
415
  - lib/square_connect/api/customers_api.rb
413
416
  - lib/square_connect/api/locations_api.rb
417
+ - lib/square_connect/api/mobile_authorization_api.rb
414
418
  - lib/square_connect/api/orders_api.rb
415
419
  - lib/square_connect/api/reporting_api.rb
416
420
  - lib/square_connect/api/transactions_api.rb
@@ -477,6 +481,8 @@ files:
477
481
  - lib/square_connect/models/create_customer_card_response.rb
478
482
  - lib/square_connect/models/create_customer_request.rb
479
483
  - lib/square_connect/models/create_customer_response.rb
484
+ - lib/square_connect/models/create_mobile_authorization_code_request.rb
485
+ - lib/square_connect/models/create_mobile_authorization_code_response.rb
480
486
  - lib/square_connect/models/create_order_request.rb
481
487
  - lib/square_connect/models/create_order_request_discount.rb
482
488
  - lib/square_connect/models/create_order_request_line_item.rb
@@ -617,6 +623,7 @@ files:
617
623
  - spec/api/checkout_api_spec.rb
618
624
  - spec/api/customers_api_spec.rb
619
625
  - spec/api/locations_api_spec.rb
626
+ - spec/api/mobile_authorization_api_spec.rb
620
627
  - spec/api/orders_api_spec.rb
621
628
  - spec/api/reporting_api_spec.rb
622
629
  - spec/api/transactions_api_spec.rb
@@ -682,6 +689,8 @@ files:
682
689
  - spec/models/create_customer_card_response_spec.rb
683
690
  - spec/models/create_customer_request_spec.rb
684
691
  - spec/models/create_customer_response_spec.rb
692
+ - spec/models/create_mobile_authorization_code_request_spec.rb
693
+ - spec/models/create_mobile_authorization_code_response_spec.rb
685
694
  - spec/models/create_order_request_discount_spec.rb
686
695
  - spec/models/create_order_request_line_item_spec.rb
687
696
  - spec/models/create_order_request_modifier_spec.rb
@@ -849,6 +858,7 @@ test_files:
849
858
  - spec/api/checkout_api_spec.rb
850
859
  - spec/api/customers_api_spec.rb
851
860
  - spec/api/locations_api_spec.rb
861
+ - spec/api/mobile_authorization_api_spec.rb
852
862
  - spec/api/orders_api_spec.rb
853
863
  - spec/api/reporting_api_spec.rb
854
864
  - spec/api/transactions_api_spec.rb
@@ -914,6 +924,8 @@ test_files:
914
924
  - spec/models/create_customer_card_response_spec.rb
915
925
  - spec/models/create_customer_request_spec.rb
916
926
  - spec/models/create_customer_response_spec.rb
927
+ - spec/models/create_mobile_authorization_code_request_spec.rb
928
+ - spec/models/create_mobile_authorization_code_response_spec.rb
917
929
  - spec/models/create_order_request_discount_spec.rb
918
930
  - spec/models/create_order_request_line_item_spec.rb
919
931
  - spec/models/create_order_request_modifier_spec.rb
@@ -1031,8 +1043,8 @@ test_files:
1031
1043
  - spec/models/v1_page_spec.rb
1032
1044
  - spec/models/v1_payment_discount_spec.rb
1033
1045
  - spec/models/v1_payment_item_detail_spec.rb
1034
- - spec/models/v1_payment_itemization_spec.rb
1035
1046
  - spec/models/v1_payment_modifier_spec.rb
1047
+ - spec/models/v1_payment_itemization_spec.rb
1036
1048
  - spec/models/v1_payment_spec.rb
1037
1049
  - spec/models/v1_payment_surcharge_spec.rb
1038
1050
  - spec/models/v1_payment_tax_spec.rb