@vicacha-devs/medusa-payment-bold 0.0.0-stage → 0.1.0
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/.medusa/server/src/admin/index.cjs +1732 -0
- package/.medusa/server/src/admin/index.js +1732 -0
- package/.medusa/server/src/api/admin/bold/banks/route.js +15 -0
- package/.medusa/server/src/api/admin/bold/payment-button/route.js +44 -0
- package/.medusa/server/src/api/admin/bold/payment-link/route.js +61 -0
- package/.medusa/server/src/api/admin/bold/payment-link-methods/route.js +16 -0
- package/.medusa/server/src/api/admin/bold/payment-methods/route.js +17 -0
- package/.medusa/server/src/api/admin/bold/payment-qr/route.js +53 -0
- package/.medusa/server/src/api/admin/bold/payment-status/route.js +37 -0
- package/.medusa/server/src/api/admin/bold/payment-stream/route.js +103 -0
- package/.medusa/server/src/api/admin/bold/pos-push/route.js +46 -0
- package/.medusa/server/src/api/admin/bold/refund/route.js +37 -0
- package/.medusa/server/src/api/admin/bold/terminals/route.js +16 -0
- package/.medusa/server/src/api/admin/plugin/route.js +10 -0
- package/.medusa/server/src/api/hooks/payment/bold/route.js +104 -0
- package/.medusa/server/src/api/store/plugin/route.js +4 -0
- package/.medusa/server/src/hooks/index.js +10 -0
- package/.medusa/server/src/hooks/use-bold-checkout-handler.js +135 -0
- package/.medusa/server/src/hooks/use-bold-payment-methods.js +20 -0
- package/.medusa/server/src/hooks/use-bold-payment-status-stream.js +19 -0
- package/.medusa/server/src/hooks/use-bold-refund.js +19 -0
- package/.medusa/server/src/hooks/use-bold-terminals.js +13 -0
- package/.medusa/server/src/hooks/use-create-bold-button.js +19 -0
- package/.medusa/server/src/hooks/use-create-bold-link.js +19 -0
- package/.medusa/server/src/hooks/use-create-bold-qr.js +19 -0
- package/.medusa/server/src/hooks/use-create-bold-terminal.js +19 -0
- package/.medusa/server/src/index.js +21 -0
- package/.medusa/server/src/lib/error-utils.js +25 -0
- package/.medusa/server/src/lib/get-active-providers.js +34 -0
- package/.medusa/server/src/lib/get-provider-options.js +20 -0
- package/.medusa/server/src/lib/index.js +4 -0
- package/.medusa/server/src/lib/session-helpers.js +11 -0
- package/.medusa/server/src/providers/bold-button/index.js +157 -0
- package/.medusa/server/src/providers/bold-link/index.js +249 -0
- package/.medusa/server/src/providers/bold-online/index.js +169 -0
- package/.medusa/server/src/providers/bold-terminal/index.js +170 -0
- package/.medusa/server/src/rbac.js +58 -0
- package/.medusa/server/src/sdk/client.js +112 -0
- package/.medusa/server/src/sdk/query-keys.js +13 -0
- package/.medusa/server/src/services/bold-client.js +304 -0
- package/.medusa/server/src/services/integrity.js +54 -0
- package/.medusa/server/src/types/constants.js +55 -0
- package/.medusa/server/src/types/enums.js +15 -0
- package/.medusa/server/src/types/errors.js +80 -0
- package/.medusa/server/src/types/index.js +3 -0
- package/.medusa/server/src/workflows/create-bold-payment-link.js +7 -0
- package/.medusa/server/src/workflows/create-bold-refund.js +7 -0
- package/.medusa/server/src/workflows/get-bold-payment-methods.js +7 -0
- package/.medusa/server/src/workflows/get-integration-api-payment-methods.js +7 -0
- package/.medusa/server/src/workflows/get-payment-link-methods.js +7 -0
- package/.medusa/server/src/workflows/get-terminals.js +7 -0
- package/.medusa/server/src/workflows/index.js +7 -0
- package/.medusa/server/src/workflows/steps/create-bold-link.js +43 -0
- package/.medusa/server/src/workflows/steps/get-bold-payment-methods.js +12 -0
- package/.medusa/server/src/workflows/steps/get-payment-link-methods.js +12 -0
- package/.medusa/server/src/workflows/steps/get-terminals.js +13 -0
- package/.medusa/server/src/workflows/steps/refund-bold-payment.js +15 -0
- package/README.md +106 -2
- package/package.json +120 -3
- package/src/__tests__/bold-contract.spec.ts +40 -0
- package/src/__tests__/bold-qa-emulator.ts +582 -0
- package/src/__tests__/bold-use-cases.spec.ts +773 -0
- package/src/__tests__/medusa-payment-shim.mjs +334 -0
- package/src/__tests__/register-ts-resolver.mjs +101 -0
- package/src/admin/README.md +70 -0
- package/src/admin/components/bold-terminal-status.tsx +166 -0
- package/src/admin/components/icons/bold-fav.tsx +45 -0
- package/src/admin/components/icons/copy.tsx +23 -0
- package/src/admin/components/icons/index.ts +3 -0
- package/src/admin/components/icons/qr-code.tsx +33 -0
- package/src/admin/components/icons/smart-phone.tsx +23 -0
- package/src/admin/components/index.ts +4 -0
- package/src/admin/components/logos/bold.tsx +45 -0
- package/src/admin/components/method-item.tsx +19 -0
- package/src/admin/components/provider-card.tsx +21 -0
- package/src/admin/components/section.tsx +23 -0
- package/src/admin/i18n/README.md +58 -0
- package/src/admin/i18n/index.ts +11 -0
- package/src/admin/i18n/json/ar.json +99 -0
- package/src/admin/i18n/json/en.json +99 -0
- package/src/admin/i18n/json/es.json +99 -0
- package/src/admin/i18n/json/tr.json +99 -0
- package/src/admin/routes/settings/bold/components/bold-methods-sidebar.tsx +96 -0
- package/src/admin/routes/settings/bold/components/bold-providers-section.tsx +67 -0
- package/src/admin/routes/settings/bold/components/index.ts +2 -0
- package/src/admin/routes/settings/bold/page.tsx +109 -0
- package/src/admin/tsconfig.json +24 -0
- package/src/admin/vite-env.d.ts +1 -0
- package/src/admin/widgets/bold-audit-timeline.tsx +155 -0
- package/src/admin/widgets/bold-payment-actions/bold-payment-actions.tsx +114 -0
- package/src/admin/widgets/bold-payment-actions/components/bold-payment-tabs.tsx +127 -0
- package/src/admin/widgets/bold-payment-actions/components/bold-remote-payment-panel.tsx +104 -0
- package/src/admin/widgets/bold-payment-actions/components/bold-terminal-section.tsx +71 -0
- package/src/admin/widgets/bold-payment-actions/hooks/bold-order-balance.ts +126 -0
- package/src/admin/widgets/bold-payment-actions/hooks/use-bold-widget-state.tsx +181 -0
- package/src/admin/widgets/bold-refund-actions.tsx +151 -0
- package/src/admin/widgets/index.ts +12 -0
- package/src/api/README.md +37 -0
- package/src/api/admin/bold/banks/route.ts +23 -0
- package/src/api/admin/bold/payment-button/route.ts +57 -0
- package/src/api/admin/bold/payment-link/route.ts +68 -0
- package/src/api/admin/bold/payment-link-methods/route.ts +24 -0
- package/src/api/admin/bold/payment-methods/route.ts +27 -0
- package/src/api/admin/bold/payment-qr/route.ts +68 -0
- package/src/api/admin/bold/payment-status/route.ts +48 -0
- package/src/api/admin/bold/payment-stream/route.ts +161 -0
- package/src/api/admin/bold/pos-push/route.ts +59 -0
- package/src/api/admin/bold/refund/route.ts +51 -0
- package/src/api/admin/bold/terminals/route.ts +26 -0
- package/src/api/admin/plugin/route.ts +14 -0
- package/src/api/hooks/payment/bold/route.ts +156 -0
- package/src/api/store/plugin/route.ts +5 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/use-bold-checkout-handler.ts +172 -0
- package/src/hooks/use-bold-payment-methods.ts +36 -0
- package/src/hooks/use-bold-payment-status-stream.ts +55 -0
- package/src/hooks/use-bold-refund.ts +33 -0
- package/src/hooks/use-bold-terminals.ts +22 -0
- package/src/hooks/use-create-bold-button.ts +34 -0
- package/src/hooks/use-create-bold-link.ts +33 -0
- package/src/hooks/use-create-bold-qr.ts +33 -0
- package/src/hooks/use-create-bold-terminal.ts +37 -0
- package/src/index.ts +31 -0
- package/src/lib/error-utils.ts +29 -0
- package/src/lib/get-active-providers.ts +52 -0
- package/src/lib/get-provider-options.ts +54 -0
- package/src/lib/index.ts +3 -0
- package/src/lib/session-helpers.ts +16 -0
- package/src/providers/README.md +30 -0
- package/src/providers/bold-button/index.ts +244 -0
- package/src/providers/bold-link/index.ts +350 -0
- package/src/providers/bold-online/index.ts +254 -0
- package/src/providers/bold-terminal/index.ts +258 -0
- package/src/rbac.ts +72 -0
- package/src/sdk/client.ts +157 -0
- package/src/sdk/query-keys.ts +13 -0
- package/src/services/bold-client.ts +470 -0
- package/src/services/integrity.ts +74 -0
- package/src/types/constants.ts +63 -0
- package/src/types/enums.ts +13 -0
- package/src/types/errors.ts +88 -0
- package/src/types/index.ts +517 -0
- package/src/workflows/create-bold-payment-link.ts +16 -0
- package/src/workflows/create-bold-refund.ts +16 -0
- package/src/workflows/get-bold-payment-methods.ts +13 -0
- package/src/workflows/get-integration-api-payment-methods.ts +13 -0
- package/src/workflows/get-payment-link-methods.ts +13 -0
- package/src/workflows/get-terminals.ts +10 -0
- package/src/workflows/index.ts +6 -0
- package/src/workflows/steps/create-bold-link.ts +74 -0
- package/src/workflows/steps/get-bold-payment-methods.ts +21 -0
- package/src/workflows/steps/get-payment-link-methods.ts +19 -0
- package/src/workflows/steps/get-terminals.ts +20 -0
- package/src/workflows/steps/refund-bold-payment.ts +28 -0
- package/tsconfig.json +41 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SVGProps } from "react"
|
|
2
|
+
|
|
3
|
+
export const BoldFavIcon = ({
|
|
4
|
+
width = 24,
|
|
5
|
+
height = 24,
|
|
6
|
+
...props
|
|
7
|
+
}: SVGProps<SVGSVGElement>) => (
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
width={width}
|
|
11
|
+
height={height}
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
strokeWidth="2"
|
|
16
|
+
strokeLinecap="round"
|
|
17
|
+
strokeLinejoin="round"
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<rect width="256" height="256" rx="56" fill="#000000" />
|
|
21
|
+
<path
|
|
22
|
+
d="M64 56H136C166.928 56 192 81.0721 192 112C192 128.532 184.832 143.392 173.408 153.648C185.728 164.288 193.5 179.936 193.5 197.5C193.5 229.808 167.308 256 135 256H64V56Z"
|
|
23
|
+
fill="url(#bold-grad)"
|
|
24
|
+
/>
|
|
25
|
+
<path
|
|
26
|
+
d="M64 56H132C162.928 56 188 81.0721 188 112C188 142.928 162.928 168 132 168H108V56H64Z"
|
|
27
|
+
fill="#FFFFFF"
|
|
28
|
+
/>
|
|
29
|
+
<circle cx="108" cy="112" r="20" fill="#000000" />
|
|
30
|
+
<defs>
|
|
31
|
+
<linearGradient
|
|
32
|
+
id="bold-grad"
|
|
33
|
+
x1="64"
|
|
34
|
+
y1="56"
|
|
35
|
+
x2="193.5"
|
|
36
|
+
y2="256"
|
|
37
|
+
gradientUnits="userSpaceOnUse"
|
|
38
|
+
>
|
|
39
|
+
<stop stopColor="#00E5FF" />
|
|
40
|
+
<stop offset="0.5" stopColor="#0052FF" />
|
|
41
|
+
<stop offset="1" stopColor="#7000FF" />
|
|
42
|
+
</linearGradient>
|
|
43
|
+
</defs>
|
|
44
|
+
</svg>
|
|
45
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SVGProps } from "react"
|
|
2
|
+
|
|
3
|
+
export const CopyIcon = ({
|
|
4
|
+
width = 24,
|
|
5
|
+
height = 24,
|
|
6
|
+
...props
|
|
7
|
+
}: SVGProps<SVGSVGElement>) => (
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
width={width}
|
|
11
|
+
height={height}
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
strokeWidth="2"
|
|
16
|
+
strokeLinecap="round"
|
|
17
|
+
strokeLinejoin="round"
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
|
|
21
|
+
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
|
|
22
|
+
</svg>
|
|
23
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SVGProps } from "react"
|
|
2
|
+
|
|
3
|
+
export const QrCodeIcon = ({
|
|
4
|
+
width = 24,
|
|
5
|
+
height = 24,
|
|
6
|
+
...props
|
|
7
|
+
}: SVGProps<SVGSVGElement>) => (
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
width={width}
|
|
11
|
+
height={height}
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
strokeWidth="2"
|
|
16
|
+
strokeLinecap="round"
|
|
17
|
+
strokeLinejoin="round"
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<rect width="5" height="5" x="3" y="3" rx="1" />
|
|
21
|
+
<rect width="5" height="5" x="16" y="3" rx="1" />
|
|
22
|
+
<rect width="5" height="5" x="3" y="16" rx="1" />
|
|
23
|
+
<path d="M21 16h-3a2 2 0 0 0-2 2v3" />
|
|
24
|
+
<path d="M21 21v.01" />
|
|
25
|
+
<path d="M12 7v3a2 2 0 0 1-2 2H7" />
|
|
26
|
+
<path d="M3 12h.01" />
|
|
27
|
+
<path d="M12 3h.01" />
|
|
28
|
+
<path d="M12 16v.01" />
|
|
29
|
+
<path d="M16 12h1" />
|
|
30
|
+
<path d="M21 12v.01" />
|
|
31
|
+
<path d="M12 21v-1" />
|
|
32
|
+
</svg>
|
|
33
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SVGProps } from "react"
|
|
2
|
+
|
|
3
|
+
export const SmartphoneIcon = ({
|
|
4
|
+
width = 24,
|
|
5
|
+
height = 24,
|
|
6
|
+
...props
|
|
7
|
+
}: SVGProps<SVGSVGElement>) => (
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
width={width}
|
|
11
|
+
height={height}
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
strokeWidth="2"
|
|
16
|
+
strokeLinecap="round"
|
|
17
|
+
strokeLinejoin="round"
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<rect width="14" height="20" x="5" y="2" rx="2" ry="2" />
|
|
21
|
+
<path d="M12 18h.01" />
|
|
22
|
+
</svg>
|
|
23
|
+
)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useDarkMode } from "@vicacha-devs/medusa-shared-admin/admin"
|
|
2
|
+
|
|
3
|
+
interface BoldLogoProps {
|
|
4
|
+
width?: number
|
|
5
|
+
height?: number
|
|
6
|
+
className?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function BoldLogo({
|
|
10
|
+
width = 79,
|
|
11
|
+
height = 28,
|
|
12
|
+
className,
|
|
13
|
+
}: BoldLogoProps) {
|
|
14
|
+
const isDark = useDarkMode()
|
|
15
|
+
const gradientEnd = isDark ? "#FFFFFF" : "#121E6C"
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<svg
|
|
19
|
+
width={width}
|
|
20
|
+
height={height}
|
|
21
|
+
viewBox="0 0 79 28"
|
|
22
|
+
fill="none"
|
|
23
|
+
className={className}
|
|
24
|
+
aria-label="Bold"
|
|
25
|
+
>
|
|
26
|
+
<path
|
|
27
|
+
d="M23.764 18.993h19.502c-.469 5.045-4.662 9.006-9.752 9.006-5.09 0-9.282-3.96-9.75-9.006zM9.85 8.154v19.8c4.967-.476 8.87-4.734 8.87-9.9S14.816 8.63 9.85 8.155zm23.665-.044c-5.089 0-9.282 3.962-9.751 9.007h19.502c-.469-5.045-4.662-9.008-9.752-9.008h.001zM0 15.335V28h7.944V0H0v15.336zM70.804 0v28h7.944V0h-7.944zM60.085 18.055c0 .628.06 1.242.171 1.839.797 4.305 4.336 7.642 8.7 8.06v-19.8c-4.968.476-8.87 4.734-8.87 9.9zm-12.802 9.944h7.944V0h-7.944v28z"
|
|
28
|
+
fill="url(#bold-logo-gradient)"
|
|
29
|
+
/>
|
|
30
|
+
<defs>
|
|
31
|
+
<linearGradient
|
|
32
|
+
id="bold-logo-gradient"
|
|
33
|
+
x1="78.748"
|
|
34
|
+
y1="14"
|
|
35
|
+
x2="0"
|
|
36
|
+
y2="14"
|
|
37
|
+
gradientUnits="userSpaceOnUse"
|
|
38
|
+
>
|
|
39
|
+
<stop offset="0.2" stopColor="#EE424E" />
|
|
40
|
+
<stop offset="0.8" stopColor={gradientEnd} />
|
|
41
|
+
</linearGradient>
|
|
42
|
+
</defs>
|
|
43
|
+
</svg>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Badge, Text } from "@medusajs/ui"
|
|
2
|
+
|
|
3
|
+
export const MethodItem = ({
|
|
4
|
+
name,
|
|
5
|
+
status,
|
|
6
|
+
}: {
|
|
7
|
+
name: string
|
|
8
|
+
status?: string
|
|
9
|
+
}) => (
|
|
10
|
+
<div className="flex items-center justify-between px-4 py-3 border-b border-ui-border-base last:border-b-0 hover:bg-ui-bg-subtle/50">
|
|
11
|
+
<Text className="text-sm text-ui-fg-base">{name}</Text>
|
|
12
|
+
<Badge
|
|
13
|
+
color={status === "Enabled" || status === "Available" ? "green" : "grey"}
|
|
14
|
+
size="small"
|
|
15
|
+
>
|
|
16
|
+
{status || "Active"}
|
|
17
|
+
</Badge>
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StatusBadge, Text } from "@medusajs/ui"
|
|
2
|
+
|
|
3
|
+
export const ProviderCard = ({
|
|
4
|
+
title,
|
|
5
|
+
providerId,
|
|
6
|
+
isEnabled,
|
|
7
|
+
}: {
|
|
8
|
+
title: string
|
|
9
|
+
providerId: string
|
|
10
|
+
isEnabled: boolean
|
|
11
|
+
}) => (
|
|
12
|
+
<div className="p-3 border border-ui-border-base bg-ui-bg-base rounded-md space-y-2">
|
|
13
|
+
<div className="flex items-center justify-between">
|
|
14
|
+
<Text className="text-xs font-semibold text-ui-fg-base">{title}</Text>
|
|
15
|
+
<StatusBadge color={isEnabled ? "green" : "grey"} />
|
|
16
|
+
</div>
|
|
17
|
+
<Text className="text-[10px] font-mono text-ui-fg-subtle truncate">
|
|
18
|
+
{providerId}
|
|
19
|
+
</Text>
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Container, Heading, Text } from "@medusajs/ui"
|
|
2
|
+
|
|
3
|
+
export const Section = ({
|
|
4
|
+
title,
|
|
5
|
+
description,
|
|
6
|
+
children,
|
|
7
|
+
}: {
|
|
8
|
+
title: string
|
|
9
|
+
description?: string
|
|
10
|
+
children: React.ReactNode
|
|
11
|
+
}) => (
|
|
12
|
+
<Container className="divide-y p-0 border border-ui-border-base">
|
|
13
|
+
<div className="px-6 py-4 bg-ui-bg-subtle/30">
|
|
14
|
+
<Heading level="h3" className="text-base font-semibold text-ui-fg-base">
|
|
15
|
+
{title}
|
|
16
|
+
</Heading>
|
|
17
|
+
{description && (
|
|
18
|
+
<Text className="text-xs text-ui-fg-subtle mt-1">{description}</Text>
|
|
19
|
+
)}
|
|
20
|
+
</div>
|
|
21
|
+
<div>{children}</div>
|
|
22
|
+
</Container>
|
|
23
|
+
)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Admin Customizations Translations
|
|
2
|
+
|
|
3
|
+
The Medusa Admin dashboard supports multiple languages for its interface. Medusa uses [react-i18next](https://react.i18next.com/) to manage translations in the admin dashboard.
|
|
4
|
+
|
|
5
|
+
To add translations, create JSON translation files for each language under the `src/admin/i18n/json` directory. For example, create the `src/admin/i18n/json/en.json` file with the following content:
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"brands": {
|
|
10
|
+
"title": "Brands",
|
|
11
|
+
"description": "Manage your product brands"
|
|
12
|
+
},
|
|
13
|
+
"done": "Done"
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then, export the translations in `src/admin/i18n/index.ts`:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import en from "./json/en.json" with { type: "json" }
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
en: {
|
|
24
|
+
translation: en,
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Finally, use translations in your admin widgets and routes using the `useTranslation` hook:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { defineWidgetConfig } from "@medusajs/admin-sdk"
|
|
33
|
+
import { Button, Container, Heading } from "@medusajs/ui"
|
|
34
|
+
import { useTranslation } from "react-i18next"
|
|
35
|
+
|
|
36
|
+
const ProductWidget = () => {
|
|
37
|
+
const { t } = useTranslation()
|
|
38
|
+
return (
|
|
39
|
+
<Container className="p-0">
|
|
40
|
+
<div className="flex items-center justify-between px-6 py-4">
|
|
41
|
+
<Heading level="h2">{t("brands.title")}</Heading>
|
|
42
|
+
<p>{t("brands.description")}</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div className="flex justify-end px-6 py-4">
|
|
45
|
+
<Button variant="primary">{t("done")}</Button>
|
|
46
|
+
</div>
|
|
47
|
+
</Container>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const config = defineWidgetConfig({
|
|
52
|
+
zone: "product.details.before",
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
export default ProductWidget
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Learn more about translating admin extensions in the [Translate Admin Customizations](https://docs.medusajs.com/learn/fundamentals/admin/translations) documentation.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ar from "./json/ar.json"
|
|
2
|
+
import en from "./json/en.json"
|
|
3
|
+
import es from "./json/es.json"
|
|
4
|
+
import tr from "./json/tr.json"
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
ar: { translation: ar },
|
|
8
|
+
en: { translation: en },
|
|
9
|
+
es: { translation: es },
|
|
10
|
+
tr: { translation: tr },
|
|
11
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bold": {
|
|
3
|
+
"admin": {
|
|
4
|
+
"settings": {
|
|
5
|
+
"title": "إعدادات Bold كولومبيا",
|
|
6
|
+
"subtitle": "إدارة مزودي الدفع وطرق الدفع.",
|
|
7
|
+
"refresh": "تحديث",
|
|
8
|
+
"enabled_providers": "المزودون المفعّلون",
|
|
9
|
+
"enabled_providers_description": "أنواع مزودي الدفع النشطين",
|
|
10
|
+
"integration_methods": "طرق واجهة برمجة التطبيقات للربط",
|
|
11
|
+
"integration_methods_description": "طرق الدفع لأجهزة POS والطرفيات",
|
|
12
|
+
"payment_link_methods": "طرق رابط الدفع",
|
|
13
|
+
"payment_link_methods_description": "طرق الدفع عبر الإنترنت (رمز QR، البطاقات، PSE، Nequi)",
|
|
14
|
+
"no_providers_configured": "لا يوجد مزودون مُعدّلون",
|
|
15
|
+
"no_methods_available": "لا توجد طرق متاحة",
|
|
16
|
+
"method_status_available": "متاح",
|
|
17
|
+
"provider_link": "رابط الدفع",
|
|
18
|
+
"provider_online": "المدفوعات عبر الإنترنت",
|
|
19
|
+
"provider_terminal": "طرفية POS",
|
|
20
|
+
"provider_button": "زر الدفع",
|
|
21
|
+
"loading": "جاري التحميل...",
|
|
22
|
+
"unauthorized_short": "وصول API معلق (403)",
|
|
23
|
+
"unauthorized_methods_desc": "يرجى التأكد من تفعيل واجهة برمجة تطبيقات المدفوعات عبر الإنترنت في بوابة التجار الخاصة بك في Bold.",
|
|
24
|
+
"enable_payments_link": "تفعيل API المدفوعات عبر الإنترنت ←",
|
|
25
|
+
"unauthorized_terminals_title": "تفويض الربط البرمجي لأجهزة POS مطلوب (403)",
|
|
26
|
+
"unauthorized_terminals_desc": "يجب تفويض معاملات أجهزة POS صراحةً للربط البرمجي عبر بوابة التجار في Bold.",
|
|
27
|
+
"enable_terminals_link": "تفويض أجهزة POS ←"
|
|
28
|
+
},
|
|
29
|
+
"widget": {
|
|
30
|
+
"title": "إجراءات دفع Bold",
|
|
31
|
+
"description": "إرسال رابط دفع عن بُعد أو دفع عبر جهاز POS للعميل",
|
|
32
|
+
"link_btn": "رابط الدفع",
|
|
33
|
+
"qr_btn": "رمز QR",
|
|
34
|
+
"terminal_btn": "إرسال للجهاز",
|
|
35
|
+
"terminal_placeholder": "الرقم التسلسلي للجهاز (مثال: POS_SMART_01)",
|
|
36
|
+
"send_to_terminal": "إرسال إلى جهاز POS",
|
|
37
|
+
"approved": "تمت الموافقة على الدفع",
|
|
38
|
+
"partially_paid": "مدفوع جزئياً",
|
|
39
|
+
"remaining_balance": "الرصيد المتبقي",
|
|
40
|
+
"processing": "جاري معالجة الدفع",
|
|
41
|
+
"copy_link": "نسخ الرابط",
|
|
42
|
+
"copied": "تم النسخ",
|
|
43
|
+
"copied_desc": "تم نسخ رابط الدفع إلى الحافظة!",
|
|
44
|
+
"already_captured": "تمت تفويض وتحصيل هذا الطلب بنجاح عبر Bold.",
|
|
45
|
+
"paid_and_captured": "مدفوع ومحصل"
|
|
46
|
+
},
|
|
47
|
+
"terminal_status": {
|
|
48
|
+
"title": "حالة أجهزة POS Bold",
|
|
49
|
+
"refresh": "تحديث الأجهزة",
|
|
50
|
+
"serial": "الرقم التسلسلي",
|
|
51
|
+
"model": "طراز الجهاز",
|
|
52
|
+
"status": "الحالة",
|
|
53
|
+
"battery": "البطارية",
|
|
54
|
+
"connectivity": "الاتصال",
|
|
55
|
+
"unknown": "غير معروف",
|
|
56
|
+
"na": "غير متاح"
|
|
57
|
+
},
|
|
58
|
+
"audit": {
|
|
59
|
+
"title": "سجل مراجعة مدفوعات Bold",
|
|
60
|
+
"events_count": "تم تسجيل {{count}} أحداث",
|
|
61
|
+
"session_init": "تم بدء الجلسة",
|
|
62
|
+
"payment_auth": "تم تفويض الدفع",
|
|
63
|
+
"payment_captured": "تم تحصيل الدفع وتسويته",
|
|
64
|
+
"mode_link": "رابط الدفع",
|
|
65
|
+
"mode_terminal": "إرسال للجهاز",
|
|
66
|
+
"ref": "المرجع: {{ref}}",
|
|
67
|
+
"amount": "المبلغ: ${{amount}} {{currency}}",
|
|
68
|
+
"headers": {
|
|
69
|
+
"event": "الحدث",
|
|
70
|
+
"provider_mode": "المزود / الوضع",
|
|
71
|
+
"reference": "المرجع",
|
|
72
|
+
"amount": "المبلغ",
|
|
73
|
+
"status": "الحالة",
|
|
74
|
+
"timestamp": "الطابع الزمني"
|
|
75
|
+
},
|
|
76
|
+
"statuses": {
|
|
77
|
+
"success": "ناجح",
|
|
78
|
+
"pending": "قيد الانتظار",
|
|
79
|
+
"info": "معلومات"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"refund": {
|
|
83
|
+
"title": "استرداد مدفوعات Bold",
|
|
84
|
+
"captured": "تم التحصيل",
|
|
85
|
+
"fully_refunded": "مسترد بالكامل",
|
|
86
|
+
"fully_refunded_desc": "تم استرداد هذا المبلغ بالكامل (${{amount}} COP).",
|
|
87
|
+
"captured_total": "إجمالي المحصل",
|
|
88
|
+
"remaining": "المتبقي للاسترداد",
|
|
89
|
+
"placeholder": "مبلغ الاسترداد (COP)",
|
|
90
|
+
"action": "إجراء الاسترداد",
|
|
91
|
+
"invalid_amount_title": "مبلغ غير صحيح",
|
|
92
|
+
"invalid_amount_desc": "يرجى إدخال مبلغ بين 1 و ${{max}} COP.",
|
|
93
|
+
"success_title": "تمت معالجة الاسترداد",
|
|
94
|
+
"success_desc": "تم استرداد ${{amount}} COP بنجاح.",
|
|
95
|
+
"error_title": "خطأ في الاسترداد"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bold": {
|
|
3
|
+
"admin": {
|
|
4
|
+
"settings": {
|
|
5
|
+
"title": "Bold Colombia Settings",
|
|
6
|
+
"subtitle": "Manage payment providers and methods.",
|
|
7
|
+
"refresh": "Refresh",
|
|
8
|
+
"enabled_providers": "Enabled Providers",
|
|
9
|
+
"enabled_providers_description": "Active payment provider types",
|
|
10
|
+
"integration_methods": "Integration API Methods",
|
|
11
|
+
"integration_methods_description": "POS and terminal payment methods",
|
|
12
|
+
"payment_link_methods": "Payment Link Methods",
|
|
13
|
+
"payment_link_methods_description": "Online payment methods (QR, Cards, PSE, Nequi)",
|
|
14
|
+
"no_providers_configured": "No providers configured",
|
|
15
|
+
"no_methods_available": "No methods available",
|
|
16
|
+
"method_status_available": "Available",
|
|
17
|
+
"provider_link": "Payment Link",
|
|
18
|
+
"provider_online": "Online Payments",
|
|
19
|
+
"provider_terminal": "POS Terminal",
|
|
20
|
+
"provider_button": "Payment Button",
|
|
21
|
+
"loading": "Loading...",
|
|
22
|
+
"unauthorized_short": "API Access Pending (403)",
|
|
23
|
+
"unauthorized_methods_desc": "Please ensure Online Payments (API de Pagos en Línea) is activated in your Bold Merchant Portal.",
|
|
24
|
+
"enable_payments_link": "Enable Online Payments API →",
|
|
25
|
+
"unauthorized_terminals_title": "POS Terminal Integration Authorization Required (403)",
|
|
26
|
+
"unauthorized_terminals_desc": "Datáfono POS transactions must be explicitly authorized for API Integrations in your Bold merchant portal.",
|
|
27
|
+
"enable_terminals_link": "Authorize Terminals →"
|
|
28
|
+
},
|
|
29
|
+
"widget": {
|
|
30
|
+
"title": "Bold Payment Actions",
|
|
31
|
+
"description": "Dispatch remote or POS payment to customer",
|
|
32
|
+
"link_btn": "Payment Link",
|
|
33
|
+
"qr_btn": "QR Code",
|
|
34
|
+
"terminal_btn": "Terminal Push",
|
|
35
|
+
"terminal_placeholder": "Data-phone Serial (e.g. POS_SMART_01)",
|
|
36
|
+
"send_to_terminal": "Push to POS Terminal",
|
|
37
|
+
"approved": "Payment Approved",
|
|
38
|
+
"partially_paid": "Partially Paid",
|
|
39
|
+
"remaining_balance": "Remaining Balance",
|
|
40
|
+
"processing": "Processing Payment",
|
|
41
|
+
"copy_link": "Copy Link",
|
|
42
|
+
"copied": "Copied",
|
|
43
|
+
"copied_desc": "Payment link copied to clipboard!",
|
|
44
|
+
"already_captured": "This order has already been successfully authorized and captured via Bold.",
|
|
45
|
+
"paid_and_captured": "Paid & Captured"
|
|
46
|
+
},
|
|
47
|
+
"terminal_status": {
|
|
48
|
+
"title": "Bold POS Terminal Fleet Health",
|
|
49
|
+
"refresh": "Refresh Fleet",
|
|
50
|
+
"serial": "Serial Number",
|
|
51
|
+
"model": "Hardware Model",
|
|
52
|
+
"status": "Status",
|
|
53
|
+
"battery": "Battery",
|
|
54
|
+
"connectivity": "Connectivity",
|
|
55
|
+
"unknown": "UNKNOWN",
|
|
56
|
+
"na": "N/A"
|
|
57
|
+
},
|
|
58
|
+
"audit": {
|
|
59
|
+
"title": "Bold Payment Audit Trail",
|
|
60
|
+
"events_count": "{{count}} Events Recorded",
|
|
61
|
+
"session_init": "Session Initialized",
|
|
62
|
+
"payment_auth": "Payment Authorized",
|
|
63
|
+
"payment_captured": "Payment Captured & Settled",
|
|
64
|
+
"mode_link": "Payment Link",
|
|
65
|
+
"mode_terminal": "Terminal Push",
|
|
66
|
+
"ref": "Ref: {{ref}}",
|
|
67
|
+
"amount": "Amount: ${{amount}} {{currency}}",
|
|
68
|
+
"headers": {
|
|
69
|
+
"event": "Event",
|
|
70
|
+
"provider_mode": "Provider / Mode",
|
|
71
|
+
"reference": "Reference",
|
|
72
|
+
"amount": "Amount",
|
|
73
|
+
"status": "Status",
|
|
74
|
+
"timestamp": "Timestamp"
|
|
75
|
+
},
|
|
76
|
+
"statuses": {
|
|
77
|
+
"success": "SUCCESS",
|
|
78
|
+
"pending": "PENDING",
|
|
79
|
+
"info": "INFO"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"refund": {
|
|
83
|
+
"title": "Bold Payment Refund",
|
|
84
|
+
"captured": "Captured",
|
|
85
|
+
"fully_refunded": "Fully Refunded",
|
|
86
|
+
"fully_refunded_desc": "This payment has been fully refunded (${{amount}} COP).",
|
|
87
|
+
"captured_total": "Captured Total",
|
|
88
|
+
"remaining": "Remaining Refundable",
|
|
89
|
+
"placeholder": "Refund Amount (COP)",
|
|
90
|
+
"action": "Issue Refund",
|
|
91
|
+
"invalid_amount_title": "Invalid Amount",
|
|
92
|
+
"invalid_amount_desc": "Please enter an amount between 1 and ${{max}} COP.",
|
|
93
|
+
"success_title": "Refund Processed",
|
|
94
|
+
"success_desc": "Refund of ${{amount}} COP was successful.",
|
|
95
|
+
"error_title": "Refund Error"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bold": {
|
|
3
|
+
"admin": {
|
|
4
|
+
"settings": {
|
|
5
|
+
"title": "Configuración de Bold Colombia",
|
|
6
|
+
"subtitle": "Gestione proveedores de pago y métodos disponibles.",
|
|
7
|
+
"refresh": "Actualizar",
|
|
8
|
+
"enabled_providers": "Proveedores Habilitados",
|
|
9
|
+
"enabled_providers_description": "Tipos de proveedores de pago activos",
|
|
10
|
+
"integration_methods": "Métodos de API de Integración",
|
|
11
|
+
"integration_methods_description": "Métodos de pago para datáfonos y terminales POS",
|
|
12
|
+
"payment_link_methods": "Métodos de Enlace de Pago",
|
|
13
|
+
"payment_link_methods_description": "Métodos de pago en línea (QR, Tarjetas, PSE, Nequi)",
|
|
14
|
+
"no_providers_configured": "No hay proveedores configurados",
|
|
15
|
+
"no_methods_available": "No hay métodos disponibles",
|
|
16
|
+
"method_status_available": "Disponible",
|
|
17
|
+
"provider_link": "Enlace de Pago",
|
|
18
|
+
"provider_online": "Pagos en Línea",
|
|
19
|
+
"provider_terminal": "Datáfono POS",
|
|
20
|
+
"provider_button": "Botón de Pago",
|
|
21
|
+
"loading": "Cargando...",
|
|
22
|
+
"unauthorized_short": "Acceso a API Pendiente (403)",
|
|
23
|
+
"unauthorized_methods_desc": "Asegúrese de que la API de Pagos en Línea esté activada en su Portal de Comercios Bold.",
|
|
24
|
+
"enable_payments_link": "Habilitar API de Pagos en Línea →",
|
|
25
|
+
"unauthorized_terminals_title": "Autorización de Integración POS Requerida (403)",
|
|
26
|
+
"unauthorized_terminals_desc": "Las transacciones de datáfono POS deben ser autorizadas explícitamente para integraciones API en su portal de Bold.",
|
|
27
|
+
"enable_terminals_link": "Autorizar Terminales →"
|
|
28
|
+
},
|
|
29
|
+
"widget": {
|
|
30
|
+
"title": "Acciones de Pago Bold",
|
|
31
|
+
"description": "Despachar pago remoto o POS al cliente",
|
|
32
|
+
"link_btn": "Enlace de Pago",
|
|
33
|
+
"qr_btn": "Código QR",
|
|
34
|
+
"terminal_btn": "Envío a Datáfono",
|
|
35
|
+
"terminal_placeholder": "Serial de Datáfono (ej. POS_SMART_01)",
|
|
36
|
+
"send_to_terminal": "Enviar a Datáfono",
|
|
37
|
+
"approved": "Pago Aprobado",
|
|
38
|
+
"partially_paid": "Pagado Parcialmente",
|
|
39
|
+
"remaining_balance": "Saldo Pendiente",
|
|
40
|
+
"processing": "Procesando Pago",
|
|
41
|
+
"copy_link": "Copiar Enlace",
|
|
42
|
+
"copied": "Copiado",
|
|
43
|
+
"copied_desc": "¡Enlace de pago copiado al portapapeles!",
|
|
44
|
+
"already_captured": "Esta orden ya ha sido autorizada y capturada exitosamente con Bold.",
|
|
45
|
+
"paid_and_captured": "Pagado y Capturado"
|
|
46
|
+
},
|
|
47
|
+
"terminal_status": {
|
|
48
|
+
"title": "Estado de Flota de Datáfonos POS Bold",
|
|
49
|
+
"refresh": "Actualizar Flota",
|
|
50
|
+
"serial": "Número de Serie",
|
|
51
|
+
"model": "Modelo de Hardware",
|
|
52
|
+
"status": "Estado",
|
|
53
|
+
"battery": "Batería",
|
|
54
|
+
"connectivity": "Conectividad",
|
|
55
|
+
"unknown": "DESCONOCIDO",
|
|
56
|
+
"na": "N/D"
|
|
57
|
+
},
|
|
58
|
+
"audit": {
|
|
59
|
+
"title": "Auditoría de Pagos Bold",
|
|
60
|
+
"events_count": "{{count}} Eventos Registrados",
|
|
61
|
+
"session_init": "Sesión Inicializada",
|
|
62
|
+
"payment_auth": "Pago Autorizado",
|
|
63
|
+
"payment_captured": "Pago Capturado y Liquidado",
|
|
64
|
+
"mode_link": "Enlace de Pago",
|
|
65
|
+
"mode_terminal": "Envío a Datáfono",
|
|
66
|
+
"ref": "Ref: {{ref}}",
|
|
67
|
+
"amount": "Monto: ${{amount}} {{currency}}",
|
|
68
|
+
"headers": {
|
|
69
|
+
"event": "Evento",
|
|
70
|
+
"provider_mode": "Proveedor / Modo",
|
|
71
|
+
"reference": "Referencia",
|
|
72
|
+
"amount": "Monto",
|
|
73
|
+
"status": "Estado",
|
|
74
|
+
"timestamp": "Marca de Tiempo"
|
|
75
|
+
},
|
|
76
|
+
"statuses": {
|
|
77
|
+
"success": "ÉXITO",
|
|
78
|
+
"pending": "PENDIENTE",
|
|
79
|
+
"info": "INFO"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"refund": {
|
|
83
|
+
"title": "Reembolso de Pago Bold",
|
|
84
|
+
"captured": "Capturado",
|
|
85
|
+
"fully_refunded": "Reembolsado Totalmente",
|
|
86
|
+
"fully_refunded_desc": "Este pago ha sido reembolsado totalmente (${{amount}} COP).",
|
|
87
|
+
"captured_total": "Total Capturado",
|
|
88
|
+
"remaining": "Restante Reembolsable",
|
|
89
|
+
"placeholder": "Monto a Reembolsar (COP)",
|
|
90
|
+
"action": "Emitir Reembolso",
|
|
91
|
+
"invalid_amount_title": "Monto Inválido",
|
|
92
|
+
"invalid_amount_desc": "Por favor ingrese un monto entre 1 y ${{max}} COP.",
|
|
93
|
+
"success_title": "Reembolso Procesado",
|
|
94
|
+
"success_desc": "El reembolso de ${{amount}} COP fue exitoso.",
|
|
95
|
+
"error_title": "Error de Reembolso"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|