@autobusal/order-process 1.3.3 → 1.3.5

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,9 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.5
4
+
5
+ ### Fixed
6
+
7
+ - **A refused funds payment spun forever.** The standard (funds/reserve) processor had only a success branch, so an agent's "not enough funds" left the page on "Processing your order" with no message and the order stuck reserved. It now surfaces the API's own message and returns the buyer so they can try again. (Platform audit BOOK-05-c.)
8
+
3
9
  All notable changes to `@autobusal/order-process` are documented here. This
4
10
  project adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
11
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
12
 
13
+ ## [1.3.4] - 2026-07-30
14
+
15
+ ### Fixed
16
+
17
+ - **`noIndex` never used on the order processing page (`OrderProcess.tsx`).**
18
+ Same rationale as order-confirm - a transient, hash-gated page with no
19
+ search value, previously indexable by default.
20
+
7
21
  ## [1.3.3] - 2026-07-24
8
22
 
9
23
  ### Fixed
package/OrderProcess.tsx CHANGED
@@ -11,7 +11,7 @@ const OrderProcess = ({ t }: Props): JSX.Element => {
11
11
  const { type, hash } = useParams();
12
12
 
13
13
  return (
14
- <Meta title={ t('order_process.title') }>
14
+ <Meta title={ t('order_process.title') } noIndex={ true }>
15
15
  <Content type={ type } hash={ hash } t={ t } />
16
16
  </Meta>
17
17
  );
@@ -1,6 +1,8 @@
1
+ import { useEffect } from 'react';
1
2
  import { TFunction } from 'i18next';
2
- import { Navigate } from 'react-router-dom';
3
+ import { Navigate, useNavigate } from 'react-router-dom';
3
4
  import { Inline } from '@autobusal/common';
5
+ import { error as notifyError } from '@autobusal/utilities';
4
6
  import { Container } from '../styles';
5
7
  import { useMakeStandard } from '../services';
6
8
 
@@ -10,8 +12,30 @@ interface Props {
10
12
  t: TFunction<'common'>
11
13
  }
12
14
 
15
+ /*
16
+ * Edited: Claude - Date: 2026-08-22 (audit finding BOOK-05-c)
17
+ *
18
+ * This had only an isSuccess branch, so a refused payment - most visibly an
19
+ * agent's "not enough funds" - left the page spinning on "Processing your
20
+ * order" forever, with no message and no way out. The reserved order just
21
+ * sat there. Now a failure surfaces the API's own message (the funds gate
22
+ * returns exactly the text the agent needs) and returns them to where they
23
+ * were, so they can top up and try again - the reservation is still theirs.
24
+ */
13
25
  const Standard = ({ type, hash, t }: Props): JSX.Element => {
14
- const { data, isSuccess } = useMakeStandard(String(type), String(hash));
26
+ const { data, isSuccess, isError, error } = useMakeStandard(String(type), String(hash));
27
+
28
+ const navigate = useNavigate();
29
+
30
+ useEffect(() => {
31
+ if (isError) {
32
+ const message = (error as { response?: { data?: { message?: string } } })?.response?.data?.message;
33
+
34
+ notifyError(message ?? t('order_process.error', { ns: 'common', defaultValue: 'We could not complete your order. Please try again.' }));
35
+
36
+ navigate(-1);
37
+ }
38
+ }, [isError, error, navigate, t]);
15
39
 
16
40
  if (isSuccess) {
17
41
  return <Navigate to={ data } />;
@@ -24,4 +48,4 @@ const Standard = ({ type, hash, t }: Props): JSX.Element => {
24
48
  );
25
49
  };
26
50
 
27
- export default Standard;
51
+ export default Standard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/order-process",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"