@bates-solutions/squareup 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +154 -0
- package/README.md.backup +292 -0
- package/dist/angular/__tests__/setup.d.ts +1 -0
- package/dist/angular/__tests__/setup.d.ts.map +1 -0
- package/dist/angular/__tests__/setup.js +5 -0
- package/dist/angular/__tests__/setup.js.map +1 -0
- package/dist/angular/components/index.d.ts +2 -0
- package/dist/angular/components/index.d.ts.map +1 -0
- package/dist/angular/components/index.js +2 -0
- package/dist/angular/components/index.js.map +1 -0
- package/dist/angular/components/payment-button.component.d.ts +49 -0
- package/dist/angular/components/payment-button.component.d.ts.map +1 -0
- package/dist/angular/components/payment-button.component.js +176 -0
- package/dist/angular/components/payment-button.component.js.map +1 -0
- package/dist/angular/directives/index.d.ts +2 -0
- package/dist/angular/directives/index.d.ts.map +1 -0
- package/dist/angular/directives/index.js +2 -0
- package/dist/angular/directives/index.js.map +1 -0
- package/dist/angular/directives/square-card.directive.d.ts +52 -0
- package/dist/angular/directives/square-card.directive.d.ts.map +1 -0
- package/dist/angular/directives/square-card.directive.js +98 -0
- package/dist/angular/directives/square-card.directive.js.map +1 -0
- package/dist/angular/index.d.ts +42 -0
- package/dist/angular/index.d.ts.map +1 -0
- package/dist/angular/index.js +45 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/angular/services/index.d.ts +6 -0
- package/dist/angular/services/index.d.ts.map +1 -0
- package/dist/angular/services/index.js +6 -0
- package/dist/angular/services/index.js.map +1 -0
- package/dist/angular/services/square-catalog.service.d.ts +60 -0
- package/dist/angular/services/square-catalog.service.d.ts.map +1 -0
- package/dist/angular/services/square-catalog.service.js +152 -0
- package/dist/angular/services/square-catalog.service.js.map +1 -0
- package/dist/angular/services/square-customers.service.d.ts +77 -0
- package/dist/angular/services/square-customers.service.d.ts.map +1 -0
- package/dist/angular/services/square-customers.service.js +187 -0
- package/dist/angular/services/square-customers.service.js.map +1 -0
- package/dist/angular/services/square-orders.service.d.ts +66 -0
- package/dist/angular/services/square-orders.service.d.ts.map +1 -0
- package/dist/angular/services/square-orders.service.js +170 -0
- package/dist/angular/services/square-orders.service.js.map +1 -0
- package/dist/angular/services/square-payments.service.d.ts +73 -0
- package/dist/angular/services/square-payments.service.d.ts.map +1 -0
- package/dist/angular/services/square-payments.service.js +167 -0
- package/dist/angular/services/square-payments.service.js.map +1 -0
- package/dist/angular/services/square-sdk.service.d.ts +45 -0
- package/dist/angular/services/square-sdk.service.d.ts.map +1 -0
- package/dist/angular/services/square-sdk.service.js +133 -0
- package/dist/angular/services/square-sdk.service.js.map +1 -0
- package/dist/angular/square.module.d.ts +36 -0
- package/dist/angular/square.module.d.ts.map +1 -0
- package/dist/angular/square.module.js +75 -0
- package/dist/angular/square.module.js.map +1 -0
- package/dist/angular/types.d.ts +189 -0
- package/dist/angular/types.d.ts.map +1 -0
- package/dist/angular/types.js +8 -0
- package/dist/angular/types.js.map +1 -0
- package/dist/core/builders/order.builder.d.ts +140 -0
- package/dist/core/builders/order.builder.d.ts.map +1 -0
- package/dist/core/builders/order.builder.js +185 -0
- package/dist/core/builders/order.builder.js.map +1 -0
- package/dist/core/client.d.ts +93 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +99 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/errors.d.ts +55 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +118 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +18 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/services/catalog.service.d.ts +218 -0
- package/dist/core/services/catalog.service.d.ts.map +1 -0
- package/dist/core/services/catalog.service.js +274 -0
- package/dist/core/services/catalog.service.js.map +1 -0
- package/dist/core/services/customers.service.d.ts +197 -0
- package/dist/core/services/customers.service.d.ts.map +1 -0
- package/dist/core/services/customers.service.js +246 -0
- package/dist/core/services/customers.service.js.map +1 -0
- package/dist/core/services/inventory.service.d.ts +196 -0
- package/dist/core/services/inventory.service.d.ts.map +1 -0
- package/dist/core/services/inventory.service.js +266 -0
- package/dist/core/services/inventory.service.js.map +1 -0
- package/dist/core/services/invoices.service.d.ts +211 -0
- package/dist/core/services/invoices.service.d.ts.map +1 -0
- package/dist/core/services/invoices.service.js +297 -0
- package/dist/core/services/invoices.service.js.map +1 -0
- package/dist/core/services/loyalty.service.d.ts +282 -0
- package/dist/core/services/loyalty.service.d.ts.map +1 -0
- package/dist/core/services/loyalty.service.js +340 -0
- package/dist/core/services/loyalty.service.js.map +1 -0
- package/dist/core/services/orders.service.d.ts +121 -0
- package/dist/core/services/orders.service.d.ts.map +1 -0
- package/dist/core/services/orders.service.js +208 -0
- package/dist/core/services/orders.service.js.map +1 -0
- package/dist/core/services/payments.service.d.ts +121 -0
- package/dist/core/services/payments.service.d.ts.map +1 -0
- package/dist/core/services/payments.service.js +189 -0
- package/dist/core/services/payments.service.js.map +1 -0
- package/dist/core/services/subscriptions.service.d.ts +205 -0
- package/dist/core/services/subscriptions.service.d.ts.map +1 -0
- package/dist/core/services/subscriptions.service.js +265 -0
- package/dist/core/services/subscriptions.service.js.map +1 -0
- package/dist/core/types/index.d.ts +68 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/types/index.js +2 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/core/utils.d.ts +74 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +96 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/react/SquareProvider.d.ts +50 -0
- package/dist/react/SquareProvider.d.ts.map +1 -0
- package/dist/react/SquareProvider.js +134 -0
- package/dist/react/SquareProvider.js.map +1 -0
- package/dist/react/__tests__/CardInput.test.d.ts +2 -0
- package/dist/react/__tests__/CardInput.test.d.ts.map +1 -0
- package/dist/react/__tests__/CardInput.test.js +218 -0
- package/dist/react/__tests__/CardInput.test.js.map +1 -0
- package/dist/react/__tests__/PaymentButton.test.d.ts +2 -0
- package/dist/react/__tests__/PaymentButton.test.d.ts.map +1 -0
- package/dist/react/__tests__/PaymentButton.test.js +400 -0
- package/dist/react/__tests__/PaymentButton.test.js.map +1 -0
- package/dist/react/__tests__/SquareProvider.test.d.ts +2 -0
- package/dist/react/__tests__/SquareProvider.test.d.ts.map +1 -0
- package/dist/react/__tests__/SquareProvider.test.js +126 -0
- package/dist/react/__tests__/SquareProvider.test.js.map +1 -0
- package/dist/react/__tests__/setup.d.ts +2 -0
- package/dist/react/__tests__/setup.d.ts.map +1 -0
- package/dist/react/__tests__/setup.js +3 -0
- package/dist/react/__tests__/setup.js.map +1 -0
- package/dist/react/__tests__/useCatalog.test.d.ts +2 -0
- package/dist/react/__tests__/useCatalog.test.d.ts.map +1 -0
- package/dist/react/__tests__/useCatalog.test.js +277 -0
- package/dist/react/__tests__/useCatalog.test.js.map +1 -0
- package/dist/react/__tests__/useCustomers.test.d.ts +2 -0
- package/dist/react/__tests__/useCustomers.test.d.ts.map +1 -0
- package/dist/react/__tests__/useCustomers.test.js +312 -0
- package/dist/react/__tests__/useCustomers.test.js.map +1 -0
- package/dist/react/__tests__/useOrders.test.d.ts +2 -0
- package/dist/react/__tests__/useOrders.test.d.ts.map +1 -0
- package/dist/react/__tests__/useOrders.test.js +216 -0
- package/dist/react/__tests__/useOrders.test.js.map +1 -0
- package/dist/react/__tests__/usePayments.test.d.ts +2 -0
- package/dist/react/__tests__/usePayments.test.d.ts.map +1 -0
- package/dist/react/__tests__/usePayments.test.js +235 -0
- package/dist/react/__tests__/usePayments.test.js.map +1 -0
- package/dist/react/__tests__/useSquarePayment.test.d.ts +2 -0
- package/dist/react/__tests__/useSquarePayment.test.d.ts.map +1 -0
- package/dist/react/__tests__/useSquarePayment.test.js +447 -0
- package/dist/react/__tests__/useSquarePayment.test.js.map +1 -0
- package/dist/react/components/CardInput.d.ts +69 -0
- package/dist/react/components/CardInput.d.ts.map +1 -0
- package/dist/react/components/CardInput.js +58 -0
- package/dist/react/components/CardInput.js.map +1 -0
- package/dist/react/components/PaymentButton.d.ts +71 -0
- package/dist/react/components/PaymentButton.d.ts.map +1 -0
- package/dist/react/components/PaymentButton.js +140 -0
- package/dist/react/components/PaymentButton.js.map +1 -0
- package/dist/react/components/index.d.ts +5 -0
- package/dist/react/components/index.d.ts.map +1 -0
- package/dist/react/components/index.js +3 -0
- package/dist/react/components/index.js.map +1 -0
- package/dist/react/hooks/index.d.ts +11 -0
- package/dist/react/hooks/index.d.ts.map +1 -0
- package/dist/react/hooks/index.js +6 -0
- package/dist/react/hooks/index.js.map +1 -0
- package/dist/react/hooks/useCatalog.d.ts +98 -0
- package/dist/react/hooks/useCatalog.d.ts.map +1 -0
- package/dist/react/hooks/useCatalog.js +134 -0
- package/dist/react/hooks/useCatalog.js.map +1 -0
- package/dist/react/hooks/useCustomers.d.ts +105 -0
- package/dist/react/hooks/useCustomers.d.ts.map +1 -0
- package/dist/react/hooks/useCustomers.js +174 -0
- package/dist/react/hooks/useCustomers.js.map +1 -0
- package/dist/react/hooks/useOrders.d.ts +112 -0
- package/dist/react/hooks/useOrders.d.ts.map +1 -0
- package/dist/react/hooks/useOrders.js +115 -0
- package/dist/react/hooks/useOrders.js.map +1 -0
- package/dist/react/hooks/usePayments.d.ts +98 -0
- package/dist/react/hooks/usePayments.d.ts.map +1 -0
- package/dist/react/hooks/usePayments.js +89 -0
- package/dist/react/hooks/usePayments.js.map +1 -0
- package/dist/react/hooks/useSquarePayment.d.ts +52 -0
- package/dist/react/hooks/useSquarePayment.d.ts.map +1 -0
- package/dist/react/hooks/useSquarePayment.js +146 -0
- package/dist/react/hooks/useSquarePayment.js.map +1 -0
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +7 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/types.d.ts +183 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/types.js +2 -0
- package/dist/react/types.js.map +1 -0
- package/dist/server/index.d.ts +43 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +45 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/middleware/express.d.ts +77 -0
- package/dist/server/middleware/express.d.ts.map +1 -0
- package/dist/server/middleware/express.js +123 -0
- package/dist/server/middleware/express.js.map +1 -0
- package/dist/server/middleware/nextjs.d.ts +118 -0
- package/dist/server/middleware/nextjs.d.ts.map +1 -0
- package/dist/server/middleware/nextjs.js +172 -0
- package/dist/server/middleware/nextjs.js.map +1 -0
- package/dist/server/types.d.ts +89 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/types.js +7 -0
- package/dist/server/types.js.map +1 -0
- package/dist/server/webhook.d.ts +114 -0
- package/dist/server/webhook.d.ts.map +1 -0
- package/dist/server/webhook.js +190 -0
- package/dist/server/webhook.js.map +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { SquareClient } from 'square';
|
|
2
|
+
import type { CreatePaymentOptions } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Payment object type from Square API
|
|
5
|
+
*/
|
|
6
|
+
export interface Payment {
|
|
7
|
+
id?: string;
|
|
8
|
+
createdAt?: string;
|
|
9
|
+
updatedAt?: string;
|
|
10
|
+
amountMoney?: {
|
|
11
|
+
amount?: bigint;
|
|
12
|
+
currency?: string;
|
|
13
|
+
};
|
|
14
|
+
status?: string;
|
|
15
|
+
sourceType?: string;
|
|
16
|
+
orderId?: string;
|
|
17
|
+
customerId?: string;
|
|
18
|
+
locationId?: string;
|
|
19
|
+
referenceId?: string;
|
|
20
|
+
note?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Simplified payments service
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const payment = await square.payments.create({
|
|
28
|
+
* sourceId: 'cnon:card-nonce-ok',
|
|
29
|
+
* amount: 1000, // $10.00 in cents
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class PaymentsService {
|
|
34
|
+
private readonly client;
|
|
35
|
+
private readonly defaultLocationId?;
|
|
36
|
+
constructor(client: SquareClient, defaultLocationId?: string | undefined);
|
|
37
|
+
/**
|
|
38
|
+
* Create a payment
|
|
39
|
+
*
|
|
40
|
+
* @param options - Payment creation options
|
|
41
|
+
* @returns Created payment
|
|
42
|
+
*
|
|
43
|
+
* @throws {SquarePaymentError} When payment processing fails
|
|
44
|
+
* @throws {SquareValidationError} When input validation fails
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* // Simple payment
|
|
49
|
+
* const payment = await square.payments.create({
|
|
50
|
+
* sourceId: 'cnon:card-nonce-ok',
|
|
51
|
+
* amount: 1000, // $10.00 in cents
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* // Payment with all options
|
|
55
|
+
* const payment = await square.payments.create({
|
|
56
|
+
* sourceId: 'cnon:card-nonce-ok',
|
|
57
|
+
* amount: 1000,
|
|
58
|
+
* currency: 'USD',
|
|
59
|
+
* customerId: 'CUST_123',
|
|
60
|
+
* orderId: 'ORDER_123',
|
|
61
|
+
* note: 'Payment for order #123',
|
|
62
|
+
* autocomplete: true,
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
create(options: CreatePaymentOptions): Promise<Payment>;
|
|
67
|
+
/**
|
|
68
|
+
* Get a payment by ID
|
|
69
|
+
*
|
|
70
|
+
* @param paymentId - Payment ID
|
|
71
|
+
* @returns Payment details
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const payment = await square.payments.get('PAYMENT_123');
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
get(paymentId: string): Promise<Payment>;
|
|
79
|
+
/**
|
|
80
|
+
* Cancel a payment
|
|
81
|
+
*
|
|
82
|
+
* @param paymentId - Payment ID to cancel
|
|
83
|
+
* @returns Cancelled payment
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const payment = await square.payments.cancel('PAYMENT_123');
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
cancel(paymentId: string): Promise<Payment>;
|
|
91
|
+
/**
|
|
92
|
+
* Complete a payment (for payments created with autocomplete: false)
|
|
93
|
+
*
|
|
94
|
+
* @param paymentId - Payment ID to complete
|
|
95
|
+
* @returns Completed payment
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const payment = await square.payments.complete('PAYMENT_123');
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
complete(paymentId: string): Promise<Payment>;
|
|
103
|
+
/**
|
|
104
|
+
* List payments with optional filters
|
|
105
|
+
*
|
|
106
|
+
* @param options - List options
|
|
107
|
+
* @returns Array of payments
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const payments = await square.payments.list({
|
|
112
|
+
* limit: 10,
|
|
113
|
+
* });
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
list(options?: {
|
|
117
|
+
limit?: number;
|
|
118
|
+
locationId?: string;
|
|
119
|
+
}): Promise<Payment[]>;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=payments.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/payments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAgB,MAAM,mBAAmB,CAAC;AAI5E;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MA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.js';
|
|
2
|
+
import { createIdempotencyKey } from '../utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Simplified payments service
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const payment = await square.payments.create({
|
|
9
|
+
* sourceId: 'cnon:card-nonce-ok',
|
|
10
|
+
* amount: 1000, // $10.00 in cents
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export class PaymentsService {
|
|
15
|
+
client;
|
|
16
|
+
defaultLocationId;
|
|
17
|
+
constructor(client, defaultLocationId) {
|
|
18
|
+
this.client = client;
|
|
19
|
+
this.defaultLocationId = defaultLocationId;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create a payment
|
|
23
|
+
*
|
|
24
|
+
* @param options - Payment creation options
|
|
25
|
+
* @returns Created payment
|
|
26
|
+
*
|
|
27
|
+
* @throws {SquarePaymentError} When payment processing fails
|
|
28
|
+
* @throws {SquareValidationError} When input validation fails
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Simple payment
|
|
33
|
+
* const payment = await square.payments.create({
|
|
34
|
+
* sourceId: 'cnon:card-nonce-ok',
|
|
35
|
+
* amount: 1000, // $10.00 in cents
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // Payment with all options
|
|
39
|
+
* const payment = await square.payments.create({
|
|
40
|
+
* sourceId: 'cnon:card-nonce-ok',
|
|
41
|
+
* amount: 1000,
|
|
42
|
+
* currency: 'USD',
|
|
43
|
+
* customerId: 'CUST_123',
|
|
44
|
+
* orderId: 'ORDER_123',
|
|
45
|
+
* note: 'Payment for order #123',
|
|
46
|
+
* autocomplete: true,
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
async create(options) {
|
|
51
|
+
// Validate required fields
|
|
52
|
+
if (!options.sourceId) {
|
|
53
|
+
throw new SquareValidationError('sourceId is required', 'sourceId');
|
|
54
|
+
}
|
|
55
|
+
if (options.amount <= 0) {
|
|
56
|
+
throw new SquareValidationError('amount must be greater than 0', 'amount');
|
|
57
|
+
}
|
|
58
|
+
const locationId = this.defaultLocationId;
|
|
59
|
+
if (!locationId) {
|
|
60
|
+
throw new SquareValidationError('locationId is required. Set it in client config or provide it explicitly.', 'locationId');
|
|
61
|
+
}
|
|
62
|
+
const currency = options.currency ?? 'USD';
|
|
63
|
+
try {
|
|
64
|
+
const response = await this.client.payments.create({
|
|
65
|
+
sourceId: options.sourceId,
|
|
66
|
+
idempotencyKey: options.idempotencyKey ?? createIdempotencyKey(),
|
|
67
|
+
amountMoney: {
|
|
68
|
+
amount: BigInt(options.amount),
|
|
69
|
+
currency,
|
|
70
|
+
},
|
|
71
|
+
customerId: options.customerId,
|
|
72
|
+
orderId: options.orderId,
|
|
73
|
+
referenceId: options.referenceId,
|
|
74
|
+
note: options.note,
|
|
75
|
+
autocomplete: options.autocomplete ?? true,
|
|
76
|
+
locationId,
|
|
77
|
+
});
|
|
78
|
+
if (!response.payment) {
|
|
79
|
+
throw new Error('Payment was not created');
|
|
80
|
+
}
|
|
81
|
+
return response.payment;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
throw parseSquareError(error);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get a payment by ID
|
|
89
|
+
*
|
|
90
|
+
* @param paymentId - Payment ID
|
|
91
|
+
* @returns Payment details
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const payment = await square.payments.get('PAYMENT_123');
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
async get(paymentId) {
|
|
99
|
+
try {
|
|
100
|
+
const response = await this.client.payments.get({ paymentId });
|
|
101
|
+
if (!response.payment) {
|
|
102
|
+
throw new Error('Payment not found');
|
|
103
|
+
}
|
|
104
|
+
return response.payment;
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
throw parseSquareError(error);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Cancel a payment
|
|
112
|
+
*
|
|
113
|
+
* @param paymentId - Payment ID to cancel
|
|
114
|
+
* @returns Cancelled payment
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const payment = await square.payments.cancel('PAYMENT_123');
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
async cancel(paymentId) {
|
|
122
|
+
try {
|
|
123
|
+
const response = await this.client.payments.cancel({ paymentId });
|
|
124
|
+
if (!response.payment) {
|
|
125
|
+
throw new Error('Payment cancellation failed');
|
|
126
|
+
}
|
|
127
|
+
return response.payment;
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
throw parseSquareError(error);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Complete a payment (for payments created with autocomplete: false)
|
|
135
|
+
*
|
|
136
|
+
* @param paymentId - Payment ID to complete
|
|
137
|
+
* @returns Completed payment
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const payment = await square.payments.complete('PAYMENT_123');
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
async complete(paymentId) {
|
|
145
|
+
try {
|
|
146
|
+
const response = await this.client.payments.complete({ paymentId });
|
|
147
|
+
if (!response.payment) {
|
|
148
|
+
throw new Error('Payment completion failed');
|
|
149
|
+
}
|
|
150
|
+
return response.payment;
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
throw parseSquareError(error);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* List payments with optional filters
|
|
158
|
+
*
|
|
159
|
+
* @param options - List options
|
|
160
|
+
* @returns Array of payments
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* const payments = await square.payments.list({
|
|
165
|
+
* limit: 10,
|
|
166
|
+
* });
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
async list(options) {
|
|
170
|
+
try {
|
|
171
|
+
const payments = [];
|
|
172
|
+
const limit = options?.limit ?? 100;
|
|
173
|
+
const page = await this.client.payments.list({
|
|
174
|
+
locationId: options?.locationId ?? this.defaultLocationId,
|
|
175
|
+
});
|
|
176
|
+
for await (const payment of page) {
|
|
177
|
+
payments.push(payment);
|
|
178
|
+
if (payments.length >= limit) {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return payments;
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
throw parseSquareError(error);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=payments.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.service.js","sourceRoot":"","sources":["../../../src/core/services/payments.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAsBnD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eAAe;IAEP;IACA;IAFnB,YACmB,MAAoB,EACpB,iBAA0B;QAD1B,WAAM,GAAN,MAAM,CAAc;QACpB,sBAAiB,GAAjB,iBAAiB,CAAS;IAC1C,CAAC;IAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,KAAK,CAAC,MAAM,CAAC,OAA6B;QACxC,2BAA2B;QAC3B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAI,qBAAqB,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;QACtE,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;Y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AAC,IAAI,CAAC,OAGV;QACC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAc,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,GAAG,CAAC;YAEpC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC3C,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,IAAI,CAAC,iBAAiB;aAC1D,CAAC,CAAC;YAEH,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,IAAI,EAAE,CAAC;gBACjC,QAAQ,CAAC,IAAI,CAAC,OAAkB,CAAC,CAAC;gBAClC,IAAI,QAAQ,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;oBAC7B,MAAM;gBACR,CAAC;YACH,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { SquareClient } from 'square';
|
|
2
|
+
/**
|
|
3
|
+
* Subscription status types
|
|
4
|
+
*/
|
|
5
|
+
export type SubscriptionStatus = 'PENDING' | 'ACTIVE' | 'CANCELED' | 'DEACTIVATED' | 'PAUSED';
|
|
6
|
+
/**
|
|
7
|
+
* Subscription cadence types
|
|
8
|
+
*/
|
|
9
|
+
export type SubscriptionCadence = 'DAILY' | 'WEEKLY' | 'EVERY_TWO_WEEKS' | 'THIRTY_DAYS' | 'SIXTY_DAYS' | 'NINETY_DAYS' | 'MONTHLY' | 'EVERY_TWO_MONTHS' | 'QUARTERLY' | 'EVERY_FOUR_MONTHS' | 'EVERY_SIX_MONTHS' | 'ANNUAL' | 'EVERY_TWO_YEARS';
|
|
10
|
+
/**
|
|
11
|
+
* Subscription from Square API
|
|
12
|
+
*/
|
|
13
|
+
export interface Subscription {
|
|
14
|
+
id?: string;
|
|
15
|
+
locationId?: string;
|
|
16
|
+
planVariationId?: string;
|
|
17
|
+
customerId?: string;
|
|
18
|
+
startDate?: string;
|
|
19
|
+
canceledDate?: string;
|
|
20
|
+
chargedThroughDate?: string;
|
|
21
|
+
status?: SubscriptionStatus;
|
|
22
|
+
taxPercentage?: string;
|
|
23
|
+
invoiceIds?: string[];
|
|
24
|
+
priceOverrideMoney?: {
|
|
25
|
+
amount?: bigint;
|
|
26
|
+
currency?: string;
|
|
27
|
+
};
|
|
28
|
+
version?: bigint;
|
|
29
|
+
createdAt?: string;
|
|
30
|
+
cardId?: string;
|
|
31
|
+
timezone?: string;
|
|
32
|
+
source?: {
|
|
33
|
+
name?: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Subscription plan from Square API
|
|
38
|
+
*/
|
|
39
|
+
export interface SubscriptionPlan {
|
|
40
|
+
id?: string;
|
|
41
|
+
type?: string;
|
|
42
|
+
subscriptionPlanData?: {
|
|
43
|
+
name?: string;
|
|
44
|
+
subscriptionPlanVariations?: Array<{
|
|
45
|
+
id?: string;
|
|
46
|
+
subscriptionPlanVariationData?: {
|
|
47
|
+
name?: string;
|
|
48
|
+
phases?: Array<{
|
|
49
|
+
cadence?: SubscriptionCadence;
|
|
50
|
+
recurringPriceMoney?: {
|
|
51
|
+
amount?: bigint;
|
|
52
|
+
currency?: string;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Options for creating a subscription
|
|
61
|
+
*/
|
|
62
|
+
export interface CreateSubscriptionOptions {
|
|
63
|
+
customerId: string;
|
|
64
|
+
planVariationId: string;
|
|
65
|
+
locationId?: string;
|
|
66
|
+
startDate?: string;
|
|
67
|
+
cardId?: string;
|
|
68
|
+
timezone?: string;
|
|
69
|
+
priceOverride?: number;
|
|
70
|
+
taxPercentage?: string;
|
|
71
|
+
idempotencyKey?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Subscriptions service for managing Square subscriptions
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* // Create a subscription
|
|
79
|
+
* const subscription = await square.subscriptions.create({
|
|
80
|
+
* customerId: 'CUST_123',
|
|
81
|
+
* planVariationId: 'PLAN_VAR_123',
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* // Cancel a subscription
|
|
85
|
+
* await square.subscriptions.cancel('SUB_123');
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare class SubscriptionsService {
|
|
89
|
+
private readonly client;
|
|
90
|
+
private readonly defaultLocationId?;
|
|
91
|
+
constructor(client: SquareClient, defaultLocationId?: string | undefined);
|
|
92
|
+
/**
|
|
93
|
+
* Create a new subscription
|
|
94
|
+
*
|
|
95
|
+
* @param options - Subscription creation options
|
|
96
|
+
* @returns Created subscription
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const subscription = await square.subscriptions.create({
|
|
101
|
+
* customerId: 'CUST_123',
|
|
102
|
+
* planVariationId: 'PLAN_VAR_123',
|
|
103
|
+
* startDate: '2024-02-01',
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
create(options: CreateSubscriptionOptions): Promise<Subscription>;
|
|
108
|
+
/**
|
|
109
|
+
* Get a subscription by ID
|
|
110
|
+
*
|
|
111
|
+
* @param subscriptionId - Subscription ID
|
|
112
|
+
* @returns Subscription details
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* const subscription = await square.subscriptions.get('SUB_123');
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
get(subscriptionId: string): Promise<Subscription>;
|
|
120
|
+
/**
|
|
121
|
+
* Update a subscription
|
|
122
|
+
*
|
|
123
|
+
* @param subscriptionId - Subscription ID
|
|
124
|
+
* @param options - Update options
|
|
125
|
+
* @returns Updated subscription
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* const subscription = await square.subscriptions.update('SUB_123', {
|
|
130
|
+
* priceOverride: 1500,
|
|
131
|
+
* });
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
update(subscriptionId: string, options: {
|
|
135
|
+
priceOverride?: number;
|
|
136
|
+
cardId?: string;
|
|
137
|
+
taxPercentage?: string;
|
|
138
|
+
}): Promise<Subscription>;
|
|
139
|
+
/**
|
|
140
|
+
* Cancel a subscription
|
|
141
|
+
*
|
|
142
|
+
* @param subscriptionId - Subscription ID to cancel
|
|
143
|
+
* @returns Cancelled subscription
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const subscription = await square.subscriptions.cancel('SUB_123');
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
cancel(subscriptionId: string): Promise<Subscription>;
|
|
151
|
+
/**
|
|
152
|
+
* Pause a subscription
|
|
153
|
+
*
|
|
154
|
+
* @param subscriptionId - Subscription ID to pause
|
|
155
|
+
* @param options - Pause options
|
|
156
|
+
* @returns Paused subscription
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const subscription = await square.subscriptions.pause('SUB_123', {
|
|
161
|
+
* pauseEffectiveDate: '2024-03-01',
|
|
162
|
+
* });
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
pause(subscriptionId: string, options?: {
|
|
166
|
+
pauseEffectiveDate?: string;
|
|
167
|
+
pauseCycleDuration?: number;
|
|
168
|
+
}): Promise<Subscription>;
|
|
169
|
+
/**
|
|
170
|
+
* Resume a paused subscription
|
|
171
|
+
*
|
|
172
|
+
* @param subscriptionId - Subscription ID to resume
|
|
173
|
+
* @param resumeEffectiveDate - Optional date to resume
|
|
174
|
+
* @returns Resumed subscription
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```typescript
|
|
178
|
+
* const subscription = await square.subscriptions.resume('SUB_123');
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
resume(subscriptionId: string, resumeEffectiveDate?: string): Promise<Subscription>;
|
|
182
|
+
/**
|
|
183
|
+
* Search for subscriptions
|
|
184
|
+
*
|
|
185
|
+
* @param options - Search options
|
|
186
|
+
* @returns Matching subscriptions with pagination
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```typescript
|
|
190
|
+
* const results = await square.subscriptions.search({
|
|
191
|
+
* customerId: 'CUST_123',
|
|
192
|
+
* });
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
search(options?: {
|
|
196
|
+
customerId?: string;
|
|
197
|
+
locationIds?: string[];
|
|
198
|
+
cursor?: string;
|
|
199
|
+
limit?: number;
|
|
200
|
+
}): Promise<{
|
|
201
|
+
data: Subscription[];
|
|
202
|
+
cursor?: string;
|
|
203
|
+
}>;
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=subscriptions.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/subscriptions.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAI3C;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE9F;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,OAAO,GACP,QAAQ,GACR,iBAAiB,GACjB,aAAa,GACb,YAAY,GACZ,aAAa,GACb,SAAS,GACT,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,kBAAkB,GAClB,QAAQ,GACR,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,WAA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