Merged in feat/SW-618-payment-non-happy-path (pull request #874)

Feat/SW-618 payment non happy path

* feat(SW-618): filter out expired saved cards

* feat(SW-618): Added payment error codes and way of showing messages based on code

* feat(SW-618): show error message if max retries has been reached and remove search param after showing toast

* fix(SW-618): move fallback error codes

* fix(SW-618): remove ref from stopping useEffect to run twice

* fix(SW-618): refactored logic for toast message and minor fixes

* fix(SW-618): remove error message enum due to static analysis problems


Approved-by: Christian Andolf
Approved-by: Arvid Norlin
This commit is contained in:
Tobias Johansson
2024-11-18 14:10:11 +00:00
committed by Joakim Jäderberg
parent 5fb70866ea
commit 293800f024
13 changed files with 176 additions and 28 deletions

View File

@@ -46,6 +46,12 @@ export enum PaymentMethodEnum {
discover = "discover",
}
export enum PaymentErrorCodeEnum {
Abandoned = 5,
Cancelled = 6,
Failed = 7,
}
export const PAYMENT_METHOD_TITLES: Record<
keyof typeof PaymentMethodEnum,
string