-
Notifications
You must be signed in to change notification settings - Fork 97
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
chore: [IOBP-617] Add expired state to payment card component #5674
Conversation
…yments-landing-screen
…g-screen' into IOBP-563-add-payments-screen-empty-states
…yments-landing-screen
…yments-landing-screen
…g-screen' into IOBP-563-add-payments-screen-empty-states
…7-add-expired-state-to-payment-card-component
🎉 All dependencies have been resolved ! |
ts/utils/dates.ts
Outdated
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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.
…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>
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
isError
fromPaymentCardSmallProps
, 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