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

chore: [IOBP-617] Add expired state to payment card component #5674

Merged
merged 64 commits into from
Apr 15, 2024

Conversation

mastro993
Copy link
Contributor

@mastro993 mastro993 commented Apr 9, 2024

Warning

This PR depends on #5663, pagopa/io-dev-api-server#361

Short description

This PR adds the error state to payment cards which are expired.

List of changes proposed in this pull request

  • Removed isError from PaymentCardSmallProps, which is now based on payment expiry date.

How to test

With the io-dev-api-server, checkout this PR pagopa/io-dev-api-server#361, enable the New wallet section FF from the profile screen in the IO app.
Check that in the payments landing screen you can see an error card.

Preview

mastro993 and others added 30 commits March 29, 2024 16:36
…g-screen' into IOBP-563-add-payments-screen-empty-states
…g-screen' into IOBP-563-add-payments-screen-empty-states
…7-add-expired-state-to-payment-card-component
Copy link

dpulls bot commented Apr 12, 2024

🎉 All dependencies have been resolved !

export const isExpiredDate = (expiryDate: string): boolean => {
const year = +expiryDate.slice(0, 4);
const month = +expiryDate.slice(4, 6);
export const isExpiredDate = (expiryDate: Date): boolean => {
const now = new Date();
const nowYearMonth = new Date(now.getFullYear(), now.getMonth() + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

a payment method expiring this exact month will be set as expired, if this is not intended I believe it is because of the Date.getMonth method, which returns a zero-indexed month

Copy link
Contributor Author

@mastro993 mastro993 Apr 12, 2024

Choose a reason for hiding this comment

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

You are right. The + 1 here should be removed because we already subtract 1 from the month in the getDateFromExpiryDate function.
Fixed and I've also added some tests!
See here 2f82776

Copy link
Contributor

@hevelius hevelius left a comment

Choose a reason for hiding this comment

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

LGTM. Tested on iOS emulator.

@mastro993 mastro993 merged commit dc9b146 into master Apr 15, 2024
11 checks passed
@mastro993 mastro993 deleted the IOBP-617-add-expired-state-to-payment-card-component branch April 15, 2024 14:58
mastro993 added a commit that referenced this pull request Apr 16, 2024
…ods (#5680)

> [!WARNING]
> This PR depends on #5674,
pagopa/io-dev-api-server#363

## Short description
This PR adds the `ONBOARDABLE` filter for the payment methods usable for
the onboarding

## List of changes proposed in this pull request
- Updated pagoPA wallet and ecommerce API definitions
- Added `ONBOARDABLE` filter to the payment methods selector

## How to test
In an UAT environment, start a payment method onboarding flow. In the
payment method selection screen you should be able to see only
`ONBOARDABLE` methods

---------

Co-authored-by: Martino Cesari Tomba <60693085+forrest57@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO-Bonus e pagamenti IO - Bonus e pagamenti
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants