diff --git a/src/components/displays/department/pos/displays/PayWithStripeButton.vue b/src/components/displays/department/pos/displays/PayWithStripeButton.vue index 9f2aeed7..34a8e058 100644 --- a/src/components/displays/department/pos/displays/PayWithStripeButton.vue +++ b/src/components/displays/department/pos/displays/PayWithStripeButton.vue @@ -16,6 +16,7 @@ import { const POLLING_INTERVAL_MS = 5000; const STRIPE_TERMINAL_SETUP_REQUIRED_CODE = 'stripe_terminal_setup_required'; +const CARD_PAYMENT_TAX_PERCENTAGE = 25; const props = defineProps({ departmentId: { @@ -61,12 +62,6 @@ const autoCapturePaymentIntentId = ref(null); const operationState = ref('idle'); const pollingEnabled = ref(true); -const taxRates = computed(() => ([ - { id: 1, display_name: stripeText('tax_rates.danish_customer'), percentage: 25 }, - { id: 2, display_name: stripeText('tax_rates.eu_customer'), percentage: 0 }, -])); - -const selectedTaxRate = ref(1); const paymentIntent = computed(() => StripeModule.paymentIntents.paymentIntent.value); const isTerminalPaymentCaptured = computed(() => StripeModule.paymentIntents.isPaymentIntentAmountReceived(paymentIntent.value)); const shouldShowDesktopCompletion = computed(() => isTerminalPaymentCaptured.value); @@ -93,11 +88,6 @@ const normalizeErrorState = (errorLike, fallbackMessage, source) => { }; }; -const getTaxRatePercentage = (taxRateId) => { - const taxRate = taxRates.value.find((rate) => rate.id === taxRateId); - return taxRate ? taxRate.percentage : 0; -}; - const clearErrorState = (...sources) => { const sourceSet = new Set(sources); if (sourceSet.has('readers')) { @@ -135,7 +125,7 @@ const paymentIntentReaderId = computed(() => { const paymentIntentTaxPercentage = computed(() => { const value = paymentIntent.value?.metadata?.tax_percentage; return value === undefined || value === null - ? getTaxRatePercentage(selectedTaxRate.value) + ? CARD_PAYMENT_TAX_PERCENTAGE : Number(value); }); @@ -267,18 +257,7 @@ const selectedReaderLabel = computed(() => { return stripeText('reader.no_selection'); }); -const formatTaxRateLabel = (taxRate) => { - return stripeText('tax_rates.option', { - name: taxRate.display_name, - percentage: taxRate.percentage, - }); -}; - const paymentTaxSummary = computed(() => { - const matchingRate = taxRates.value.find((rate) => Number(rate.percentage) === Number(paymentIntentTaxPercentage.value)); - if (matchingRate) { - return formatTaxRateLabel(matchingRate); - } return stripeText('tax_rates.fallback', { percentage: paymentIntentTaxPercentage.value }); }); @@ -345,7 +324,6 @@ const canCancelPaymentIntent = computed(() => { }); const shouldShowReaderSelection = computed(() => paymentIntent.value === null); -const shouldShowTaxSelection = computed(() => paymentIntent.value === null); const attemptAutomaticReaderSelection = (readerList) => { selectedReaderId.value = selectPreferredStripeTerminalReaderId( @@ -432,7 +410,7 @@ const onClickCreatePaymentIntent = async () => { const response = await StripeModule.paymentIntents.createPaymentIntent( selectedReader.value.reader, props.order_id, - getTaxRatePercentage(selectedTaxRate.value), + CARD_PAYMENT_TAX_PERCENTAGE, ); if (response?.status !== 200) { @@ -689,19 +667,6 @@ onUnmounted(() => { /> -