@inttegro/angular 0.2.0 → 0.5.1
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
CHANGED
|
@@ -14,3 +14,10 @@ import { CheckoutComponent } from '@inttegro/angular'
|
|
|
14
14
|
})
|
|
15
15
|
export class PaymentPage {}
|
|
16
16
|
```
|
|
17
|
+
|
|
18
|
+
For a `customer_selected_amount` Buy link, bind `purchaseIntentId` instead of
|
|
19
|
+
`orderId`. This works in both embedded and modal presentations:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<inttegro-checkout [purchaseIntentId]="purchaseIntentId" presentation="modal" />
|
|
23
|
+
```
|
|
@@ -7,9 +7,9 @@ import { loadInttegro } from '@inttegro/js';
|
|
|
7
7
|
*
|
|
8
8
|
* Add the component to a host component's `imports` array. It loads the hosted
|
|
9
9
|
* runtime after its view initializes, creates one controller, and destroys that
|
|
10
|
-
* controller with the Angular view. Changing `features`, `orderId`,
|
|
11
|
-
* or `title` replaces the controller; changing
|
|
12
|
-
* updates it in place.
|
|
10
|
+
* controller with the Angular view. Changing `features`, `orderId`,
|
|
11
|
+
* `presentation`, `timeout`, or `title` replaces the controller; changing
|
|
12
|
+
* `appearance` or `locale` updates it in place.
|
|
13
13
|
*
|
|
14
14
|
* Keep this component mounted while a payment attempt or confirmation is
|
|
15
15
|
* pending. The successful `completed` output is suitable for navigation, but
|
|
@@ -23,8 +23,10 @@ import { loadInttegro } from '@inttegro/js';
|
|
|
23
23
|
* template: `
|
|
24
24
|
* <inttegro-checkout
|
|
25
25
|
* [orderId]="orderId"
|
|
26
|
+
* presentation="modal"
|
|
26
27
|
* [appearance]="{ theme: 'system' }"
|
|
27
28
|
* (completed)="onCompleted()"
|
|
29
|
+
* (failed)="onFailed($event)"
|
|
28
30
|
* (error)="onError($event)"
|
|
29
31
|
* />
|
|
30
32
|
* `,
|
|
@@ -32,7 +34,10 @@ import { loadInttegro } from '@inttegro/js';
|
|
|
32
34
|
* export class PaymentPage {
|
|
33
35
|
* orderId = input.required<string>()
|
|
34
36
|
* onCompleted(): void { location.assign('/orders/complete') }
|
|
35
|
-
*
|
|
37
|
+
* onFailed(event: CheckoutFailedEvent): void {
|
|
38
|
+
* showCheckoutFailure(event.failure)
|
|
39
|
+
* }
|
|
40
|
+
* onError(error: Error): void {
|
|
36
41
|
* reportCheckoutError(error)
|
|
37
42
|
* }
|
|
38
43
|
* }
|
|
@@ -42,11 +47,15 @@ import { loadInttegro } from '@inttegro/js';
|
|
|
42
47
|
*/
|
|
43
48
|
class CheckoutComponent {
|
|
44
49
|
constructor() {
|
|
45
|
-
/**
|
|
46
|
-
this.
|
|
50
|
+
/** Displays Checkout inline by default or in an Inttegro-managed modal. */
|
|
51
|
+
this.presentation = 'embedded';
|
|
47
52
|
/** Emitted after Checkout reports its successful terminal state. */
|
|
48
53
|
this.completed = new EventEmitter();
|
|
49
|
-
/** Emitted
|
|
54
|
+
/** Emitted when a payer dismisses managed modal Checkout before completion. */
|
|
55
|
+
this.canceled = new EventEmitter();
|
|
56
|
+
/** Emitted when Checkout reaches a terminal failure state. */
|
|
57
|
+
this.failed = new EventEmitter();
|
|
58
|
+
/** Emitted for loader or mount failures. */
|
|
50
59
|
this.error = new EventEmitter();
|
|
51
60
|
/** Emitted for every sanitized hosted Checkout lifecycle event. */
|
|
52
61
|
this.event = new EventEmitter();
|
|
@@ -64,6 +73,8 @@ class CheckoutComponent {
|
|
|
64
73
|
return;
|
|
65
74
|
if (changes['features'] ||
|
|
66
75
|
changes['orderId'] ||
|
|
76
|
+
changes['purchaseIntentId'] ||
|
|
77
|
+
changes['presentation'] ||
|
|
67
78
|
changes['timeout'] ||
|
|
68
79
|
changes['title']) {
|
|
69
80
|
void this.mountCheckout();
|
|
@@ -83,6 +94,10 @@ class CheckoutComponent {
|
|
|
83
94
|
focus() {
|
|
84
95
|
this.checkout?.focus();
|
|
85
96
|
}
|
|
97
|
+
/** Closes managed modal Checkout when it is open. */
|
|
98
|
+
dismiss() {
|
|
99
|
+
this.checkout?.dismiss();
|
|
100
|
+
}
|
|
86
101
|
/**
|
|
87
102
|
* Applies a new locale or color scheme when a controller exists.
|
|
88
103
|
* Prefer binding `appearance` and `locale` for declarative Angular views.
|
|
@@ -96,6 +111,8 @@ class CheckoutComponent {
|
|
|
96
111
|
this.destroyCheckout();
|
|
97
112
|
const generation = this.generation;
|
|
98
113
|
const target = this.container.nativeElement;
|
|
114
|
+
let canceled = false;
|
|
115
|
+
let failed = false;
|
|
99
116
|
try {
|
|
100
117
|
const inttegro = await loadInttegro();
|
|
101
118
|
if (generation !== this.generation || !inttegro)
|
|
@@ -105,6 +122,7 @@ class CheckoutComponent {
|
|
|
105
122
|
features: this.features,
|
|
106
123
|
locale: this.locale,
|
|
107
124
|
orderId: this.orderId,
|
|
125
|
+
purchaseIntentId: this.purchaseIntentId,
|
|
108
126
|
timeout: this.timeout,
|
|
109
127
|
title: this.title,
|
|
110
128
|
}));
|
|
@@ -115,17 +133,26 @@ class CheckoutComponent {
|
|
|
115
133
|
this.checkout = checkout;
|
|
116
134
|
this.unsubscribe = checkout.onEvent((event) => {
|
|
117
135
|
this.event.emit(event);
|
|
136
|
+
if (event.type === 'canceled') {
|
|
137
|
+
canceled = true;
|
|
138
|
+
this.canceled.emit(event);
|
|
139
|
+
}
|
|
118
140
|
if (event.type === 'ready')
|
|
119
141
|
this.ready.emit(event);
|
|
120
142
|
if (event.type === 'completed')
|
|
121
143
|
this.completed.emit(event);
|
|
122
|
-
if (event.type === '
|
|
123
|
-
|
|
144
|
+
if (event.type === 'failed') {
|
|
145
|
+
failed = true;
|
|
146
|
+
this.failed.emit(event);
|
|
147
|
+
}
|
|
124
148
|
});
|
|
125
|
-
|
|
149
|
+
if (this.presentation === 'modal')
|
|
150
|
+
await checkout.present();
|
|
151
|
+
else
|
|
152
|
+
await checkout.mount(target);
|
|
126
153
|
}
|
|
127
154
|
catch (error) {
|
|
128
|
-
if (generation !== this.generation)
|
|
155
|
+
if (generation !== this.generation || canceled || failed)
|
|
129
156
|
return;
|
|
130
157
|
this.error.emit(error instanceof Error ? error : new Error('Checkout failed to load.'));
|
|
131
158
|
}
|
|
@@ -138,7 +165,7 @@ class CheckoutComponent {
|
|
|
138
165
|
this.checkout = undefined;
|
|
139
166
|
}
|
|
140
167
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CheckoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
141
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.5", type: CheckoutComponent, isStandalone: true, selector: "inttegro-checkout", inputs: { appearance: "appearance", features: "features", locale: "locale", orderId: "orderId", timeout: "timeout", title: "title" }, outputs: { completed: "completed", error: "error", event: "event", ready: "ready" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #container></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
168
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.5", type: CheckoutComponent, isStandalone: true, selector: "inttegro-checkout", inputs: { appearance: "appearance", features: "features", locale: "locale", orderId: "orderId", purchaseIntentId: "purchaseIntentId", presentation: "presentation", timeout: "timeout", title: "title" }, outputs: { completed: "completed", canceled: "canceled", failed: "failed", error: "error", event: "event", ready: "ready" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #container></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
142
169
|
}
|
|
143
170
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: CheckoutComponent, decorators: [{
|
|
144
171
|
type: Component,
|
|
@@ -155,14 +182,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
155
182
|
}], locale: [{
|
|
156
183
|
type: Input
|
|
157
184
|
}], orderId: [{
|
|
158
|
-
type: Input
|
|
159
|
-
|
|
185
|
+
type: Input
|
|
186
|
+
}], purchaseIntentId: [{
|
|
187
|
+
type: Input
|
|
188
|
+
}], presentation: [{
|
|
189
|
+
type: Input
|
|
160
190
|
}], timeout: [{
|
|
161
191
|
type: Input
|
|
162
192
|
}], title: [{
|
|
163
193
|
type: Input
|
|
164
194
|
}], completed: [{
|
|
165
195
|
type: Output
|
|
196
|
+
}], canceled: [{
|
|
197
|
+
type: Output
|
|
198
|
+
}], failed: [{
|
|
199
|
+
type: Output
|
|
166
200
|
}], error: [{
|
|
167
201
|
type: Output
|
|
168
202
|
}], event: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inttegro-angular.mjs","sources":["../../src/lib/checkout.component.ts","../../src/public-api.ts","../../src/inttegro-angular.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n type AfterViewInit,\n type OnChanges,\n type OnDestroy,\n type SimpleChanges,\n} from '@angular/core'\nimport {\n loadInttegro,\n type CheckoutAppearance,\n type CheckoutController,\n type CheckoutErrorEvent,\n type CheckoutEvent,\n type CheckoutFeatures,\n type CheckoutUpdateOptions,\n} from '@inttegro/js'\n\n/**\n * Standalone Angular component that embeds Inttegro-hosted Checkout.\n *\n * Add the component to a host component's `imports` array. It loads the hosted\n * runtime after its view initializes, creates one controller, and destroys that\n * controller with the Angular view. Changing `features`, `orderId`, `timeout`,\n * or `title` replaces the controller; changing `appearance` or `locale`\n * updates it in place.\n *\n * Keep this component mounted while a payment attempt or confirmation is\n * pending. The successful `completed` output is suitable for navigation, but\n * fulfillment must use server-retrieved Order state or a signed webhook.\n *\n * @example\n * ```ts\n * @Component({\n * standalone: true,\n * imports: [CheckoutComponent],\n * template: `\n * <inttegro-checkout\n * [orderId]=\"orderId\"\n * [appearance]=\"{ theme: 'system' }\"\n * (completed)=\"onCompleted()\"\n * (error)=\"onError($event)\"\n * />\n * `,\n * })\n * export class PaymentPage {\n * orderId = input.required<string>()\n * onCompleted(): void { location.assign('/orders/complete') }\n * onError(error: CheckoutErrorEvent | Error): void {\n * reportCheckoutError(error)\n * }\n * }\n * ```\n *\n * @category Angular\n */\n@Component({\n selector: 'inttegro-checkout',\n standalone: true,\n template: '<div #container></div>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CheckoutComponent implements AfterViewInit, OnChanges, OnDestroy {\n /** Initial and reactive theme preference for hosted Checkout. */\n @Input() appearance?: CheckoutAppearance\n /** Hosted Checkout content and actions. Changing it replaces the controller. */\n @Input() features?: CheckoutFeatures\n /** Initial and reactive BCP 47 locale preference. */\n @Input() locale?: string\n /** Client-safe reference for the finalized Order being paid. */\n @Input({ required: true }) orderId = ''\n /** Mount timeout from 1,000–60,000 ms; defaults to 15,000 ms. */\n @Input() timeout?: number\n /** Accessible iframe title; defaults to `Checkout`. */\n @Input() title?: string\n\n /** Emitted after Checkout reports its successful terminal state. */\n @Output() readonly completed = new EventEmitter<\n Extract<CheckoutEvent, { type: 'completed' }>\n >()\n /** Emitted for loader/mount failures and sanitized hosted errors. */\n @Output() readonly error = new EventEmitter<CheckoutErrorEvent | Error>()\n /** Emitted for every sanitized hosted Checkout lifecycle event. */\n @Output() readonly event = new EventEmitter<CheckoutEvent>()\n /** Emitted once the iframe is interactive. */\n @Output() readonly ready = new EventEmitter<\n Extract<CheckoutEvent, { type: 'ready' }>\n >()\n\n @ViewChild('container', { static: true })\n private container?: ElementRef<HTMLDivElement>\n\n private checkout: CheckoutController | undefined\n private unsubscribe: (() => void) | undefined\n private viewReady = false\n private generation = 0\n\n ngAfterViewInit(): void {\n this.viewReady = true\n void this.mountCheckout()\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.viewReady) return\n\n if (\n changes['features'] ||\n changes['orderId'] ||\n changes['timeout'] ||\n changes['title']\n ) {\n void this.mountCheckout()\n return\n }\n\n if (changes['appearance'] || changes['locale']) {\n this.checkout?.update(\n definedOptions({ appearance: this.appearance, locale: this.locale }),\n )\n }\n }\n\n ngOnDestroy(): void {\n this.destroyCheckout()\n }\n\n /**\n * Moves focus into hosted Checkout when its controller is ready.\n * Before initialization or after teardown this method safely does nothing.\n */\n focus(): void {\n this.checkout?.focus()\n }\n\n /**\n * Applies a new locale or color scheme when a controller exists.\n * Prefer binding `appearance` and `locale` for declarative Angular views.\n */\n update(options: CheckoutUpdateOptions): void {\n this.checkout?.update(options)\n }\n\n private async mountCheckout(): Promise<void> {\n if (!this.container) return\n this.destroyCheckout()\n const generation = this.generation\n const target = this.container.nativeElement\n\n try {\n const inttegro = await loadInttegro()\n if (generation !== this.generation || !inttegro) return\n const checkout = inttegro.createCheckout(\n definedOptions({\n appearance: this.appearance,\n features: this.features,\n locale: this.locale,\n orderId: this.orderId,\n timeout: this.timeout,\n title: this.title,\n }),\n )\n if (generation !== this.generation) {\n checkout.destroy()\n return\n }\n this.checkout = checkout\n this.unsubscribe = checkout.onEvent((event) => {\n this.event.emit(event)\n if (event.type === 'ready') this.ready.emit(event)\n if (event.type === 'completed') this.completed.emit(event)\n if (event.type === 'error') this.error.emit(event)\n })\n await checkout.mount(target)\n } catch (error) {\n if (generation !== this.generation) return\n this.error.emit(\n error instanceof Error ? error : new Error('Checkout failed to load.'),\n )\n }\n }\n\n private destroyCheckout(): void {\n this.generation += 1\n this.unsubscribe?.()\n this.unsubscribe = undefined\n this.checkout?.destroy()\n this.checkout = undefined\n }\n}\n\nfunction definedOptions<Value extends object>(options: Value): Value {\n return Object.fromEntries(\n Object.entries(options).filter(([, value]) => value !== undefined),\n ) as Value\n}\n","/**\n * Angular standalone component adapter for Inttegro-hosted Checkout.\n *\n * @module @inttegro/angular\n */\nexport { CheckoutComponent } from './lib/checkout.component'\nexport type {\n CheckoutAppearance,\n CheckoutErrorEvent,\n CheckoutEvent,\n CheckoutFeatures,\n CheckoutTheme,\n} from '@inttegro/js'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAuBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;MAOU,iBAAiB,CAAA;AAN9B,IAAA,WAAA,GAAA;;QAc6B,IAAA,CAAA,OAAO,GAAG,EAAE;;AAOpB,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAE5C;;AAEgB,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAA8B;;AAEtD,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAAiB;;AAEzC,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAExC;QAOK,IAAA,CAAA,SAAS,GAAG,KAAK;QACjB,IAAA,CAAA,UAAU,GAAG,CAAC;AA6FvB,IAAA;IA3FC,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI;AACrB,QAAA,KAAK,IAAI,CAAC,aAAa,EAAE;IAC3B;AAEA,IAAA,WAAW,CAAC,OAAsB,EAAA;QAChC,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE;QAErB,IACE,OAAO,CAAC,UAAU,CAAC;YACnB,OAAO,CAAC,SAAS,CAAC;YAClB,OAAO,CAAC,SAAS,CAAC;AAClB,YAAA,OAAO,CAAC,OAAO,CAAC,EAChB;AACA,YAAA,KAAK,IAAI,CAAC,aAAa,EAAE;YACzB;QACF;QAEA,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC9C,IAAI,CAAC,QAAQ,EAAE,MAAM,CACnB,cAAc,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CACrE;QACH;IACF;IAEA,WAAW,GAAA;QACT,IAAI,CAAC,eAAe,EAAE;IACxB;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oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,wBAAwB;oBAClC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;sBAGE;;sBAEA;;sBAEA;;sBAEA,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAExB;;sBAEA;;sBAGA;;sBAIA;;sBAEA;;sBAEA;;sBAIA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;AAqG1C,SAAS,cAAc,CAAuB,OAAc,EAAA;IAC1D,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,KAAK,KAAK,SAAS,CAAC,CAC1D;AACZ;;ACvMA;;;;AAIG;;ACJH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"inttegro-angular.mjs","sources":["../../src/lib/checkout.component.ts","../../src/public-api.ts","../../src/inttegro-angular.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n type AfterViewInit,\n type OnChanges,\n type OnDestroy,\n type SimpleChanges,\n} from '@angular/core'\nimport {\n loadInttegro,\n type CheckoutAppearance,\n type CheckoutController,\n type CheckoutEvent,\n type CheckoutFeatures,\n type CheckoutOptions,\n type CheckoutPresentation,\n type CheckoutUpdateOptions,\n} from '@inttegro/js'\n\n/**\n * Standalone Angular component that embeds Inttegro-hosted Checkout.\n *\n * Add the component to a host component's `imports` array. It loads the hosted\n * runtime after its view initializes, creates one controller, and destroys that\n * controller with the Angular view. Changing `features`, `orderId`,\n * `presentation`, `timeout`, or `title` replaces the controller; changing\n * `appearance` or `locale` updates it in place.\n *\n * Keep this component mounted while a payment attempt or confirmation is\n * pending. The successful `completed` output is suitable for navigation, but\n * fulfillment must use server-retrieved Order state or a signed webhook.\n *\n * @example\n * ```ts\n * @Component({\n * standalone: true,\n * imports: [CheckoutComponent],\n * template: `\n * <inttegro-checkout\n * [orderId]=\"orderId\"\n * presentation=\"modal\"\n * [appearance]=\"{ theme: 'system' }\"\n * (completed)=\"onCompleted()\"\n * (failed)=\"onFailed($event)\"\n * (error)=\"onError($event)\"\n * />\n * `,\n * })\n * export class PaymentPage {\n * orderId = input.required<string>()\n * onCompleted(): void { location.assign('/orders/complete') }\n * onFailed(event: CheckoutFailedEvent): void {\n * showCheckoutFailure(event.failure)\n * }\n * onError(error: Error): void {\n * reportCheckoutError(error)\n * }\n * }\n * ```\n *\n * @category Angular\n */\n@Component({\n selector: 'inttegro-checkout',\n standalone: true,\n template: '<div #container></div>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CheckoutComponent implements AfterViewInit, OnChanges, OnDestroy {\n /** Initial and reactive theme preference for hosted Checkout. */\n @Input() appearance?: CheckoutAppearance\n /** Hosted Checkout content and actions. Changing it replaces the controller. */\n @Input() features?: CheckoutFeatures\n /** Initial and reactive BCP 47 locale preference. */\n @Input() locale?: string\n /** Client-safe reference for the finalized Order being paid. */\n @Input() orderId?: string\n /** Client-safe amount-selection Purchase Intent. Mutually exclusive with orderId. */\n @Input() purchaseIntentId?: string\n /** Displays Checkout inline by default or in an Inttegro-managed modal. */\n @Input() presentation: CheckoutPresentation = 'embedded'\n /** Mount timeout from 1,000–60,000 ms; defaults to 15,000 ms. */\n @Input() timeout?: number\n /** Accessible iframe title; defaults to `Checkout`. */\n @Input() title?: string\n\n /** Emitted after Checkout reports its successful terminal state. */\n @Output() readonly completed = new EventEmitter<\n Extract<CheckoutEvent, { type: 'completed' }>\n >()\n /** Emitted when a payer dismisses managed modal Checkout before completion. */\n @Output() readonly canceled = new EventEmitter<\n Extract<CheckoutEvent, { type: 'canceled' }>\n >()\n /** Emitted when Checkout reaches a terminal failure state. */\n @Output() readonly failed = new EventEmitter<\n Extract<CheckoutEvent, { type: 'failed' }>\n >()\n /** Emitted for loader or mount failures. */\n @Output() readonly error = new EventEmitter<Error>()\n /** Emitted for every sanitized hosted Checkout lifecycle event. */\n @Output() readonly event = new EventEmitter<CheckoutEvent>()\n /** Emitted once the iframe is interactive. */\n @Output() readonly ready = new EventEmitter<\n Extract<CheckoutEvent, { type: 'ready' }>\n >()\n\n @ViewChild('container', { static: true })\n private container?: ElementRef<HTMLDivElement>\n\n private checkout: CheckoutController | undefined\n private unsubscribe: (() => void) | undefined\n private viewReady = false\n private generation = 0\n\n ngAfterViewInit(): void {\n this.viewReady = true\n void this.mountCheckout()\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.viewReady) return\n\n if (\n changes['features'] ||\n changes['orderId'] ||\n changes['purchaseIntentId'] ||\n changes['presentation'] ||\n changes['timeout'] ||\n changes['title']\n ) {\n void this.mountCheckout()\n return\n }\n\n if (changes['appearance'] || changes['locale']) {\n this.checkout?.update(\n definedOptions({ appearance: this.appearance, locale: this.locale }),\n )\n }\n }\n\n ngOnDestroy(): void {\n this.destroyCheckout()\n }\n\n /**\n * Moves focus into hosted Checkout when its controller is ready.\n * Before initialization or after teardown this method safely does nothing.\n */\n focus(): void {\n this.checkout?.focus()\n }\n\n /** Closes managed modal Checkout when it is open. */\n dismiss(): void {\n this.checkout?.dismiss()\n }\n\n /**\n * Applies a new locale or color scheme when a controller exists.\n * Prefer binding `appearance` and `locale` for declarative Angular views.\n */\n update(options: CheckoutUpdateOptions): void {\n this.checkout?.update(options)\n }\n\n private async mountCheckout(): Promise<void> {\n if (!this.container) return\n this.destroyCheckout()\n const generation = this.generation\n const target = this.container.nativeElement\n let canceled = false\n let failed = false\n\n try {\n const inttegro = await loadInttegro()\n if (generation !== this.generation || !inttegro) return\n const checkout = inttegro.createCheckout(\n definedOptions({\n appearance: this.appearance,\n features: this.features,\n locale: this.locale,\n orderId: this.orderId,\n purchaseIntentId: this.purchaseIntentId,\n timeout: this.timeout,\n title: this.title,\n }) as CheckoutOptions,\n )\n if (generation !== this.generation) {\n checkout.destroy()\n return\n }\n this.checkout = checkout\n this.unsubscribe = checkout.onEvent((event) => {\n this.event.emit(event)\n if (event.type === 'canceled') {\n canceled = true\n this.canceled.emit(event)\n }\n if (event.type === 'ready') this.ready.emit(event)\n if (event.type === 'completed') this.completed.emit(event)\n if (event.type === 'failed') {\n failed = true\n this.failed.emit(event)\n }\n })\n if (this.presentation === 'modal') await checkout.present()\n else await checkout.mount(target)\n } catch (error) {\n if (generation !== this.generation || canceled || failed) return\n this.error.emit(\n error instanceof Error ? error : new Error('Checkout failed to load.'),\n )\n }\n }\n\n private destroyCheckout(): void {\n this.generation += 1\n this.unsubscribe?.()\n this.unsubscribe = undefined\n this.checkout?.destroy()\n this.checkout = undefined\n }\n}\n\nfunction definedOptions<Value extends object>(options: Value): Value {\n return Object.fromEntries(\n Object.entries(options).filter(([, value]) => value !== undefined),\n ) as Value\n}\n","/**\n * Angular standalone component adapter for Inttegro-hosted Checkout.\n *\n * @module @inttegro/angular\n */\nexport { CheckoutComponent } from './lib/checkout.component'\nexport type {\n CheckoutAppearance,\n CheckoutEvent,\n CheckoutFailedEvent,\n CheckoutOrder,\n CheckoutFeatures,\n CheckoutPresentation,\n CheckoutTheme,\n} from '@inttegro/js'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAwBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;MAOU,iBAAiB,CAAA;AAN9B,IAAA,WAAA,GAAA;;QAkBW,IAAA,CAAA,YAAY,GAAyB,UAAU;;AAOrC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAE5C;;AAEgB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YAAY,EAE3C;;AAEgB,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,YAAY,EAEzC;;AAEgB,QAAA,IAAA,CAAA,KAAK,GAAG,I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HlB,wBAAwB,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAGvB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,wBAAwB;oBAClC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;sBAGE;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAEA;;sBAGA;;sBAIA;;sBAIA;;sBAIA;;sBAEA;;sBAEA;;sBAIA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;AAuH1C,SAAS,cAAc,CAAuB,OAAc,EAAA;IAC1D,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,KAAK,KAAK,SAAS,CAAC,CAC1D;AACZ;;AC3OA;;;;AAIG;;ACJH;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inttegro/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Angular components for Inttegro hosted workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@inttegro/js": "0.
|
|
10
|
+
"@inttegro/js": "0.5.1",
|
|
11
11
|
"tslib": "^2.8.1"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/
|
|
19
|
+
"url": "git+https://github.com/inttegro/js.git",
|
|
20
20
|
"directory": "packages/angular"
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://studio.inttegro.com/web/angular",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _inttegro_js from '@inttegro/js';
|
|
2
|
-
import { CheckoutAppearance, CheckoutFeatures,
|
|
3
|
-
export { CheckoutAppearance,
|
|
2
|
+
import { CheckoutAppearance, CheckoutFeatures, CheckoutPresentation, CheckoutEvent, CheckoutUpdateOptions } from '@inttegro/js';
|
|
3
|
+
export { CheckoutAppearance, CheckoutEvent, CheckoutFailedEvent, CheckoutFeatures, CheckoutOrder, CheckoutPresentation, CheckoutTheme } from '@inttegro/js';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { AfterViewInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges } from '@angular/core';
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@ import { AfterViewInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges } from
|
|
|
9
9
|
*
|
|
10
10
|
* Add the component to a host component's `imports` array. It loads the hosted
|
|
11
11
|
* runtime after its view initializes, creates one controller, and destroys that
|
|
12
|
-
* controller with the Angular view. Changing `features`, `orderId`,
|
|
13
|
-
* or `title` replaces the controller; changing
|
|
14
|
-
* updates it in place.
|
|
12
|
+
* controller with the Angular view. Changing `features`, `orderId`,
|
|
13
|
+
* `presentation`, `timeout`, or `title` replaces the controller; changing
|
|
14
|
+
* `appearance` or `locale` updates it in place.
|
|
15
15
|
*
|
|
16
16
|
* Keep this component mounted while a payment attempt or confirmation is
|
|
17
17
|
* pending. The successful `completed` output is suitable for navigation, but
|
|
@@ -25,8 +25,10 @@ import { AfterViewInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges } from
|
|
|
25
25
|
* template: `
|
|
26
26
|
* <inttegro-checkout
|
|
27
27
|
* [orderId]="orderId"
|
|
28
|
+
* presentation="modal"
|
|
28
29
|
* [appearance]="{ theme: 'system' }"
|
|
29
30
|
* (completed)="onCompleted()"
|
|
31
|
+
* (failed)="onFailed($event)"
|
|
30
32
|
* (error)="onError($event)"
|
|
31
33
|
* />
|
|
32
34
|
* `,
|
|
@@ -34,7 +36,10 @@ import { AfterViewInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges } from
|
|
|
34
36
|
* export class PaymentPage {
|
|
35
37
|
* orderId = input.required<string>()
|
|
36
38
|
* onCompleted(): void { location.assign('/orders/complete') }
|
|
37
|
-
*
|
|
39
|
+
* onFailed(event: CheckoutFailedEvent): void {
|
|
40
|
+
* showCheckoutFailure(event.failure)
|
|
41
|
+
* }
|
|
42
|
+
* onError(error: Error): void {
|
|
38
43
|
* reportCheckoutError(error)
|
|
39
44
|
* }
|
|
40
45
|
* }
|
|
@@ -50,15 +55,23 @@ declare class CheckoutComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
|
50
55
|
/** Initial and reactive BCP 47 locale preference. */
|
|
51
56
|
locale?: string;
|
|
52
57
|
/** Client-safe reference for the finalized Order being paid. */
|
|
53
|
-
orderId
|
|
58
|
+
orderId?: string;
|
|
59
|
+
/** Client-safe amount-selection Purchase Intent. Mutually exclusive with orderId. */
|
|
60
|
+
purchaseIntentId?: string;
|
|
61
|
+
/** Displays Checkout inline by default or in an Inttegro-managed modal. */
|
|
62
|
+
presentation: CheckoutPresentation;
|
|
54
63
|
/** Mount timeout from 1,000–60,000 ms; defaults to 15,000 ms. */
|
|
55
64
|
timeout?: number;
|
|
56
65
|
/** Accessible iframe title; defaults to `Checkout`. */
|
|
57
66
|
title?: string;
|
|
58
67
|
/** Emitted after Checkout reports its successful terminal state. */
|
|
59
68
|
readonly completed: EventEmitter<_inttegro_js.CheckoutCompletedEvent>;
|
|
60
|
-
/** Emitted
|
|
61
|
-
readonly
|
|
69
|
+
/** Emitted when a payer dismisses managed modal Checkout before completion. */
|
|
70
|
+
readonly canceled: EventEmitter<_inttegro_js.CheckoutCanceledEvent>;
|
|
71
|
+
/** Emitted when Checkout reaches a terminal failure state. */
|
|
72
|
+
readonly failed: EventEmitter<_inttegro_js.CheckoutFailedEvent>;
|
|
73
|
+
/** Emitted for loader or mount failures. */
|
|
74
|
+
readonly error: EventEmitter<Error>;
|
|
62
75
|
/** Emitted for every sanitized hosted Checkout lifecycle event. */
|
|
63
76
|
readonly event: EventEmitter<CheckoutEvent>;
|
|
64
77
|
/** Emitted once the iframe is interactive. */
|
|
@@ -76,6 +89,8 @@ declare class CheckoutComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
|
76
89
|
* Before initialization or after teardown this method safely does nothing.
|
|
77
90
|
*/
|
|
78
91
|
focus(): void;
|
|
92
|
+
/** Closes managed modal Checkout when it is open. */
|
|
93
|
+
dismiss(): void;
|
|
79
94
|
/**
|
|
80
95
|
* Applies a new locale or color scheme when a controller exists.
|
|
81
96
|
* Prefer binding `appearance` and `locale` for declarative Angular views.
|
|
@@ -84,7 +99,7 @@ declare class CheckoutComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
|
84
99
|
private mountCheckout;
|
|
85
100
|
private destroyCheckout;
|
|
86
101
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutComponent, never>;
|
|
87
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutComponent, "inttegro-checkout", never, { "appearance": { "alias": "appearance"; "required": false; }; "features": { "alias": "features"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "orderId": { "alias": "orderId"; "required":
|
|
102
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutComponent, "inttegro-checkout", never, { "appearance": { "alias": "appearance"; "required": false; }; "features": { "alias": "features"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "orderId": { "alias": "orderId"; "required": false; }; "purchaseIntentId": { "alias": "purchaseIntentId"; "required": false; }; "presentation": { "alias": "presentation"; "required": false; }; "timeout": { "alias": "timeout"; "required": false; }; "title": { "alias": "title"; "required": false; }; }, { "completed": "completed"; "canceled": "canceled"; "failed": "failed"; "error": "error"; "event": "event"; "ready": "ready"; }, never, never, true, never>;
|
|
88
103
|
}
|
|
89
104
|
|
|
90
105
|
export { CheckoutComponent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inttegro-angular.d.ts","sources":["../../src/lib/checkout.component.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"inttegro-angular.d.ts","sources":["../../src/lib/checkout.component.ts"],"mappings":";;;;;;AAwBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AACH,cAMa,iBAAkB,YAAW,aAAa,EAAE,SAAS,EAAE,SAAS;;iBAErD,kBAAkB;;eAEpB,gBAAgB;;;;;;;;kBAQb,oBAAoB;;;;;;wBAOf,YAAA,CAAA,YAAA,CAAA,sBAAA;;uBAID,YAAA,CAAA,YAAA,CAAA,qBAAA;;qBAIF,YAAA,CAAA,YAAA,CAAA,mBAAA;;oBAID,YAAA,CAAA,KAAA;;oBAEA,YAAA,CAAA,aAAA;;oBAEA,YAAA,CAAA,YAAA,CAAA,kBAAA;;;;;;AAYxB;AAKA,yBAAqB,aAAa;AAsBlC;AAIA;;;AAGG;AACH;;AAKA;AAIA;;;AAGG;AACH,oBAAgB,qBAAqB;;AAsDrC;yCArJW,iBAAiB;2CAAjB,iBAAiB;AA4J7B;;","names":[]}
|