@open-mercato/checkout 0.10.1-develop.7614.1.75d5ac1a6a → 0.10.1-develop.7618.1.ba9531c18e
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 +1 -1
- package/README.md +1 -0
- package/dist/modules/checkout/__integration__/TC-CHKT-044-payer-fields.spec.js +104 -0
- package/dist/modules/checkout/__integration__/TC-CHKT-044-payer-fields.spec.js.map +7 -0
- package/dist/modules/checkout/commands/links.js +3 -0
- package/dist/modules/checkout/commands/links.js.map +2 -2
- package/dist/modules/checkout/commands/templates.js +7 -0
- package/dist/modules/checkout/commands/templates.js.map +2 -2
- package/dist/modules/checkout/components/LinkTemplateForm.js +18 -0
- package/dist/modules/checkout/components/LinkTemplateForm.js.map +2 -2
- package/dist/modules/checkout/lib/payerFieldRequirements.js +51 -0
- package/dist/modules/checkout/lib/payerFieldRequirements.js.map +7 -0
- package/package.json +5 -5
- package/src/modules/checkout/__integration__/TC-CHKT-044-payer-fields.spec.ts +129 -0
- package/src/modules/checkout/commands/__tests__/payer-fields.test.ts +160 -0
- package/src/modules/checkout/commands/links.ts +3 -0
- package/src/modules/checkout/commands/templates.ts +7 -0
- package/src/modules/checkout/components/LinkTemplateForm.tsx +27 -0
- package/src/modules/checkout/i18n/de.json +3 -0
- package/src/modules/checkout/i18n/en.json +3 -0
- package/src/modules/checkout/i18n/es.json +3 -0
- package/src/modules/checkout/i18n/ko.json +3 -0
- package/src/modules/checkout/i18n/pl.json +3 -0
- package/src/modules/checkout/lib/__tests__/payerFieldRequirements.test.ts +135 -0
- package/src/modules/checkout/lib/payerFieldRequirements.ts +72 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CrudHttpError } from "@open-mercato/shared/lib/crud/errors";
|
|
2
|
+
import {
|
|
3
|
+
getPaymentGatewayDescriptor
|
|
4
|
+
} from "@open-mercato/shared/modules/payment_gateways/types";
|
|
5
|
+
const PAYER_FIELDS_NOT_COLLECTED_MESSAGE_KEY = "checkout.validation.gatewayProviderKey.payerFieldsNotCollected";
|
|
6
|
+
const PAYER_FIELD_CUSTOMER_FIELD_KEYS = {
|
|
7
|
+
email: ["email"],
|
|
8
|
+
name: ["firstName", "lastName"]
|
|
9
|
+
};
|
|
10
|
+
function isKnownPayerField(value) {
|
|
11
|
+
return Object.prototype.hasOwnProperty.call(PAYER_FIELD_CUSTOMER_FIELD_KEYS, value);
|
|
12
|
+
}
|
|
13
|
+
function findUncollectedPayerFields(input) {
|
|
14
|
+
const requested = Array.from(new Set(input.requiredPayerFields ?? [])).filter(isKnownPayerField);
|
|
15
|
+
if (requested.length === 0) return [];
|
|
16
|
+
if (input.collectCustomerDetails === false) return requested;
|
|
17
|
+
const requiredCustomerFieldKeys = new Set(
|
|
18
|
+
(input.customerFieldsSchema ?? []).filter((field) => field.required === true && typeof field.key === "string").map((field) => field.key)
|
|
19
|
+
);
|
|
20
|
+
return requested.filter(
|
|
21
|
+
(payerField) => PAYER_FIELD_CUSTOMER_FIELD_KEYS[payerField].some((key) => !requiredCustomerFieldKeys.has(key))
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function resolveRequiredPayerFields(providerKey) {
|
|
25
|
+
const normalizedProviderKey = typeof providerKey === "string" ? providerKey.trim() : "";
|
|
26
|
+
if (!normalizedProviderKey) return [];
|
|
27
|
+
return getPaymentGatewayDescriptor(normalizedProviderKey)?.requiresPayerFields ?? [];
|
|
28
|
+
}
|
|
29
|
+
function ensurePayerFieldsCollected(configuration) {
|
|
30
|
+
const missing = findUncollectedPayerFields({
|
|
31
|
+
requiredPayerFields: resolveRequiredPayerFields(configuration.gatewayProviderKey),
|
|
32
|
+
collectCustomerDetails: configuration.collectCustomerDetails,
|
|
33
|
+
customerFieldsSchema: configuration.customerFieldsSchema
|
|
34
|
+
});
|
|
35
|
+
if (missing.length === 0) return;
|
|
36
|
+
throw new CrudHttpError(422, {
|
|
37
|
+
error: "Validation failed",
|
|
38
|
+
fieldErrors: {
|
|
39
|
+
gatewayProviderKey: PAYER_FIELDS_NOT_COLLECTED_MESSAGE_KEY
|
|
40
|
+
},
|
|
41
|
+
missingPayerFields: missing
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
PAYER_FIELDS_NOT_COLLECTED_MESSAGE_KEY,
|
|
46
|
+
PAYER_FIELD_CUSTOMER_FIELD_KEYS,
|
|
47
|
+
ensurePayerFieldsCollected,
|
|
48
|
+
findUncollectedPayerFields,
|
|
49
|
+
resolveRequiredPayerFields
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=payerFieldRequirements.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/checkout/lib/payerFieldRequirements.ts"],
|
|
4
|
+
"sourcesContent": ["import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport {\n getPaymentGatewayDescriptor,\n type PaymentGatewayPayerField,\n} from '@open-mercato/shared/modules/payment_gateways/types'\n\nexport const PAYER_FIELDS_NOT_COLLECTED_MESSAGE_KEY = 'checkout.validation.gatewayProviderKey.payerFieldsNotCollected'\n\nexport const PAYER_FIELD_CUSTOMER_FIELD_KEYS: Readonly<Record<PaymentGatewayPayerField, readonly string[]>> = {\n email: ['email'],\n name: ['firstName', 'lastName'],\n}\n\ntype CustomerFieldRequirementLike = {\n key?: unknown\n required?: unknown\n}\n\nexport type PayerFieldCollectionInput = {\n requiredPayerFields: readonly string[] | null | undefined\n collectCustomerDetails: boolean | null | undefined\n customerFieldsSchema: readonly CustomerFieldRequirementLike[] | null | undefined\n}\n\nexport type CheckoutPayerFieldConfiguration = {\n gatewayProviderKey?: string | null\n collectCustomerDetails?: boolean | null\n customerFieldsSchema?: readonly CustomerFieldRequirementLike[] | null\n}\n\nfunction isKnownPayerField(value: string): value is PaymentGatewayPayerField {\n return Object.prototype.hasOwnProperty.call(PAYER_FIELD_CUSTOMER_FIELD_KEYS, value)\n}\n\nexport function findUncollectedPayerFields(input: PayerFieldCollectionInput): PaymentGatewayPayerField[] {\n const requested = Array.from(new Set(input.requiredPayerFields ?? [])).filter(isKnownPayerField)\n if (requested.length === 0) return []\n if (input.collectCustomerDetails === false) return requested\n\n const requiredCustomerFieldKeys = new Set(\n (input.customerFieldsSchema ?? [])\n .filter((field) => field.required === true && typeof field.key === 'string')\n .map((field) => field.key as string),\n )\n\n return requested.filter((payerField) =>\n PAYER_FIELD_CUSTOMER_FIELD_KEYS[payerField].some((key) => !requiredCustomerFieldKeys.has(key)),\n )\n}\n\nexport function resolveRequiredPayerFields(providerKey: string | null | undefined): PaymentGatewayPayerField[] {\n const normalizedProviderKey = typeof providerKey === 'string' ? providerKey.trim() : ''\n if (!normalizedProviderKey) return []\n return getPaymentGatewayDescriptor(normalizedProviderKey)?.requiresPayerFields ?? []\n}\n\nexport function ensurePayerFieldsCollected(configuration: CheckoutPayerFieldConfiguration): void {\n const missing = findUncollectedPayerFields({\n requiredPayerFields: resolveRequiredPayerFields(configuration.gatewayProviderKey),\n collectCustomerDetails: configuration.collectCustomerDetails,\n customerFieldsSchema: configuration.customerFieldsSchema,\n })\n if (missing.length === 0) return\n\n throw new CrudHttpError(422, {\n error: 'Validation failed',\n fieldErrors: {\n gatewayProviderKey: PAYER_FIELDS_NOT_COLLECTED_MESSAGE_KEY,\n },\n missingPayerFields: missing,\n })\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,OAEK;AAEA,MAAM,yCAAyC;AAE/C,MAAM,kCAAiG;AAAA,EAC5G,OAAO,CAAC,OAAO;AAAA,EACf,MAAM,CAAC,aAAa,UAAU;AAChC;AAmBA,SAAS,kBAAkB,OAAkD;AAC3E,SAAO,OAAO,UAAU,eAAe,KAAK,iCAAiC,KAAK;AACpF;AAEO,SAAS,2BAA2B,OAA8D;AACvG,QAAM,YAAY,MAAM,KAAK,IAAI,IAAI,MAAM,uBAAuB,CAAC,CAAC,CAAC,EAAE,OAAO,iBAAiB;AAC/F,MAAI,UAAU,WAAW,EAAG,QAAO,CAAC;AACpC,MAAI,MAAM,2BAA2B,MAAO,QAAO;AAEnD,QAAM,4BAA4B,IAAI;AAAA,KACnC,MAAM,wBAAwB,CAAC,GAC7B,OAAO,CAAC,UAAU,MAAM,aAAa,QAAQ,OAAO,MAAM,QAAQ,QAAQ,EAC1E,IAAI,CAAC,UAAU,MAAM,GAAa;AAAA,EACvC;AAEA,SAAO,UAAU;AAAA,IAAO,CAAC,eACvB,gCAAgC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,0BAA0B,IAAI,GAAG,CAAC;AAAA,EAC/F;AACF;AAEO,SAAS,2BAA2B,aAAoE;AAC7G,QAAM,wBAAwB,OAAO,gBAAgB,WAAW,YAAY,KAAK,IAAI;AACrF,MAAI,CAAC,sBAAuB,QAAO,CAAC;AACpC,SAAO,4BAA4B,qBAAqB,GAAG,uBAAuB,CAAC;AACrF;AAEO,SAAS,2BAA2B,eAAsD;AAC/F,QAAM,UAAU,2BAA2B;AAAA,IACzC,qBAAqB,2BAA2B,cAAc,kBAAkB;AAAA,IAChF,wBAAwB,cAAc;AAAA,IACtC,sBAAsB,cAAc;AAAA,EACtC,CAAC;AACD,MAAI,QAAQ,WAAW,EAAG;AAE1B,QAAM,IAAI,cAAc,KAAK;AAAA,IAC3B,OAAO;AAAA,IACP,aAAa;AAAA,MACX,oBAAoB;AAAA,IACtB;AAAA,IACA,oBAAoB;AAAA,EACtB,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/checkout",
|
|
3
|
-
"version": "0.10.1-develop.
|
|
3
|
+
"version": "0.10.1-develop.7618.1.ba9531c18e",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -62,18 +62,18 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@open-mercato/core": "0.10.1-develop.
|
|
66
|
-
"@open-mercato/ui": "0.10.1-develop.
|
|
65
|
+
"@open-mercato/core": "0.10.1-develop.7618.1.ba9531c18e",
|
|
66
|
+
"@open-mercato/ui": "0.10.1-develop.7618.1.ba9531c18e",
|
|
67
67
|
"bcryptjs": "^3.0.3"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@mikro-orm/postgresql": "^7.0.14",
|
|
71
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
71
|
+
"@open-mercato/shared": "0.10.1-develop.7618.1.ba9531c18e",
|
|
72
72
|
"react": "^19.0.0",
|
|
73
73
|
"react-dom": "^19.0.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
76
|
+
"@open-mercato/shared": "0.10.1-develop.7618.1.ba9531c18e",
|
|
77
77
|
"@types/jest": "^30.0.0",
|
|
78
78
|
"@types/react": "^19.2.18",
|
|
79
79
|
"@types/react-dom": "^19.2.5",
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { expect, test, type APIRequestContext } from '@playwright/test'
|
|
2
|
+
import { apiRequest, getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api'
|
|
3
|
+
import { readJsonSafe } from '@open-mercato/core/modules/core/__integration__/helpers/generalFixtures'
|
|
4
|
+
import {
|
|
5
|
+
createFixedTemplateInput,
|
|
6
|
+
deleteCheckoutEntityIfExists,
|
|
7
|
+
updateLink,
|
|
8
|
+
updateTemplate,
|
|
9
|
+
} from './helpers/fixtures'
|
|
10
|
+
|
|
11
|
+
const PAYER_REQUIRED_PROVIDER = 'mock_payer_required'
|
|
12
|
+
const PAYER_FIELDS_ERROR_KEY = 'checkout.validation.gatewayProviderKey.payerFieldsNotCollected'
|
|
13
|
+
|
|
14
|
+
const DEFAULT_CUSTOMER_FIELDS = [
|
|
15
|
+
{ key: 'firstName', label: 'First name', kind: 'text', required: true, fixed: false, sortOrder: 0 },
|
|
16
|
+
{ key: 'lastName', label: 'Last name', kind: 'text', required: true, fixed: false, sortOrder: 1 },
|
|
17
|
+
{ key: 'email', label: 'Email', kind: 'text', required: true, fixed: false, sortOrder: 2 },
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
const OPTIONAL_EMAIL_CUSTOMER_FIELDS = DEFAULT_CUSTOMER_FIELDS.map((field) => (
|
|
21
|
+
field.key === 'email' ? { ...field, required: false } : field
|
|
22
|
+
))
|
|
23
|
+
|
|
24
|
+
async function postCheckout(
|
|
25
|
+
request: APIRequestContext,
|
|
26
|
+
token: string,
|
|
27
|
+
kind: 'templates' | 'links',
|
|
28
|
+
data: Record<string, unknown>,
|
|
29
|
+
) {
|
|
30
|
+
const response = await apiRequest(request, 'POST', `/api/checkout/${kind}`, { token, data })
|
|
31
|
+
const body = await readJsonSafe<{ id?: string; fieldErrors?: Record<string, string> }>(response)
|
|
32
|
+
return { status: response.status(), body }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function expectPayerFieldsRejected(response: { status(): number; json(): Promise<unknown> }) {
|
|
36
|
+
expect(response.status()).toBe(422)
|
|
37
|
+
expect(await response.json()).toMatchObject({
|
|
38
|
+
fieldErrors: { gatewayProviderKey: PAYER_FIELDS_ERROR_KEY },
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
test.describe('TC-CHKT-044: Link/template save rejects providers whose required payer fields are not collected', () => {
|
|
43
|
+
test('template create/update enforces the payer fields declared by the provider descriptor', async ({ request }) => {
|
|
44
|
+
let token: string | null = null
|
|
45
|
+
let templateId: string | null = null
|
|
46
|
+
let unaffectedTemplateId: string | null = null
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
token = await getAuthToken(request)
|
|
50
|
+
|
|
51
|
+
const rejected = await postCheckout(request, token, 'templates', {
|
|
52
|
+
...createFixedTemplateInput({ gatewayProviderKey: PAYER_REQUIRED_PROVIDER, collectCustomerDetails: false }),
|
|
53
|
+
})
|
|
54
|
+
expect(rejected.status).toBe(422)
|
|
55
|
+
expect(rejected.body?.fieldErrors?.gatewayProviderKey).toBe(PAYER_FIELDS_ERROR_KEY)
|
|
56
|
+
|
|
57
|
+
const rejectedOptionalEmail = await postCheckout(request, token, 'templates', {
|
|
58
|
+
...createFixedTemplateInput({ gatewayProviderKey: PAYER_REQUIRED_PROVIDER }),
|
|
59
|
+
customerFieldsSchema: OPTIONAL_EMAIL_CUSTOMER_FIELDS,
|
|
60
|
+
})
|
|
61
|
+
expect(rejectedOptionalEmail.status).toBe(422)
|
|
62
|
+
expect(rejectedOptionalEmail.body?.fieldErrors?.gatewayProviderKey).toBe(PAYER_FIELDS_ERROR_KEY)
|
|
63
|
+
|
|
64
|
+
const created = await postCheckout(request, token, 'templates', {
|
|
65
|
+
...createFixedTemplateInput({ gatewayProviderKey: PAYER_REQUIRED_PROVIDER }),
|
|
66
|
+
customerFieldsSchema: DEFAULT_CUSTOMER_FIELDS,
|
|
67
|
+
})
|
|
68
|
+
expect(created.status).toBe(201)
|
|
69
|
+
templateId = created.body?.id ?? null
|
|
70
|
+
expect(templateId).toBeTruthy()
|
|
71
|
+
|
|
72
|
+
await expectPayerFieldsRejected(await updateTemplate(request, token, templateId!, {
|
|
73
|
+
customerFieldsSchema: OPTIONAL_EMAIL_CUSTOMER_FIELDS,
|
|
74
|
+
}))
|
|
75
|
+
|
|
76
|
+
const unaffected = await postCheckout(request, token, 'templates', {
|
|
77
|
+
...createFixedTemplateInput({ gatewayProviderKey: 'mock', collectCustomerDetails: false }),
|
|
78
|
+
})
|
|
79
|
+
expect(unaffected.status).toBe(201)
|
|
80
|
+
unaffectedTemplateId = unaffected.body?.id ?? null
|
|
81
|
+
} finally {
|
|
82
|
+
await deleteCheckoutEntityIfExists(request, token, 'templates', templateId)
|
|
83
|
+
await deleteCheckoutEntityIfExists(request, token, 'templates', unaffectedTemplateId)
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
test('link create/update enforces the payer fields declared by the provider descriptor', async ({ request }) => {
|
|
88
|
+
let token: string | null = null
|
|
89
|
+
let linkId: string | null = null
|
|
90
|
+
let unaffectedLinkId: string | null = null
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
token = await getAuthToken(request)
|
|
94
|
+
|
|
95
|
+
const rejected = await postCheckout(request, token, 'links', {
|
|
96
|
+
...createFixedTemplateInput({ gatewayProviderKey: PAYER_REQUIRED_PROVIDER, collectCustomerDetails: false }),
|
|
97
|
+
})
|
|
98
|
+
expect(rejected.status).toBe(422)
|
|
99
|
+
expect(rejected.body?.fieldErrors?.gatewayProviderKey).toBe(PAYER_FIELDS_ERROR_KEY)
|
|
100
|
+
|
|
101
|
+
const created = await postCheckout(request, token, 'links', {
|
|
102
|
+
...createFixedTemplateInput({ gatewayProviderKey: PAYER_REQUIRED_PROVIDER }),
|
|
103
|
+
customerFieldsSchema: DEFAULT_CUSTOMER_FIELDS,
|
|
104
|
+
})
|
|
105
|
+
expect(created.status).toBe(201)
|
|
106
|
+
linkId = created.body?.id ?? null
|
|
107
|
+
expect(linkId).toBeTruthy()
|
|
108
|
+
|
|
109
|
+
await expectPayerFieldsRejected(await updateLink(request, token, linkId!, {
|
|
110
|
+
collectCustomerDetails: false,
|
|
111
|
+
}))
|
|
112
|
+
|
|
113
|
+
const accepted = await updateLink(request, token, linkId!, {
|
|
114
|
+
gatewayProviderKey: 'mock',
|
|
115
|
+
collectCustomerDetails: false,
|
|
116
|
+
})
|
|
117
|
+
expect(accepted.status()).toBe(200)
|
|
118
|
+
|
|
119
|
+
const unaffected = await postCheckout(request, token, 'links', {
|
|
120
|
+
...createFixedTemplateInput({ gatewayProviderKey: 'mock', collectCustomerDetails: false }),
|
|
121
|
+
})
|
|
122
|
+
expect(unaffected.status).toBe(201)
|
|
123
|
+
unaffectedLinkId = unaffected.body?.id ?? null
|
|
124
|
+
} finally {
|
|
125
|
+
await deleteCheckoutEntityIfExists(request, token, 'links', linkId)
|
|
126
|
+
await deleteCheckoutEntityIfExists(request, token, 'links', unaffectedLinkId)
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
})
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/** @jest-environment node */
|
|
2
|
+
|
|
3
|
+
import { commandRegistry } from '@open-mercato/shared/lib/commands/registry'
|
|
4
|
+
import type { CommandRuntimeContext } from '@open-mercato/shared/lib/commands/types'
|
|
5
|
+
import {
|
|
6
|
+
clearPaymentGatewayDescriptors,
|
|
7
|
+
registerPaymentGatewayDescriptor,
|
|
8
|
+
} from '@open-mercato/shared/modules/payment_gateways/types'
|
|
9
|
+
import { DEFAULT_CHECKOUT_CUSTOMER_FIELDS } from '../../lib/defaults'
|
|
10
|
+
import { PAYER_FIELDS_NOT_COLLECTED_MESSAGE_KEY } from '../../lib/payerFieldRequirements'
|
|
11
|
+
|
|
12
|
+
const ORG_ID = '123e4567-e89b-12d3-a456-426614174000'
|
|
13
|
+
const TENANT_ID = '123e4567-e89b-12d3-a456-426614174001'
|
|
14
|
+
const LINK_ID = '123e4567-e89b-12d3-a456-426614174010'
|
|
15
|
+
const TEMPLATE_ID = '123e4567-e89b-12d3-a456-426614174020'
|
|
16
|
+
const FLUSH_SENTINEL = 'FLUSH_REACHED_AFTER_VALIDATION'
|
|
17
|
+
|
|
18
|
+
const mockFindOneWithDecryption = jest.fn()
|
|
19
|
+
|
|
20
|
+
jest.mock('@open-mercato/shared/lib/encryption/find', () => ({
|
|
21
|
+
findOneWithDecryption: jest.fn((...args: unknown[]) => mockFindOneWithDecryption(...args)),
|
|
22
|
+
}))
|
|
23
|
+
|
|
24
|
+
jest.mock('../../lib/gatewayProviderAvailability', () => ({
|
|
25
|
+
ensureGatewayProviderConfigured: jest.fn(async () => undefined),
|
|
26
|
+
getGatewayProviderConfigurationMessageKey: jest.fn(() => null),
|
|
27
|
+
}))
|
|
28
|
+
|
|
29
|
+
jest.mock('@open-mercato/shared/lib/commands/helpers', () => ({
|
|
30
|
+
setCustomFieldsIfAny: jest.fn(async () => undefined),
|
|
31
|
+
}))
|
|
32
|
+
|
|
33
|
+
jest.mock('@open-mercato/shared/lib/commands/customFieldSnapshots', () => ({
|
|
34
|
+
loadCustomFieldSnapshot: jest.fn(async () => ({})),
|
|
35
|
+
buildCustomFieldResetMap: jest.fn(() => ({})),
|
|
36
|
+
}))
|
|
37
|
+
|
|
38
|
+
jest.mock('@open-mercato/shared/lib/crud/custom-fields', () => ({
|
|
39
|
+
loadCustomFieldValues: jest.fn(async () => ({})),
|
|
40
|
+
}))
|
|
41
|
+
|
|
42
|
+
jest.mock('../../events', () => ({
|
|
43
|
+
emitCheckoutEvent: jest.fn(async () => undefined),
|
|
44
|
+
}))
|
|
45
|
+
|
|
46
|
+
import '../links'
|
|
47
|
+
import '../templates'
|
|
48
|
+
|
|
49
|
+
const mockEm = {
|
|
50
|
+
flush: jest.fn(async () => {
|
|
51
|
+
throw new Error(FLUSH_SENTINEL)
|
|
52
|
+
}),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function makeContext(): CommandRuntimeContext {
|
|
56
|
+
return {
|
|
57
|
+
container: {
|
|
58
|
+
resolve: (token: string) => {
|
|
59
|
+
if (token === 'em') return mockEm
|
|
60
|
+
if (token === 'dataEngine') return {}
|
|
61
|
+
if (token === 'paymentGatewayDescriptorService') return {}
|
|
62
|
+
throw new Error('not registered')
|
|
63
|
+
},
|
|
64
|
+
} as unknown as CommandRuntimeContext['container'],
|
|
65
|
+
auth: { orgId: ORG_ID, tenantId: TENANT_ID } as CommandRuntimeContext['auth'],
|
|
66
|
+
organizationScope: null,
|
|
67
|
+
selectedOrganizationId: ORG_ID,
|
|
68
|
+
organizationIds: [ORG_ID],
|
|
69
|
+
request: new Request('http://localhost/api/checkout/links/x', { method: 'PUT' }),
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function storedRecord(id: string, overrides: Record<string, unknown> = {}) {
|
|
74
|
+
return {
|
|
75
|
+
id,
|
|
76
|
+
organizationId: ORG_ID,
|
|
77
|
+
tenantId: TENANT_ID,
|
|
78
|
+
name: 'Record',
|
|
79
|
+
title: null,
|
|
80
|
+
slug: 'record',
|
|
81
|
+
templateId: null,
|
|
82
|
+
status: 'draft',
|
|
83
|
+
isLocked: false,
|
|
84
|
+
pricingMode: 'fixed',
|
|
85
|
+
gatewayProviderKey: 'payer_required',
|
|
86
|
+
gatewaySettings: {},
|
|
87
|
+
collectCustomerDetails: true,
|
|
88
|
+
customerFieldsSchema: DEFAULT_CHECKOUT_CUSTOMER_FIELDS.map((field) => ({ ...field })),
|
|
89
|
+
fixedPriceAmount: null,
|
|
90
|
+
fixedPriceOriginalAmount: null,
|
|
91
|
+
customAmountMin: null,
|
|
92
|
+
customAmountMax: null,
|
|
93
|
+
passwordHash: null,
|
|
94
|
+
updatedAt: new Date('2026-06-01T10:00:00.000Z'),
|
|
95
|
+
...overrides,
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function runUpdate(commandId: string, input: Record<string, unknown>) {
|
|
100
|
+
const handler = commandRegistry.get(commandId)
|
|
101
|
+
if (!handler) throw new Error(`Command ${commandId} not registered`)
|
|
102
|
+
return handler.execute(input, makeContext())
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const payerFieldsRejection = {
|
|
106
|
+
status: 422,
|
|
107
|
+
body: { fieldErrors: { gatewayProviderKey: PAYER_FIELDS_NOT_COLLECTED_MESSAGE_KEY } },
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
describe.each([
|
|
111
|
+
['checkout.link.update', LINK_ID],
|
|
112
|
+
['checkout.template.update', TEMPLATE_ID],
|
|
113
|
+
])('%s payer-field validation on the merged state', (commandId, recordId) => {
|
|
114
|
+
beforeAll(() => {
|
|
115
|
+
clearPaymentGatewayDescriptors()
|
|
116
|
+
registerPaymentGatewayDescriptor({
|
|
117
|
+
providerKey: 'payer_required',
|
|
118
|
+
label: 'Payer required',
|
|
119
|
+
requiresPayerFields: ['email', 'name'],
|
|
120
|
+
})
|
|
121
|
+
registerPaymentGatewayDescriptor({ providerKey: 'no_payer', label: 'No payer data' })
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
afterAll(() => {
|
|
125
|
+
clearPaymentGatewayDescriptors()
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
beforeEach(() => {
|
|
129
|
+
jest.clearAllMocks()
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it('rejects a patch that turns off customer details for a provider requiring payer fields', async () => {
|
|
133
|
+
mockFindOneWithDecryption.mockResolvedValue(storedRecord(recordId))
|
|
134
|
+
await expect(runUpdate(commandId, { id: recordId, collectCustomerDetails: false }))
|
|
135
|
+
.rejects.toMatchObject(payerFieldsRejection)
|
|
136
|
+
expect(mockEm.flush).not.toHaveBeenCalled()
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
it('rejects an unrelated patch while the stored record is still misconfigured', async () => {
|
|
140
|
+
mockFindOneWithDecryption.mockResolvedValue(storedRecord(recordId, {
|
|
141
|
+
customerFieldsSchema: DEFAULT_CHECKOUT_CUSTOMER_FIELDS.map((field) => (
|
|
142
|
+
field.key === 'email' ? { ...field, required: false } : { ...field }
|
|
143
|
+
)),
|
|
144
|
+
}))
|
|
145
|
+
await expect(runUpdate(commandId, { id: recordId, name: 'Renamed' }))
|
|
146
|
+
.rejects.toMatchObject(payerFieldsRejection)
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
it('accepts a patch that fixes the stored misconfiguration', async () => {
|
|
150
|
+
mockFindOneWithDecryption.mockResolvedValue(storedRecord(recordId, { collectCustomerDetails: false }))
|
|
151
|
+
await expect(runUpdate(commandId, { id: recordId, collectCustomerDetails: true }))
|
|
152
|
+
.rejects.toThrow(FLUSH_SENTINEL)
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
it('accepts a patch that switches to a provider declaring no payer fields', async () => {
|
|
156
|
+
mockFindOneWithDecryption.mockResolvedValue(storedRecord(recordId, { collectCustomerDetails: false }))
|
|
157
|
+
await expect(runUpdate(commandId, { id: recordId, gatewayProviderKey: 'no_payer' }))
|
|
158
|
+
.rejects.toThrow(FLUSH_SENTINEL)
|
|
159
|
+
})
|
|
160
|
+
})
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
ensureGatewayProviderConfigured,
|
|
18
18
|
type PaymentGatewayDescriptorService,
|
|
19
19
|
} from '../lib/gatewayProviderAvailability'
|
|
20
|
+
import { ensurePayerFieldsCollected } from '../lib/payerFieldRequirements'
|
|
20
21
|
import { emitCheckoutEvent } from '../events'
|
|
21
22
|
import {
|
|
22
23
|
deriveConfiguredCurrencies,
|
|
@@ -101,6 +102,7 @@ const createLinkCommand: CommandHandler<Record<string, unknown>, { id: string; s
|
|
|
101
102
|
validateDescriptorCurrencies(sourceValues.gatewayProviderKey ?? null, deriveConfiguredCurrencies(sourceValues))
|
|
102
103
|
const descriptorService = ctx.container.resolve('paymentGatewayDescriptorService') as PaymentGatewayDescriptorService
|
|
103
104
|
await ensureGatewayProviderConfigured(sourceValues.gatewayProviderKey ?? null, descriptorService, scope)
|
|
105
|
+
ensurePayerFieldsCollected(sourceValues)
|
|
104
106
|
if (isCheckoutLinkPublic(sourceValues.status) && !sourceValues.gatewayProviderKey) {
|
|
105
107
|
throw new CrudHttpError(422, { error: 'A payment gateway must be configured before this link can be published' })
|
|
106
108
|
}
|
|
@@ -302,6 +304,7 @@ const updateLinkCommand: CommandHandler<Record<string, unknown>, { ok: true; slu
|
|
|
302
304
|
)
|
|
303
305
|
const descriptorService = ctx.container.resolve('paymentGatewayDescriptorService') as PaymentGatewayDescriptorService
|
|
304
306
|
await ensureGatewayProviderConfigured(nextValues.gatewayProviderKey ?? null, descriptorService, scope)
|
|
307
|
+
ensurePayerFieldsCollected(nextValues)
|
|
305
308
|
if (isCheckoutLinkPublic(nextValues.status) && !nextValues.gatewayProviderKey) {
|
|
306
309
|
throw new CrudHttpError(422, { error: 'A payment gateway must be configured before this link can be published' })
|
|
307
310
|
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
ensureGatewayProviderConfigured,
|
|
17
17
|
type PaymentGatewayDescriptorService,
|
|
18
18
|
} from '../lib/gatewayProviderAvailability'
|
|
19
|
+
import { ensurePayerFieldsCollected } from '../lib/payerFieldRequirements'
|
|
19
20
|
import { emitCheckoutEvent } from '../events'
|
|
20
21
|
import {
|
|
21
22
|
deriveConfiguredCurrencies,
|
|
@@ -111,6 +112,7 @@ const createTemplateCommand: CommandHandler<Record<string, unknown>, { id: strin
|
|
|
111
112
|
validateDescriptorCurrencies(parsed.gatewayProviderKey, deriveConfiguredCurrencies(parsed))
|
|
112
113
|
const descriptorService = ctx.container.resolve('paymentGatewayDescriptorService') as PaymentGatewayDescriptorService
|
|
113
114
|
await ensureGatewayProviderConfigured(parsed.gatewayProviderKey, descriptorService, scope)
|
|
115
|
+
ensurePayerFieldsCollected(parsed)
|
|
114
116
|
const em = ctx.container.resolve('em') as EntityManager
|
|
115
117
|
const dataEngine = ctx.container.resolve('dataEngine') as DataEngine
|
|
116
118
|
const template = em.create(CheckoutLinkTemplate, {
|
|
@@ -280,6 +282,11 @@ const updateTemplateCommand: CommandHandler<Record<string, unknown>, { ok: true
|
|
|
280
282
|
current: template.updatedAt ?? null,
|
|
281
283
|
request: ctx.request ?? null,
|
|
282
284
|
})
|
|
285
|
+
ensurePayerFieldsCollected({
|
|
286
|
+
gatewayProviderKey: parsed.gatewayProviderKey !== undefined ? parsed.gatewayProviderKey : template.gatewayProviderKey,
|
|
287
|
+
collectCustomerDetails: parsed.collectCustomerDetails ?? template.collectCustomerDetails,
|
|
288
|
+
customerFieldsSchema: parsed.customerFieldsSchema ?? template.customerFieldsSchema,
|
|
289
|
+
})
|
|
283
290
|
const beforeCustom = await loadCustomFieldSnapshot(em, {
|
|
284
291
|
entityId: CHECKOUT_ENTITY_IDS.template,
|
|
285
292
|
recordId: template.id,
|
|
@@ -42,6 +42,7 @@ import { CHECKOUT_ENTITY_IDS } from '../lib/constants'
|
|
|
42
42
|
import { getLocalizedDefaultCheckoutCustomerFields } from '../lib/defaults'
|
|
43
43
|
import type { CustomerFieldDefinitionInput, PriceListItemInput } from '../data/validators'
|
|
44
44
|
import { getGatewayProviderConfigurationMessageKey } from '../lib/gatewayProviderAvailability'
|
|
45
|
+
import { findUncollectedPayerFields, PAYER_FIELD_CUSTOMER_FIELD_KEYS } from '../lib/payerFieldRequirements'
|
|
45
46
|
import { readCustomerFieldsSectionError } from '../lib/customerFieldErrors'
|
|
46
47
|
import { isRecordNotFoundError } from '../lib/recordNotFound'
|
|
47
48
|
import { CheckoutCurrencySelect } from './CheckoutCurrencySelect'
|
|
@@ -62,6 +63,7 @@ type ProviderDescriptor = {
|
|
|
62
63
|
isConfigured?: boolean
|
|
63
64
|
requiresConfiguration?: boolean
|
|
64
65
|
configurationStatus?: 'configured' | 'missing_credentials' | 'disabled' | 'unmanaged' | null
|
|
66
|
+
requiresPayerFields?: string[]
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
type TemplateSummary = {
|
|
@@ -922,6 +924,24 @@ function PaymentSection({ values, setValue, errors, providers }: CrudFormGroupCo
|
|
|
922
924
|
return messageKey ? t(messageKey) : undefined
|
|
923
925
|
})()
|
|
924
926
|
const gatewaySettingsError = readError(errors, 'gatewaySettings')
|
|
927
|
+
const customerFields = readCustomerFields(values.customerFieldsSchema, t)
|
|
928
|
+
const uncollectedPayerFields = findUncollectedPayerFields({
|
|
929
|
+
requiredPayerFields: selectedProvider?.requiresPayerFields,
|
|
930
|
+
collectCustomerDetails: readBoolean(values.collectCustomerDetails, true),
|
|
931
|
+
customerFieldsSchema: customerFields,
|
|
932
|
+
})
|
|
933
|
+
const customerFieldLabels = new Map(
|
|
934
|
+
[...getLocalizedDefaultCheckoutCustomerFields(t), ...customerFields].map((field) => [field.key, field.label]),
|
|
935
|
+
)
|
|
936
|
+
const payerFieldWarning = selectedProvider && uncollectedPayerFields.length > 0
|
|
937
|
+
? t('checkout.linkTemplateForm.payment.payerFields.description', {
|
|
938
|
+
provider: selectedProvider.label,
|
|
939
|
+
fields: uncollectedPayerFields
|
|
940
|
+
.flatMap((payerField) => PAYER_FIELD_CUSTOMER_FIELD_KEYS[payerField])
|
|
941
|
+
.map((key) => customerFieldLabels.get(key) ?? key)
|
|
942
|
+
.join(', '),
|
|
943
|
+
})
|
|
944
|
+
: null
|
|
925
945
|
|
|
926
946
|
return (
|
|
927
947
|
<div className="space-y-4">
|
|
@@ -949,6 +969,13 @@ function PaymentSection({ values, setValue, errors, providers }: CrudFormGroupCo
|
|
|
949
969
|
</select>
|
|
950
970
|
</SectionLabel>
|
|
951
971
|
|
|
972
|
+
{payerFieldWarning ? (
|
|
973
|
+
<Alert status="warning">
|
|
974
|
+
<AlertTitle>{t('checkout.linkTemplateForm.payment.payerFields.title')}</AlertTitle>
|
|
975
|
+
<AlertDescription>{payerFieldWarning}</AlertDescription>
|
|
976
|
+
</Alert>
|
|
977
|
+
) : null}
|
|
978
|
+
|
|
952
979
|
<GatewaySettingsFields
|
|
953
980
|
providerKey={readString(values.gatewayProviderKey) || null}
|
|
954
981
|
value={isRecord(values.gatewaySettings) ? values.gatewaySettings : {}}
|
|
@@ -250,6 +250,8 @@
|
|
|
250
250
|
"checkout.linkTemplateForm.notFound.template.description": "This template no longer exists. It may have been deleted in another tab or by another user.",
|
|
251
251
|
"checkout.linkTemplateForm.notFound.template.title": "Template not found",
|
|
252
252
|
"checkout.linkTemplateForm.payment.fields.gatewayProvider": "Gateway provider",
|
|
253
|
+
"checkout.linkTemplateForm.payment.payerFields.description": "{provider} benötigt Zahlerdaten, um eine Zahlung zu erstellen. Aktiviere die Kundendaten und markiere diese Felder als Pflichtfelder: {fields}.",
|
|
254
|
+
"checkout.linkTemplateForm.payment.payerFields.title": "Dieser Anbieter benötigt Zahlerdaten",
|
|
253
255
|
"checkout.linkTemplateForm.payment.placeholders.provider": "Select a provider…",
|
|
254
256
|
"checkout.linkTemplateForm.payment.providerUnavailableSuffix": "(zuerst in Integrations konfigurieren)",
|
|
255
257
|
"checkout.linkTemplateForm.priceList.actions.addItem": "Add item",
|
|
@@ -450,6 +452,7 @@
|
|
|
450
452
|
"checkout.validation.fixedPriceCurrencyCode.required": "Waehrung ist fuer Festpreis erforderlich.",
|
|
451
453
|
"checkout.validation.gatewayProviderKey.disabled": "Dieser Gateway-Anbieter ist in Integrations deaktiviert.",
|
|
452
454
|
"checkout.validation.gatewayProviderKey.notConfigured": "Dieser Gateway-Anbieter ist in Integrations nicht konfiguriert.",
|
|
455
|
+
"checkout.validation.gatewayProviderKey.payerFieldsNotCollected": "Dieser Gateway-Anbieter benötigt Zahlerdaten, die dieser Link nicht erfasst. Aktiviere die Kundendaten und markiere die im Zahlungsbereich genannten Felder als Pflichtfelder.",
|
|
453
456
|
"checkout.validation.gatewayProviderKey.required": "Gateway-Anbieter ist erforderlich.",
|
|
454
457
|
"checkout.validation.name.required": "Name ist erforderlich.",
|
|
455
458
|
"checkout.validation.priceListItems.required": "Fuege mindestens einen Preislisten-Eintrag hinzu.",
|
|
@@ -250,6 +250,8 @@
|
|
|
250
250
|
"checkout.linkTemplateForm.notFound.template.description": "This template no longer exists. It may have been deleted in another tab or by another user.",
|
|
251
251
|
"checkout.linkTemplateForm.notFound.template.title": "Template not found",
|
|
252
252
|
"checkout.linkTemplateForm.payment.fields.gatewayProvider": "Gateway provider",
|
|
253
|
+
"checkout.linkTemplateForm.payment.payerFields.description": "{provider} needs payer details to create a payment. Turn on customer details and mark these fields as required: {fields}.",
|
|
254
|
+
"checkout.linkTemplateForm.payment.payerFields.title": "This provider needs payer details",
|
|
253
255
|
"checkout.linkTemplateForm.payment.placeholders.provider": "Select a provider…",
|
|
254
256
|
"checkout.linkTemplateForm.payment.providerUnavailableSuffix": "(configure in Integrations first)",
|
|
255
257
|
"checkout.linkTemplateForm.priceList.actions.addItem": "Add item",
|
|
@@ -450,6 +452,7 @@
|
|
|
450
452
|
"checkout.validation.fixedPriceCurrencyCode.required": "Currency is required for fixed pricing.",
|
|
451
453
|
"checkout.validation.gatewayProviderKey.disabled": "This gateway provider is disabled in Integrations.",
|
|
452
454
|
"checkout.validation.gatewayProviderKey.notConfigured": "This gateway provider is not configured in Integrations.",
|
|
455
|
+
"checkout.validation.gatewayProviderKey.payerFieldsNotCollected": "This gateway provider needs payer details that this link does not collect. Turn on customer details and mark the fields named in the payment section as required.",
|
|
453
456
|
"checkout.validation.gatewayProviderKey.required": "Gateway provider is required.",
|
|
454
457
|
"checkout.validation.name.required": "Name is required.",
|
|
455
458
|
"checkout.validation.priceListItems.required": "Add at least one price-list item.",
|
|
@@ -250,6 +250,8 @@
|
|
|
250
250
|
"checkout.linkTemplateForm.notFound.template.description": "This template no longer exists. It may have been deleted in another tab or by another user.",
|
|
251
251
|
"checkout.linkTemplateForm.notFound.template.title": "Template not found",
|
|
252
252
|
"checkout.linkTemplateForm.payment.fields.gatewayProvider": "Gateway provider",
|
|
253
|
+
"checkout.linkTemplateForm.payment.payerFields.description": "{provider} necesita datos del pagador para crear un pago. Activa los datos del cliente y marca estos campos como obligatorios: {fields}.",
|
|
254
|
+
"checkout.linkTemplateForm.payment.payerFields.title": "Este proveedor necesita datos del pagador",
|
|
253
255
|
"checkout.linkTemplateForm.payment.placeholders.provider": "Select a provider…",
|
|
254
256
|
"checkout.linkTemplateForm.payment.providerUnavailableSuffix": "(configure primero en Integrations)",
|
|
255
257
|
"checkout.linkTemplateForm.priceList.actions.addItem": "Add item",
|
|
@@ -450,6 +452,7 @@
|
|
|
450
452
|
"checkout.validation.fixedPriceCurrencyCode.required": "La moneda es obligatoria para el precio fijo.",
|
|
451
453
|
"checkout.validation.gatewayProviderKey.disabled": "Este proveedor de pasarela está deshabilitado en Integrations.",
|
|
452
454
|
"checkout.validation.gatewayProviderKey.notConfigured": "Este proveedor de pasarela no está configurado en Integrations.",
|
|
455
|
+
"checkout.validation.gatewayProviderKey.payerFieldsNotCollected": "Este proveedor de pasarela necesita datos del pagador que este enlace no recopila. Activa los datos del cliente y marca como obligatorios los campos indicados en la sección de pago.",
|
|
453
456
|
"checkout.validation.gatewayProviderKey.required": "El proveedor de pasarela es obligatorio.",
|
|
454
457
|
"checkout.validation.name.required": "El nombre es obligatorio.",
|
|
455
458
|
"checkout.validation.priceListItems.required": "Agrega al menos un elemento a la lista de precios.",
|
|
@@ -250,6 +250,8 @@
|
|
|
250
250
|
"checkout.linkTemplateForm.notFound.template.description": "이 템플릿이 더 이상 존재하지 않습니다. 다른 탭이나 다른 사용자가 삭제했을 수 있습니다.",
|
|
251
251
|
"checkout.linkTemplateForm.notFound.template.title": "템플릿을 찾을 수 없음",
|
|
252
252
|
"checkout.linkTemplateForm.payment.fields.gatewayProvider": "게이트웨이 제공업체",
|
|
253
|
+
"checkout.linkTemplateForm.payment.payerFields.description": "{provider}에서 결제를 생성하려면 결제자 정보가 필요합니다. 고객 정보 수집을 켜고 다음 필드를 필수로 지정하세요: {fields}.",
|
|
254
|
+
"checkout.linkTemplateForm.payment.payerFields.title": "이 제공업체는 결제자 정보가 필요합니다",
|
|
253
255
|
"checkout.linkTemplateForm.payment.placeholders.provider": "제공업체 선택…",
|
|
254
256
|
"checkout.linkTemplateForm.payment.providerUnavailableSuffix": "(먼저 연동에서 구성하세요)",
|
|
255
257
|
"checkout.linkTemplateForm.priceList.actions.addItem": "항목 추가",
|
|
@@ -450,6 +452,7 @@
|
|
|
450
452
|
"checkout.validation.fixedPriceCurrencyCode.required": "고정 가격 책정에는 통화가 필요합니다.",
|
|
451
453
|
"checkout.validation.gatewayProviderKey.disabled": "이 게이트웨이 제공업체는 연동에서 비활성화되어 있습니다.",
|
|
452
454
|
"checkout.validation.gatewayProviderKey.notConfigured": "이 게이트웨이 제공업체는 연동에서 구성되지 않았습니다.",
|
|
455
|
+
"checkout.validation.gatewayProviderKey.payerFieldsNotCollected": "이 게이트웨이 제공업체에는 이 링크가 수집하지 않는 결제자 정보가 필요합니다. 고객 정보 수집을 켜고 결제 섹션에 표시된 필드를 필수로 지정하세요.",
|
|
453
456
|
"checkout.validation.gatewayProviderKey.required": "게이트웨이 제공업체는 필수입니다.",
|
|
454
457
|
"checkout.validation.name.required": "이름은 필수입니다.",
|
|
455
458
|
"checkout.validation.priceListItems.required": "가격표 항목을 하나 이상 추가하세요.",
|
|
@@ -250,6 +250,8 @@
|
|
|
250
250
|
"checkout.linkTemplateForm.notFound.template.description": "Ten szablon już nie istnieje. Mógł zostać usunięty w innej karcie lub przez innego użytkownika.",
|
|
251
251
|
"checkout.linkTemplateForm.notFound.template.title": "Nie znaleziono szablonu",
|
|
252
252
|
"checkout.linkTemplateForm.payment.fields.gatewayProvider": "Dostawca bramki",
|
|
253
|
+
"checkout.linkTemplateForm.payment.payerFields.description": "{provider} wymaga danych płatnika do utworzenia płatności. Włącz zbieranie danych klienta i oznacz te pola jako wymagane: {fields}.",
|
|
254
|
+
"checkout.linkTemplateForm.payment.payerFields.title": "Ten dostawca wymaga danych płatnika",
|
|
253
255
|
"checkout.linkTemplateForm.payment.placeholders.provider": "Wybierz dostawcę…",
|
|
254
256
|
"checkout.linkTemplateForm.payment.providerUnavailableSuffix": "(najpierw skonfiguruj w Integracjach)",
|
|
255
257
|
"checkout.linkTemplateForm.priceList.actions.addItem": "Dodaj pozycję",
|
|
@@ -450,6 +452,7 @@
|
|
|
450
452
|
"checkout.validation.fixedPriceCurrencyCode.required": "Waluta jest wymagana dla stałej ceny.",
|
|
451
453
|
"checkout.validation.gatewayProviderKey.disabled": "Ten dostawca bramki jest wyłączony w Integracjach.",
|
|
452
454
|
"checkout.validation.gatewayProviderKey.notConfigured": "Ten dostawca bramki nie jest skonfigurowany w Integracjach.",
|
|
455
|
+
"checkout.validation.gatewayProviderKey.payerFieldsNotCollected": "Ten dostawca bramki wymaga danych płatnika, których ten link nie zbiera. Włącz zbieranie danych klienta i oznacz jako wymagane pola wskazane w sekcji płatności.",
|
|
453
456
|
"checkout.validation.gatewayProviderKey.required": "Dostawca bramki jest wymagany.",
|
|
454
457
|
"checkout.validation.name.required": "Nazwa jest wymagana.",
|
|
455
458
|
"checkout.validation.priceListItems.required": "Dodaj przynajmniej jedną pozycję cennika.",
|