Skip to content

Commit

Permalink
Merge pull request #102 from square/release/21.1.0
Browse files Browse the repository at this point in the history
Generated PR for Release: 21.1.0
  • Loading branch information
Xiao Hu authored Aug 22, 2022
2 parents d6f56ec + e2b016b commit e2ce966
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 10 deletions.
6 changes: 3 additions & 3 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-08-17'` |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-08-23'` |
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
| `environment` | `string` | The API environment. <br> **Default: `production`** |
| `additionalHeaders` | `Readonly<Record<string, string>>` | Additional headers to add to each API call<br>*Default*: `{}` |
Expand Down Expand Up @@ -40,7 +40,7 @@ The API client can be initialized as follows:

```ts
const client = new Client({
squareVersion: '2022-08-17',
squareVersion: '2022-08-23',
timeout: 60000,
additionalHeaders: {},
userAgentDetail: '',
Expand All @@ -56,7 +56,7 @@ import fs from 'fs';
import { ApiError, Client, FileWrapper, LocationsApi } from 'square';

const client = new Client({
squareVersion: '2022-08-17',
squareVersion: '2022-08-23',
timeout: 60000,
additionalHeaders: {},
userAgentDetail: '',
Expand Down
6 changes: 4 additions & 2 deletions doc/models/buy-now-pay-later-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ Additional details about a Buy Now Pay Later payment type.

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `brand` | `string \| undefined` | Optional | The brand used for the Buy Now Pay Later payment.<br>The brand can be `AFTERPAY` or `UNKNOWN`.<br>**Constraints**: *Maximum Length*: `50` |
| `brand` | `string \| undefined` | Optional | The brand used for the Buy Now Pay Later payment.<br>The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.<br>**Constraints**: *Maximum Length*: `50` |
| `afterpayDetails` | [`AfterpayDetails \| undefined`](../../doc/models/afterpay-details.md) | Optional | Additional details about Afterpay payments. |
| `clearpayDetails` | [`ClearpayDetails \| undefined`](../../doc/models/clearpay-details.md) | Optional | Additional details about Clearpay payments. |

## Example (as JSON)

```json
{
"brand": null,
"afterpay_details": null
"afterpay_details": null,
"clearpay_details": null
}
```

23 changes: 23 additions & 0 deletions doc/models/clearpay-details.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# Clearpay Details

Additional details about Clearpay payments.

## Structure

`ClearpayDetails`

## Fields

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `emailAddress` | `string \| undefined` | Optional | Email address on the buyer's Clearpay account.<br>**Constraints**: *Maximum Length*: `255` |

## Example (as JSON)

```json
{
"email_address": null
}
```

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "21.0.0",
"version": "21.1.0",
"license": "MIT",
"sideEffects": false,
"main": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import {
import { XmlSerialization } from './http/xmlSerialization';

/** Current SDK version */
export const SDK_VERSION = '21.0.0';
export const SDK_VERSION = '21.1.0';
export class Client implements ClientInterface {
private _config: Readonly<Configuration>;
private _timeout: number;
Expand Down Expand Up @@ -124,7 +124,7 @@ export class Client implements ClientInterface {
? this._config.httpClientOptions.timeout
: this._config.timeout;
this._userAgent = updateUserAgent(
'Square-TypeScript-SDK/21.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
'Square-TypeScript-SDK/21.1.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
this._config.squareVersion,
this._config.userAgentDetail
);
Expand Down
2 changes: 1 addition & 1 deletion src/defaultConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RetryConfiguration } from './core';
/** Default values for the configuration parameters of the client. */
export const DEFAULT_CONFIGURATION: Configuration = {
timeout: 60000,
squareVersion: '2022-08-17',
squareVersion: '2022-08-23',
additionalHeaders: {},
userAgentDetail: '',
environment: Environment.Production,
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export { ChargeRequestAdditionalRecipient } from './models/chargeRequestAddition
export { ChargeResponse } from './models/chargeResponse';
export { Checkout } from './models/checkout';
export { CheckoutOptions } from './models/checkoutOptions';
export { ClearpayDetails } from './models/clearpayDetails';
export { CloneOrderRequest } from './models/cloneOrderRequest';
export { CloneOrderResponse } from './models/cloneOrderResponse';
export { CompletePaymentRequest } from './models/completePaymentRequest';
Expand Down
9 changes: 8 additions & 1 deletion src/models/buyNowPayLaterDetails.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { lazy, object, optional, Schema, string } from '../schema';
import { AfterpayDetails, afterpayDetailsSchema } from './afterpayDetails';
import { ClearpayDetails, clearpayDetailsSchema } from './clearpayDetails';

/** Additional details about a Buy Now Pay Later payment type. */
export interface BuyNowPayLaterDetails {
/**
* The brand used for the Buy Now Pay Later payment.
* The brand can be `AFTERPAY` or `UNKNOWN`.
* The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.
*/
brand?: string;
/** Additional details about Afterpay payments. */
afterpayDetails?: AfterpayDetails;
/** Additional details about Clearpay payments. */
clearpayDetails?: ClearpayDetails;
}

export const buyNowPayLaterDetailsSchema: Schema<BuyNowPayLaterDetails> = object(
Expand All @@ -19,5 +22,9 @@ export const buyNowPayLaterDetailsSchema: Schema<BuyNowPayLaterDetails> = object
'afterpay_details',
optional(lazy(() => afterpayDetailsSchema)),
],
clearpayDetails: [
'clearpay_details',
optional(lazy(() => clearpayDetailsSchema)),
],
}
);
11 changes: 11 additions & 0 deletions src/models/clearpayDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { object, optional, Schema, string } from '../schema';

/** Additional details about Clearpay payments. */
export interface ClearpayDetails {
/** Email address on the buyer's Clearpay account. */
emailAddress?: string;
}

export const clearpayDetailsSchema: Schema<ClearpayDetails> = object({
emailAddress: ['email_address', optional(string())],
});

0 comments on commit e2ce966

Please sign in to comment.