Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.py[cod]

12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: python
cache: pip
python:
- '2.7'
- '3.4'
- '3.5'
install:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
script: nosetests ./test
before_install:
- openssl aes-256-cbc -K $encrypted_27a1e8612058_key -iv $encrypted_27a1e8612058_iv -in ./travis-ci/accounts.enc -out ./travis-ci/accounts.json -d
36 changes: 27 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Square Connect V2 Python SDK
# Square Connect V2 Python SDK [![Build Status](https://travis-ci.org/square/connect-python-sdk.svg?branch=master)](https://travis-ci.org/square/connect-python-sdk)[![PyPI version](https://badge.fury.io/py/squareconnect.svg)](https://badge.fury.io/py/squareconnect)

This repository contains the released Python client SDK. Check out our [API
specification repository](https://github.com/square/connect-api-specification)
Expand Down Expand Up @@ -39,15 +39,15 @@ import squareconnect

### Retrieve your location IDs
```python
from __future__ import print_function
from __future__ import print_function

import squareconnect
from squareconnect.rest import ApiException
from squareconnect.apis.location_api import LocationApi

# create an instance of the Location API class
api_instance = LocationApi()
access_token = 'YOUR_ACCESS_TOKEN'
access_token = 'YOUR_ACCESS_TOKEN'

try:
# ListLocations
Expand All @@ -59,7 +59,7 @@ except ApiException as e:
```
### Charge the card nonce
```python
from __future__ import print_function
from __future__ import print_function
import uuid

import squareconnect
Expand All @@ -69,8 +69,8 @@ from squareconnect.apis.transaction_api import TransactionApi
# create an instance of the Transaction API class
api_instance = TransactionApi()
access_token = 'YOUR_ACCESS_TOKEN'
location_id = 'YOUR_LOCATION_ID'
nonce = 'YOUR_NONCE'
location_id = 'YOUR_LOCATION_ID'
nonce = 'YOUR_NONCE'

try:
# Charge
Expand All @@ -89,8 +89,9 @@ except ApiException as e:
All URIs are relative to [Square Connect V2 Documentation](https://docs.connect.squareup.com/api/connect/v2/#navsection-endpoints)


Class | Method | HTTP request
------------ | ------------- | -------------
Class | Method | HTTP request
------------ | ------------- | -------------
*CheckoutApi* | [**create_checkout**](docs/CheckoutApi.md#create_checkout) | **POST** /v2/locations/{location_id}/checkouts
*CustomerApi* | [**create_customer**](docs/CustomerApi.md#create_customer) | **POST** /v2/customers
*CustomerApi* | [**delete_customer**](docs/CustomerApi.md#delete_customer) | **DELETE** /v2/customers/{customer_id}
*CustomerApi* | [**list_customers**](docs/CustomerApi.md#list_customers) | **GET** /v2/customers
Expand All @@ -111,38 +112,55 @@ Class | Method | HTTP request
## Documentation For Models

- [Address](docs/Address.md)
- [CaptureTransactionRequest](docs/CaptureTransactionRequest.md)
- [CaptureTransactionResponse](docs/CaptureTransactionResponse.md)
- [Card](docs/Card.md)
- [ChargeRequest](docs/ChargeRequest.md)
- [ChargeResponse](docs/ChargeResponse.md)
- [Checkout](docs/Checkout.md)
- [CreateCheckoutRequest](docs/CreateCheckoutRequest.md)
- [CreateCheckoutResponse](docs/CreateCheckoutResponse.md)
- [CreateCustomerCardRequest](docs/CreateCustomerCardRequest.md)
- [CreateCustomerCardResponse](docs/CreateCustomerCardResponse.md)
- [CreateCustomerRequest](docs/CreateCustomerRequest.md)
- [CreateCustomerResponse](docs/CreateCustomerResponse.md)
- [CreateOrderRequest](docs/CreateOrderRequest.md)
- [CreateOrderRequestLineItem](docs/CreateOrderRequestLineItem.md)
- [CreateOrderRequestOrder](docs/CreateOrderRequestOrder.md)
- [CreateRefundRequest](docs/CreateRefundRequest.md)
- [CreateRefundResponse](docs/CreateRefundResponse.md)
- [Customer](docs/Customer.md)
- [CustomerGroupInfo](docs/CustomerGroupInfo.md)
- [CustomerPreferences](docs/CustomerPreferences.md)
- [DeleteCustomerCardRequest](docs/DeleteCustomerCardRequest.md)
- [DeleteCustomerCardResponse](docs/DeleteCustomerCardResponse.md)
- [DeleteCustomerRequest](docs/DeleteCustomerRequest.md)
- [DeleteCustomerResponse](docs/DeleteCustomerResponse.md)
- [Error](docs/Error.md)
- [ListCustomersRequest](docs/ListCustomersRequest.md)
- [ListCustomersResponse](docs/ListCustomersResponse.md)
- [ListLocationsRequest](docs/ListLocationsRequest.md)
- [ListLocationsResponse](docs/ListLocationsResponse.md)
- [ListRefundsRequest](docs/ListRefundsRequest.md)
- [ListRefundsResponse](docs/ListRefundsResponse.md)
- [ListTransactionsRequest](docs/ListTransactionsRequest.md)
- [ListTransactionsResponse](docs/ListTransactionsResponse.md)
- [Location](docs/Location.md)
- [Money](docs/Money.md)
- [Order](docs/Order.md)
- [OrderLineItem](docs/OrderLineItem.md)
- [Refund](docs/Refund.md)
- [RetrieveCustomerRequest](docs/RetrieveCustomerRequest.md)
- [RetrieveCustomerResponse](docs/RetrieveCustomerResponse.md)
- [RetrieveTransactionRequest](docs/RetrieveTransactionRequest.md)
- [RetrieveTransactionResponse](docs/RetrieveTransactionResponse.md)
- [Tender](docs/Tender.md)
- [TenderCardDetails](docs/TenderCardDetails.md)
- [TenderCashDetails](docs/TenderCashDetails.md)
- [Transaction](docs/Transaction.md)
- [UpdateCustomerRequest](docs/UpdateCustomerRequest.md)
- [UpdateCustomerResponse](docs/UpdateCustomerResponse.md)
- [VoidTransactionRequest](docs/VoidTransactionRequest.md)
- [VoidTransactionResponse](docs/VoidTransactionResponse.md)


Expand Down Expand Up @@ -171,7 +189,7 @@ as this repository contains only the generated SDK code.
## License

```
Copyright 2016 Square, Inc.
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.
Expand Down
30 changes: 15 additions & 15 deletions docs/Address.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Represents a physical address.
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**address_line_1** | **str** | [optional]
**address_line_2** | **str** | [optional]
**address_line_3** | **str** | [optional]
**locality** | **str** | [optional]
**sublocality** | **str** | [optional]
**sublocality_2** | **str** | [optional]
**sublocality_3** | **str** | [optional]
**administrative_district_level_1** | **str** | [optional]
**administrative_district_level_2** | **str** | [optional]
**administrative_district_level_3** | **str** | [optional]
**postal_code** | **str** | [optional]
**country** | **str** | [optional]
**first_name** | **str** | [optional]
**last_name** | **str** | [optional]
**organization** | **str** | [optional]
**address_line_1** | **str** | [optional]
**address_line_2** | **str** | [optional]
**address_line_3** | **str** | [optional]
**locality** | **str** | [optional]
**sublocality** | **str** | [optional]
**sublocality_2** | **str** | [optional]
**sublocality_3** | **str** | [optional]
**administrative_district_level_1** | **str** | [optional]
**administrative_district_level_2** | **str** | [optional]
**administrative_district_level_3** | **str** | [optional]
**postal_code** | **str** | [optional]
**country** | **str** | [optional]
**first_name** | **str** | [optional]
**last_name** | **str** | [optional]
**organization** | **str** | [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)

Expand Down
2 changes: 1 addition & 1 deletion docs/CaptureTransactionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Defines the fields that are included in the response body of a request to the [C
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**errors** | [**list[Error]**](Error.md) | [optional]
**errors** | [**list[Error]**](Error.md) | [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)

Expand Down
14 changes: 7 additions & 7 deletions docs/Card.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Represents the non-confidential details of a credit card.
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**id** | **str** | [optional]
**card_brand** | **str** | [optional]
**last_4** | **str** | [optional]
**exp_month** | **int** | [optional]
**exp_year** | **int** | [optional]
**cardholder_name** | **str** | [optional]
**billing_address** | [**Address**](Address.md) | [optional]
**id** | **str** | [optional]
**card_brand** | **str** | [optional]
**last_4** | **str** | [optional]
**exp_month** | **int** | [optional]
**exp_year** | **int** | [optional]
**cardholder_name** | **str** | [optional]
**billing_address** | [**Address**](Address.md) | [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)

Expand Down
22 changes: 11 additions & 11 deletions docs/ChargeRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Defines the parameters that can be included in the body of a request to the [Cha
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**idempotency_key** | **str** |
**amount_money** | [**Money**](Money.md) |
**card_nonce** | **str** | [optional]
**customer_card_id** | **str** | [optional]
**delay_capture** | **bool** | [optional]
**reference_id** | **str** | [optional]
**note** | **str** | [optional]
**customer_id** | **str** | [optional]
**billing_address** | [**Address**](Address.md) | [optional]
**shipping_address** | [**Address**](Address.md) | [optional]
**buyer_email_address** | **str** | [optional]
**idempotency_key** | **str** |
**amount_money** | [**Money**](Money.md) |
**card_nonce** | **str** | [optional]
**customer_card_id** | **str** | [optional]
**delay_capture** | **bool** | [optional]
**reference_id** | **str** | [optional]
**note** | **str** | [optional]
**customer_id** | **str** | [optional]
**billing_address** | [**Address**](Address.md) | [optional]
**shipping_address** | [**Address**](Address.md) | [optional]
**buyer_email_address** | **str** | [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)

Expand Down
4 changes: 2 additions & 2 deletions docs/ChargeResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Defines the fields that are included in the response body of a request to the [C
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**errors** | [**list[Error]**](Error.md) | [optional]
**transaction** | [**Transaction**](Transaction.md) | [optional]
**errors** | [**list[Error]**](Error.md) | [optional]
**transaction** | [**Transaction**](Transaction.md) | [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)

Expand Down
18 changes: 9 additions & 9 deletions docs/Checkout.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Square Checkout lets merchants accept online payments for supported payment type
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**id** | **str** | [optional]
**checkout_page_url** | **str** | [optional]
**ask_for_shipping_address** | **bool** | [optional]
**merchant_support_email** | **str** | [optional]
**pre_populate_buyer_email** | **str** | [optional]
**pre_populate_shipping_address** | [**Address**](Address.md) | [optional]
**redirect_url** | **str** | [optional]
**order** | [**Order**](Order.md) | [optional]
**created_at** | **str** | [optional]
**id** | **str** | [optional]
**checkout_page_url** | **str** | [optional]
**ask_for_shipping_address** | **bool** | [optional]
**merchant_support_email** | **str** | [optional]
**pre_populate_buyer_email** | **str** | [optional]
**pre_populate_shipping_address** | [**Address**](Address.md) | [optional]
**redirect_url** | **str** | [optional]
**order** | [**Order**](Order.md) | [optional]
**created_at** | **str** | [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)

Expand Down
8 changes: 4 additions & 4 deletions docs/CheckoutApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
All endpoints are relative to [Square Connect V2 Documentation](https://docs.connect.squareup.com/api/connect/v2/#navsection-endpoints)


Method | HTTP request
Method | HTTP request
------------- | -------------
[**create_checkout**](CheckoutApi.md#create_checkout) | **POST** /v2/locations/{location_id}/checkouts

Expand All @@ -20,9 +20,9 @@ Creates a [Checkout](#type-checkout) response that links a `checkoutId` and `che

Name | Type | Notes
------------- | ------------- | ------------- | -------------
**authorization** | **str**|
**location_id** | **str**|
**body** | [**CreateCheckoutRequest**](CreateCheckoutRequest.md)|
**authorization** | **str**|
**location_id** | **str**|
**body** | [**CreateCheckoutRequest**](CreateCheckoutRequest.md)|

### Return type

Expand Down
14 changes: 7 additions & 7 deletions docs/CreateCheckoutRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Defines the parameters that can be included in the body of a request to the [Cre
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**idempotency_key** | **str** |
**order** | [**CreateOrderRequestOrder**](CreateOrderRequestOrder.md) |
**ask_for_shipping_address** | **bool** | [optional]
**merchant_support_email** | **str** | [optional]
**pre_populate_buyer_email** | **str** | [optional]
**pre_populate_shipping_address** | [**Address**](Address.md) | [optional]
**redirect_url** | **str** | [optional]
**idempotency_key** | **str** |
**order** | [**CreateOrderRequestOrder**](CreateOrderRequestOrder.md) |
**ask_for_shipping_address** | **bool** | [optional]
**merchant_support_email** | **str** | [optional]
**pre_populate_buyer_email** | **str** | [optional]
**pre_populate_shipping_address** | [**Address**](Address.md) | [optional]
**redirect_url** | **str** | [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)

Expand Down
4 changes: 2 additions & 2 deletions docs/CreateCheckoutResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Defines the fields that are included in the response body of a request to the [C
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**checkout** | [**Checkout**](Checkout.md) | [optional]
**errors** | [**list[Error]**](Error.md) | [optional]
**checkout** | [**Checkout**](Checkout.md) | [optional]
**errors** | [**list[Error]**](Error.md) | [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)

Expand Down
6 changes: 3 additions & 3 deletions docs/CreateCustomerCardRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Defines the fields that are included in the request body of a request to the [Cr
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**card_nonce** | **str** |
**billing_address** | [**Address**](Address.md) | [optional]
**cardholder_name** | **str** | [optional]
**card_nonce** | **str** |
**billing_address** | [**Address**](Address.md) | [optional]
**cardholder_name** | **str** | [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)

Expand Down
4 changes: 2 additions & 2 deletions docs/CreateCustomerCardResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Defines the fields that are included in the response body of a request to the [C
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**errors** | [**list[Error]**](Error.md) | [optional]
**card** | [**Card**](Card.md) | [optional]
**errors** | [**list[Error]**](Error.md) | [optional]
**card** | [**Card**](Card.md) | [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)

Expand Down
18 changes: 9 additions & 9 deletions docs/CreateCustomerRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Defines the body parameters that can be provided in a request to the [CreateCust
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**given_name** | **str** | [optional]
**family_name** | **str** | [optional]
**company_name** | **str** | [optional]
**nickname** | **str** | [optional]
**email_address** | **str** | [optional]
**address** | [**Address**](Address.md) | [optional]
**phone_number** | **str** | [optional]
**reference_id** | **str** | [optional]
**note** | **str** | [optional]
**given_name** | **str** | [optional]
**family_name** | **str** | [optional]
**company_name** | **str** | [optional]
**nickname** | **str** | [optional]
**email_address** | **str** | [optional]
**address** | [**Address**](Address.md) | [optional]
**phone_number** | **str** | [optional]
**reference_id** | **str** | [optional]
**note** | **str** | [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)

Expand Down
4 changes: 2 additions & 2 deletions docs/CreateCustomerResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Defines the fields that are included in the response body of a request to the [C
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**errors** | [**list[Error]**](Error.md) | [optional]
**customer** | [**Customer**](Customer.md) | [optional]
**errors** | [**list[Error]**](Error.md) | [optional]
**customer** | [**Customer**](Customer.md) | [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)

Expand Down
4 changes: 2 additions & 2 deletions docs/CreateOrderRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Defines the parameters that can be included in the body of a request to the [Cre
## Properties
Name | Type | Notes
------------ | ------------- | -------------
**idempotency_key** | **str** |
**order** | [**Order**](Order.md) |
**idempotency_key** | **str** |
**order** | [**Order**](Order.md) |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Loading