@bates-solutions/squareup 0.2.0 → 1.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/README.md +91 -88
- package/dist/core/services/catalog.service.d.ts +61 -1
- package/dist/core/services/catalog.service.d.ts.map +1 -1
- package/dist/core/services/catalog.service.js +47 -0
- package/dist/core/services/catalog.service.js.map +1 -1
- package/package.json +7 -41
- package/dist/angular/__tests__/setup.d.ts +0 -1
- package/dist/angular/__tests__/setup.d.ts.map +0 -1
- package/dist/angular/__tests__/setup.js +0 -5
- package/dist/angular/__tests__/setup.js.map +0 -1
- package/dist/angular/components/index.d.ts +0 -2
- package/dist/angular/components/index.d.ts.map +0 -1
- package/dist/angular/components/index.js +0 -2
- package/dist/angular/components/index.js.map +0 -1
- package/dist/angular/components/payment-button.component.d.ts +0 -49
- package/dist/angular/components/payment-button.component.d.ts.map +0 -1
- package/dist/angular/components/payment-button.component.js +0 -176
- package/dist/angular/components/payment-button.component.js.map +0 -1
- package/dist/angular/directives/index.d.ts +0 -2
- package/dist/angular/directives/index.d.ts.map +0 -1
- package/dist/angular/directives/index.js +0 -2
- package/dist/angular/directives/index.js.map +0 -1
- package/dist/angular/directives/square-card.directive.d.ts +0 -52
- package/dist/angular/directives/square-card.directive.d.ts.map +0 -1
- package/dist/angular/directives/square-card.directive.js +0 -98
- package/dist/angular/directives/square-card.directive.js.map +0 -1
- package/dist/angular/index.d.ts +0 -42
- package/dist/angular/index.d.ts.map +0 -1
- package/dist/angular/index.js +0 -45
- package/dist/angular/index.js.map +0 -1
- package/dist/angular/services/index.d.ts +0 -6
- package/dist/angular/services/index.d.ts.map +0 -1
- package/dist/angular/services/index.js +0 -6
- package/dist/angular/services/index.js.map +0 -1
- package/dist/angular/services/square-catalog.service.d.ts +0 -60
- package/dist/angular/services/square-catalog.service.d.ts.map +0 -1
- package/dist/angular/services/square-catalog.service.js +0 -152
- package/dist/angular/services/square-catalog.service.js.map +0 -1
- package/dist/angular/services/square-customers.service.d.ts +0 -77
- package/dist/angular/services/square-customers.service.d.ts.map +0 -1
- package/dist/angular/services/square-customers.service.js +0 -187
- package/dist/angular/services/square-customers.service.js.map +0 -1
- package/dist/angular/services/square-orders.service.d.ts +0 -66
- package/dist/angular/services/square-orders.service.d.ts.map +0 -1
- package/dist/angular/services/square-orders.service.js +0 -170
- package/dist/angular/services/square-orders.service.js.map +0 -1
- package/dist/angular/services/square-payments.service.d.ts +0 -73
- package/dist/angular/services/square-payments.service.d.ts.map +0 -1
- package/dist/angular/services/square-payments.service.js +0 -167
- package/dist/angular/services/square-payments.service.js.map +0 -1
- package/dist/angular/services/square-sdk.service.d.ts +0 -45
- package/dist/angular/services/square-sdk.service.d.ts.map +0 -1
- package/dist/angular/services/square-sdk.service.js +0 -133
- package/dist/angular/services/square-sdk.service.js.map +0 -1
- package/dist/angular/square.module.d.ts +0 -36
- package/dist/angular/square.module.d.ts.map +0 -1
- package/dist/angular/square.module.js +0 -75
- package/dist/angular/square.module.js.map +0 -1
- package/dist/angular/types.d.ts +0 -189
- package/dist/angular/types.d.ts.map +0 -1
- package/dist/angular/types.js +0 -8
- package/dist/angular/types.js.map +0 -1
- package/dist/react/SquareProvider.d.ts +0 -50
- package/dist/react/SquareProvider.d.ts.map +0 -1
- package/dist/react/SquareProvider.js +0 -134
- package/dist/react/SquareProvider.js.map +0 -1
- package/dist/react/__tests__/CardInput.test.d.ts +0 -2
- package/dist/react/__tests__/CardInput.test.d.ts.map +0 -1
- package/dist/react/__tests__/CardInput.test.js +0 -218
- package/dist/react/__tests__/CardInput.test.js.map +0 -1
- package/dist/react/__tests__/PaymentButton.test.d.ts +0 -2
- package/dist/react/__tests__/PaymentButton.test.d.ts.map +0 -1
- package/dist/react/__tests__/PaymentButton.test.js +0 -400
- package/dist/react/__tests__/PaymentButton.test.js.map +0 -1
- package/dist/react/__tests__/SquareProvider.test.d.ts +0 -2
- package/dist/react/__tests__/SquareProvider.test.d.ts.map +0 -1
- package/dist/react/__tests__/SquareProvider.test.js +0 -126
- package/dist/react/__tests__/SquareProvider.test.js.map +0 -1
- package/dist/react/__tests__/setup.d.ts +0 -2
- package/dist/react/__tests__/setup.d.ts.map +0 -1
- package/dist/react/__tests__/setup.js +0 -3
- package/dist/react/__tests__/setup.js.map +0 -1
- package/dist/react/__tests__/useCatalog.test.d.ts +0 -2
- package/dist/react/__tests__/useCatalog.test.d.ts.map +0 -1
- package/dist/react/__tests__/useCatalog.test.js +0 -277
- package/dist/react/__tests__/useCatalog.test.js.map +0 -1
- package/dist/react/__tests__/useCustomers.test.d.ts +0 -2
- package/dist/react/__tests__/useCustomers.test.d.ts.map +0 -1
- package/dist/react/__tests__/useCustomers.test.js +0 -312
- package/dist/react/__tests__/useCustomers.test.js.map +0 -1
- package/dist/react/__tests__/useOrders.test.d.ts +0 -2
- package/dist/react/__tests__/useOrders.test.d.ts.map +0 -1
- package/dist/react/__tests__/useOrders.test.js +0 -216
- package/dist/react/__tests__/useOrders.test.js.map +0 -1
- package/dist/react/__tests__/usePayments.test.d.ts +0 -2
- package/dist/react/__tests__/usePayments.test.d.ts.map +0 -1
- package/dist/react/__tests__/usePayments.test.js +0 -235
- package/dist/react/__tests__/usePayments.test.js.map +0 -1
- package/dist/react/__tests__/useSquarePayment.test.d.ts +0 -2
- package/dist/react/__tests__/useSquarePayment.test.d.ts.map +0 -1
- package/dist/react/__tests__/useSquarePayment.test.js +0 -447
- package/dist/react/__tests__/useSquarePayment.test.js.map +0 -1
- package/dist/react/components/CardInput.d.ts +0 -69
- package/dist/react/components/CardInput.d.ts.map +0 -1
- package/dist/react/components/CardInput.js +0 -58
- package/dist/react/components/CardInput.js.map +0 -1
- package/dist/react/components/PaymentButton.d.ts +0 -71
- package/dist/react/components/PaymentButton.d.ts.map +0 -1
- package/dist/react/components/PaymentButton.js +0 -140
- package/dist/react/components/PaymentButton.js.map +0 -1
- package/dist/react/components/index.d.ts +0 -5
- package/dist/react/components/index.d.ts.map +0 -1
- package/dist/react/components/index.js +0 -3
- package/dist/react/components/index.js.map +0 -1
- package/dist/react/hooks/index.d.ts +0 -11
- package/dist/react/hooks/index.d.ts.map +0 -1
- package/dist/react/hooks/index.js +0 -6
- package/dist/react/hooks/index.js.map +0 -1
- package/dist/react/hooks/useCatalog.d.ts +0 -98
- package/dist/react/hooks/useCatalog.d.ts.map +0 -1
- package/dist/react/hooks/useCatalog.js +0 -134
- package/dist/react/hooks/useCatalog.js.map +0 -1
- package/dist/react/hooks/useCustomers.d.ts +0 -105
- package/dist/react/hooks/useCustomers.d.ts.map +0 -1
- package/dist/react/hooks/useCustomers.js +0 -174
- package/dist/react/hooks/useCustomers.js.map +0 -1
- package/dist/react/hooks/useOrders.d.ts +0 -112
- package/dist/react/hooks/useOrders.d.ts.map +0 -1
- package/dist/react/hooks/useOrders.js +0 -115
- package/dist/react/hooks/useOrders.js.map +0 -1
- package/dist/react/hooks/usePayments.d.ts +0 -98
- package/dist/react/hooks/usePayments.d.ts.map +0 -1
- package/dist/react/hooks/usePayments.js +0 -89
- package/dist/react/hooks/usePayments.js.map +0 -1
- package/dist/react/hooks/useSquarePayment.d.ts +0 -52
- package/dist/react/hooks/useSquarePayment.d.ts.map +0 -1
- package/dist/react/hooks/useSquarePayment.js +0 -146
- package/dist/react/hooks/useSquarePayment.js.map +0 -1
- package/dist/react/index.d.ts +0 -8
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -7
- package/dist/react/index.js.map +0 -1
- package/dist/react/types.d.ts +0 -183
- package/dist/react/types.d.ts.map +0 -1
- package/dist/react/types.js +0 -2
- package/dist/react/types.js.map +0 -1
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { Component, Input, Output, EventEmitter, ElementRef, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef, } from '@angular/core';
|
|
11
|
-
import { SquareSdkService } from '../services/square-sdk.service.js';
|
|
12
|
-
/**
|
|
13
|
-
* Payment button component for Google Pay / Apple Pay
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```html
|
|
17
|
-
* <square-payment-button
|
|
18
|
-
* type="googlePay"
|
|
19
|
-
* (payment)="onPayment($event)"
|
|
20
|
-
* (error)="onError($event)"
|
|
21
|
-
* ></square-payment-button>
|
|
22
|
-
*
|
|
23
|
-
* <square-payment-button
|
|
24
|
-
* type="applePay"
|
|
25
|
-
* [buttonOptions]="{ buttonColor: 'black' }"
|
|
26
|
-
* (payment)="onPayment($event)"
|
|
27
|
-
* ></square-payment-button>
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
let PaymentButtonComponent = class PaymentButtonComponent {
|
|
31
|
-
sdk;
|
|
32
|
-
cdr;
|
|
33
|
-
/** Payment method type */
|
|
34
|
-
type = 'googlePay';
|
|
35
|
-
/** Button styling options */
|
|
36
|
-
buttonOptions;
|
|
37
|
-
/** Emits when button is ready */
|
|
38
|
-
buttonReady = new EventEmitter();
|
|
39
|
-
/** Emits payment token on success */
|
|
40
|
-
payment = new EventEmitter();
|
|
41
|
-
/** Emits when an error occurs */
|
|
42
|
-
error = new EventEmitter();
|
|
43
|
-
/** Emits when payment is cancelled */
|
|
44
|
-
cancel = new EventEmitter();
|
|
45
|
-
containerRef;
|
|
46
|
-
paymentMethod = null;
|
|
47
|
-
subscription;
|
|
48
|
-
ready = false;
|
|
49
|
-
loading = false;
|
|
50
|
-
constructor(sdk, cdr) {
|
|
51
|
-
this.sdk = sdk;
|
|
52
|
-
this.cdr = cdr;
|
|
53
|
-
}
|
|
54
|
-
ngOnInit() {
|
|
55
|
-
this.subscription = this.sdk.whenReady().subscribe({
|
|
56
|
-
next: (payments) => {
|
|
57
|
-
void this.initializePaymentMethod(payments);
|
|
58
|
-
},
|
|
59
|
-
error: (err) => {
|
|
60
|
-
this.error.emit(err);
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
ngOnDestroy() {
|
|
65
|
-
this.subscription?.unsubscribe();
|
|
66
|
-
if (this.paymentMethod) {
|
|
67
|
-
void this.paymentMethod.destroy();
|
|
68
|
-
this.paymentMethod = null;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
handleClick() {
|
|
72
|
-
if (!this.paymentMethod || this.loading) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
void this.tokenize();
|
|
76
|
-
}
|
|
77
|
-
async initializePaymentMethod(payments) {
|
|
78
|
-
try {
|
|
79
|
-
if (this.type === 'googlePay') {
|
|
80
|
-
this.paymentMethod = await payments.googlePay({});
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
this.paymentMethod = await payments.applePay({});
|
|
84
|
-
}
|
|
85
|
-
await this.paymentMethod.attach(this.containerRef.nativeElement, this.buttonOptions);
|
|
86
|
-
this.ready = true;
|
|
87
|
-
this.buttonReady.emit();
|
|
88
|
-
this.cdr.markForCheck();
|
|
89
|
-
}
|
|
90
|
-
catch (err) {
|
|
91
|
-
const error = err instanceof Error ? err : new Error(`Failed to initialize ${this.type}`);
|
|
92
|
-
this.error.emit(error);
|
|
93
|
-
this.cdr.markForCheck();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
async tokenize() {
|
|
97
|
-
if (!this.paymentMethod) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
this.loading = true;
|
|
101
|
-
this.cdr.markForCheck();
|
|
102
|
-
try {
|
|
103
|
-
const result = await this.paymentMethod.tokenize();
|
|
104
|
-
if (result.status === 'OK' && result.token) {
|
|
105
|
-
this.payment.emit(result.token);
|
|
106
|
-
}
|
|
107
|
-
else if (result.status === 'Cancel') {
|
|
108
|
-
this.cancel.emit();
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
const errorMessage = result.errors?.map((e) => e.message).join(', ') ?? 'Payment failed';
|
|
112
|
-
throw new Error(errorMessage);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
catch (err) {
|
|
116
|
-
const error = err instanceof Error ? err : new Error('Payment failed');
|
|
117
|
-
this.error.emit(error);
|
|
118
|
-
}
|
|
119
|
-
finally {
|
|
120
|
-
this.loading = false;
|
|
121
|
-
this.cdr.markForCheck();
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
__decorate([
|
|
126
|
-
Input(),
|
|
127
|
-
__metadata("design:type", String)
|
|
128
|
-
], PaymentButtonComponent.prototype, "type", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
Input(),
|
|
131
|
-
__metadata("design:type", Object)
|
|
132
|
-
], PaymentButtonComponent.prototype, "buttonOptions", void 0);
|
|
133
|
-
__decorate([
|
|
134
|
-
Output(),
|
|
135
|
-
__metadata("design:type", Object)
|
|
136
|
-
], PaymentButtonComponent.prototype, "buttonReady", void 0);
|
|
137
|
-
__decorate([
|
|
138
|
-
Output(),
|
|
139
|
-
__metadata("design:type", Object)
|
|
140
|
-
], PaymentButtonComponent.prototype, "payment", void 0);
|
|
141
|
-
__decorate([
|
|
142
|
-
Output(),
|
|
143
|
-
__metadata("design:type", Object)
|
|
144
|
-
], PaymentButtonComponent.prototype, "error", void 0);
|
|
145
|
-
__decorate([
|
|
146
|
-
Output(),
|
|
147
|
-
__metadata("design:type", Object)
|
|
148
|
-
], PaymentButtonComponent.prototype, "cancel", void 0);
|
|
149
|
-
__decorate([
|
|
150
|
-
ViewChild('buttonContainer', { static: true }),
|
|
151
|
-
__metadata("design:type", ElementRef)
|
|
152
|
-
], PaymentButtonComponent.prototype, "containerRef", void 0);
|
|
153
|
-
PaymentButtonComponent = __decorate([
|
|
154
|
-
Component({
|
|
155
|
-
selector: 'square-payment-button',
|
|
156
|
-
standalone: true,
|
|
157
|
-
template: `
|
|
158
|
-
<div
|
|
159
|
-
#buttonContainer
|
|
160
|
-
[style.minHeight.px]="48"
|
|
161
|
-
[style.cursor]="ready && !loading ? 'pointer' : 'default'"
|
|
162
|
-
[style.opacity]="loading ? 0.7 : 1"
|
|
163
|
-
(click)="handleClick()"
|
|
164
|
-
role="button"
|
|
165
|
-
[attr.tabindex]="ready ? 0 : -1"
|
|
166
|
-
[attr.aria-disabled]="!ready || loading"
|
|
167
|
-
[attr.aria-label]="'Pay with ' + (type === 'googlePay' ? 'Google Pay' : 'Apple Pay')"
|
|
168
|
-
></div>
|
|
169
|
-
`,
|
|
170
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
171
|
-
}),
|
|
172
|
-
__metadata("design:paramtypes", [SquareSdkService,
|
|
173
|
-
ChangeDetectorRef])
|
|
174
|
-
], PaymentButtonComponent);
|
|
175
|
-
export { PaymentButtonComponent };
|
|
176
|
-
//# sourceMappingURL=payment-button.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payment-button.component.js","sourceRoot":"","sources":["../../../src/angular/components/payment-button.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EAGV,SAAS,EACT,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE;;;;;;;;;;;;;;;;;GAiBG;AAmB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AU;4DAAc;AApBpC,sBAAsB;IAlBlC,SAAS,CAAC;QACT,QAAQ,EAAE,uBAAuB;QACjC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE;;;;;;;;;;;;GAYT;QACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;KAChD,CAAC;qCA8Be,gBAAgB;QAChB,iBAAiB;GA9BrB,sBAAsB,CAiHlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/angular/directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/angular/directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ElementRef, OnInit, OnDestroy, EventEmitter } from '@angular/core';
|
|
2
|
-
import { SquarePaymentsService } from '../services/square-payments.service.js';
|
|
3
|
-
import type { CardOptions } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Directive for attaching Square card input to an element
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```html
|
|
9
|
-
* <div
|
|
10
|
-
* squareCard
|
|
11
|
-
* [cardOptions]="{ style: { input: { fontSize: '16px' } } }"
|
|
12
|
-
* (cardReady)="onCardReady()"
|
|
13
|
-
* (cardError)="onCardError($event)"
|
|
14
|
-
* ></div>
|
|
15
|
-
*
|
|
16
|
-
* <button (click)="pay()" [disabled]="!cardReady">Pay</button>
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* ```typescript
|
|
20
|
-
* @Component({...})
|
|
21
|
-
* export class CheckoutComponent {
|
|
22
|
-
* cardReady = false;
|
|
23
|
-
*
|
|
24
|
-
* constructor(private payments: SquarePaymentsService) {}
|
|
25
|
-
*
|
|
26
|
-
* onCardReady() {
|
|
27
|
-
* this.cardReady = true;
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* pay() {
|
|
31
|
-
* this.payments.tokenize().subscribe(token => {
|
|
32
|
-
* console.log('Token:', token);
|
|
33
|
-
* });
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare class SquareCardDirective implements OnInit, OnDestroy {
|
|
39
|
-
private elementRef;
|
|
40
|
-
private payments;
|
|
41
|
-
/** Card styling options */
|
|
42
|
-
cardOptions?: CardOptions;
|
|
43
|
-
/** Emits when card input is ready */
|
|
44
|
-
cardReady: EventEmitter<void>;
|
|
45
|
-
/** Emits when an error occurs */
|
|
46
|
-
cardError: EventEmitter<Error>;
|
|
47
|
-
private subscription?;
|
|
48
|
-
constructor(elementRef: ElementRef<HTMLElement>, payments: SquarePaymentsService);
|
|
49
|
-
ngOnInit(): void;
|
|
50
|
-
ngOnDestroy(): void;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=square-card.directive.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"square-card.directive.d.ts","sourceRoot":"","sources":["../../../src/angular/directives/square-card.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,MAAM,EACN,SAAS,EAET,YAAY,EAEb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAIa,mBAAoB,YAAW,MAAM,EAAE,SAAS;IAazD,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,QAAQ;IAblB,2BAA2B;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAEnC,qCAAqC;IAC3B,SAAS,qBAA4B;IAE/C,iCAAiC;IACvB,SAAS,sBAA6B;IAEhD,OAAO,CAAC,YAAY,CAAC,CAAe;gBAG1B,UAAU,EAAE,UAAU,CAAC,WAAW,CAAC,EACnC,QAAQ,EAAE,qBAAqB;IAGzC,QAAQ,IAAI,IAAI;IAahB,WAAW,IAAI,IAAI;CAIpB"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { Directive, ElementRef, Output, EventEmitter, Input, } from '@angular/core';
|
|
11
|
-
import { SquarePaymentsService } from '../services/square-payments.service.js';
|
|
12
|
-
/**
|
|
13
|
-
* Directive for attaching Square card input to an element
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```html
|
|
17
|
-
* <div
|
|
18
|
-
* squareCard
|
|
19
|
-
* [cardOptions]="{ style: { input: { fontSize: '16px' } } }"
|
|
20
|
-
* (cardReady)="onCardReady()"
|
|
21
|
-
* (cardError)="onCardError($event)"
|
|
22
|
-
* ></div>
|
|
23
|
-
*
|
|
24
|
-
* <button (click)="pay()" [disabled]="!cardReady">Pay</button>
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* ```typescript
|
|
28
|
-
* @Component({...})
|
|
29
|
-
* export class CheckoutComponent {
|
|
30
|
-
* cardReady = false;
|
|
31
|
-
*
|
|
32
|
-
* constructor(private payments: SquarePaymentsService) {}
|
|
33
|
-
*
|
|
34
|
-
* onCardReady() {
|
|
35
|
-
* this.cardReady = true;
|
|
36
|
-
* }
|
|
37
|
-
*
|
|
38
|
-
* pay() {
|
|
39
|
-
* this.payments.tokenize().subscribe(token => {
|
|
40
|
-
* console.log('Token:', token);
|
|
41
|
-
* });
|
|
42
|
-
* }
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
let SquareCardDirective = class SquareCardDirective {
|
|
47
|
-
elementRef;
|
|
48
|
-
payments;
|
|
49
|
-
/** Card styling options */
|
|
50
|
-
cardOptions;
|
|
51
|
-
/** Emits when card input is ready */
|
|
52
|
-
cardReady = new EventEmitter();
|
|
53
|
-
/** Emits when an error occurs */
|
|
54
|
-
cardError = new EventEmitter();
|
|
55
|
-
subscription;
|
|
56
|
-
constructor(elementRef, payments) {
|
|
57
|
-
this.elementRef = elementRef;
|
|
58
|
-
this.payments = payments;
|
|
59
|
-
}
|
|
60
|
-
ngOnInit() {
|
|
61
|
-
this.subscription = this.payments
|
|
62
|
-
.attachCard(this.elementRef.nativeElement, this.cardOptions)
|
|
63
|
-
.subscribe({
|
|
64
|
-
next: () => {
|
|
65
|
-
this.cardReady.emit();
|
|
66
|
-
},
|
|
67
|
-
error: (err) => {
|
|
68
|
-
this.cardError.emit(err);
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
ngOnDestroy() {
|
|
73
|
-
this.subscription?.unsubscribe();
|
|
74
|
-
this.payments.destroyCard();
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
__decorate([
|
|
78
|
-
Input(),
|
|
79
|
-
__metadata("design:type", Object)
|
|
80
|
-
], SquareCardDirective.prototype, "cardOptions", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
Output(),
|
|
83
|
-
__metadata("design:type", Object)
|
|
84
|
-
], SquareCardDirective.prototype, "cardReady", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
Output(),
|
|
87
|
-
__metadata("design:type", Object)
|
|
88
|
-
], SquareCardDirective.prototype, "cardError", void 0);
|
|
89
|
-
SquareCardDirective = __decorate([
|
|
90
|
-
Directive({
|
|
91
|
-
selector: '[squareCard]',
|
|
92
|
-
standalone: true,
|
|
93
|
-
}),
|
|
94
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
95
|
-
SquarePaymentsService])
|
|
96
|
-
], SquareCardDirective);
|
|
97
|
-
export { SquareCardDirective };
|
|
98
|
-
//# sourceMappingURL=square-card.directive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"square-card.directive.js","sourceRoot":"","sources":["../../../src/angular/directives/square-card.directive.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,UAAU,EAGV,MAAM,EACN,YAAY,EACZ,KAAK,GACN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAG/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAapB;IACA;IAbV,2BAA2B;IAClB,WAAW,CAAe;IAEnC,qCAAqC;IAC3B,SAAS,GAAG,IAAI,YAAY,EAAQ,CAAC;IAE/C,iCAAiC;IACvB,SAAS,GAAG,IAAI,YAAY,EAAS,CAAC;IAExC,YAAY,CAAgB;IAEpC,YACU,UAAmC,EACnC,QAA+B;QAD/B,eAAU,GAAV,UAAU,CAAyB;QACnC,aAAQ,GAAR,QAAQ,CAAuB;IACtC,CAAC;IAEJ,QAAQ;QACN,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ;aAC9B,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC;aAC3D,SAAS,CAAC;YACT,IAAI,EAAE,GAAG,EAAE;gBACT,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YACxB,CAAC;YACD,KAAK,EAAE,CAAC,GAAU,EAAE,EAAE;gBACpB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;SACF,CAAC,CAAC;IACP,CAAC;IAED,WAAW;QACT,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC;CACF,CAAA;AAhCU;IAAR,KAAK,EAAE;;wDAA2B;AAGzB;IAAT,MAAM,EAAE;;sDAAsC;AAGrC;IAAT,MAAM,EAAE;;sDAAuC;AARrC,mBAAmB;IAJ/B,SAAS,CAAC;QACT,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,IAAI;KACjB,CAAC;qCAcsB,UAAU;QACZ,qBAAqB;GAd9B,mBAAmB,CAkC/B"}
|
package/dist/angular/index.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @bates-solutions/squareup Angular integration
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import { SquareModule } from '@bates-solutions/squareup/angular';
|
|
7
|
-
*
|
|
8
|
-
* @NgModule({
|
|
9
|
-
* imports: [
|
|
10
|
-
* SquareModule.forRoot({
|
|
11
|
-
* applicationId: 'sq0idp-xxx',
|
|
12
|
-
* locationId: 'LXXX',
|
|
13
|
-
* environment: 'sandbox',
|
|
14
|
-
* })
|
|
15
|
-
* ]
|
|
16
|
-
* })
|
|
17
|
-
* export class AppModule {}
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* // Standalone component usage
|
|
23
|
-
* import { SquareCardDirective, PaymentButtonComponent } from '@bates-solutions/squareup/angular';
|
|
24
|
-
*
|
|
25
|
-
* @Component({
|
|
26
|
-
* standalone: true,
|
|
27
|
-
* imports: [SquareCardDirective, PaymentButtonComponent],
|
|
28
|
-
* template: `
|
|
29
|
-
* <div squareCard (cardReady)="ready = true"></div>
|
|
30
|
-
* <square-payment-button type="googlePay" (payment)="onPayment($event)">
|
|
31
|
-
* </square-payment-button>
|
|
32
|
-
* `
|
|
33
|
-
* })
|
|
34
|
-
* export class CheckoutComponent {}
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export { SquareModule, SQUARE_CONFIG } from './square.module.js';
|
|
38
|
-
export { SquareSdkService, SquarePaymentsService, SquareOrdersService, SquareCustomersService, SquareCatalogService, } from './services/index.js';
|
|
39
|
-
export { SquareCardDirective } from './directives/index.js';
|
|
40
|
-
export { PaymentButtonComponent } from './components/index.js';
|
|
41
|
-
export type { SquareConfig, Payments, Card, GooglePay, ApplePay, CardOptions, CardStyle, GooglePayOptions, ApplePayOptions, DigitalWalletOptions, TokenResult, TokenError, CreatePaymentRequest, CreateOrderRequest, OrderLineItem, OrderDiscount, OrderTax, OrderServiceCharge, OrderFulfillment, PickupDetails, ShipmentDetails, Recipient, Money, CreateCustomerRequest, Address, CatalogSearchRequest, } from './types.js';
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/angular/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,SAAS,EACT,KAAK,EACL,qBAAqB,EACrB,OAAO,EACP,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
package/dist/angular/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @bates-solutions/squareup Angular integration
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import { SquareModule } from '@bates-solutions/squareup/angular';
|
|
7
|
-
*
|
|
8
|
-
* @NgModule({
|
|
9
|
-
* imports: [
|
|
10
|
-
* SquareModule.forRoot({
|
|
11
|
-
* applicationId: 'sq0idp-xxx',
|
|
12
|
-
* locationId: 'LXXX',
|
|
13
|
-
* environment: 'sandbox',
|
|
14
|
-
* })
|
|
15
|
-
* ]
|
|
16
|
-
* })
|
|
17
|
-
* export class AppModule {}
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* // Standalone component usage
|
|
23
|
-
* import { SquareCardDirective, PaymentButtonComponent } from '@bates-solutions/squareup/angular';
|
|
24
|
-
*
|
|
25
|
-
* @Component({
|
|
26
|
-
* standalone: true,
|
|
27
|
-
* imports: [SquareCardDirective, PaymentButtonComponent],
|
|
28
|
-
* template: `
|
|
29
|
-
* <div squareCard (cardReady)="ready = true"></div>
|
|
30
|
-
* <square-payment-button type="googlePay" (payment)="onPayment($event)">
|
|
31
|
-
* </square-payment-button>
|
|
32
|
-
* `
|
|
33
|
-
* })
|
|
34
|
-
* export class CheckoutComponent {}
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
// Module
|
|
38
|
-
export { SquareModule, SQUARE_CONFIG } from './square.module.js';
|
|
39
|
-
// Services
|
|
40
|
-
export { SquareSdkService, SquarePaymentsService, SquareOrdersService, SquareCustomersService, SquareCatalogService, } from './services/index.js';
|
|
41
|
-
// Directives
|
|
42
|
-
export { SquareCardDirective } from './directives/index.js';
|
|
43
|
-
// Components
|
|
44
|
-
export { PaymentButtonComponent } from './components/index.js';
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/angular/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,SAAS;AACT,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,WAAW;AACX,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,aAAa;AACb,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,aAAa;AACb,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { SquareSdkService } from './square-sdk.service.js';
|
|
2
|
-
export { SquarePaymentsService } from './square-payments.service.js';
|
|
3
|
-
export { SquareOrdersService } from './square-orders.service.js';
|
|
4
|
-
export { SquareCustomersService } from './square-customers.service.js';
|
|
5
|
-
export { SquareCatalogService } from './square-catalog.service.js';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/angular/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { SquareSdkService } from './square-sdk.service.js';
|
|
2
|
-
export { SquarePaymentsService } from './square-payments.service.js';
|
|
3
|
-
export { SquareOrdersService } from './square-orders.service.js';
|
|
4
|
-
export { SquareCustomersService } from './square-customers.service.js';
|
|
5
|
-
export { SquareCatalogService } from './square-catalog.service.js';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/angular/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import type { CatalogSearchRequest } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Service for Square catalog operations
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* @Component({...})
|
|
9
|
-
* export class ProductsComponent implements OnInit {
|
|
10
|
-
* products$ = this.catalog.list();
|
|
11
|
-
*
|
|
12
|
-
* constructor(private catalog: SquareCatalogService) {}
|
|
13
|
-
*
|
|
14
|
-
* search(query: string) {
|
|
15
|
-
* return this.catalog.search({ textFilter: query });
|
|
16
|
-
* }
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare class SquareCatalogService {
|
|
21
|
-
private loadingSubject;
|
|
22
|
-
private errorSubject;
|
|
23
|
-
/** Observable of loading state */
|
|
24
|
-
readonly loading$: Observable<boolean>;
|
|
25
|
-
/** Observable of errors */
|
|
26
|
-
readonly error$: Observable<Error | null>;
|
|
27
|
-
/**
|
|
28
|
-
* List catalog items
|
|
29
|
-
*
|
|
30
|
-
* @param types - Optional types to filter by
|
|
31
|
-
* @param apiEndpoint - Backend API endpoint (default: '/api/catalog')
|
|
32
|
-
* @returns Observable of catalog items
|
|
33
|
-
*/
|
|
34
|
-
list<T = unknown>(types?: string[], apiEndpoint?: string): Observable<T>;
|
|
35
|
-
/**
|
|
36
|
-
* Search catalog items
|
|
37
|
-
*
|
|
38
|
-
* @param request - Search request
|
|
39
|
-
* @param apiEndpoint - Backend API endpoint (default: '/api/catalog')
|
|
40
|
-
* @returns Observable of matching catalog items
|
|
41
|
-
*/
|
|
42
|
-
search<T = unknown>(request: CatalogSearchRequest, apiEndpoint?: string): Observable<T>;
|
|
43
|
-
/**
|
|
44
|
-
* Retrieve a catalog item by ID
|
|
45
|
-
*
|
|
46
|
-
* @param objectId - The catalog object ID
|
|
47
|
-
* @param apiEndpoint - Backend API endpoint (default: '/api/catalog')
|
|
48
|
-
* @returns Observable of the catalog item
|
|
49
|
-
*/
|
|
50
|
-
retrieve<T = unknown>(objectId: string, apiEndpoint?: string): Observable<T>;
|
|
51
|
-
/**
|
|
52
|
-
* Batch retrieve catalog items by IDs
|
|
53
|
-
*
|
|
54
|
-
* @param objectIds - The catalog object IDs
|
|
55
|
-
* @param apiEndpoint - Backend API endpoint (default: '/api/catalog')
|
|
56
|
-
* @returns Observable of the catalog items
|
|
57
|
-
*/
|
|
58
|
-
batchRetrieve<T = unknown>(objectIds: string[], apiEndpoint?: string): Observable<T>;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=square-catalog.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"square-catalog.service.d.ts","sourceRoot":"","sources":["../../../src/angular/services/square-catalog.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAqC,MAAM,MAAM,CAAC;AAErE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAGa,oBAAoB;IAC/B,OAAO,CAAC,cAAc,CAAuC;IAC7D,OAAO,CAAC,YAAY,CAA2C;IAE/D,kCAAkC;IAClC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,CAAsC;IAE5E,2BAA2B;IAC3B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,CAAoC;IAE7E;;;;;;OAMG;IACH,IAAI,CAAC,CAAC,GAAG,OAAO,EACd,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,WAAW,SAAiB,GAC3B,UAAU,CAAC,CAAC,CAAC;IA+BhB;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,GAAG,OAAO,EAChB,OAAO,EAAE,oBAAoB,EAC7B,WAAW,SAAiB,GAC3B,UAAU,CAAC,CAAC,CAAC;IA8BhB;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,SAAiB,GAAG,UAAU,CAAC,CAAC,CAAC;IA6BpF;;;;;;OAMG;IACH,aAAa,CAAC,CAAC,GAAG,OAAO,EACvB,SAAS,EAAE,MAAM,EAAE,EACnB,WAAW,SAAiB,GAC3B,UAAU,CAAC,CAAC,CAAC;CA8BjB"}
|