Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOBP-309,IOBP-312] Add ability to generate failure for payment verification and activation requests #335

Conversation

mastro993
Copy link
Contributor

@mastro993 mastro993 commented Jan 4, 2024

Short description

This PR adds the ability to force a failure during the payment verification and activation request.

How to test

  • To simulate a failure during the verification request, add the following configuration in your config.json :

     "features": {
        "wallet": {
          "verificationFailure": {
            "faultCodeCategory": "PAYMENT_UNAVAILABLE",
            "faultCodeDetail":"PPT_PSP_SCONOSCIUTO"
          }
        }
      }

    Check that the GET /payment-requests/:rpt_id endpoint returns a failure

  • To simulate a failure during the activation request, add the following configuration in your config.json :

     "features": {
        "wallet": {
          "activationFailure": {
            "faultCodeCategory": "PAYMENT_UNAVAILABLE",
            "faultCodeDetail":"PPT_PSP_SCONOSCIUTO"
          }
        }
      }

    Check that the POST /transaction endpoint returns a failure

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (fcfbfb2) 67.73% compared to head (4413f2b) 67.52%.
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #335      +/-   ##
==========================================
- Coverage   67.73%   67.52%   -0.22%     
==========================================
  Files         154      156       +2     
  Lines        5232     5272      +40     
  Branches      608      615       +7     
==========================================
+ Hits         3544     3560      +16     
- Misses       1687     1711      +24     
  Partials        1        1              
Files Coverage Δ
src/features/wallet/types/configuration.ts 100.00% <100.00%> (ø)
src/types/config.ts 100.00% <100.00%> (ø)
src/features/wallet/types/failure.ts 42.10% <42.10%> (ø)
src/features/wallet/routers/payment.ts 34.32% <19.04%> (-3.68%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 646fe37...4413f2b. Read the comment docs.

@mastro993 mastro993 changed the title [IOBP309] Add ability to generate failure for payment verification request [IOBP309] Add ability to generate failure for payment verification and activation requests Jan 8, 2024
@mastro993 mastro993 changed the title [IOBP309] Add ability to generate failure for payment verification and activation requests [IOBP-309,IOBP-312] Add ability to generate failure for payment verification and activation requests Jan 8, 2024
Copy link
Contributor

@Hantex9 Hantex9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mastro993 added a commit to pagopa/io-app that referenced this pull request Jan 11, 2024
…n and activation requests (#5378)

## Short description
This PR adds the handling of failures during the verification and
activation requests for a payment.

## List of changes proposed in this pull request
- Added `WalletPaymentFailure` type
- Added `WalletPaymentFailureDetail` component to display payment
failures
- Added `usePaymentFailureSupportModal` hook to display the payment
support request bottom sheet modal
- Added required locale keys

## How to test
Using the io-dev-api-server, checkout this branch
pagopa/io-dev-api-server#335 and add the
following to the config.json:
```json
 "features": {
    "wallet": {
      "verificationFailure": {
        "faultCodeCategory": "PAYMENT_UNAVAILABLE",
        "faultCodeDetail":"PPT_PSP_SCONOSCIUTO"
      }
    }
  }
 ```
 With the IO app, navigate to the wallet payment playground and check that the failure is correctly displayed.

## Preview

https://github.com/pagopa/io-app/assets/6160324/03ec83b8-68c5-4d77-83a1-3bfd7dd8afcd

---------

Co-authored-by: Alessandro Izzo <[email protected]>
@mastro993 mastro993 merged commit 340d5df into master Jan 15, 2024
6 checks passed
@Vangaorth Vangaorth deleted the IOBP-309-gestione-errori-in-fase-di-verifica-avviso-integrazione-ecommerce branch February 13, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants