Payment failure
- Dominant language
- JavaScript
- Stars
- 23
- Forks
- 62
- Avg merge
- 24m
- Merged PRs (30d)
- 1
Description
### 📖 User Story
**As** a Strata Hotel user, when my payment fails
**I want** to know that it has failed and be able to resubmit payment on the application confirmation page and on my dashboard
**So that** I can resubmit the payment and complete the application.
### Context:
If payment fails, we need to notify the user with a clear message and flag the application as "payment failed."
The payment failure status is "Payment Due." Additionally, we should trigger an email to notify the user of the payment failure, providing a link to retry the payment.
The image below shows what happens when the payment API fails:

#### 🎨 UX/UI Link: Needs design work
- Payment failed screens for each user type: [Figma Link](https://www.figma.com/design/R9GF5wvwq2TrnbnsbhPfvV/STR-Application-Tickets?node-id=6258-1433&t=LIsR3FCBGIkpyYDa-4)
- Other contexts for payment failed: [Figma Link](https://www.figma.com/design/R9GF5wvwq2TrnbnsbhPfvV/STR-Application-Tickets?node-id=6259-15701&t=LIsR3FCBGIkpyYDa-4)
### 📏 Business Rules
- [ ] When a payment fails, users will see "try again" and "go back" options on the Payment Declined page.
- [ ] Users can click the "Try again" button to attempt to make the payment again.
- [ ] When users click "Go back," they will be redirected to the Confirmation Page.
- [ ] The Confirmation page should indicate payment failed, and users can attempt payment from there or go to the dashboard to retry payment.
- [ ] On the Strata Hotel User Dashboard, the application status should be "Payment Due," and users can attempt payment again. (I need to write a story for this)
- [ ] If payment is successful, the status should change to "Paid," and the application will enter the queue for the auto-approval process.
- [ ] On the Examiner Dashboard, the application status should be "Payment Due," and examiners can still see the application details.
- [ ] An application flagged as "Payment Due" should not proceed through the automatic approval process.
- [ ] When the user clicks to repay, the system should pull the fee from the application and pass it to the Pay API.
- [ ] If the payment fails, or the session times out an email must be sent to the user notifying them of the failure, providing a link to retry payment.
### Email Template:
---
**Subject:** Payment Failure Notification for Your STRR Application
Dear [User's Name],
We regret to inform you that your recent payment attempt for the Short-Term Rental Registration (STRR) application was unsuccessful.
**What You Need to Do Next:**
- Please visit the following link to retry the payment: [Insert payment link]
- You can also visit your dashboard to manage your application: [Insert dashboard link]
- Once the payment is completed successfully, your application will be processed.
If you have any questions or require assistance, feel free to contact us. ADD phone number and email address
Regards
---
### 🎭 Story Scenarios
#### Scenario 1: Payment fails
- **Given** the Strata Hotel user has attempted to make payment for the registration application
- **When** the payment transaction fails for any reason
- **Then** the user should be notified on the application confirmation page and the user dashboard
- **And** an email should be triggered to notify the user of the failure, including a link to retry the payment.
#### Scenario 2: Payment re-attempts and successes
- **Given** the user has re-attempted to make payment for the registration application
- **When** the payment transaction is successful
- **Then** the user should be notified on the application confirmation page and user dashboard
- **And** the application will go through the automatic approval process.
---
🌐 Accessibility Scenarios
### Keyboard Users
**Scenario: Comprehensive Keyboard Navigation**
Given I am a keyboard user on the website
When I use the Tab key to navigate through the website
Then all interactive elements should be accessible and highlighted
And I should be able to activate these elements using the Enter or Space key.
**Scenario: Full Content Accessibility via Keyboard**
Given I am a keyboard user navigating the website
When I traverse through different pages and sections
Then all content should be fully accessible using the keyboard alone
And there should be no traps preventing me from navigating away using the keyboard.
### Screen Reader Users
**Scenario: Accessible Image Descriptions**
Given I am using a screen reader on the website
When I encounter images
Then each image should have descriptive alt text that conveys the same message as the image.
**Scenario: Structured Navigation for Screen Readers**
Given I am navigating the website using a screen reader
When I move through different page elements
Then the content should be structured with proper headings
And the reading order should be logical and sequential.
**Scenario: Descriptive Form Fields**
Given I am filling out a form using a screen reader
When I navigate through the form fields
Then each field should be clearly labeled with descriptive text
And instructions should be directly associated with their respective inputs.
### Low Vision Users
**Scenario: Effective High Contrast Mode**
Given I am a user with low vision on the website
When I enable high contrast mode
Then all content should display with high color contrast suitable for low vision
And the layout should remain coherent and unchanged.
**Scenario: Text Resizing Accommodation**
Given I am a user with low vision on the website
When I increase the text size
Then the text should resize without loss of information or functionality
And the page layout should adapt accordingly without disrupting the user experience.
**Scenario: Personalized Styling Preferences**
Given I am a user with low vision adjusting settings on the website
When I customize my styling preferences, including colors, fonts, and spacing
Then these adjustments should be applied consistently across all pages
And the changes should persist during my entire session or until altered by me.
---
🌍 Global Scenarios
### Data Validation
see https://bcgov.sharepoint.com/:f:/r/teams/09399/Shared%20Documents/Product-Scrum%20Team%20Chat/VALIDATIONS%20%20AND%20STATUSES?csf=1&web=1&e=X0F1oU
### Internet Connection
#### Standard Internet Connection
Given I am accessing the website with a standard internet connection
When I navigate to any page on the site
Then the page should load completely within 2 seconds, ensuring a fast and efficient user experience.
#### Low-Speed Internet
Given a user accesses the "Application Details View" with a low-speed internet connection defined as under [specific speed] Mbps
When the user attempts to load and interact with the dashboard page
Then the "Application Details View" should prioritize critical content and functionality, loading essential elements first to ensure usability.
#### Mobile Responsiveness
Given I am accessing the "Application Details View" on a mobile device
When I click on any link
Then the content should display correctly and be easily editable on my device, ensuring a responsive design.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.