@commercetools/connect-payments-sdk 0.23.0 → 0.23.1
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
|
@@ -178,9 +178,16 @@ class DefaultPaymentService {
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
shouldUpdateTransactionState(existingTx, newTransaction) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
const { state: currentState } = existingTx;
|
|
182
|
+
const { state: newState } = newTransaction;
|
|
183
|
+
// Define allowed state transitions
|
|
184
|
+
const allowedTransitions = {
|
|
185
|
+
Initial: ['Pending', 'Success', 'Failure'],
|
|
186
|
+
Pending: ['Success', 'Failure'],
|
|
187
|
+
Failure: ['Success'],
|
|
188
|
+
Success: ['Failure'],
|
|
189
|
+
};
|
|
190
|
+
return currentState !== newState && allowedTransitions[currentState]?.includes(newState);
|
|
184
191
|
}
|
|
185
192
|
shouldUpdateInteractionId(existingTx, newTransaction) {
|
|
186
193
|
return !existingTx.interactionId && !!newTransaction.interactionId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools/connect-payments-sdk",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"description": "Payment SDK for commercetools payment connectors",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
],
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@commercetools-backend/loggers": "
|
|
19
|
-
"@commercetools/platform-sdk": "8.
|
|
20
|
-
"@commercetools/ts-client": "3.
|
|
18
|
+
"@commercetools-backend/loggers": "24.1.0",
|
|
19
|
+
"@commercetools/platform-sdk": "8.10.0",
|
|
20
|
+
"@commercetools/ts-client": "3.4.0",
|
|
21
21
|
"jsonwebtoken": "9.0.2",
|
|
22
22
|
"jwks-rsa": "3.2.0",
|
|
23
23
|
"lodash": "4.17.21",
|