diff --git a/examples/secure-component-styles/index.html b/examples/secure-component-styles/index.html
new file mode 100644
index 0000000..9e0cefc
--- /dev/null
+++ b/examples/secure-component-styles/index.html
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+ Secure component styles
+
+
+
+
+
+
+
+
+
+ Secure component styles
+
+
+
+
+
+
+
+
+
+
diff --git a/package-lock.json b/package-lock.json
index 7bec398..2692233 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@xsolla/pay-station-sdk",
- "version": "0.1.0",
+ "version": "0.0.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@xsolla/pay-station-sdk",
- "version": "0.1.0",
+ "version": "0.0.2",
"license": "ISC",
"dependencies": {
"currency-format": "^1.0.13",
@@ -16,7 +16,6 @@
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
- "@types/i18next": "^13.0.0",
"@types/jasmine": "^4.3.5",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
@@ -1191,16 +1190,6 @@
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==",
"dev": true
},
- "node_modules/@types/i18next": {
- "version": "13.0.0",
- "resolved": "https://registry.npmjs.org/@types/i18next/-/i18next-13.0.0.tgz",
- "integrity": "sha512-gp/SIShAuf4WOqi8ey0nuI7qfWaVpMNCcs/xLygrh/QTQIXmlDC1E0TtVejweNW+7SGDY7g0lyxyKZIJuCKIJw==",
- "deprecated": "This is a stub types definition. i18next provides its own type definitions, so you do not need this installed.",
- "dev": true,
- "dependencies": {
- "i18next": "*"
- }
- },
"node_modules/@types/istanbul-lib-coverage": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz",
diff --git a/package.json b/package.json
index 3dc88b2..09969f9 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,6 @@
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
- "@types/i18next": "^13.0.0",
"@types/jasmine": "^4.3.5",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
diff --git a/src/core/event-name.enum.ts b/src/core/event-name.enum.ts
index d159f6f..3ab79d4 100644
--- a/src/core/event-name.enum.ts
+++ b/src/core/event-name.enum.ts
@@ -15,4 +15,5 @@ export const enum EventName {
nextAction = 'nextAction',
warning = 'warning',
getTextComponentConfig = 'getTextComponentConfig',
+ setSecureComponentStyles = 'setSecureComponentStyles',
}
diff --git a/src/features/headless-checkout/headless-checkout.spec.ts b/src/features/headless-checkout/headless-checkout.spec.ts
index 12744c4..1a0c1ce 100644
--- a/src/features/headless-checkout/headless-checkout.spec.ts
+++ b/src/features/headless-checkout/headless-checkout.spec.ts
@@ -125,6 +125,12 @@ describe('HeadlessCheckout', () => {
expect(spy).toHaveBeenCalled();
});
+ it('Should set secure component styles', async () => {
+ const spy = spyOn(postMessagesClient, 'send');
+ await headlessCheckout.setSecureComponentStyles('styles');
+ expect(spy).toHaveBeenCalled();
+ });
+
it('Should throw exception if empty token', async () => {
try {
await headlessCheckout.setToken('');
diff --git a/src/features/headless-checkout/headless-checkout.ts b/src/features/headless-checkout/headless-checkout.ts
index fffc60e..a9d69e2 100644
--- a/src/features/headless-checkout/headless-checkout.ts
+++ b/src/features/headless-checkout/headless-checkout.ts
@@ -28,6 +28,7 @@ import { headlessCheckoutAppUrl } from './environment';
import { FinanceDetails } from '../../core/finance-details/finance-details.interface';
import { getFinanceDetailsHandler } from './post-messages-handlers/get-finance-details.handler';
import { FormStatus } from '../../core/status/form-status.enum';
+import { setSecureComponentStylesHandler } from './post-messages-handlers/set-secure-component-styles.handler';
@singleton()
export class HeadlessCheckout {
@@ -52,7 +53,7 @@ export class HeadlessCheckout {
onCoreEvent: (
eventName: EventName,
handler: Handler,
- callback: (value?: T) => void
+ callback: (value?: T) => void,
): (() => void) => {
return this.postMessagesClient.listen(eventName, handler, callback);
},
@@ -81,7 +82,7 @@ export class HeadlessCheckout {
}
this.formSpy.formWasInit = true;
this.formStatus = FormStatus.active;
- })
+ }),
) as Promise