@dintero/checkout-web-sdk 0.6.3 → 0.6.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dintero/checkout-web-sdk",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Dintero Checkout SDK for web frontends",
5
5
  "main": "dist/dintero-checkout-web-sdk.cjs.js",
6
6
  "module": "dist/dintero-checkout-web-sdk.esm.js",
@@ -11,10 +11,9 @@
11
11
  "umdName": "dintero"
12
12
  },
13
13
  "scripts": {
14
- "patch-vitest": "patch -u node_modules/vitest/dist/vendor-node.a7c48fe1.js -i patches/vitest+0.34.6.patch --forward || true",
15
- "build": "preconstruct build",
14
+ "build": "yarn tsc --noEmit && preconstruct build",
16
15
  "lint": "prettier --cache --log-level warn -c --config .prettierrc.yml .",
17
- "test": "yarn patch-vitest && $(yarn bin)/vitest --browser.name=chrome --browser.headless",
16
+ "test": "vitest --browser.name=chrome --browser.headless",
18
17
  "semantic-release": "semantic-release",
19
18
  "prepublishOnly": "yarn run build"
20
19
  },
@@ -30,16 +29,16 @@
30
29
  "url": "https://github.com/Dintero/Dintero.Checkout.Web.SDK/issues"
31
30
  },
32
31
  "devDependencies": {
33
- "@babel/core": "7.13.0",
34
- "@babel/preset-typescript": "7.13.0",
35
- "@preconstruct/cli": "2.8.1",
32
+ "@babel/core": "7.23.7",
33
+ "@babel/preset-typescript": "7.23.3",
34
+ "@preconstruct/cli": "2.8.3",
36
35
  "@semantic-release/git": "10.0.1",
37
- "@vitest/browser": "0.34.6",
38
- "prettier": "3.0.3",
39
- "semantic-release": "22.0.5",
40
- "typescript": "5.2.2",
41
- "vitest": "0.34.6",
42
- "webdriverio": "8.16.22"
36
+ "@vitest/browser": "1.2.0",
37
+ "prettier": "3.1.1",
38
+ "semantic-release": "22.0.12",
39
+ "typescript": "5.3.3",
40
+ "vitest": "1.2.0",
41
+ "webdriverio": "8.27.2"
43
42
  },
44
43
  "dependencies": {
45
44
  "native-promise-only": "0.8.1"
@@ -1,104 +0,0 @@
1
- import type { Session } from "./session.js";
2
- export declare enum CheckoutEvents {
3
- SessionNotFound = "SessionNotFound",
4
- SessionLoaded = "SessionLoaded",
5
- SessionUpdated = "SessionUpdated",
6
- SessionCancel = "SessionCancel",
7
- SessionPaymentOnHold = "SessionPaymentOnHold",
8
- SessionPaymentAuthorized = "SessionPaymentAuthorized",
9
- SessionPaymentError = "SessionPaymentError",
10
- SessionLocked = "SessionLocked",
11
- SessionLockFailed = "SessionLockFailed",
12
- ActivePaymentProductType = "ActivePaymentProductType",
13
- ValidateSession = "ValidateSession"
14
- }
15
- export declare enum InternalCheckoutEvents {
16
- HeightChanged = "HeightChanged",
17
- LanguageChanged = "LanguageChanged",
18
- ScrollToTop = "ScrollToTop",
19
- ShowPopOutButton = "ShowPopOutButton",
20
- HidePopOutButton = "HidePopOutButton"
21
- }
22
- export type SessionNotFound = {
23
- type: CheckoutEvents.SessionNotFound;
24
- };
25
- export type SessionLoaded = {
26
- type: CheckoutEvents.SessionLoaded;
27
- session: Session;
28
- };
29
- export type SessionUpdated = {
30
- type: CheckoutEvents.SessionUpdated;
31
- session: Session;
32
- };
33
- export type SessionCancel = {
34
- type: CheckoutEvents.SessionCancel;
35
- href: string;
36
- };
37
- export type SessionPaymentOnHold = {
38
- type: CheckoutEvents.SessionPaymentOnHold;
39
- transaction_id: string;
40
- merchant_reference: string;
41
- href: string;
42
- };
43
- export type SessionPaymentAuthorized = {
44
- type: CheckoutEvents.SessionPaymentAuthorized;
45
- transaction_id: string;
46
- merchant_reference: string;
47
- href: string;
48
- };
49
- export type SessionLocked = {
50
- type: CheckoutEvents.SessionLocked;
51
- pay_lock_id: string;
52
- callback: () => void;
53
- };
54
- export type ShowPopOutButton = {
55
- type: "ShowPopOutButton";
56
- styles: {
57
- font: string;
58
- height: string;
59
- color: string;
60
- background: string;
61
- textAlign: string;
62
- padding: string;
63
- margin: string;
64
- border: string;
65
- borderRadius: string;
66
- cursor: string;
67
- fontWeight: string;
68
- lineHeight: string;
69
- };
70
- openLabel: string;
71
- focusLabel: string;
72
- closeLabel: string;
73
- descriptionLabel: string;
74
- top: string;
75
- left: string;
76
- right: string;
77
- language: string;
78
- disabled: "true" | "false";
79
- };
80
- export type SessionLockFailed = {
81
- type: CheckoutEvents.SessionLockFailed;
82
- };
83
- export type ActivePaymentProductType = {
84
- type: CheckoutEvents.ActivePaymentProductType;
85
- payment_product_type: string | undefined;
86
- };
87
- export type ValidateSession = {
88
- type: CheckoutEvents.ValidateSession;
89
- session: Session;
90
- callback: (result: SessionValidationCallback) => void;
91
- };
92
- export interface SessionValidationCallback {
93
- success: boolean;
94
- clientValidationError?: string;
95
- }
96
- export type WrappedValidateSession = Pick<ValidateSession, "type" | "session">;
97
- export type WrappedSessionLocked = Pick<SessionLocked, "type" | "pay_lock_id">;
98
- export type SessionPayment = SessionPaymentAuthorized | SessionPaymentOnHold;
99
- export type SessionPaymentError = {
100
- type: CheckoutEvents.SessionPaymentError;
101
- error: string;
102
- href: string;
103
- };
104
- export type SessionEvent = SessionNotFound | SessionLoaded | SessionUpdated | SessionCancel | SessionPaymentOnHold | SessionPaymentAuthorized | SessionPaymentError | WrappedSessionLocked | SessionLockFailed | ActivePaymentProductType | WrappedValidateSession;
@@ -1,60 +0,0 @@
1
- import "native-promise-only";
2
- import { CheckoutEvents, InternalCheckoutEvents, SessionNotFound, SessionLoaded, SessionUpdated, SessionCancel, SessionPaymentOnHold, SessionPaymentAuthorized, SessionPaymentError, SessionLocked, SessionLockFailed, ActivePaymentProductType, ValidateSession, SessionValidationCallback, SessionEvent } from "./checkout.js";
3
- import { SubscriptionHandler } from "./subscribe.js";
4
- import { Session } from "./session.js";
5
- export interface DinteroCheckoutInstance {
6
- /**
7
- * Remove iframe and all event listeners.
8
- */
9
- destroy: () => void;
10
- iframe: HTMLIFrameElement;
11
- language: string;
12
- lockSession: () => Promise<SessionEvent>;
13
- refreshSession: () => Promise<SessionEvent>;
14
- setActivePaymentProductType: (paymentProductType: string) => void;
15
- submitValidationResult: (result: SessionValidationCallback) => void;
16
- options: InternalDinteroEmbedCheckoutOptions;
17
- handlers: ({
18
- handler: SubscriptionHandler;
19
- eventTypes: InternalCheckoutEvents[];
20
- } | {
21
- handler: SubscriptionHandler;
22
- eventTypes: CheckoutEvents[];
23
- })[];
24
- session: Session | undefined;
25
- popOutWindow: Window | undefined;
26
- }
27
- export interface DinteroCheckoutOptions {
28
- sid: string;
29
- endpoint?: string;
30
- language?: string;
31
- }
32
- export interface DinteroEmbedCheckoutOptions extends DinteroCheckoutOptions {
33
- container: HTMLDivElement;
34
- popOut?: boolean;
35
- onPayment?: (event: SessionPaymentAuthorized | SessionPaymentOnHold, checkout: DinteroCheckoutInstance) => void;
36
- /**
37
- * @deprecated Since version 0.0.1. Will be deleted in version 1.0.0. Use onPayment instead.
38
- */
39
- onPaymentAuthorized?: (event: SessionPaymentAuthorized, checkout: DinteroCheckoutInstance) => void;
40
- onSession?: (event: SessionLoaded | SessionUpdated, checkout: DinteroCheckoutInstance) => void;
41
- onPaymentError?: (event: SessionPaymentError, checkout: DinteroCheckoutInstance) => void;
42
- onSessionCancel?: (event: SessionCancel, checkout: DinteroCheckoutInstance) => void;
43
- onSessionNotFound?: (event: SessionNotFound, checkout: DinteroCheckoutInstance) => void;
44
- onSessionLocked?: (event: SessionLocked, checkout: DinteroCheckoutInstance, callback: () => void) => void;
45
- onSessionLockFailed?: (event: SessionLockFailed, checkout: DinteroCheckoutInstance) => void;
46
- onActivePaymentType?: (event: ActivePaymentProductType, checkout: DinteroCheckoutInstance) => void;
47
- onValidateSession?: (event: ValidateSession, checkout: DinteroCheckoutInstance, callback: (result: SessionValidationCallback) => void) => void;
48
- }
49
- interface InternalDinteroEmbedCheckoutOptions extends DinteroEmbedCheckoutOptions {
50
- innerContainer: HTMLDivElement;
51
- }
52
- /**
53
- * Show a dintero payment session in an embedded iframe.
54
- */
55
- export declare const embed: (options: DinteroEmbedCheckoutOptions) => Promise<DinteroCheckoutInstance>;
56
- /**
57
- * Redirect the customer to a payment session in the Dintero Checkout.
58
- */
59
- export declare const redirect: (options: DinteroCheckoutOptions) => void;
60
- export type { SessionNotFound, SessionLoaded, SessionUpdated, SessionCancel, SessionPaymentOnHold, SessionPaymentAuthorized, SessionPaymentError, SessionLocked, SessionLockFailed, ActivePaymentProductType, ValidateSession, SessionValidationCallback, } from "./checkout.js";