@open-mercato/gateway-tpay 0.0.0-stage → 0.8.1-develop.7447.1.ac22e0f0bc
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/.turbo/turbo-build.log +2 -0
- package/build.mjs +7 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +7 -0
- package/dist/modules/gateway_tpay/__integration__/TC-TPAY-001.spec.js +35 -0
- package/dist/modules/gateway_tpay/__integration__/TC-TPAY-001.spec.js.map +7 -0
- package/dist/modules/gateway_tpay/__integration__/TC-TPAY-002.spec.js +34 -0
- package/dist/modules/gateway_tpay/__integration__/TC-TPAY-002.spec.js.map +7 -0
- package/dist/modules/gateway_tpay/__integration__/TC-TPAY-003.spec.js +35 -0
- package/dist/modules/gateway_tpay/__integration__/TC-TPAY-003.spec.js.map +7 -0
- package/dist/modules/gateway_tpay/__integration__/helpers/fixtures.js +122 -0
- package/dist/modules/gateway_tpay/__integration__/helpers/fixtures.js.map +7 -0
- package/dist/modules/gateway_tpay/__integration__/meta.js +10 -0
- package/dist/modules/gateway_tpay/__integration__/meta.js.map +7 -0
- package/dist/modules/gateway_tpay/acl.js +20 -0
- package/dist/modules/gateway_tpay/acl.js.map +7 -0
- package/dist/modules/gateway_tpay/cli.js +108 -0
- package/dist/modules/gateway_tpay/cli.js.map +7 -0
- package/dist/modules/gateway_tpay/di.js +27 -0
- package/dist/modules/gateway_tpay/di.js.map +7 -0
- package/dist/modules/gateway_tpay/index.js +9 -0
- package/dist/modules/gateway_tpay/index.js.map +7 -0
- package/dist/modules/gateway_tpay/integration.js +80 -0
- package/dist/modules/gateway_tpay/integration.js.map +7 -0
- package/dist/modules/gateway_tpay/lib/adapters/v1.js +177 -0
- package/dist/modules/gateway_tpay/lib/adapters/v1.js.map +7 -0
- package/dist/modules/gateway_tpay/lib/amount.js +24 -0
- package/dist/modules/gateway_tpay/lib/amount.js.map +7 -0
- package/dist/modules/gateway_tpay/lib/callback-url.js +36 -0
- package/dist/modules/gateway_tpay/lib/callback-url.js.map +7 -0
- package/dist/modules/gateway_tpay/lib/errors.js +32 -0
- package/dist/modules/gateway_tpay/lib/errors.js.map +7 -0
- package/dist/modules/gateway_tpay/lib/health.js +67 -0
- package/dist/modules/gateway_tpay/lib/health.js.map +7 -0
- package/dist/modules/gateway_tpay/lib/preset.js +115 -0
- package/dist/modules/gateway_tpay/lib/preset.js.map +7 -0
- package/dist/modules/gateway_tpay/lib/status-map.js +15 -0
- package/dist/modules/gateway_tpay/lib/status-map.js.map +7 -0
- package/dist/modules/gateway_tpay/lib/tpay-client.js +147 -0
- package/dist/modules/gateway_tpay/lib/tpay-client.js.map +7 -0
- package/dist/modules/gateway_tpay/setup.js +32 -0
- package/dist/modules/gateway_tpay/setup.js.map +7 -0
- package/jest.config.cjs +32 -0
- package/package.json +87 -3
- package/src/index.ts +1 -0
- package/src/modules/gateway_tpay/__integration__/TC-TPAY-001.spec.ts +44 -0
- package/src/modules/gateway_tpay/__integration__/TC-TPAY-002.spec.ts +43 -0
- package/src/modules/gateway_tpay/__integration__/TC-TPAY-003.spec.ts +43 -0
- package/src/modules/gateway_tpay/__integration__/helpers/fixtures.ts +148 -0
- package/src/modules/gateway_tpay/__integration__/meta.ts +6 -0
- package/src/modules/gateway_tpay/__tests__/acl-dependencies.test.ts +82 -0
- package/src/modules/gateway_tpay/__tests__/adapter-v1.test.ts +316 -0
- package/src/modules/gateway_tpay/__tests__/amount.test.ts +36 -0
- package/src/modules/gateway_tpay/__tests__/callback-url.test.ts +48 -0
- package/src/modules/gateway_tpay/__tests__/health.test.ts +96 -0
- package/src/modules/gateway_tpay/__tests__/integration-definition.test.ts +60 -0
- package/src/modules/gateway_tpay/__tests__/preset.test.ts +212 -0
- package/src/modules/gateway_tpay/__tests__/status-map.test.ts +25 -0
- package/src/modules/gateway_tpay/__tests__/tpay-client.test.ts +175 -0
- package/src/modules/gateway_tpay/acl.ts +16 -0
- package/src/modules/gateway_tpay/cli.ts +124 -0
- package/src/modules/gateway_tpay/di.ts +26 -0
- package/src/modules/gateway_tpay/i18n/de.json +16 -0
- package/src/modules/gateway_tpay/i18n/en.json +16 -0
- package/src/modules/gateway_tpay/i18n/es.json +16 -0
- package/src/modules/gateway_tpay/i18n/ko.json +16 -0
- package/src/modules/gateway_tpay/i18n/pl.json +16 -0
- package/src/modules/gateway_tpay/index.ts +5 -0
- package/src/modules/gateway_tpay/integration.ts +76 -0
- package/src/modules/gateway_tpay/lib/adapters/v1.ts +220 -0
- package/src/modules/gateway_tpay/lib/amount.ts +21 -0
- package/src/modules/gateway_tpay/lib/callback-url.ts +39 -0
- package/src/modules/gateway_tpay/lib/errors.ts +31 -0
- package/src/modules/gateway_tpay/lib/health.ts +89 -0
- package/src/modules/gateway_tpay/lib/preset.ts +164 -0
- package/src/modules/gateway_tpay/lib/status-map.ts +14 -0
- package/src/modules/gateway_tpay/lib/tpay-client.ts +191 -0
- package/src/modules/gateway_tpay/setup.ts +32 -0
- package/tsconfig.json +9 -0
- package/watch.mjs +7 -0
- package/README.md +0 -3
package/build.mjs
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { expect, test } from "@playwright/test";
|
|
2
|
+
import { getAuthToken } from "@open-mercato/core/modules/core/__integration__/helpers/api";
|
|
3
|
+
import {
|
|
4
|
+
TPAY_DUMMY_CLIENT_ID,
|
|
5
|
+
TPAY_DUMMY_CLIENT_SECRET,
|
|
6
|
+
TPAY_PRECONFIGURED_SKIP_REASON,
|
|
7
|
+
captureTpayBaseline,
|
|
8
|
+
hasPreconfiguredTpaySecrets,
|
|
9
|
+
readTpayCredentials,
|
|
10
|
+
readTpayEnabled,
|
|
11
|
+
restoreTpayBaseline,
|
|
12
|
+
saveTpayDummyCredentials,
|
|
13
|
+
setTpayEnabled
|
|
14
|
+
} from "./helpers/fixtures.js";
|
|
15
|
+
test.describe("TC-TPAY-001: Tpay credentials and enablement", () => {
|
|
16
|
+
test("saves credentials without exposing the client secret and enables the integration", async ({ request }) => {
|
|
17
|
+
const token = await getAuthToken(request, "admin");
|
|
18
|
+
const baseline = await captureTpayBaseline(request, token);
|
|
19
|
+
test.skip(hasPreconfiguredTpaySecrets(baseline), TPAY_PRECONFIGURED_SKIP_REASON);
|
|
20
|
+
try {
|
|
21
|
+
await saveTpayDummyCredentials(request, token);
|
|
22
|
+
await setTpayEnabled(request, token, true);
|
|
23
|
+
const { credentials, secretFieldsConfigured } = await readTpayCredentials(request, token);
|
|
24
|
+
expect(credentials.clientId).toBe(TPAY_DUMMY_CLIENT_ID);
|
|
25
|
+
expect(credentials.environment).toBe("sandbox");
|
|
26
|
+
expect(secretFieldsConfigured.clientSecret).toBe(true);
|
|
27
|
+
expect(JSON.stringify(credentials)).not.toContain(TPAY_DUMMY_CLIENT_SECRET);
|
|
28
|
+
expect(credentials.clientSecret).not.toBe(TPAY_DUMMY_CLIENT_SECRET);
|
|
29
|
+
expect(await readTpayEnabled(request, token)).toBe(true);
|
|
30
|
+
} finally {
|
|
31
|
+
await restoreTpayBaseline(request, token, baseline);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=TC-TPAY-001.spec.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/gateway_tpay/__integration__/TC-TPAY-001.spec.ts"],
|
|
4
|
+
"sourcesContent": ["import { expect, test } from '@playwright/test'\nimport { getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api'\nimport {\n TPAY_DUMMY_CLIENT_ID,\n TPAY_DUMMY_CLIENT_SECRET,\n TPAY_PRECONFIGURED_SKIP_REASON,\n captureTpayBaseline,\n hasPreconfiguredTpaySecrets,\n readTpayCredentials,\n readTpayEnabled,\n restoreTpayBaseline,\n saveTpayDummyCredentials,\n setTpayEnabled,\n} from './helpers/fixtures'\n\n/**\n * TC-TPAY-001: Tpay credentials are saved write-only and the integration can be enabled\n *\n * Saves dummy sandbox credentials, enables the integration, and asserts that the credentials API\n * returns the client secret masked (never in plaintext). Never calls Tpay. Restores prior state.\n */\ntest.describe('TC-TPAY-001: Tpay credentials and enablement', () => {\n test('saves credentials without exposing the client secret and enables the integration', async ({ request }) => {\n const token = await getAuthToken(request, 'admin')\n const baseline = await captureTpayBaseline(request, token)\n test.skip(hasPreconfiguredTpaySecrets(baseline), TPAY_PRECONFIGURED_SKIP_REASON)\n\n try {\n await saveTpayDummyCredentials(request, token)\n await setTpayEnabled(request, token, true)\n\n const { credentials, secretFieldsConfigured } = await readTpayCredentials(request, token)\n expect(credentials.clientId).toBe(TPAY_DUMMY_CLIENT_ID)\n expect(credentials.environment).toBe('sandbox')\n expect(secretFieldsConfigured.clientSecret).toBe(true)\n expect(JSON.stringify(credentials)).not.toContain(TPAY_DUMMY_CLIENT_SECRET)\n expect(credentials.clientSecret).not.toBe(TPAY_DUMMY_CLIENT_SECRET)\n\n expect(await readTpayEnabled(request, token)).toBe(true)\n } finally {\n await restoreTpayBaseline(request, token, baseline)\n }\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,QAAQ,YAAY;AAC7B,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,KAAK,SAAS,gDAAgD,MAAM;AAClE,OAAK,oFAAoF,OAAO,EAAE,QAAQ,MAAM;AAC9G,UAAM,QAAQ,MAAM,aAAa,SAAS,OAAO;AACjD,UAAM,WAAW,MAAM,oBAAoB,SAAS,KAAK;AACzD,SAAK,KAAK,4BAA4B,QAAQ,GAAG,8BAA8B;AAE/E,QAAI;AACF,YAAM,yBAAyB,SAAS,KAAK;AAC7C,YAAM,eAAe,SAAS,OAAO,IAAI;AAEzC,YAAM,EAAE,aAAa,uBAAuB,IAAI,MAAM,oBAAoB,SAAS,KAAK;AACxF,aAAO,YAAY,QAAQ,EAAE,KAAK,oBAAoB;AACtD,aAAO,YAAY,WAAW,EAAE,KAAK,SAAS;AAC9C,aAAO,uBAAuB,YAAY,EAAE,KAAK,IAAI;AACrD,aAAO,KAAK,UAAU,WAAW,CAAC,EAAE,IAAI,UAAU,wBAAwB;AAC1E,aAAO,YAAY,YAAY,EAAE,IAAI,KAAK,wBAAwB;AAElE,aAAO,MAAM,gBAAgB,SAAS,KAAK,CAAC,EAAE,KAAK,IAAI;AAAA,IACzD,UAAE;AACA,YAAM,oBAAoB,SAAS,OAAO,QAAQ;AAAA,IACpD;AAAA,EACF,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { expect, test } from "@playwright/test";
|
|
2
|
+
import { getAuthToken } from "@open-mercato/core/modules/core/__integration__/helpers/api";
|
|
3
|
+
import {
|
|
4
|
+
TPAY_PRECONFIGURED_SKIP_REASON,
|
|
5
|
+
captureTpayBaseline,
|
|
6
|
+
hasPreconfiguredTpaySecrets,
|
|
7
|
+
countGatewayTransactions,
|
|
8
|
+
createTpaySession,
|
|
9
|
+
restoreTpayBaseline,
|
|
10
|
+
saveTpayDummyCredentials,
|
|
11
|
+
setTpayEnabled
|
|
12
|
+
} from "./helpers/fixtures.js";
|
|
13
|
+
test.describe("TC-TPAY-002: Tpay session validation", () => {
|
|
14
|
+
test("rejects a PLN session without payer data before any provider call", async ({ request }) => {
|
|
15
|
+
const token = await getAuthToken(request, "admin");
|
|
16
|
+
const baseline = await captureTpayBaseline(request, token);
|
|
17
|
+
test.skip(hasPreconfiguredTpaySecrets(baseline), TPAY_PRECONFIGURED_SKIP_REASON);
|
|
18
|
+
try {
|
|
19
|
+
await saveTpayDummyCredentials(request, token);
|
|
20
|
+
await setTpayEnabled(request, token, true);
|
|
21
|
+
const transactionsBefore = await countGatewayTransactions(request, token);
|
|
22
|
+
const result = await createTpaySession(request, token, {
|
|
23
|
+
amount: 49.99,
|
|
24
|
+
currencyCode: "PLN"
|
|
25
|
+
});
|
|
26
|
+
expect(result.status).toBe(422);
|
|
27
|
+
expect(result.body.code).toBe("gateway_tpay.errors.payerEmailRequired");
|
|
28
|
+
expect(await countGatewayTransactions(request, token)).toBe(transactionsBefore);
|
|
29
|
+
} finally {
|
|
30
|
+
await restoreTpayBaseline(request, token, baseline);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=TC-TPAY-002.spec.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/gateway_tpay/__integration__/TC-TPAY-002.spec.ts"],
|
|
4
|
+
"sourcesContent": ["import { expect, test } from '@playwright/test'\nimport { getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api'\nimport {\n TPAY_PRECONFIGURED_SKIP_REASON,\n captureTpayBaseline,\n hasPreconfiguredTpaySecrets,\n countGatewayTransactions,\n createTpaySession,\n restoreTpayBaseline,\n saveTpayDummyCredentials,\n setTpayEnabled,\n} from './helpers/fixtures'\n\n/**\n * TC-TPAY-002: Tpay session validation rejects before reaching the provider\n *\n * A PLN session with no payer metadata is rejected with 422 `gateway_tpay.errors.payerEmailRequired` and creates no gateway transaction.\n * Uses dummy credentials only; the rejection happens before any network call to Tpay.\n */\ntest.describe('TC-TPAY-002: Tpay session validation', () => {\n test('rejects a PLN session without payer data before any provider call', async ({ request }) => {\n const token = await getAuthToken(request, 'admin')\n const baseline = await captureTpayBaseline(request, token)\n test.skip(hasPreconfiguredTpaySecrets(baseline), TPAY_PRECONFIGURED_SKIP_REASON)\n\n try {\n await saveTpayDummyCredentials(request, token)\n await setTpayEnabled(request, token, true)\n const transactionsBefore = await countGatewayTransactions(request, token)\n\n const result = await createTpaySession(request, token, {\n amount: 49.99,\n currencyCode: 'PLN',\n })\n\n expect(result.status).toBe(422)\n expect(result.body.code).toBe('gateway_tpay.errors.payerEmailRequired')\n expect(await countGatewayTransactions(request, token)).toBe(transactionsBefore)\n } finally {\n await restoreTpayBaseline(request, token, baseline)\n }\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,QAAQ,YAAY;AAC7B,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,KAAK,SAAS,wCAAwC,MAAM;AAC1D,OAAK,qEAAqE,OAAO,EAAE,QAAQ,MAAM;AAC/F,UAAM,QAAQ,MAAM,aAAa,SAAS,OAAO;AACjD,UAAM,WAAW,MAAM,oBAAoB,SAAS,KAAK;AACzD,SAAK,KAAK,4BAA4B,QAAQ,GAAG,8BAA8B;AAE/E,QAAI;AACF,YAAM,yBAAyB,SAAS,KAAK;AAC7C,YAAM,eAAe,SAAS,OAAO,IAAI;AACzC,YAAM,qBAAqB,MAAM,yBAAyB,SAAS,KAAK;AAExE,YAAM,SAAS,MAAM,kBAAkB,SAAS,OAAO;AAAA,QACrD,QAAQ;AAAA,QACR,cAAc;AAAA,MAChB,CAAC;AAED,aAAO,OAAO,MAAM,EAAE,KAAK,GAAG;AAC9B,aAAO,OAAO,KAAK,IAAI,EAAE,KAAK,wCAAwC;AACtE,aAAO,MAAM,yBAAyB,SAAS,KAAK,CAAC,EAAE,KAAK,kBAAkB;AAAA,IAChF,UAAE;AACA,YAAM,oBAAoB,SAAS,OAAO,QAAQ;AAAA,IACpD;AAAA,EACF,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { expect, test } from "@playwright/test";
|
|
2
|
+
import { getAuthToken } from "@open-mercato/core/modules/core/__integration__/helpers/api";
|
|
3
|
+
import {
|
|
4
|
+
TPAY_PRECONFIGURED_SKIP_REASON,
|
|
5
|
+
captureTpayBaseline,
|
|
6
|
+
hasPreconfiguredTpaySecrets,
|
|
7
|
+
countGatewayTransactions,
|
|
8
|
+
createTpaySession,
|
|
9
|
+
restoreTpayBaseline,
|
|
10
|
+
saveTpayDummyCredentials,
|
|
11
|
+
setTpayEnabled
|
|
12
|
+
} from "./helpers/fixtures.js";
|
|
13
|
+
test.describe("TC-TPAY-003: Tpay session validation", () => {
|
|
14
|
+
test("rejects a non-PLN session before any provider call", async ({ request }) => {
|
|
15
|
+
const token = await getAuthToken(request, "admin");
|
|
16
|
+
const baseline = await captureTpayBaseline(request, token);
|
|
17
|
+
test.skip(hasPreconfiguredTpaySecrets(baseline), TPAY_PRECONFIGURED_SKIP_REASON);
|
|
18
|
+
try {
|
|
19
|
+
await saveTpayDummyCredentials(request, token);
|
|
20
|
+
await setTpayEnabled(request, token, true);
|
|
21
|
+
const transactionsBefore = await countGatewayTransactions(request, token);
|
|
22
|
+
const result = await createTpaySession(request, token, {
|
|
23
|
+
amount: 49.99,
|
|
24
|
+
currencyCode: "EUR",
|
|
25
|
+
metadata: { customerEmail: "qa@example.com", customerName: "QA Payer" }
|
|
26
|
+
});
|
|
27
|
+
expect(result.status).toBe(422);
|
|
28
|
+
expect(result.body.code).toBe("gateway_tpay.errors.currencyNotSupported");
|
|
29
|
+
expect(await countGatewayTransactions(request, token)).toBe(transactionsBefore);
|
|
30
|
+
} finally {
|
|
31
|
+
await restoreTpayBaseline(request, token, baseline);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=TC-TPAY-003.spec.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/gateway_tpay/__integration__/TC-TPAY-003.spec.ts"],
|
|
4
|
+
"sourcesContent": ["import { expect, test } from '@playwright/test'\nimport { getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api'\nimport {\n TPAY_PRECONFIGURED_SKIP_REASON,\n captureTpayBaseline,\n hasPreconfiguredTpaySecrets,\n countGatewayTransactions,\n createTpaySession,\n restoreTpayBaseline,\n saveTpayDummyCredentials,\n setTpayEnabled,\n} from './helpers/fixtures'\n\n/**\n * TC-TPAY-003: Tpay session validation rejects before reaching the provider\n *\n * An EUR session is rejected with 422 `gateway_tpay.errors.currencyNotSupported` and creates no gateway transaction.\n * Uses dummy credentials only; the rejection happens before any network call to Tpay.\n */\ntest.describe('TC-TPAY-003: Tpay session validation', () => {\n test('rejects a non-PLN session before any provider call', async ({ request }) => {\n const token = await getAuthToken(request, 'admin')\n const baseline = await captureTpayBaseline(request, token)\n test.skip(hasPreconfiguredTpaySecrets(baseline), TPAY_PRECONFIGURED_SKIP_REASON)\n\n try {\n await saveTpayDummyCredentials(request, token)\n await setTpayEnabled(request, token, true)\n const transactionsBefore = await countGatewayTransactions(request, token)\n\n const result = await createTpaySession(request, token, {\n amount: 49.99,\n currencyCode: 'EUR', metadata: { customerEmail: 'qa@example.com', customerName: 'QA Payer' },\n })\n\n expect(result.status).toBe(422)\n expect(result.body.code).toBe('gateway_tpay.errors.currencyNotSupported')\n expect(await countGatewayTransactions(request, token)).toBe(transactionsBefore)\n } finally {\n await restoreTpayBaseline(request, token, baseline)\n }\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,QAAQ,YAAY;AAC7B,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,KAAK,SAAS,wCAAwC,MAAM;AAC1D,OAAK,sDAAsD,OAAO,EAAE,QAAQ,MAAM;AAChF,UAAM,QAAQ,MAAM,aAAa,SAAS,OAAO;AACjD,UAAM,WAAW,MAAM,oBAAoB,SAAS,KAAK;AACzD,SAAK,KAAK,4BAA4B,QAAQ,GAAG,8BAA8B;AAE/E,QAAI;AACF,YAAM,yBAAyB,SAAS,KAAK;AAC7C,YAAM,eAAe,SAAS,OAAO,IAAI;AACzC,YAAM,qBAAqB,MAAM,yBAAyB,SAAS,KAAK;AAExE,YAAM,SAAS,MAAM,kBAAkB,SAAS,OAAO;AAAA,QACrD,QAAQ;AAAA,QACR,cAAc;AAAA,QAAO,UAAU,EAAE,eAAe,kBAAkB,cAAc,WAAW;AAAA,MAC7F,CAAC;AAED,aAAO,OAAO,MAAM,EAAE,KAAK,GAAG;AAC9B,aAAO,OAAO,KAAK,IAAI,EAAE,KAAK,0CAA0C;AACxE,aAAO,MAAM,yBAAyB,SAAS,KAAK,CAAC,EAAE,KAAK,kBAAkB;AAAA,IAChF,UAAE;AACA,YAAM,oBAAoB,SAAS,OAAO,QAAQ;AAAA,IACpD;AAAA,EACF,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { apiRequest } from "@open-mercato/core/modules/core/__integration__/helpers/api";
|
|
2
|
+
const TPAY_INTEGRATION_ID = "gateway_tpay";
|
|
3
|
+
const TPAY_DUMMY_CLIENT_ID = "qa-dummy-client-id";
|
|
4
|
+
const TPAY_DUMMY_CLIENT_SECRET = "qa-dummy-client-secret-value";
|
|
5
|
+
const TPAY_PRECONFIGURED_SKIP_REASON = "Tpay secrets are already configured for this tenant; the test cannot restore a write-only secret it cannot read back";
|
|
6
|
+
async function readBody(response) {
|
|
7
|
+
try {
|
|
8
|
+
const parsed = await response.json();
|
|
9
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
10
|
+
} catch {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function readTpayCredentials(request, token) {
|
|
15
|
+
const response = await apiRequest(request, "GET", `/api/integrations/${TPAY_INTEGRATION_ID}/credentials`, { token });
|
|
16
|
+
if (!response.ok()) {
|
|
17
|
+
throw new Error(`Failed to read Tpay credentials: ${response.status()}`);
|
|
18
|
+
}
|
|
19
|
+
const body = await readBody(response);
|
|
20
|
+
return {
|
|
21
|
+
credentials: body.credentials ?? {},
|
|
22
|
+
secretFieldsConfigured: body.secretFieldsConfigured ?? {}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
async function readTpayEnabled(request, token) {
|
|
26
|
+
const response = await apiRequest(request, "GET", `/api/integrations/${TPAY_INTEGRATION_ID}`, { token });
|
|
27
|
+
if (!response.ok()) {
|
|
28
|
+
throw new Error(`Failed to read Tpay integration: ${response.status()}`);
|
|
29
|
+
}
|
|
30
|
+
const body = await readBody(response);
|
|
31
|
+
const state = body.state ?? {};
|
|
32
|
+
return state.isEnabled === true;
|
|
33
|
+
}
|
|
34
|
+
async function captureTpayBaseline(request, token) {
|
|
35
|
+
const { credentials, secretFieldsConfigured } = await readTpayCredentials(request, token);
|
|
36
|
+
const configuredSecretKeys = Object.keys(secretFieldsConfigured).filter((key) => secretFieldsConfigured[key]);
|
|
37
|
+
const nonSecretCredentials = {};
|
|
38
|
+
for (const [key, value] of Object.entries(credentials)) {
|
|
39
|
+
if (configuredSecretKeys.includes(key)) continue;
|
|
40
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null) {
|
|
41
|
+
nonSecretCredentials[key] = value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return { nonSecretCredentials, configuredSecretKeys, isEnabled: await readTpayEnabled(request, token) };
|
|
45
|
+
}
|
|
46
|
+
function hasPreconfiguredTpaySecrets(baseline) {
|
|
47
|
+
return baseline.configuredSecretKeys.length > 0;
|
|
48
|
+
}
|
|
49
|
+
async function saveTpayDummyCredentials(request, token) {
|
|
50
|
+
const response = await apiRequest(request, "PUT", `/api/integrations/${TPAY_INTEGRATION_ID}/credentials`, {
|
|
51
|
+
token,
|
|
52
|
+
data: {
|
|
53
|
+
credentials: {
|
|
54
|
+
clientId: TPAY_DUMMY_CLIENT_ID,
|
|
55
|
+
clientSecret: TPAY_DUMMY_CLIENT_SECRET,
|
|
56
|
+
environment: "sandbox"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
if (!response.ok()) {
|
|
61
|
+
throw new Error(`Failed to save Tpay credentials: ${response.status()} ${await response.text()}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function setTpayEnabled(request, token, isEnabled) {
|
|
65
|
+
const response = await apiRequest(request, "PUT", `/api/integrations/${TPAY_INTEGRATION_ID}/state`, {
|
|
66
|
+
token,
|
|
67
|
+
data: { isEnabled }
|
|
68
|
+
});
|
|
69
|
+
if (!response.ok()) {
|
|
70
|
+
throw new Error(`Failed to set Tpay enabled=${isEnabled}: ${response.status()} ${await response.text()}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async function restoreTpayBaseline(request, token, baseline) {
|
|
74
|
+
const credentialsResponse = await apiRequest(request, "PUT", `/api/integrations/${TPAY_INTEGRATION_ID}/credentials`, {
|
|
75
|
+
token,
|
|
76
|
+
data: {
|
|
77
|
+
credentials: baseline.nonSecretCredentials,
|
|
78
|
+
unchangedSecretFields: baseline.configuredSecretKeys
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
if (!credentialsResponse.ok()) {
|
|
82
|
+
throw new Error(`Failed to restore Tpay credentials: ${credentialsResponse.status()}`);
|
|
83
|
+
}
|
|
84
|
+
const stateResponse = await apiRequest(request, "PUT", `/api/integrations/${TPAY_INTEGRATION_ID}/state`, {
|
|
85
|
+
token,
|
|
86
|
+
data: { isEnabled: baseline.isEnabled }
|
|
87
|
+
});
|
|
88
|
+
if (!stateResponse.ok()) {
|
|
89
|
+
throw new Error(`Failed to restore Tpay state: ${stateResponse.status()}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async function createTpaySession(request, token, data) {
|
|
93
|
+
const response = await apiRequest(request, "POST", "/api/payment_gateways/sessions", {
|
|
94
|
+
token,
|
|
95
|
+
data: { providerKey: "tpay", description: `QA Tpay ${Date.now()}`, ...data }
|
|
96
|
+
});
|
|
97
|
+
return { status: response.status(), body: await readBody(response) };
|
|
98
|
+
}
|
|
99
|
+
async function countGatewayTransactions(request, token) {
|
|
100
|
+
const response = await apiRequest(request, "GET", "/api/payment_gateways/transactions", { token });
|
|
101
|
+
if (!response.ok()) {
|
|
102
|
+
throw new Error(`Failed to list transactions: ${response.status()}`);
|
|
103
|
+
}
|
|
104
|
+
const body = await readBody(response);
|
|
105
|
+
return typeof body.total === "number" ? body.total : 0;
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
TPAY_DUMMY_CLIENT_ID,
|
|
109
|
+
TPAY_DUMMY_CLIENT_SECRET,
|
|
110
|
+
TPAY_INTEGRATION_ID,
|
|
111
|
+
TPAY_PRECONFIGURED_SKIP_REASON,
|
|
112
|
+
captureTpayBaseline,
|
|
113
|
+
countGatewayTransactions,
|
|
114
|
+
createTpaySession,
|
|
115
|
+
hasPreconfiguredTpaySecrets,
|
|
116
|
+
readTpayCredentials,
|
|
117
|
+
readTpayEnabled,
|
|
118
|
+
restoreTpayBaseline,
|
|
119
|
+
saveTpayDummyCredentials,
|
|
120
|
+
setTpayEnabled
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/gateway_tpay/__integration__/helpers/fixtures.ts"],
|
|
4
|
+
"sourcesContent": ["import type { APIRequestContext } from '@playwright/test'\nimport { apiRequest } from '@open-mercato/core/modules/core/__integration__/helpers/api'\n\nexport const TPAY_INTEGRATION_ID = 'gateway_tpay'\nexport const TPAY_DUMMY_CLIENT_ID = 'qa-dummy-client-id'\nexport const TPAY_DUMMY_CLIENT_SECRET = 'qa-dummy-client-secret-value'\nexport const TPAY_PRECONFIGURED_SKIP_REASON =\n 'Tpay secrets are already configured for this tenant; the test cannot restore a write-only secret it cannot read back'\n\ntype JsonRecord = Record<string, unknown>\n\ntype TpayBaseline = {\n nonSecretCredentials: Record<string, string | number | boolean | null>\n configuredSecretKeys: string[]\n isEnabled: boolean\n}\n\nexport type TpayCredentialsResponse = {\n credentials: JsonRecord\n secretFieldsConfigured: Record<string, boolean>\n}\n\nexport type TpaySessionResponse = {\n status: number\n body: JsonRecord\n}\n\nasync function readBody(response: { json: () => Promise<unknown> }): Promise<JsonRecord> {\n try {\n const parsed = await response.json()\n return parsed && typeof parsed === 'object' ? (parsed as JsonRecord) : {}\n } catch {\n return {}\n }\n}\n\nexport async function readTpayCredentials(\n request: APIRequestContext,\n token: string,\n): Promise<TpayCredentialsResponse> {\n const response = await apiRequest(request, 'GET', `/api/integrations/${TPAY_INTEGRATION_ID}/credentials`, { token })\n if (!response.ok()) {\n throw new Error(`Failed to read Tpay credentials: ${response.status()}`)\n }\n const body = await readBody(response)\n return {\n credentials: (body.credentials as JsonRecord | undefined) ?? {},\n secretFieldsConfigured: (body.secretFieldsConfigured as Record<string, boolean> | undefined) ?? {},\n }\n}\n\nexport async function readTpayEnabled(request: APIRequestContext, token: string): Promise<boolean> {\n const response = await apiRequest(request, 'GET', `/api/integrations/${TPAY_INTEGRATION_ID}`, { token })\n if (!response.ok()) {\n throw new Error(`Failed to read Tpay integration: ${response.status()}`)\n }\n const body = await readBody(response)\n const state = (body.state as JsonRecord | undefined) ?? {}\n return state.isEnabled === true\n}\n\nexport async function captureTpayBaseline(request: APIRequestContext, token: string): Promise<TpayBaseline> {\n const { credentials, secretFieldsConfigured } = await readTpayCredentials(request, token)\n const configuredSecretKeys = Object.keys(secretFieldsConfigured).filter((key) => secretFieldsConfigured[key])\n const nonSecretCredentials: TpayBaseline['nonSecretCredentials'] = {}\n for (const [key, value] of Object.entries(credentials)) {\n if (configuredSecretKeys.includes(key)) continue\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null) {\n nonSecretCredentials[key] = value\n }\n }\n return { nonSecretCredentials, configuredSecretKeys, isEnabled: await readTpayEnabled(request, token) }\n}\n\nexport function hasPreconfiguredTpaySecrets(baseline: TpayBaseline): boolean {\n return baseline.configuredSecretKeys.length > 0\n}\n\nexport async function saveTpayDummyCredentials(request: APIRequestContext, token: string): Promise<void> {\n const response = await apiRequest(request, 'PUT', `/api/integrations/${TPAY_INTEGRATION_ID}/credentials`, {\n token,\n data: {\n credentials: {\n clientId: TPAY_DUMMY_CLIENT_ID,\n clientSecret: TPAY_DUMMY_CLIENT_SECRET,\n environment: 'sandbox',\n },\n },\n })\n if (!response.ok()) {\n throw new Error(`Failed to save Tpay credentials: ${response.status()} ${await response.text()}`)\n }\n}\n\nexport async function setTpayEnabled(request: APIRequestContext, token: string, isEnabled: boolean): Promise<void> {\n const response = await apiRequest(request, 'PUT', `/api/integrations/${TPAY_INTEGRATION_ID}/state`, {\n token,\n data: { isEnabled },\n })\n if (!response.ok()) {\n throw new Error(`Failed to set Tpay enabled=${isEnabled}: ${response.status()} ${await response.text()}`)\n }\n}\n\nexport async function restoreTpayBaseline(\n request: APIRequestContext,\n token: string,\n baseline: TpayBaseline,\n): Promise<void> {\n const credentialsResponse = await apiRequest(request, 'PUT', `/api/integrations/${TPAY_INTEGRATION_ID}/credentials`, {\n token,\n data: {\n credentials: baseline.nonSecretCredentials,\n unchangedSecretFields: baseline.configuredSecretKeys,\n },\n })\n if (!credentialsResponse.ok()) {\n throw new Error(`Failed to restore Tpay credentials: ${credentialsResponse.status()}`)\n }\n const stateResponse = await apiRequest(request, 'PUT', `/api/integrations/${TPAY_INTEGRATION_ID}/state`, {\n token,\n data: { isEnabled: baseline.isEnabled },\n })\n if (!stateResponse.ok()) {\n throw new Error(`Failed to restore Tpay state: ${stateResponse.status()}`)\n }\n}\n\nexport async function createTpaySession(\n request: APIRequestContext,\n token: string,\n data: { amount: number; currencyCode: string; metadata?: Record<string, unknown> },\n): Promise<TpaySessionResponse> {\n const response = await apiRequest(request, 'POST', '/api/payment_gateways/sessions', {\n token,\n data: { providerKey: 'tpay', description: `QA Tpay ${Date.now()}`, ...data },\n })\n return { status: response.status(), body: await readBody(response) }\n}\n\nexport async function countGatewayTransactions(request: APIRequestContext, token: string): Promise<number> {\n const response = await apiRequest(request, 'GET', '/api/payment_gateways/transactions', { token })\n if (!response.ok()) {\n throw new Error(`Failed to list transactions: ${response.status()}`)\n }\n const body = await readBody(response)\n return typeof body.total === 'number' ? body.total : 0\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,kBAAkB;AAEpB,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB;AAC7B,MAAM,2BAA2B;AACjC,MAAM,iCACX;AAoBF,eAAe,SAAS,UAAiE;AACvF,MAAI;AACF,UAAM,SAAS,MAAM,SAAS,KAAK;AACnC,WAAO,UAAU,OAAO,WAAW,WAAY,SAAwB,CAAC;AAAA,EAC1E,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;AAEA,eAAsB,oBACpB,SACA,OACkC;AAClC,QAAM,WAAW,MAAM,WAAW,SAAS,OAAO,qBAAqB,mBAAmB,gBAAgB,EAAE,MAAM,CAAC;AACnH,MAAI,CAAC,SAAS,GAAG,GAAG;AAClB,UAAM,IAAI,MAAM,oCAAoC,SAAS,OAAO,CAAC,EAAE;AAAA,EACzE;AACA,QAAM,OAAO,MAAM,SAAS,QAAQ;AACpC,SAAO;AAAA,IACL,aAAc,KAAK,eAA0C,CAAC;AAAA,IAC9D,wBAAyB,KAAK,0BAAkE,CAAC;AAAA,EACnG;AACF;AAEA,eAAsB,gBAAgB,SAA4B,OAAiC;AACjG,QAAM,WAAW,MAAM,WAAW,SAAS,OAAO,qBAAqB,mBAAmB,IAAI,EAAE,MAAM,CAAC;AACvG,MAAI,CAAC,SAAS,GAAG,GAAG;AAClB,UAAM,IAAI,MAAM,oCAAoC,SAAS,OAAO,CAAC,EAAE;AAAA,EACzE;AACA,QAAM,OAAO,MAAM,SAAS,QAAQ;AACpC,QAAM,QAAS,KAAK,SAAoC,CAAC;AACzD,SAAO,MAAM,cAAc;AAC7B;AAEA,eAAsB,oBAAoB,SAA4B,OAAsC;AAC1G,QAAM,EAAE,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ta = {
|
|
2
|
+
description: "Tpay gateway provider configuration and pre-network session rejection coverage (TC-TPAY-001..003)",
|
|
3
|
+
dependsOnModules: ["payment_gateways", "integrations", "gateway_tpay"]
|
|
4
|
+
};
|
|
5
|
+
var meta_default = integrationMeta;
|
|
6
|
+
export {
|
|
7
|
+
meta_default as default,
|
|
8
|
+
integrationMeta
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/gateway_tpay/__integration__/meta.ts"],
|
|
4
|
+
"sourcesContent": ["export const integrationMeta = {\n description: 'Tpay gateway provider configuration and pre-network session rejection coverage (TC-TPAY-001..003)',\n dependsOnModules: ['payment_gateways', 'integrations', 'gateway_tpay'],\n}\n\nexport default integrationMeta\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,kBAAkB;AAAA,EAC7B,aAAa;AAAA,EACb,kBAAkB,CAAC,oBAAoB,gBAAgB,cAAc;AACvE;AAEA,IAAO,eAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const features = [
|
|
2
|
+
{
|
|
3
|
+
id: "gateway_tpay.view",
|
|
4
|
+
title: "View Tpay gateway configuration",
|
|
5
|
+
module: "gateway_tpay",
|
|
6
|
+
dependsOn: ["payment_gateways.view"]
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
id: "gateway_tpay.configure",
|
|
10
|
+
title: "Configure Tpay gateway settings",
|
|
11
|
+
module: "gateway_tpay",
|
|
12
|
+
dependsOn: ["gateway_tpay.view", "payment_gateways.manage"]
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
var acl_default = features;
|
|
16
|
+
export {
|
|
17
|
+
acl_default as default,
|
|
18
|
+
features
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=acl.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/gateway_tpay/acl.ts"],
|
|
4
|
+
"sourcesContent": ["export const features = [\n {\n id: 'gateway_tpay.view',\n title: 'View Tpay gateway configuration',\n module: 'gateway_tpay',\n dependsOn: ['payment_gateways.view'],\n },\n {\n id: 'gateway_tpay.configure',\n title: 'Configure Tpay gateway settings',\n module: 'gateway_tpay',\n dependsOn: ['gateway_tpay.view', 'payment_gateways.manage'],\n },\n]\n\nexport default features\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,WAAW;AAAA,EACtB;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW,CAAC,qBAAqB,yBAAyB;AAAA,EAC5D;AACF;AAEA,IAAO,cAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
2
|
+
import { getTelemetryRuntime } from "@open-mercato/shared/lib/telemetry/runtime";
|
|
3
|
+
import { applyTpayEnvPreset, readTpayEnvPreset } from "./lib/preset.js";
|
|
4
|
+
function parseArgs(args) {
|
|
5
|
+
const result = {};
|
|
6
|
+
for (let i = 0; i < args.length; i++) {
|
|
7
|
+
const arg = args[i];
|
|
8
|
+
if (!arg.startsWith("--")) continue;
|
|
9
|
+
const key = arg.slice(2);
|
|
10
|
+
if (key.includes("=")) {
|
|
11
|
+
const [name, value] = key.split("=");
|
|
12
|
+
result[name] = value;
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const next = args[i + 1];
|
|
16
|
+
if (next && !next.startsWith("--")) {
|
|
17
|
+
result[key] = next;
|
|
18
|
+
i += 1;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
result[key] = true;
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
function printHelp() {
|
|
26
|
+
console.log("Usage: yarn mercato gateway_tpay configure-from-env --tenant <tenantId> --org <organizationId> [--force]");
|
|
27
|
+
console.log("");
|
|
28
|
+
console.log("Required env vars:");
|
|
29
|
+
console.log(" OM_INTEGRATION_TPAY_CLIENT_ID");
|
|
30
|
+
console.log(" OM_INTEGRATION_TPAY_CLIENT_SECRET");
|
|
31
|
+
console.log("");
|
|
32
|
+
console.log("Optional env vars:");
|
|
33
|
+
console.log(" OM_INTEGRATION_TPAY_ENVIRONMENT (sandbox|production, default sandbox)");
|
|
34
|
+
console.log(" OM_INTEGRATION_TPAY_NOTIFICATION_URL");
|
|
35
|
+
console.log(" OM_INTEGRATION_TPAY_NOTIFICATION_SECURITY_CODE");
|
|
36
|
+
console.log(" OM_INTEGRATION_TPAY_ENABLED");
|
|
37
|
+
console.log(" OM_INTEGRATION_TPAY_FORCE_PRECONFIGURE");
|
|
38
|
+
}
|
|
39
|
+
const configureFromEnvCommand = {
|
|
40
|
+
command: "configure-from-env",
|
|
41
|
+
async run(rest) {
|
|
42
|
+
const args = parseArgs(rest);
|
|
43
|
+
const tenantId = String(args.tenantId ?? args.tenant ?? "");
|
|
44
|
+
const organizationId = String(args.organizationId ?? args.orgId ?? args.org ?? "");
|
|
45
|
+
const force = args.force === true;
|
|
46
|
+
if (!tenantId || !organizationId) {
|
|
47
|
+
printHelp();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let preset;
|
|
51
|
+
try {
|
|
52
|
+
preset = await readTpayEnvPreset();
|
|
53
|
+
} catch (error) {
|
|
54
|
+
getTelemetryRuntime()?.reportError(error, { module: "gateway_tpay", code: "gateway_tpay.preset_failed" });
|
|
55
|
+
const message = error instanceof Error ? error.message : "Unknown Tpay preset error";
|
|
56
|
+
console.error(`[gateway_tpay] ${message}`);
|
|
57
|
+
process.exitCode = 1;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (!preset) {
|
|
61
|
+
console.error("[gateway_tpay] No Tpay env preset was found.");
|
|
62
|
+
printHelp();
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const container = await createRequestContainer();
|
|
67
|
+
try {
|
|
68
|
+
const credentialsService = container.resolve("integrationCredentialsService");
|
|
69
|
+
const integrationStateService = container.resolve("integrationStateService");
|
|
70
|
+
const integrationLogService = container.resolve("integrationLogService");
|
|
71
|
+
const result = await applyTpayEnvPreset({
|
|
72
|
+
credentialsService,
|
|
73
|
+
integrationStateService,
|
|
74
|
+
integrationLogService,
|
|
75
|
+
scope: { tenantId, organizationId },
|
|
76
|
+
force
|
|
77
|
+
});
|
|
78
|
+
if (result.status === "skipped") {
|
|
79
|
+
console.log(`[gateway_tpay] Skipped: ${result.reason}`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
console.log(
|
|
83
|
+
`[gateway_tpay] Tpay credentials were configured from env. enabled=${String(result.enabled)} apiVersion=${result.appliedApiVersion ?? "default"}`
|
|
84
|
+
);
|
|
85
|
+
} catch (error) {
|
|
86
|
+
getTelemetryRuntime()?.reportError(error, { module: "gateway_tpay", code: "gateway_tpay.preset_failed" });
|
|
87
|
+
const message = error instanceof Error ? error.message : "Unknown Tpay preset error";
|
|
88
|
+
console.error(`[gateway_tpay] ${message}`);
|
|
89
|
+
process.exitCode = 1;
|
|
90
|
+
} finally {
|
|
91
|
+
const disposable = container;
|
|
92
|
+
if (typeof disposable.dispose === "function") {
|
|
93
|
+
await disposable.dispose();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const helpCommand = {
|
|
99
|
+
command: "help",
|
|
100
|
+
async run() {
|
|
101
|
+
printHelp();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var cli_default = [configureFromEnvCommand, helpCommand];
|
|
105
|
+
export {
|
|
106
|
+
cli_default as default
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/gateway_tpay/cli.ts"],
|
|
4
|
+
"sourcesContent": ["import { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport type { ModuleCli } from '@open-mercato/shared/modules/registry'\nimport type { CredentialsService } from '@open-mercato/core/modules/integrations/lib/credentials-service'\nimport type { IntegrationLogService } from '@open-mercato/core/modules/integrations/lib/log-service'\nimport type { IntegrationStateService } from '@open-mercato/core/modules/integrations/lib/state-service'\nimport { getTelemetryRuntime } from '@open-mercato/shared/lib/telemetry/runtime'\nimport { applyTpayEnvPreset, readTpayEnvPreset } from './lib/preset'\n\nfunction parseArgs(args: string[]): Record<string, string | boolean> {\n const result: Record<string, string | boolean> = {}\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i]\n if (!arg.startsWith('--')) continue\n\n const key = arg.slice(2)\n if (key.includes('=')) {\n const [name, value] = key.split('=')\n result[name] = value\n continue\n }\n\n const next = args[i + 1]\n if (next && !next.startsWith('--')) {\n result[key] = next\n i += 1\n continue\n }\n\n result[key] = true\n }\n\n return result\n}\n\nfunction printHelp(): void {\n console.log('Usage: yarn mercato gateway_tpay configure-from-env --tenant <tenantId> --org <organizationId> [--force]')\n console.log('')\n console.log('Required env vars:')\n console.log(' OM_INTEGRATION_TPAY_CLIENT_ID')\n console.log(' OM_INTEGRATION_TPAY_CLIENT_SECRET')\n console.log('')\n console.log('Optional env vars:')\n console.log(' OM_INTEGRATION_TPAY_ENVIRONMENT (sandbox|production, default sandbox)')\n console.log(' OM_INTEGRATION_TPAY_NOTIFICATION_URL')\n console.log(' OM_INTEGRATION_TPAY_NOTIFICATION_SECURITY_CODE')\n console.log(' OM_INTEGRATION_TPAY_ENABLED')\n console.log(' OM_INTEGRATION_TPAY_FORCE_PRECONFIGURE')\n}\n\nconst configureFromEnvCommand: ModuleCli = {\n command: 'configure-from-env',\n async run(rest) {\n const args = parseArgs(rest)\n const tenantId = String(args.tenantId ?? args.tenant ?? '')\n const organizationId = String(args.organizationId ?? args.orgId ?? args.org ?? '')\n const force = args.force === true\n\n if (!tenantId || !organizationId) {\n printHelp()\n return\n }\n\n let preset: Awaited<ReturnType<typeof readTpayEnvPreset>>\n try {\n preset = await readTpayEnvPreset()\n } catch (error) {\n getTelemetryRuntime()?.reportError(error, { module: 'gateway_tpay', code: 'gateway_tpay.preset_failed' })\n const message = error instanceof Error ? error.message : 'Unknown Tpay preset error'\n console.error(`[gateway_tpay] ${message}`)\n process.exitCode = 1\n return\n }\n if (!preset) {\n console.error('[gateway_tpay] No Tpay env preset was found.')\n printHelp()\n process.exitCode = 1\n return\n }\n\n const container = await createRequestContainer()\n try {\n const credentialsService = container.resolve('integrationCredentialsService') as CredentialsService\n const integrationStateService = container.resolve('integrationStateService') as IntegrationStateService\n const integrationLogService = container.resolve('integrationLogService') as IntegrationLogService\n\n const result = await applyTpayEnvPreset({\n credentialsService,\n integrationStateService,\n integrationLogService,\n scope: { tenantId, organizationId },\n force,\n })\n\n if (result.status === 'skipped') {\n console.log(`[gateway_tpay] Skipped: ${result.reason}`)\n return\n }\n\n console.log(\n `[gateway_tpay] Tpay credentials were configured from env. enabled=${String(result.enabled)} apiVersion=${result.appliedApiVersion ?? 'default'}`,\n )\n } catch (error) {\n getTelemetryRuntime()?.reportError(error, { module: 'gateway_tpay', code: 'gateway_tpay.preset_failed' })\n const message = error instanceof Error ? error.message : 'Unknown Tpay preset error'\n console.error(`[gateway_tpay] ${message}`)\n process.exitCode = 1\n } finally {\n const disposable = container as unknown as { dispose?: () => Promise<void> }\n if (typeof disposable.dispose === 'function') {\n await disposable.dispose()\n }\n }\n },\n}\n\nconst helpCommand: ModuleCli = {\n command: 'help',\n async run() {\n printHelp()\n },\n}\n\nexport default [configureFromEnvCommand, helpCommand]\n"],
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MAC3B;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,cAAyB;AAAA,EAC7B,SAAS;AAAA,EACT,MAAM,MAAM;AACV,cAAU;AAAA,EACZ;AACF;AAEA,IAAO,cAAQ,CAAC,yBAAyB,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { asValue } from "awilix";
|
|
2
|
+
import {
|
|
3
|
+
registerGatewayAdapter,
|
|
4
|
+
registerPaymentGatewayDescriptor
|
|
5
|
+
} from "@open-mercato/shared/modules/payment_gateways/types";
|
|
6
|
+
import { tpayAdapterV1 } from "./lib/adapters/v1.js";
|
|
7
|
+
import { tpayHealthCheck } from "./lib/health.js";
|
|
8
|
+
function register(container) {
|
|
9
|
+
registerGatewayAdapter(tpayAdapterV1, { version: "v1" });
|
|
10
|
+
registerPaymentGatewayDescriptor({
|
|
11
|
+
providerKey: "tpay",
|
|
12
|
+
label: "Tpay",
|
|
13
|
+
sessionConfig: {
|
|
14
|
+
fields: [],
|
|
15
|
+
supportedCurrencies: ["PLN"],
|
|
16
|
+
supportedPaymentTypes: [{ value: "pay_by_link", label: "Online transfer / BLIK (Tpay hosted page)" }],
|
|
17
|
+
presentation: "redirect"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
container.register({
|
|
21
|
+
tpayHealthCheck: asValue(tpayHealthCheck)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
register
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=di.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/gateway_tpay/di.ts"],
|
|
4
|
+
"sourcesContent": ["import { asValue } from 'awilix'\nimport type { AppContainer } from '@open-mercato/shared/lib/di/container'\nimport {\n registerGatewayAdapter,\n registerPaymentGatewayDescriptor,\n} from '@open-mercato/shared/modules/payment_gateways/types'\nimport { tpayAdapterV1 } from './lib/adapters/v1'\nimport { tpayHealthCheck } from './lib/health'\n\nexport function register(container: AppContainer) {\n registerGatewayAdapter(tpayAdapterV1, { version: 'v1' })\n registerPaymentGatewayDescriptor({\n providerKey: 'tpay',\n label: 'Tpay',\n sessionConfig: {\n fields: [],\n supportedCurrencies: ['PLN'],\n supportedPaymentTypes: [{ value: 'pay_by_link', label: 'Online transfer / BLIK (Tpay hosted page)' }],\n presentation: 'redirect',\n },\n })\n\n container.register({\n tpayHealthCheck: asValue(tpayHealthCheck),\n })\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAEzB,SAAS,SAAS,WAAyB;AAChD,yBAAuB,eAAe,EAAE,SAAS,KAAK,CAAC;AACvD,mCAAiC;AAAA,IAC/B,aAAa;AAAA,IACb,OAAO;AAAA,IACP,eAAe;AAAA,MACb,QAAQ,CAAC;AAAA,MACT,qBAAqB,CAAC,KAAK;AAAA,MAC3B,uBAAuB,CAAC,EAAE,OAAO,eAAe,OAAO,4CAA4C,CAAC;AAAA,MACpG,cAAc;AAAA,IAChB;AAAA,EACF,CAAC;AAED,YAAU,SAAS;AAAA,IACjB,iBAAiB,QAAQ,eAAe;AAAA,EAC1C,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/gateway_tpay/index.ts"],
|
|
4
|
+
"sourcesContent": ["export const metadata = {\n id: 'gateway_tpay',\n title: 'Tpay Payment Gateway',\n description: 'Accept hosted PLN payments, BLIK, cards, and bank transfers via Tpay.',\n}\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,WAAW;AAAA,EACtB,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,aAAa;AACf;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const integration = {
|
|
2
|
+
id: "gateway_tpay",
|
|
3
|
+
title: "Tpay",
|
|
4
|
+
description: "Accept hosted PLN payments, BLIK, cards, and bank transfers via Tpay.",
|
|
5
|
+
category: "payment",
|
|
6
|
+
hub: "payment_gateways",
|
|
7
|
+
providerKey: "tpay",
|
|
8
|
+
icon: "tpay",
|
|
9
|
+
docsUrl: "https://docs-api.tpay.com",
|
|
10
|
+
package: "@open-mercato/gateway-tpay",
|
|
11
|
+
version: "1.0.0",
|
|
12
|
+
author: "Open Mercato Team",
|
|
13
|
+
company: "Open Mercato",
|
|
14
|
+
license: "MIT",
|
|
15
|
+
tags: ["bank-transfer", "pay-by-link", "blik", "pln"],
|
|
16
|
+
apiVersions: [
|
|
17
|
+
{
|
|
18
|
+
id: "v1",
|
|
19
|
+
label: "Tpay Open API",
|
|
20
|
+
status: "stable",
|
|
21
|
+
default: true,
|
|
22
|
+
changelog: "Hosted PLN payment sessions and status reads through the Tpay Open API."
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
credentials: {
|
|
26
|
+
fields: [
|
|
27
|
+
{
|
|
28
|
+
key: "clientId",
|
|
29
|
+
label: "Client ID",
|
|
30
|
+
type: "text",
|
|
31
|
+
required: true,
|
|
32
|
+
helpText: "Tpay Merchant Panel -> Integrations -> API. Create an API key and copy its Client ID."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "clientSecret",
|
|
36
|
+
label: "Client Secret",
|
|
37
|
+
type: "secret",
|
|
38
|
+
required: true,
|
|
39
|
+
helpText: "Tpay Merchant Panel -> Integrations -> API. Copy the Secret of the same API key as the Client ID."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "environment",
|
|
43
|
+
label: "Environment",
|
|
44
|
+
type: "select",
|
|
45
|
+
required: true,
|
|
46
|
+
options: [
|
|
47
|
+
{ value: "sandbox", label: "Sandbox" },
|
|
48
|
+
{ value: "production", label: "Production" }
|
|
49
|
+
],
|
|
50
|
+
helpText: "Use Sandbox with credentials from the Tpay sandbox panel and Production with live credentials."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "notificationUrl",
|
|
54
|
+
label: "Notification URL",
|
|
55
|
+
type: "url",
|
|
56
|
+
required: false,
|
|
57
|
+
placeholder: "https://shop.example.com/notifications/tpay",
|
|
58
|
+
helpText: "Public HTTPS address on port 443 (sandbox also allows HTTP and port 8080) without credentials, query string, or fragment. Leave empty if the Tpay Merchant Panel already configures the notification address."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "notificationSecurityCode",
|
|
62
|
+
label: "Notification Security Code",
|
|
63
|
+
type: "secret",
|
|
64
|
+
required: false,
|
|
65
|
+
helpText: "Tpay Merchant Panel -> Integrations -> Notifications. Security code used to verify payment notifications. Optional until notification handling is enabled."
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
healthCheck: { service: "tpayHealthCheck" }
|
|
70
|
+
};
|
|
71
|
+
const integrations = [integration];
|
|
72
|
+
const bundles = [];
|
|
73
|
+
const bundle = void 0;
|
|
74
|
+
export {
|
|
75
|
+
bundle,
|
|
76
|
+
bundles,
|
|
77
|
+
integration,
|
|
78
|
+
integrations
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=integration.js.map
|