Skip to content

Commit 0951504

Browse files
author
autobot
committed
Generated PR for Release: 9.1.0.20210317
1 parent 503b7ed commit 0951504

77 files changed

Lines changed: 714 additions & 391 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# Change Log
22

3+
## Version 9.1.0.20210317 (2021-03-17)
4+
5+
## Existing API updates
6+
7+
* **Payments API:**
8+
* [CreatePayment](https://developer.squareup.com/reference/square_2021-03-17/payments-api/create-payment). Until now, the `CreatePayment` endpoint supported only taking card payments. In this release, the API now supports cash and external payments. For more information, see [Take Payments.](https://developer.squareup.com/docs/payments-api/take-payments)
9+
* [UpdatePayment](https://developer.squareup.com/reference/square_2021-03-17/payments-api/update-payment). This new endpoint enables developers to change the payment amount and tip amount after a payment is created. For more information, see [Update Payments.](https://developer.squareup.com/docs/payments-api/update-payments)
10+
11+
* **Invoices API:**
12+
* [InvoiceDeliveryMethod](https://developer.squareup.com/reference/square_2021-03-17/enums/InvoiceDeliveryMethod) enum. Added the read-only `SMS` value.
13+
* [InvoiceRequestMethod](https://developer.squareup.com/reference/square_2021-03-17/enums/InvoiceRequestMethod) enum (deprecated). Added the read-only `SMS`, `SMS_CHARGE_CARD_ON_FILE`, and `SMS_CHARGE_BANK_ON_FILE` values for backward compatibility.
14+
15+
These values direct Square to send invoices and receipts to customers using SMS (text message). SMS settings can be configured from first-party Square applications only; they cannot be configured from the Invoices API. Square does not send invoice reminders when using SMS to communicate with customers.
16+
17+
18+
* **Terminal API:**
19+
* [TerminalCheckout](https://developer.squareup.com/reference/square_2021-03-17/objects/TerminalCheckout). Previously, `TerminalCheckout` only supported tapped, dipped, or swiped credit cards. It now supports manual card entry and e-money. Added the `payment_type` field to denote a request for a manually entered payment card or an e-money payment.
20+
* [TerminalCheckoutPaymentType.](https://developer.squareup.com/reference/square_2021-03-17enums/TerminalCheckoutPaymentType) A new enum for the Terminal checkout payment types that can be requested.
21+
* [E-money support](https://developer.squareup.com/docs/terminal-api/e-money-payments) is now available for Terminal checkout requests in Japan.
22+
23+
24+
## SDKs
25+
* **Square Java SDK:**
26+
* Updated the OkHttp dependency to version 4.9.0.
27+
* Fixed a `NullPointerException` when passing an empty order ID to the `UpdateOrder` method.
28+
29+
## Documentation updates
30+
31+
* **Multi-language code examples.** Previously, various topics showed only cURL examples for the REST API operations. These topics now show examples in multiple languages. You can use the language drop-down list to choose a language.
32+
33+
* [When to Use Connect V1.](https://developer.squareup.com/docs/build-basics/using-connect-v1) Content is revised to reflect the most current information about when to use the Connect V1 API.
34+
35+
336
## Version 9.0.0.20210226 (2021-02-26)
437
## Existing API updates
538

doc/api/apple-pay.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ apple_pay_api = client.apple_pay
1111

1212
# Register Domain
1313

14-
Activates a domain for use with Web Apple Pay and Square. A validation
15-
will be performed on this domain by Apple to ensure is it properly set up as
14+
Activates a domain for use with Apple Pay on the Web and Square. A validation
15+
is performed on this domain by Apple to ensure that it is properly set up as
1616
an Apple Pay enabled domain.
1717

1818
This endpoint provides an easy way for platform developers to bulk activate
19-
Web Apple Pay with Square for merchants using their platform.
19+
Apple Pay on the Web with Square for merchants using their platform.
2020

21-
To learn more about Apple Pay on Web see the Apple Pay section in the
22-
[Square Payment Form Walkthrough](https://developer.squareup.com/docs/payment-form/payment-form-walkthrough).
21+
To learn more about Web Apple Pay, see
22+
[Add the Apple Pay on the Web Button](https://developer.squareup.com/docs/payment-form/add-digital-wallets/apple-pay).
2323

2424
```python
2525
def register_domain(self,

doc/api/checkout.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ checkout_api = client.checkout
1111

1212
# Create Checkout
1313

14-
Links a `checkoutId` to a `checkout_page_url` that customers will
15-
be directed to in order to provide their payment information using a
14+
Links a `checkoutId` to a `checkout_page_url` that customers are
15+
directed to in order to provide their payment information using a
1616
payment processing workflow hosted on connect.squareup.com.
1717

1818
```python

doc/api/invoices.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ body['invoice']['payment_requests'] = []
108108

109109
body['invoice']['payment_requests'].append({})
110110
body['invoice']['payment_requests'][0]['uid'] = 'uid4'
111-
body['invoice']['payment_requests'][0]['request_method'] = 'SHARE_MANUALLY'
111+
body['invoice']['payment_requests'][0]['request_method'] = 'SMS_CHARGE_CARD_ON_FILE'
112112
body['invoice']['payment_requests'][0]['request_type'] = 'BALANCE'
113113
body['invoice']['payment_requests'][0]['due_date'] = '2030-01-24'
114114
body['invoice']['payment_requests'][0]['fixed_amount_requested_money'] = {}
@@ -131,6 +131,18 @@ body['invoice']['invoice_number'] = 'inv-100'
131131
body['invoice']['title'] = 'Event Planning Services'
132132
body['invoice']['description'] = 'We appreciate your business!'
133133
body['invoice']['scheduled_at'] = '2030-01-13T10:00:00Z'
134+
body['invoice']['custom_fields'] = []
135+
136+
body['invoice']['custom_fields'].append({})
137+
body['invoice']['custom_fields'][0]['label'] = 'Event Reference Number'
138+
body['invoice']['custom_fields'][0]['value'] = 'Ref. #1234'
139+
body['invoice']['custom_fields'][0]['placement'] = 'ABOVE_LINE_ITEMS'
140+
141+
body['invoice']['custom_fields'].append({})
142+
body['invoice']['custom_fields'][1]['label'] = 'Terms of Service'
143+
body['invoice']['custom_fields'][1]['value'] = 'The terms of service are...'
144+
body['invoice']['custom_fields'][1]['placement'] = 'BELOW_LINE_ITEMS'
145+
134146
body['idempotency_key'] = 'ce3748f9-5fc1-4762-aa12-aae5e843f1f4'
135147

136148
result = invoices_api.create_invoice(body)
@@ -310,7 +322,7 @@ body['invoice']['payment_requests'] = []
310322

311323
body['invoice']['payment_requests'].append({})
312324
body['invoice']['payment_requests'][0]['uid'] = '2da7964f-f3d2-4f43-81e8-5aa220bf3355'
313-
body['invoice']['payment_requests'][0]['request_method'] = 'SHARE_MANUALLY'
325+
body['invoice']['payment_requests'][0]['request_method'] = 'SMS_CHARGE_CARD_ON_FILE'
314326
body['invoice']['payment_requests'][0]['request_type'] = 'DEPOSIT'
315327
body['invoice']['payment_requests'][0]['due_date'] = 'due_date2'
316328
body['invoice']['payment_requests'][0]['fixed_amount_requested_money'] = {}

doc/api/payments.md

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ payments_api = client.payments
1414
* [Create Payment](/doc/api/payments.md#create-payment)
1515
* [Cancel Payment by Idempotency Key](/doc/api/payments.md#cancel-payment-by-idempotency-key)
1616
* [Get Payment](/doc/api/payments.md#get-payment)
17+
* [Update Payment](/doc/api/payments.md#update-payment)
1718
* [Cancel Payment](/doc/api/payments.md#cancel-payment)
1819
* [Complete Payment](/doc/api/payments.md#complete-payment)
1920

@@ -79,17 +80,14 @@ elif result.is_error():
7980

8081
# Create Payment
8182

82-
Charges a payment source (for example, a card
83-
represented by customer's card on file or a card nonce). In addition
84-
to the payment source, the request must include the
85-
amount to accept for the payment.
83+
Creates a payment using the provided source. You can use this endpoint
84+
to charge a card (credit/debit card or
85+
Square gift card) or record a payment that the seller received outside of Square
86+
(cash payment from a buyer or a payment that an external entity
87+
procesed on behalf of the seller).
8688

87-
There are several optional parameters that you can include in the request
88-
(for example, tip money, whether to autocomplete the payment, or a reference ID
89-
to correlate this payment with another system).
90-
91-
The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required
92-
to enable application fees.
89+
The endpoint creates a
90+
`Payment` object and returns it in the response.
9391

9492
```python
9593
def create_payment(self,
@@ -215,10 +213,59 @@ elif result.is_error():
215213
```
216214

217215

216+
# Update Payment
217+
218+
Updates a payment with the APPROVED status.
219+
You can update the `amount_money` and `tip_money` using this endpoint.
220+
221+
```python
222+
def update_payment(self,
223+
payment_id,
224+
body)
225+
```
226+
227+
## Parameters
228+
229+
| Parameter | Type | Tags | Description |
230+
| --- | --- | --- | --- |
231+
| `payment_id` | `string` | Template, Required | The ID of the payment to update. |
232+
| `body` | [`Update Payment Request`](/doc/models/update-payment-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
233+
234+
## Response Type
235+
236+
[`Update Payment Response`](/doc/models/update-payment-response.md)
237+
238+
## Example Usage
239+
240+
```python
241+
payment_id = 'payment_id0'
242+
body = {}
243+
body['payment'] = {}
244+
body['payment']['id'] = 'id2'
245+
body['payment']['created_at'] = 'created_at0'
246+
body['payment']['updated_at'] = 'updated_at8'
247+
body['payment']['amount_money'] = {}
248+
body['payment']['amount_money']['amount'] = 1000
249+
body['payment']['amount_money']['currency'] = 'USD'
250+
body['payment']['tip_money'] = {}
251+
body['payment']['tip_money']['amount'] = 300
252+
body['payment']['tip_money']['currency'] = 'USD'
253+
body['payment']['version_token'] = 'Z3okDzm2VRv5m5nE3WGx381ItTNhvjkB4VapByyz54h6o'
254+
body['idempotency_key'] = '3d3c3b22-9572-4fc6-1111-e4d2f41b4122'
255+
256+
result = payments_api.update_payment(payment_id, body)
257+
258+
if result.is_success():
259+
print(result.body)
260+
elif result.is_error():
261+
print(result.errors)
262+
```
263+
264+
218265
# Cancel Payment
219266

220-
Cancels (voids) a payment. If you set `autocomplete` to `false` when creating a payment,
221-
you can cancel the payment using this endpoint.
267+
Cancels (voids) a payment. You can use this endpoint to cancel a payment with
268+
the APPROVED `status`.
222269

223270
```python
224271
def cancel_payment(self,
@@ -229,7 +276,7 @@ def cancel_payment(self,
229276

230277
| Parameter | Type | Tags | Description |
231278
| --- | --- | --- | --- |
232-
| `payment_id` | `string` | Template, Required | The `payment_id` identifying the payment to be canceled. |
279+
| `payment_id` | `string` | Template, Required | The ID of the payment to cancel. |
233280

234281
## Response Type
235282

@@ -252,10 +299,9 @@ elif result.is_error():
252299
# Complete Payment
253300

254301
Completes (captures) a payment.
255-
256302
By default, payments are set to complete immediately after they are created.
257-
If you set `autocomplete` to `false` when creating a payment, you can complete (capture)
258-
the payment using this endpoint.
303+
304+
You can use this endpoint to complete a payment with the APPROVED `status`.
259305

260306
```python
261307
def complete_payment(self,

doc/api/refunds.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ elif result.is_error():
7474
# Refund Payment
7575

7676
Refunds a payment. You can refund the entire payment amount or a
77-
portion of it.
77+
portion of it. You can use this endpoint to refund a card payment or record a
78+
refund of a cash or external payment. For more information, see
79+
[Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments).
7880

7981
```python
8082
def refund_payment(self,

doc/api/terminal.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ terminal_api = client.terminal
2222

2323
# Create Terminal Checkout
2424

25-
Creates a new Terminal checkout request and sends it to the specified device to take a payment for the requested amount.
25+
Creates a Terminal checkout request and sends it to the specified device to take a payment
26+
for the requested amount.
2627

2728
```python
2829
def create_terminal_checkout(self,
@@ -118,7 +119,7 @@ elif result.is_error():
118119

119120
# Get Terminal Checkout
120121

121-
Retrieves a Terminal checkout request by checkout_id.
122+
Retrieves a Terminal checkout request by `checkout_id`.
122123

123124
```python
124125
def get_terminal_checkout(self,
@@ -129,7 +130,7 @@ def get_terminal_checkout(self,
129130

130131
| Parameter | Type | Tags | Description |
131132
| --- | --- | --- | --- |
132-
| `checkout_id` | `string` | Template, Required | Unique ID for the desired `TerminalCheckout` |
133+
| `checkout_id` | `string` | Template, Required | The unique ID for the desired `TerminalCheckout`. |
133134

134135
## Response Type
135136

@@ -162,7 +163,7 @@ def cancel_terminal_checkout(self,
162163

163164
| Parameter | Type | Tags | Description |
164165
| --- | --- | --- | --- |
165-
| `checkout_id` | `string` | Template, Required | Unique ID for the desired `TerminalCheckout` |
166+
| `checkout_id` | `string` | Template, Required | The unique ID for the desired `TerminalCheckout`. |
166167

167168
## Response Type
168169

@@ -228,7 +229,7 @@ elif result.is_error():
228229

229230
# Search Terminal Refunds
230231

231-
Retrieves a filtered list of Terminal Interac refund requests created by the seller making the request.
232+
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request.
232233

233234
```python
234235
def search_terminal_refunds(self,
@@ -272,7 +273,7 @@ elif result.is_error():
272273

273274
# Get Terminal Refund
274275

275-
Retrieves an Interac terminal refund object by ID.
276+
Retrieves an Interac Terminal refund object by ID.
276277

277278
```python
278279
def get_terminal_refund(self,
@@ -283,7 +284,7 @@ def get_terminal_refund(self,
283284

284285
| Parameter | Type | Tags | Description |
285286
| --- | --- | --- | --- |
286-
| `terminal_refund_id` | `string` | Template, Required | Unique ID for the desired `TerminalRefund` |
287+
| `terminal_refund_id` | `string` | Template, Required | The unique ID for the desired `TerminalRefund`. |
287288

288289
## Response Type
289290

@@ -305,7 +306,7 @@ elif result.is_error():
305306

306307
# Cancel Terminal Refund
307308

308-
Cancels an Interac terminal refund request by refund request ID if the status of the request permits it.
309+
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.
309310

310311
```python
311312
def cancel_terminal_refund(self,
@@ -316,7 +317,7 @@ def cancel_terminal_refund(self,
316317

317318
| Parameter | Type | Tags | Description |
318319
| --- | --- | --- | --- |
319-
| `terminal_refund_id` | `string` | Template, Required | Unique ID for the desired `TerminalRefund` |
320+
| `terminal_refund_id` | `string` | Template, Required | The unique ID for the desired `TerminalRefund`. |
320321

321322
## Response Type
322323

0 commit comments

Comments
 (0)