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

feat: [IOBP-687,IOBP-886] Add the recent used payment method when the user pays #415

Merged
merged 6 commits into from
Oct 14, 2024

Conversation

Hantex9
Copy link
Contributor

@Hantex9 Hantex9 commented Oct 3, 2024

Short description

This PR updates the ecommerce and pagopa wallet APIs definitions to handle even the recent used payment method when the user pays.

List of changes proposed in this pull request

  • Added the API /user/lastPaymentMethodUsed;
  • Added inside the WalletDB the recent used payment method that is saved in a variable that is in the RAM lifetime;
  • Added a logic to save in the variable the most recently used payment method when the API POST /transactions/:transactionId/auth-requests is called;

How to test

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 37.50000% with 15 lines in your changes missing coverage. Please review.

Project coverage is 64.34%. Comparing base (6197f78) to head (21ba0ce).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/features/payments/routers/payment.ts 28.57% 10 Missing ⚠️
src/features/payments/persistence/userWallet.ts 50.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #415      +/-   ##
==========================================
- Coverage   64.38%   64.34%   -0.05%     
==========================================
  Files         167      167              
  Lines        5332     5354      +22     
  Branches      719      748      +29     
==========================================
+ Hits         3433     3445      +12     
+ Misses       1898     1769     -129     
- Partials        1      140     +139     
Files with missing lines Coverage Δ
src/features/payments/persistence/userWallet.ts 67.34% <50.00%> (-5.16%) ⬇️
src/features/payments/routers/payment.ts 37.64% <28.57%> (-1.25%) ⬇️

... and 34 files with indirect coverage changes


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 94a89a6...21ba0ce. Read the comment docs.

Hantex9 added a commit to pagopa/io-app that referenced this pull request Oct 14, 2024
…ayment flow (#6234)

## Short description
This PR implements the ability to display the most recently used payment
method during in-app payments, ensuring it matches the method used in a
previous transaction.

## List of changes proposed in this pull request
- Updated the open API definitions;
- Added saga, action & reducer about the `recentUsedPaymentMethod`
- Added an additional list item at the top of the list that contains the
most recently used payment method if available, otherwise it isn't
showed
- Added a logic to remove the recently used payment method from the
cluster membership

## How to test
- Checkout this PR: pagopa/io-dev-api-server#415
from the io-dev-api-server and generate the API definitions;
- Start the io-dev-api-server;
- With the app in local env, start a payment flow from the "Payments"
section screen tapping the CTA "Paga un avviso"
- Then tap on the CTA "Digita"
- Inside of it, type any notice code -> go forward and type any fiscal
code;
- After, you should be able to see a list of available payment method,
complete the first payment choosing any payment method;
- When you complete the transaction, try to start another payment flow,
you should be able to see the payment method previously you choose in
the "Recently used" section;

## Preview


https://github.com/user-attachments/assets/62c30602-9581-42cd-b75c-dd3c0703aa22

---------

Co-authored-by: Mario Perrotta <[email protected]>
@Hantex9 Hantex9 merged commit f8549ca into master Oct 14, 2024
8 checks passed
@Hantex9 Hantex9 deleted the IOBP-886-add-mock-recent-used-payment-method branch October 14, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants