@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 +25 -7
- package/package.json +1 -1
- package/src/views/index.tsx +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
# @akinon/pz-flow-payment
|
|
2
2
|
|
|
3
|
-
## 2.0.0-beta.
|
|
3
|
+
## 2.0.0-beta.21
|
|
4
4
|
|
|
5
|
-
## 2.0.0-beta.
|
|
5
|
+
## 2.0.0-beta.20
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 1.126.0
|
|
8
8
|
|
|
9
|
-
|
|
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
|
-
##
|
|
29
|
+
## 1.121.0
|
|
12
30
|
|
|
13
|
-
##
|
|
31
|
+
## 1.120.0
|
|
14
32
|
|
|
15
|
-
##
|
|
33
|
+
## 1.119.0
|
|
16
34
|
|
|
17
35
|
## 1.118.0
|
|
18
36
|
|
package/package.json
CHANGED
package/src/views/index.tsx
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
183
|
+
await resetPaymentSession(error);
|
|
176
184
|
};
|
|
177
185
|
|
|
178
186
|
const initFlowPaymentWebComponents = async ({
|