@akinon/pz-flow-payment 2.0.0-beta.19 → 2.0.0-beta.21

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,18 +1,36 @@
1
1
  # @akinon/pz-flow-payment
2
2
 
3
- ## 2.0.0-beta.19
3
+ ## 2.0.0-beta.21
4
4
 
5
- ## 2.0.0-beta.18
5
+ ## 2.0.0-beta.20
6
6
 
7
- ## 2.0.0-beta.17
7
+ ## 1.126.0
8
8
 
9
- ## 2.0.0-beta.16
9
+ ### Minor Changes
10
+
11
+ - 46d787e6: Align versions to unblock rc publish pipeline
12
+
13
+ ## 1.125.2
14
+
15
+ ### Patch Changes
16
+
17
+ - 0220a136: ZERO-4211: Reset payment session on error to prevent stale orderNumber reuse
18
+
19
+ ## 1.125.1
20
+
21
+ ## 1.125.0
22
+
23
+ ## 1.124.0
24
+
25
+ ## 1.123.0
26
+
27
+ ## 1.122.0
10
28
 
11
- ## 2.0.0-beta.15
29
+ ## 1.121.0
12
30
 
13
- ## 2.0.0-beta.14
31
+ ## 1.120.0
14
32
 
15
- ## 2.0.0-beta.13
33
+ ## 1.119.0
16
34
 
17
35
  ## 1.118.0
18
36
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/pz-flow-payment",
3
3
  "license": "MIT",
4
- "version": "2.0.0-beta.19",
4
+ "version": "2.0.0-beta.21",
5
5
  "main": "src/index.tsx",
6
6
  "dependencies": {
7
7
  "@checkout.com/checkout-web-components": "0.7.0-beta"
@@ -129,6 +129,14 @@ export default function FlowPayment({
129
129
  setWalletSelectionReady(true);
130
130
  };
131
131
 
132
+ // Reset payment state and get a fresh orderNumber + payment session for retry
133
+ const resetPaymentSession = async (errors: any) => {
134
+ setErrors(errors);
135
+ setWalletSelectionReady(false);
136
+ lastAmountRef.current = null;
137
+ await initWalletSelection();
138
+ };
139
+
132
140
  const handlePaymentSuccess = async (paymentData: any) => {
133
141
  setErrors(null);
134
142
 
@@ -145,7 +153,7 @@ export default function FlowPayment({
145
153
  ).unwrap();
146
154
 
147
155
  if (paymentCompleteResponse.errors) {
148
- setErrors(paymentCompleteResponse.errors);
156
+ await resetPaymentSession(paymentCompleteResponse.errors);
149
157
  return;
150
158
  }
151
159
 
@@ -166,13 +174,13 @@ export default function FlowPayment({
166
174
  }
167
175
  } catch (error) {
168
176
  console.error('Error processing payment completion:', error);
169
- setErrors(error);
177
+ await resetPaymentSession(error);
170
178
  }
171
179
  };
172
180
 
173
181
  const handlePaymentError = async (error: any) => {
174
182
  console.error('Payment error occurred:', error);
175
- setErrors(error);
183
+ await resetPaymentSession(error);
176
184
  };
177
185
 
178
186
  const initFlowPaymentWebComponents = async ({