@autobusal/routes-order 1.34.1 → 1.34.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.34.2 - 2026-08-29
2
+
3
+ - With more than one card gateway available, each Credit Card button carries its processor's name - they used to render byte-identical (audit A0-06).
4
+
1
5
  # Changelog
2
6
 
3
7
  ## 1.34.0 (2026-08-29)
@@ -42,6 +42,22 @@ const Payments = ({ selected, isPartner, routeId, total, currency, t, onChange }
42
42
 
43
43
  const available = getAvailablePayments(data, isPartner);
44
44
 
45
+ /*
46
+ * Claude - 2026-08-29 (audit A0-06, medium): a brand with several card
47
+ * gateways rendered N byte-identical "Credit Card" buttons - same icon,
48
+ * same words - so the buyer could not tell the options apart (and could
49
+ * not know which processor's surcharge they were accepting). With more
50
+ * than one card option each button now carries its processor's name;
51
+ * a single card gateway keeps the plain label it always had.
52
+ */
53
+ const CARD_GATEWAYS = ['bkt', 'stripe', 'mollie', 'raiffeisen', 'nexi'] as const;
54
+ const cardCount = isPartner ? CARD_GATEWAYS.length : CARD_GATEWAYS.filter(gateway => data?.[gateway]).length;
55
+ const CARD_NAMES: Record<string, string> = { bkt: 'BKT', stripe: 'Stripe', mollie: 'Mollie', raiffeisen: 'Raiffeisen', nexi: 'Nexi' };
56
+ const cardLabel = (gateway: string): string => (
57
+ cardCount > 1 ? `${ t('routes_order.step5.actions.card') } (${ CARD_NAMES[gateway] })` : t('routes_order.step5.actions.card')
58
+ );
59
+
60
+
45
61
  useEffect(() => {
46
62
  if (isSuccess) {
47
63
  const found = Object.keys(data).find(item => {
@@ -121,35 +137,35 @@ const Payments = ({ selected, isPartner, routeId, total, currency, t, onChange }
121
137
  { (data?.bkt || isPartner) && (
122
138
  <ButtonPayment type="button" $selected={ selected === 'bkt' } onClick={ () => onChange('bkt') }>
123
139
  <AiOutlineCreditCard />
124
- { t('routes_order.step5.actions.card') }{ fee('bkt') }
140
+ { cardLabel('bkt') }{ fee('bkt') }
125
141
  </ButtonPayment>
126
142
  ) }
127
143
 
128
144
  { (data?.stripe || isPartner) && (
129
145
  <ButtonPayment type="button" $selected={ selected === 'stripe' } onClick={ () => onChange('stripe') }>
130
146
  <AiOutlineCreditCard />
131
- { t('routes_order.step5.actions.card') }{ fee('stripe') }
147
+ { cardLabel('stripe') }{ fee('stripe') }
132
148
  </ButtonPayment>
133
149
  ) }
134
150
 
135
151
  { (data?.mollie || isPartner) && (
136
152
  <ButtonPayment type="button" $selected={ selected === 'mollie' } onClick={ () => onChange('mollie') }>
137
153
  <AiOutlineCreditCard />
138
- { t('routes_order.step5.actions.card') }{ fee('mollie') }
154
+ { cardLabel('mollie') }{ fee('mollie') }
139
155
  </ButtonPayment>
140
156
  ) }
141
157
 
142
158
  { (data?.raiffeisen || isPartner) && (
143
159
  <ButtonPayment type="button" $selected={ selected === 'raiffeisen' } onClick={ () => onChange('raiffeisen') }>
144
160
  <AiOutlineCreditCard />
145
- { t('routes_order.step5.actions.card') }{ fee('raiffeisen') }
161
+ { cardLabel('raiffeisen') }{ fee('raiffeisen') }
146
162
  </ButtonPayment>
147
163
  ) }
148
164
 
149
165
  { (data?.nexi || isPartner) && (
150
166
  <ButtonPayment type="button" $selected={ selected === 'nexi' } onClick={ () => onChange('nexi') }>
151
167
  <AiOutlineCreditCard />
152
- { t('routes_order.step5.actions.card') }{ fee('nexi') }
168
+ { cardLabel('nexi') }{ fee('nexi') }
153
169
  </ButtonPayment>
154
170
  ) }
155
171
  </ContainerPayments>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.34.1",
3
+ "version": "1.34.2",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"