Skip to content

Commit

Permalink
Merge pull request #46 from pagopa/CHK-3584-mapping-npg-outcome-io
Browse files Browse the repository at this point in the history
[CHK-3458] remapping npg/redirect outcome for app io outcome
  • Loading branch information
ciuffagianluca authored Dec 2, 2024
2 parents 61c422b + 12c96eb commit 6cbe1b0
Show file tree
Hide file tree
Showing 7 changed files with 842 additions and 246 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,24 @@ Test use cases:
The ecommerce transaction get transaction endpoint `/checkout/webview/v1/transactions/:transactionId` is driven by the following mockFlow values:

| MOCK FLOW | Transaction Id Suffix | OUTCOME |
|----------------------------------------------------|--------------|----------------------|
| NOTIFIED_OK | other | SUCCESS (0) |
| NOTIFICATION_REQUESTED - Outcome OK | 61 | SUCCESS (0) |
| NOTIFICATION_REQUESTED - Outcome KO | 62 | GENERIC_ERROR (1) |
| NOTIFICATION_ERROR - Outcome OK | 63 | SUCCESS (0) |
| NOTIFICATION_ERROR - Outcome KO | 64 | GENERIC_ERROR (1) |
| NOTIFIED_KO | 65 | GENERIC_ERROR (1) |
| REFUNDED | 66 | GENERIC_ERROR (1) |
| REFUND_REQUESTED | 67 | GENERIC_ERROR (1) |
| REFUND_ERROR | 68 | GENERIC_ERROR (1) |
| EXPIRED_NOT_AUTHORIZED | 69 | TIMEOUT (4) |
| CANCELED | 70 | CANCELED_BY_USER (8) |
| CANCELLATION_EXPIRED | 71 | CANCELED_BY_USER (8) |
| CLOSURE_ERROR - NPG EXECUTED | 72 | GENERIC_ERROR (1) |
| CLOSURE_REQUESTED - NPG CANCELED | 73 | CANCELED_BY_USER (8) |
| AUTHORIZATION_COMPLETED - NPG AUTHORIZED | 74 | GENERIC_ERROR (1) |
| UNAUTHORIZED - NPG DENIED_BY_RISK | 75 | AUTH_ERROR (2) |
| CLOSED - Outcome NOT_RECEIVED | 76 | TAKING_CHARGE (17) |
| CLOSED - Other | 77 | GENERIC_ERROR (1) |
| EXPIRED - Outcome OK | 78 | SUCCESS (0) |
| AUTHORIZATION_REQUESTED | 79 | TAKING_CHARGE (17) |
|----------------------------------------------------|-----------------------|----------------------|
| NOTIFIED_OK | other | SUCCESS (0) |
| NOTIFICATION_REQUESTED - Outcome OK | 61 | SUCCESS (0) |
| NOTIFICATION_REQUESTED - Outcome KO | 62 | PSP_ERROR (25) |
| NOTIFICATION_ERROR - Outcome OK | 63 | SUCCESS (0) |
| NOTIFICATION_ERROR - Outcome KO | 64 | PSP_ERROR (25) |
| NOTIFIED_KO | 65 | PSP_ERROR (25) |
| REFUNDED | 66 | PSP_ERROR (25) |
| REFUND_REQUESTED | 67 | GENERIC_ERROR (1) |
| REFUND_ERROR | 68 | GENERIC_ERROR (1) |
| EXPIRED_NOT_AUTHORIZED | 69 | TIMEOUT (4) |
| CANCELED | 70 | CANCELED_BY_USER (8) |
| CANCELLATION_EXPIRED | 71 | CANCELED_BY_USER (8) |
| CLOSURE_ERROR - NPG EXECUTED | 72 | GENERIC_ERROR (1) |
| CLOSURE_REQUESTED - NPG CANCELED | 73 | CANCELED_BY_USER (8) |
| AUTHORIZATION_COMPLETED - NPG AUTHORIZED | 74 | PSP_ERROR (25) |
| UNAUTHORIZED - NPG DENIED_BY_RISK | 75 | AUTH_ERROR (2) |
| CLOSED - Outcome NOT_RECEIVED | 76 | TAKE_IN_CHARGE (17) |
| CLOSED - Other | 77 | GENERIC_ERROR (1) |
| EXPIRED - Outcome OK | 78 | SUCCESS (0) |
| AUTHORIZATION_REQUESTED | 79 | TAKE_IN_CHARGE (17) |
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"scripts": {
"type-check": "tsc",
"generate": "npm-run-all generate:*",
"generate:payment-ecommerce-webview": "rimraf generated/definitions/payment-ecommerce-webview && shx mkdir -p generated/definitions/payment-ecommerce-webview && gen-api-models --api-spec https://raw.githubusercontent.com/pagopa/pagopa-infra/v1.200.0/src/domains/ecommerce-app/api/ecommerce-webview/v1/_openapi.json.tpl --no-strict --out-dir ./generated/definitions/payment-ecommerce-webview --request-types --response-decoders --client",
"generate:payment-ecommerce": "rimraf generated/definitions/payment-ecommerce && shx mkdir -p generated/definitions/payment-ecommerce && gen-api-models --api-spec https://raw.githubusercontent.com/pagopa/pagopa-infra/v1.200.0/src/domains/ecommerce-app/api/ecommerce-checkout/v1/_openapi.json.tpl --no-strict --out-dir ./generated/definitions/payment-ecommerce --request-types --response-decoders --client",
"generate:payment-ecommerce-webview": "rimraf generated/definitions/payment-ecommerce-webview && shx mkdir -p generated/definitions/payment-ecommerce-webview && gen-api-models --api-spec https://raw.githubusercontent.com/pagopa/pagopa-infra/v1.292.0/src/domains/ecommerce-app/api/ecommerce-webview/v1/_openapi.json.tpl --no-strict --out-dir ./generated/definitions/payment-ecommerce-webview --request-types --response-decoders --client",
"generate:payment-ecommerce": "rimraf generated/definitions/payment-ecommerce && shx mkdir -p generated/definitions/payment-ecommerce && gen-api-models --api-spec https://raw.githubusercontent.com/pagopa/pagopa-infra/v1.292.0/src/domains/ecommerce-app/api/ecommerce-checkout/v1/_openapi.json.tpl --no-strict --out-dir ./generated/definitions/payment-ecommerce --request-types --response-decoders --client",
"lint": "eslint . -c .eslintrc.js --ext .ts,.tsx",
"lint-autofix": "eslint . -c .eslintrc.js --ext .ts,.tsx --fix",
"prebuild": "npm-run-all generate type-check lint",
Expand Down
10 changes: 5 additions & 5 deletions src/__integration_tests__/final-status-io.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ describe("Check final status on IO mapping tests", () => {
const mockTransactionIdsWithExpectedResultMap = new Map([
["302054585254587560","0"],
["302054585254587561","0"],
["302054585254587562","1"],
["302054585254587562","25"],
["302054585254587563","0"],
["302054585254587564","1"],
["302054585254587565","1"],
["302054585254587566","1"],
["302054585254587564","25"],
["302054585254587565","25"],
["302054585254587566","25"],
["302054585254587567","1"],
["302054585254587568","1"],
["302054585254587569","4"],
["302054585254587570","8"],
["302054585254587571","8"],
["302054585254587572","1"],
["302054585254587573","8"],
["302054585254587574","1"],
["302054585254587574","25"],
["302054585254587575","2"],
["302054585254587576","17"],
["302054585254587577","1"],
Expand Down
Loading

0 comments on commit 6cbe1b0

Please sign in to comment.