feat: limit checkout payment options from product rules

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-16 09:25:46 +03:30
co-authored by Cursor
parent ec0b5eead4
commit bde75ecf07
58 changed files with 122 additions and 58 deletions
+3
View File
@@ -20,6 +20,7 @@ const {
submitError,
settlementType,
checkTermMonths,
paymentLimits,
removeItem,
proceedToCheckout,
proceedAnyway,
@@ -47,6 +48,7 @@ function goToOrdering() {
:submitting="submitting"
:settlement-type="settlementType"
:check-term-months="checkTermMonths"
:payment-limits="paymentLimits"
@update:settlement-type="settlementType = $event"
@update:check-term-months="checkTermMonths = $event"
@back="router.push('/')"
@@ -67,6 +69,7 @@ function goToOrdering() {
:submitting="submitting"
:settlement-type="settlementType"
:check-term-months="checkTermMonths"
:payment-limits="paymentLimits"
@update:settlement-type="settlementType = $event"
@update:check-term-months="checkTermMonths = $event"
@remove="removeItem"
@@ -10,7 +10,7 @@ import IconLightbulb from '@/components/icons/IconLightbulb.vue'
import IconLayoutGrid from '@/components/icons/IconLayoutGrid.vue'
import IconDiamond from '@/components/icons/IconDiamond.vue'
import { formatMeterage, formatNumber } from '@/utils/format'
import type { CartItem, SettlementType } from '@/types'
import type { CartItem, PaymentLimits, SettlementType } from '@/types'
import PreorderPaymentFields from '@/components/orders/PreorderPaymentFields.vue'
defineProps<{
@@ -30,6 +30,7 @@ defineProps<{
submitting?: boolean
settlementType: SettlementType | null
checkTermMonths: number | null
paymentLimits?: PaymentLimits
}>()
const emit = defineEmits<{
@@ -188,6 +189,8 @@ const quickLinks = [
<PreorderPaymentFields
:settlement-type="settlementType"
:check-term-months="checkTermMonths"
:allowed-methods="paymentLimits?.methods"
:max-check-months="paymentLimits?.maxCheckMonths"
@update:settlement-type="emit('update:settlementType', $event)"
@update:check-term-months="emit('update:checkTermMonths', $event)"
/>
+4 -1
View File
@@ -4,7 +4,7 @@ import EmptyState from '@/components/ui/EmptyState.vue'
import IconTrash from '@/components/icons/IconTrash.vue'
import IconChevronBack from '@/components/icons/IconChevronBack.vue'
import { formatMeterage, formatNumber } from '@/utils/format'
import type { CartItem, SettlementType } from '@/types'
import type { CartItem, PaymentLimits, SettlementType } from '@/types'
import PreorderPaymentFields from '@/components/orders/PreorderPaymentFields.vue'
defineProps<{
@@ -24,6 +24,7 @@ defineProps<{
submitting?: boolean
settlementType: SettlementType | null
checkTermMonths: number | null
paymentLimits?: PaymentLimits
}>()
const emit = defineEmits<{
@@ -106,6 +107,8 @@ const emit = defineEmits<{
<PreorderPaymentFields
:settlement-type="settlementType"
:check-term-months="checkTermMonths"
:allowed-methods="paymentLimits?.methods"
:max-check-months="paymentLimits?.maxCheckMonths"
@update:settlement-type="emit('update:settlementType', $event)"
@update:check-term-months="emit('update:checkTermMonths', $event)"
/>