From 1da6fbd1c45df7abf3373f09c7e825d570244523 Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Tue, 28 Jul 2026 22:31:26 +0200 Subject: [PATCH] Remove card payment moms selector (#232) ## Summary - Removes the visible POS card-payment moms/tax selector from mobile and desktop Stripe terminal payment flows. - Keeps Stripe terminal payment intents at 25% moms by default and updates the POS desktop E2E assertion for the removed selector. ## Testing - `npx playwright test tests/e2e/pos-desktop-card-payments.spec.js --project=chromium-desktop --grep "idle state renders grouped terminal statuses"` - Visual preview capture on `origin/master`: `POS_CARD_PAYMENT_PREVIEW_DIR=.../before PLAYWRIGHT_WORKERS=1 npx playwright test tests/e2e/pos-card-payment-visual-preview.spec.js --project=chromium-desktop` - Visual preview capture on this branch: `POS_CARD_PAYMENT_PREVIEW_DIR=output/visual-previews/after PLAYWRIGHT_WORKERS=1 npx playwright test tests/e2e/pos-card-payment-visual-preview.spec.js --project=chromium-desktop` ## Visual change previews ### View: POS card payment **Description:** The POS card-payment step no longer shows the moms selector. The terminal selector and card-payment action remain available; 25% moms is still reflected in the payment summary where shown. #### Mobile (390x844) **Before:** ![Before mobile POS card payment](https://raw.githubusercontent.com/copenhagentruckwash/pleno-vue/de780d857cddcc6f61f728662e21e3a6b73fa791/visual-previews/pos-card-payment-vat/before-mobile-390x844.png) **After:** ![After mobile POS card payment](https://raw.githubusercontent.com/copenhagentruckwash/pleno-vue/de780d857cddcc6f61f728662e21e3a6b73fa791/visual-previews/pos-card-payment-vat/after-mobile-390x844.png) #### Tablet (768x1024) **Before:** ![Before tablet POS card payment](https://raw.githubusercontent.com/copenhagentruckwash/pleno-vue/de780d857cddcc6f61f728662e21e3a6b73fa791/visual-previews/pos-card-payment-vat/before-tablet-768x1024.png) **After:** ![After tablet POS card payment](https://raw.githubusercontent.com/copenhagentruckwash/pleno-vue/de780d857cddcc6f61f728662e21e3a6b73fa791/visual-previews/pos-card-payment-vat/after-tablet-768x1024.png) #### Desktop (1440x900) **Before:** ![Before desktop POS card payment](https://raw.githubusercontent.com/copenhagentruckwash/pleno-vue/de780d857cddcc6f61f728662e21e3a6b73fa791/visual-previews/pos-card-payment-vat/before-desktop-1440x900.png) **After:** ![After desktop POS card payment](https://raw.githubusercontent.com/copenhagentruckwash/pleno-vue/de780d857cddcc6f61f728662e21e3a6b73fa791/visual-previews/pos-card-payment-vat/after-desktop-1440x900.png) Co-authored-by: Jeppe Bundgaard --- .../pos/displays/PayWithStripeButton.vue | 55 +------------------ .../stripe/endpoints/PaymentIntents.vue | 2 +- tests/e2e/pos-desktop-card-payments.spec.js | 16 +----- 3 files changed, 7 insertions(+), 66 deletions(-) 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(() => { /> -
- -
- -
-
-
{{ currentErrorMessage }}
@@ -794,20 +759,6 @@ onUnmounted(() => {