From 4b3006f55241d3da5dca65e9e65d14a4162f0925 Mon Sep 17 00:00:00 2001 From: Connect API Specification Generator Date: Wed, 26 Jun 2019 21:55:33 +0000 Subject: [PATCH] Release 2.20190612.1 --- CHANGES.md | 4 + README.md | 1 + docs/CatalogObject.md | 2 +- docs/ChargeRequest.md | 1 + docs/CreateCustomerCardRequest.md | 5 +- docs/OAuthApi.md | 2 +- docs/OrderLineItem.md | 2 +- docs/OrderQuantityUnit.md | 2 +- docs/V1CashDrawerShift.md | 4 +- docs/V1Item.md | 2 +- docs/WebhookEvents.md | 15 +++ setup.py | 2 +- squareconnect/__init__.py | 1 + squareconnect/api_client.py | 2 +- squareconnect/apis/customers_api.py | 2 +- squareconnect/apis/o_auth_api.py | 2 +- squareconnect/configuration.py | 2 +- squareconnect/models/__init__.py | 1 + squareconnect/models/charge_request.py | 32 ++++++- .../models/create_customer_card_request.py | 40 ++++++-- squareconnect/models/order_line_item.py | 4 +- squareconnect/models/order_quantity_unit.py | 4 +- squareconnect/models/v1_cash_drawer_shift.py | 4 +- squareconnect/models/v1_item.py | 6 +- squareconnect/models/webhook_events.py | 95 +++++++++++++++++++ test/test_webhook_events.py | 48 ++++++++++ 26 files changed, 252 insertions(+), 33 deletions(-) create mode 100644 docs/WebhookEvents.md create mode 100644 squareconnect/models/webhook_events.py create mode 100644 test/test_webhook_events.py diff --git a/CHANGES.md b/CHANGES.md index 2be1772..42622b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Change Log +## Version 2.20190612.1 (2019-06-26) + +* **Bug fix**: `Transaction.Charge` and `Customers.CreateCustomerCard` request objects — now include the `verification_token` required for [Strong Customer Authentication](https://developer.squareup.com/docs/sca-overview). + ## Version 2.20190612.0 (2019-06-12) * **BETA releases**: diff --git a/README.md b/README.md index f3a53de..f9cf19b 100644 --- a/README.md +++ b/README.md @@ -677,6 +677,7 @@ Class | Method | HTTP request - [V1UpdateOrderRequestAction](docs/V1UpdateOrderRequestAction.md) - [V1VariationInventoryAlertType](docs/V1VariationInventoryAlertType.md) - [V1VariationPricingType](docs/V1VariationPricingType.md) + - [WebhookEvents](docs/WebhookEvents.md) - [Weekday](docs/Weekday.md) diff --git a/docs/CatalogObject.md b/docs/CatalogObject.md index 30d226e..30c73aa 100644 --- a/docs/CatalogObject.md +++ b/docs/CatalogObject.md @@ -3,7 +3,7 @@ ### Description -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. - if type = `IMAGE`, only `image_data` will be populated and it will contain a valid [CatalogImage](#type-catalogimage) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview). +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. - if type = `IMAGE`, only `image_data` will be populated and it will contain a valid [CatalogImage](#type-catalogimage) object. For a more detailed discussion of the Catalog data model, please see the [Design a Catalog](/catalog-api/design-a-catalog) guide. ## Properties Name | Type | Description | Notes diff --git a/docs/ChargeRequest.md b/docs/ChargeRequest.md index 2ef9ebd..7498838 100644 --- a/docs/ChargeRequest.md +++ b/docs/ChargeRequest.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **buyer_email_address** | **str** | The buyer's email address, if available. | [optional] **order_id** | **str** | 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] **additional_recipients** | [**list[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] +**verification_token** | **str** | An identifying token generated by `SqPaymentForm.verifyBuyer()`. Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCustomerCardRequest.md b/docs/CreateCustomerCardRequest.md index f97f1aa..b550eb8 100644 --- a/docs/CreateCustomerCardRequest.md +++ b/docs/CreateCustomerCardRequest.md @@ -8,9 +8,10 @@ Defines the fields that are included in the request body of a request to the Cre ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**card_nonce** | **str** | 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. | +**card_nonce** | **str** | 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](/payment-form/payment-form-walkthrough) for more information. __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card. | **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] -**cardholder_name** | **str** | The cardholder's name. | [optional] +**cardholder_name** | **str** | The full name printed on the credit card. | [optional] +**verification_token** | **str** | An identifying token generated by `SqPaymentForm.verifyBuyer()`. Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OAuthApi.md b/docs/OAuthApi.md index 62ff9d5..8c52838 100644 --- a/docs/OAuthApi.md +++ b/docs/OAuthApi.md @@ -39,7 +39,7 @@ Assign your **Access Token** from developer portal to the authorization paramete ### Description -`RenewToken` is deprecated. For information about refreshing OAuth access tokens, see [Renew OAuth Token](/authz/oauth/cookbook/oauth-renew). Renews an OAuth access token before it expires. OAuth access tokens besides your application's personal access token expire after __30 days__. You can also renew expired tokens within __15 days__ of their expiration. You cannot renew an access token that has been expired for more than 15 days. Instead, the associated user must re-complete the OAuth flow from the beginning. __Important:__ The `Authorization` header for this endpoint must have the following format: ``` Authorization: Client APPLICATION_SECRET ``` Replace `APPLICATION_SECRET` with the application secret on the Credentials page in the [application dashboard](https://connect.squareup.com/apps). +`RenewToken` is deprecated. For information about refreshing OAuth access tokens, see [Renew OAuth Token](https://developer.squareup.com/docs/oauth-api/cookbook/renew-oauth-tokens). Renews an OAuth access token before it expires. OAuth access tokens besides your application's personal access token expire after __30 days__. You can also renew expired tokens within __15 days__ of their expiration. You cannot renew an access token that has been expired for more than 15 days. Instead, the associated user must re-complete the OAuth flow from the beginning. __Important:__ The `Authorization` header for this endpoint must have the following format: ``` Authorization: Client APPLICATION_SECRET ``` Replace `APPLICATION_SECRET` with the application secret on the Credentials page in the [application dashboard](https://connect.squareup.com/apps). ### Parameters diff --git a/docs/OrderLineItem.md b/docs/OrderLineItem.md index 5a81ce4..33dd447 100644 --- a/docs/OrderLineItem.md +++ b/docs/OrderLineItem.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uid** | **str** | Unique ID that identifies the line item only within this order. This field is read-only. | [optional] **name** | **str** | The name of the line item. | [optional] -**quantity** | **str** | The quantity purchased, formatted as a decimal number. For example: `\"3\"`. Line items with a `quantity_unit` can have non-integer quantities. For example: `\"1.70000\"`. Orders Hub and older versions of Connect do not support non-integer quantities. See [Decimal quantities with Orders hub and older versions of Connect](/more-apis/orders/overview#decimal-quantities). | +**quantity** | **str** | The quantity purchased, formatted as a decimal number. For example: `\"3\"`. Line items with a `quantity_unit` can have non-integer quantities. For example: `\"1.70000\"`. | **quantity_unit** | [**OrderQuantityUnit**](OrderQuantityUnit.md) | The unit and precision that this line item's quantity is measured in. | [optional] **note** | **str** | The note of the line item. | [optional] **catalog_object_id** | **str** | The [CatalogItemVariation](#type-catalogitemvariation) id applied to this line item. | [optional] diff --git a/docs/OrderQuantityUnit.md b/docs/OrderQuantityUnit.md index 2821117..5071765 100644 --- a/docs/OrderQuantityUnit.md +++ b/docs/OrderQuantityUnit.md @@ -9,7 +9,7 @@ Contains the measurement unit for a quantity and a precision which specifies the Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **measurement_unit** | [**MeasurementUnit**](MeasurementUnit.md) | A [MeasurementUnit](#type-measurementunit) that represents the unit of measure for the quantity. | [optional] -**precision** | **int** | For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity. For example, a precision of 1 allows quantities like `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`. Min: 0. Max: 5. Orders Hub and older versions of Connect do not support non-integer quantities. See [Decimal quantities with Orders hub and older versions of Connect](/more-apis/orders/overview#decimal-quantities). | [optional] +**precision** | **int** | For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity. For example, a precision of 1 allows quantities like `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`. Min: 0. Max: 5. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/V1CashDrawerShift.md b/docs/V1CashDrawerShift.md index 572917a..8f45d78 100644 --- a/docs/V1CashDrawerShift.md +++ b/docs/V1CashDrawerShift.md @@ -3,7 +3,7 @@ ### Description -V1CashDrawerShift +Contains details for a single cash drawer shift. ## Properties Name | Type | Description | Notes @@ -17,7 +17,7 @@ Name | Type | Description | Notes **opening_employee_id** | **str** | The ID of the employee that started the cash drawer shift. | [optional] **ending_employee_id** | **str** | The ID of the employee that ended the cash drawer shift. | [optional] **closing_employee_id** | **str** | The ID of the employee that closed the cash drawer shift by auditing the cash drawer's contents. | [optional] -**description** | **str** | The time when the timecard was created, in ISO 8601 format. | [optional] +**description** | **str** | A description of the cash drawer shift. | [optional] **starting_cash_money** | [**V1Money**](V1Money.md) | The amount of money in the cash drawer at the start of the shift. | [optional] **cash_payment_money** | [**V1Money**](V1Money.md) | The amount of money added to the cash drawer from cash payments. | [optional] **cash_refunds_money** | [**V1Money**](V1Money.md) | The amount of money removed from the cash drawer from cash refunds. This value is always negative or zero. | [optional] diff --git a/docs/V1Item.md b/docs/V1Item.md index aa11663..494bfc4 100644 --- a/docs/V1Item.md +++ b/docs/V1Item.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **master_image** | [**V1ItemImage**](V1ItemImage.md) | The item's master image, if any. | [optional] **category** | [**V1Category**](V1Category.md) | The category the item belongs to, if any. | [optional] **variations** | [**list[V1Variation]**](V1Variation.md) | The item's variations. You must specify at least one variation. | [optional] -**modifier_lists** | [**list[V1Variation]**](V1Variation.md) | The modifier lists that apply to the item, if any. | [optional] +**modifier_lists** | [**list[V1ModifierList]**](V1ModifierList.md) | The modifier lists that apply to the item, if any. | [optional] **fees** | [**list[V1Fee]**](V1Fee.md) | The fees that apply to the item, if any. | [optional] **taxable** | **bool** | Deprecated. This field is not used. | [optional] **category_id** | **str** | The ID of the item's category, if any. | [optional] diff --git a/docs/WebhookEvents.md b/docs/WebhookEvents.md new file mode 100644 index 0000000..bd7dbab --- /dev/null +++ b/docs/WebhookEvents.md @@ -0,0 +1,15 @@ +# WebhookEvents + + +### Description + +The type of an event that triggers a webhook notification to an application. + +## Properties +Name | Type +------------ | ------------- +**inventory.count.updated** | string + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/setup.py b/setup.py index 741bcb7..b454d80 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages NAME = "squareconnect" -VERSION = "2.20190612.0" +VERSION = "2.20190612.1" diff --git a/squareconnect/__init__.py b/squareconnect/__init__.py index 11e89af..ffd6d27 100644 --- a/squareconnect/__init__.py +++ b/squareconnect/__init__.py @@ -441,6 +441,7 @@ from .models.v1_variation_pricing_type import V1VariationPricingType from .models.void_transaction_request import VoidTransactionRequest from .models.void_transaction_response import VoidTransactionResponse +from .models.webhook_events import WebhookEvents from .models.weekday import Weekday from .models.workweek_config import WorkweekConfig diff --git a/squareconnect/api_client.py b/squareconnect/api_client.py index f7a3f1f..2248d56 100644 --- a/squareconnect/api_client.py +++ b/squareconnect/api_client.py @@ -75,7 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Square-Connect-Python/2.20190612.0' + self.user_agent = 'Square-Connect-Python/2.20190612.1' @property def user_agent(self): diff --git a/squareconnect/apis/customers_api.py b/squareconnect/apis/customers_api.py index b67fd42..0f5291f 100644 --- a/squareconnect/apis/customers_api.py +++ b/squareconnect/apis/customers_api.py @@ -134,7 +134,7 @@ def create_customer_card(self, customer_id, body, **kwargs): :param callback function: The callback function for asynchronous request. (optional) - :param str customer_id: The ID of the customer to link the card on file to. (required) + :param str customer_id: The Square ID of the customer profile the card is linked to. (required) :param CreateCustomerCardRequest body: An object containing the fields to POST for the request. See the corresponding object definition for field details. (required) :return: CreateCustomerCardResponse If the method is called asynchronously, diff --git a/squareconnect/apis/o_auth_api.py b/squareconnect/apis/o_auth_api.py index ade73b9..1963c6c 100644 --- a/squareconnect/apis/o_auth_api.py +++ b/squareconnect/apis/o_auth_api.py @@ -122,7 +122,7 @@ def obtain_token(self, body, **kwargs): def renew_token(self, client_id, body, **kwargs): """ RenewToken - `RenewToken` is deprecated. For information about refreshing OAuth access tokens, see [Renew OAuth Token](/authz/oauth/cookbook/oauth-renew). Renews an OAuth access token before it expires. OAuth access tokens besides your application's personal access token expire after __30 days__. You can also renew expired tokens within __15 days__ of their expiration. You cannot renew an access token that has been expired for more than 15 days. Instead, the associated user must re-complete the OAuth flow from the beginning. __Important:__ The `Authorization` header for this endpoint must have the following format: ``` Authorization: Client APPLICATION_SECRET ``` Replace `APPLICATION_SECRET` with the application secret on the Credentials page in the [application dashboard](https://connect.squareup.com/apps). + `RenewToken` is deprecated. For information about refreshing OAuth access tokens, see [Renew OAuth Token](https://developer.squareup.com/docs/oauth-api/cookbook/renew-oauth-tokens). Renews an OAuth access token before it expires. OAuth access tokens besides your application's personal access token expire after __30 days__. You can also renew expired tokens within __15 days__ of their expiration. You cannot renew an access token that has been expired for more than 15 days. Instead, the associated user must re-complete the OAuth flow from the beginning. __Important:__ The `Authorization` header for this endpoint must have the following format: ``` Authorization: Client APPLICATION_SECRET ``` Replace `APPLICATION_SECRET` with the application secret on the Credentials page in the [application dashboard](https://connect.squareup.com/apps). This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function diff --git a/squareconnect/configuration.py b/squareconnect/configuration.py index a6fcf8e..cd9b786 100644 --- a/squareconnect/configuration.py +++ b/squareconnect/configuration.py @@ -229,5 +229,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2.0\n"\ - "SDK Package Version: 2.20190612.0".\ + "SDK Package Version: 2.20190612.1".\ format(env=sys.platform, pyversion=sys.version) diff --git a/squareconnect/models/__init__.py b/squareconnect/models/__init__.py index cc6e65c..01cc51e 100644 --- a/squareconnect/models/__init__.py +++ b/squareconnect/models/__init__.py @@ -441,5 +441,6 @@ from .v1_variation_pricing_type import V1VariationPricingType from .void_transaction_request import VoidTransactionRequest from .void_transaction_response import VoidTransactionResponse +from .webhook_events import WebhookEvents from .weekday import Weekday from .workweek_config import WorkweekConfig diff --git a/squareconnect/models/charge_request.py b/squareconnect/models/charge_request.py index 178f199..7492a62 100644 --- a/squareconnect/models/charge_request.py +++ b/squareconnect/models/charge_request.py @@ -27,7 +27,7 @@ class ChargeRequest(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - def __init__(self, idempotency_key=None, amount_money=None, card_nonce=None, customer_card_id=None, delay_capture=None, reference_id=None, note=None, customer_id=None, billing_address=None, shipping_address=None, buyer_email_address=None, order_id=None, additional_recipients=None): + def __init__(self, idempotency_key=None, amount_money=None, card_nonce=None, customer_card_id=None, delay_capture=None, reference_id=None, note=None, customer_id=None, billing_address=None, shipping_address=None, buyer_email_address=None, order_id=None, additional_recipients=None, verification_token=None): """ ChargeRequest - a model defined in Swagger @@ -49,7 +49,8 @@ def __init__(self, idempotency_key=None, amount_money=None, card_nonce=None, cus 'shipping_address': 'Address', 'buyer_email_address': 'str', 'order_id': 'str', - 'additional_recipients': 'list[AdditionalRecipient]' + 'additional_recipients': 'list[AdditionalRecipient]', + 'verification_token': 'str' } self.attribute_map = { @@ -65,7 +66,8 @@ def __init__(self, idempotency_key=None, amount_money=None, card_nonce=None, cus 'shipping_address': 'shipping_address', 'buyer_email_address': 'buyer_email_address', 'order_id': 'order_id', - 'additional_recipients': 'additional_recipients' + 'additional_recipients': 'additional_recipients', + 'verification_token': 'verification_token' } self._idempotency_key = idempotency_key @@ -81,6 +83,7 @@ def __init__(self, idempotency_key=None, amount_money=None, card_nonce=None, cus self._buyer_email_address = buyer_email_address self._order_id = order_id self._additional_recipients = additional_recipients + self._verification_token = verification_token @property def idempotency_key(self): @@ -418,6 +421,29 @@ def additional_recipients(self, additional_recipients): self._additional_recipients = additional_recipients + @property + def verification_token(self): + """ + Gets the verification_token of this ChargeRequest. + An identifying token generated by `SqPaymentForm.verifyBuyer()`. Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. + + :return: The verification_token of this ChargeRequest. + :rtype: str + """ + return self._verification_token + + @verification_token.setter + def verification_token(self, verification_token): + """ + Sets the verification_token of this ChargeRequest. + An identifying token generated by `SqPaymentForm.verifyBuyer()`. Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. + + :param verification_token: The verification_token of this ChargeRequest. + :type: str + """ + + self._verification_token = verification_token + def to_dict(self): """ Returns the model properties as a dict diff --git a/squareconnect/models/create_customer_card_request.py b/squareconnect/models/create_customer_card_request.py index 9362f28..a674628 100644 --- a/squareconnect/models/create_customer_card_request.py +++ b/squareconnect/models/create_customer_card_request.py @@ -27,7 +27,7 @@ class CreateCustomerCardRequest(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - def __init__(self, card_nonce=None, billing_address=None, cardholder_name=None): + def __init__(self, card_nonce=None, billing_address=None, cardholder_name=None, verification_token=None): """ CreateCustomerCardRequest - a model defined in Swagger @@ -39,24 +39,27 @@ def __init__(self, card_nonce=None, billing_address=None, cardholder_name=None): self.swagger_types = { 'card_nonce': 'str', 'billing_address': 'Address', - 'cardholder_name': 'str' + 'cardholder_name': 'str', + 'verification_token': 'str' } self.attribute_map = { 'card_nonce': 'card_nonce', 'billing_address': 'billing_address', - 'cardholder_name': 'cardholder_name' + 'cardholder_name': 'cardholder_name', + 'verification_token': 'verification_token' } self._card_nonce = card_nonce self._billing_address = billing_address self._cardholder_name = cardholder_name + self._verification_token = verification_token @property def card_nonce(self): """ Gets the card_nonce of this CreateCustomerCardRequest. - 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. + 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](/payment-form/payment-form-walkthrough) for more information. __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card. :return: The card_nonce of this CreateCustomerCardRequest. :rtype: str @@ -67,7 +70,7 @@ def card_nonce(self): def card_nonce(self, card_nonce): """ Sets the card_nonce of this CreateCustomerCardRequest. - 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. + 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](/payment-form/payment-form-walkthrough) for more information. __Note:__ Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card. :param card_nonce: The card_nonce of this CreateCustomerCardRequest. :type: str @@ -102,7 +105,7 @@ def billing_address(self, billing_address): def cardholder_name(self): """ Gets the cardholder_name of this CreateCustomerCardRequest. - The cardholder's name. + The full name printed on the credit card. :return: The cardholder_name of this CreateCustomerCardRequest. :rtype: str @@ -113,7 +116,7 @@ def cardholder_name(self): def cardholder_name(self, cardholder_name): """ Sets the cardholder_name of this CreateCustomerCardRequest. - The cardholder's name. + The full name printed on the credit card. :param cardholder_name: The cardholder_name of this CreateCustomerCardRequest. :type: str @@ -121,6 +124,29 @@ def cardholder_name(self, cardholder_name): self._cardholder_name = cardholder_name + @property + def verification_token(self): + """ + Gets the verification_token of this CreateCustomerCardRequest. + An identifying token generated by `SqPaymentForm.verifyBuyer()`. Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. + + :return: The verification_token of this CreateCustomerCardRequest. + :rtype: str + """ + return self._verification_token + + @verification_token.setter + def verification_token(self, verification_token): + """ + Sets the verification_token of this CreateCustomerCardRequest. + An identifying token generated by `SqPaymentForm.verifyBuyer()`. Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. + + :param verification_token: The verification_token of this CreateCustomerCardRequest. + :type: str + """ + + self._verification_token = verification_token + def to_dict(self): """ Returns the model properties as a dict diff --git a/squareconnect/models/order_line_item.py b/squareconnect/models/order_line_item.py index eca07fa..02c8714 100644 --- a/squareconnect/models/order_line_item.py +++ b/squareconnect/models/order_line_item.py @@ -151,7 +151,7 @@ def name(self, name): def quantity(self): """ Gets the quantity of this OrderLineItem. - The quantity purchased, formatted as a decimal number. For example: `\"3\"`. Line items with a `quantity_unit` can have non-integer quantities. For example: `\"1.70000\"`. Orders Hub and older versions of Connect do not support non-integer quantities. See [Decimal quantities with Orders hub and older versions of Connect](/more-apis/orders/overview#decimal-quantities). + The quantity purchased, formatted as a decimal number. For example: `\"3\"`. Line items with a `quantity_unit` can have non-integer quantities. For example: `\"1.70000\"`. :return: The quantity of this OrderLineItem. :rtype: str @@ -162,7 +162,7 @@ def quantity(self): def quantity(self, quantity): """ Sets the quantity of this OrderLineItem. - The quantity purchased, formatted as a decimal number. For example: `\"3\"`. Line items with a `quantity_unit` can have non-integer quantities. For example: `\"1.70000\"`. Orders Hub and older versions of Connect do not support non-integer quantities. See [Decimal quantities with Orders hub and older versions of Connect](/more-apis/orders/overview#decimal-quantities). + The quantity purchased, formatted as a decimal number. For example: `\"3\"`. Line items with a `quantity_unit` can have non-integer quantities. For example: `\"1.70000\"`. :param quantity: The quantity of this OrderLineItem. :type: str diff --git a/squareconnect/models/order_quantity_unit.py b/squareconnect/models/order_quantity_unit.py index cce026a..4d03798 100644 --- a/squareconnect/models/order_quantity_unit.py +++ b/squareconnect/models/order_quantity_unit.py @@ -76,7 +76,7 @@ def measurement_unit(self, measurement_unit): def precision(self): """ Gets the precision of this OrderQuantityUnit. - For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity. For example, a precision of 1 allows quantities like `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`. Min: 0. Max: 5. Orders Hub and older versions of Connect do not support non-integer quantities. See [Decimal quantities with Orders hub and older versions of Connect](/more-apis/orders/overview#decimal-quantities). + For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity. For example, a precision of 1 allows quantities like `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`. Min: 0. Max: 5. :return: The precision of this OrderQuantityUnit. :rtype: int @@ -87,7 +87,7 @@ def precision(self): def precision(self, precision): """ Sets the precision of this OrderQuantityUnit. - For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity. For example, a precision of 1 allows quantities like `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`. Min: 0. Max: 5. Orders Hub and older versions of Connect do not support non-integer quantities. See [Decimal quantities with Orders hub and older versions of Connect](/more-apis/orders/overview#decimal-quantities). + For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity. For example, a precision of 1 allows quantities like `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`. Min: 0. Max: 5. :param precision: The precision of this OrderQuantityUnit. :type: int diff --git a/squareconnect/models/v1_cash_drawer_shift.py b/squareconnect/models/v1_cash_drawer_shift.py index dedfc22..01b0bba 100644 --- a/squareconnect/models/v1_cash_drawer_shift.py +++ b/squareconnect/models/v1_cash_drawer_shift.py @@ -311,7 +311,7 @@ def closing_employee_id(self, closing_employee_id): def description(self): """ Gets the description of this V1CashDrawerShift. - The time when the timecard was created, in ISO 8601 format. + A description of the cash drawer shift. :return: The description of this V1CashDrawerShift. :rtype: str @@ -322,7 +322,7 @@ def description(self): def description(self, description): """ Sets the description of this V1CashDrawerShift. - The time when the timecard was created, in ISO 8601 format. + A description of the cash drawer shift. :param description: The description of this V1CashDrawerShift. :type: str diff --git a/squareconnect/models/v1_item.py b/squareconnect/models/v1_item.py index 0fa7e2d..ee7fd67 100644 --- a/squareconnect/models/v1_item.py +++ b/squareconnect/models/v1_item.py @@ -48,7 +48,7 @@ def __init__(self, id=None, name=None, description=None, type=None, color=None, 'master_image': 'V1ItemImage', 'category': 'V1Category', 'variations': 'list[V1Variation]', - 'modifier_lists': 'list[V1Variation]', + 'modifier_lists': 'list[V1ModifierList]', 'fees': 'list[V1Fee]', 'taxable': 'bool', 'category_id': 'str', @@ -354,7 +354,7 @@ def modifier_lists(self): The modifier lists that apply to the item, if any. :return: The modifier_lists of this V1Item. - :rtype: list[V1Variation] + :rtype: list[V1ModifierList] """ return self._modifier_lists @@ -365,7 +365,7 @@ def modifier_lists(self, modifier_lists): The modifier lists that apply to the item, if any. :param modifier_lists: The modifier_lists of this V1Item. - :type: list[V1Variation] + :type: list[V1ModifierList] """ self._modifier_lists = modifier_lists diff --git a/squareconnect/models/webhook_events.py b/squareconnect/models/webhook_events.py new file mode 100644 index 0000000..d062542 --- /dev/null +++ b/squareconnect/models/webhook_events.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" +Copyright 2017 Square, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + + +from pprint import pformat +from six import iteritems +import re + + +class WebhookEvents(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + WebhookEvents - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + + } + + self.attribute_map = { + + } + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/test/test_webhook_events.py b/test/test_webhook_events.py new file mode 100644 index 0000000..c0924ff --- /dev/null +++ b/test/test_webhook_events.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" +Copyright 2017 Square, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import squareconnect +from squareconnect.rest import ApiException +from squareconnect.models.webhook_events import WebhookEvents + + +class TestWebhookEvents(unittest.TestCase): + """ WebhookEvents unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWebhookEvents(self): + """ + Test WebhookEvents + """ + model = squareconnect.models.webhook_events.WebhookEvents() + + +if __name__ == '__main__': + unittest.main()