# 2. Payments & Billing — Test Cases

User Type: **Student**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: payments_billing.md — every feature, sub-feature, and rule covered

---

## Test Execution Policy
- Zero tolerance: any deviation from documented behavior = FAILED = bug
- Every bug is immediately logged/reported (Bug ID, feature, sub-feature, expected vs actual, severity) and fixed 100% before the group passes
- Feature group passes only at 100% test pass rate

## Coverage Matrix
| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 2.1 Payment Processing | Select a payment method (as configured by the platform) | TC-ST-07-02-001 |
| 2.1 Payment Processing | Complete a payment securely | TC-ST-07-02-002 |
| 2.1 Payment Processing | Payment states: success, failure, pending | TC-ST-07-02-003 |
| 2.1 Payment Processing | Receipt issued on successful payment | TC-ST-07-02-004 |
| 2.1 Payment Processing | Payment amount and description shown before confirming | TC-ST-07-02-005 |
| 2.1 Payment Processing | Retry a failed payment | TC-ST-07-02-006 |
| 2.1 Payment Processing | Payment security (encrypted transaction) | TC-ST-07-02-007 |
| 2.1 Payment Processing | Payment event logging (initiated, succeeded, failed) | TC-ST-07-02-008 |
| 2.1 Payment Processing | Audit logging of the payment processing | TC-ST-07-02-009 |
| 2.1 Payment Processing | Rule: The payment amount and description are shown before confirming. | TC-ST-07-02-001 |
| 2.1 Payment Processing | Rule: A payment is in one of the states: success, failure, pending. | TC-ST-07-02-002 |
| 2.1 Payment Processing | Rule: A receipt is issued only on a successful payment. | TC-ST-07-02-003 |
| 2.1 Payment Processing | Rule: A failed payment can be retried. | TC-ST-07-02-004 |
| 2.1 Payment Processing | Rule: The transaction is encrypted. | TC-ST-07-02-005 |
| 2.1 Payment Processing | Rule: Payment events (initiated, succeeded, failed) are logged with the order and the timestamp. | TC-ST-07-02-006 |
| 2.1 Payment Processing | Rule: The payment processing is audit-logged with the account, the order, and the timestamp. | TC-ST-07-02-007 |
| 2.2 Payment History | Full payment history (date, amount, description, method, status) | TC-ST-07-02-010 |
| 2.2 Payment History | Filter by date range and status | TC-ST-07-02-011 |
| 2.2 Payment History | Download a receipt for a payment | TC-ST-07-02-012 |
| 2.2 Payment History | Search the payment history | TC-ST-07-02-013 |
| 2.2 Payment History | Payment history available on web and mobile | TC-ST-07-02-014 |
| 2.2 Payment History | History is read-only to the Student | TC-ST-07-02-015 |
| 2.2 Payment History | History event logging (viewed, receipt downloaded) | TC-ST-07-02-016 |
| 2.2 Payment History | Audit logging of the payment history | TC-ST-07-02-017 |
| 2.2 Payment History | Rule: The payment history is read-only to the Student. | TC-ST-07-02-010 |
| 2.2 Payment History | Rule: Filters operate on date range and status. | TC-ST-07-02-011 |
| 2.2 Payment History | Rule: A receipt can be downloaded for any payment. | TC-ST-07-02-012 |
| 2.2 Payment History | Rule: The history is available on web and mobile. | TC-ST-07-02-013 |
| 2.2 Payment History | Rule: History events (viewed, receipt downloaded) are logged with the payment and the timestamp. | TC-ST-07-02-014 |
| 2.2 Payment History | Rule: The payment history is audit-logged with the account, the payment, and the timestamp. | TC-ST-07-02-015 |
| 2.3 Invoices and Receipts | Invoice per payment (plan, subjects, taxes, total) | TC-ST-07-02-018 |
| 2.3 Invoices and Receipts | View an invoice detail | TC-ST-07-02-019 |
| 2.3 Invoices and Receipts | Download an invoice | TC-ST-07-02-020 |
| 2.3 Invoices and Receipts | Invoice list by date | TC-ST-07-02-021 |
| 2.3 Invoices and Receipts | Invoice available on web and mobile | TC-ST-07-02-022 |
| 2.3 Invoices and Receipts | Invoice is read-only to the Student | TC-ST-07-02-023 |
| 2.3 Invoices and Receipts | Invoice event logging (viewed, downloaded) | TC-ST-07-02-024 |
| 2.3 Invoices and Receipts | Audit logging of the invoices and receipts | TC-ST-07-02-025 |
| 2.3 Invoices and Receipts | Rule: An invoice is issued per payment. | TC-ST-07-02-018 |
| 2.3 Invoices and Receipts | Rule: The invoice shows the breakdown (plan, subjects, taxes, total). | TC-ST-07-02-019 |
| 2.3 Invoices and Receipts | Rule: An invoice can be downloaded. | TC-ST-07-02-020 |
| 2.3 Invoices and Receipts | Rule: The invoice is read-only to the Student. | TC-ST-07-02-021 |
| 2.3 Invoices and Receipts | Rule: Invoice events (viewed, downloaded) are logged with the invoice and the timestamp. | TC-ST-07-02-022 |
| 2.3 Invoices and Receipts | Rule: The invoices and receipts is audit-logged with the account, the invoice, and the timestamp. | TC-ST-07-02-023 |

## 2.1 Payment Processing

### TC-ST-07-02-001 — Select a payment method (as configured by the platform)
**Type:** Positive
**Covers:** 2.1 → Select a payment method (as configured by the platform); Rule: The payment amount and description are shown before confirming.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Select a payment method (as configured by the platform).
2. Observe the result and verify the full behavior: Select a payment method (as configured by the platform).
**Expected Result:** Select a payment method (as configured by the platform) — delivered exactly as documented.
**Priority:** Critical

### TC-ST-07-02-002 — Complete a payment securely
**Type:** Positive
**Covers:** 2.1 → Complete a payment securely; Rule: A payment is in one of the states: success, failure, pending.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Complete a payment securely.
2. Observe the result and verify the full behavior: Complete a payment securely.
**Expected Result:** Complete a payment securely — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-003 — Payment states: success, failure, pending
**Type:** Positive
**Covers:** 2.1 → Payment states: success, failure, pending; Rule: A receipt is issued only on a successful payment.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Payment states: success.
2. Observe the result and verify the full behavior: Payment states: success, failure, pending.
**Expected Result:** Payment states: success, failure, pending — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-004 — Receipt issued on successful payment
**Type:** Positive
**Covers:** 2.1 → Receipt issued on successful payment; Rule: A failed payment can be retried.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Receipt issued on successful payment.
2. Observe the result and verify the full behavior: Receipt issued on successful payment.
**Expected Result:** Receipt issued on successful payment — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-005 — Payment amount and description shown before confirming
**Type:** Positive
**Covers:** 2.1 → Payment amount and description shown before confirming; Rule: The transaction is encrypted.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Payment amount and description shown before confirming.
2. Observe the result and verify the full behavior: Payment amount and description shown before confirming.
**Expected Result:** Payment amount and description shown before confirming — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-006 — Retry a failed payment
**Type:** Positive
**Covers:** 2.1 → Retry a failed payment; Rule: Payment events (initiated, succeeded, failed) are logged with the order and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Retry a failed payment.
2. Observe the result and verify the full behavior: Retry a failed payment.
**Expected Result:** Retry a failed payment — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-007 — Payment security (encrypted transaction)
**Type:** Positive
**Covers:** 2.1 → Payment security (encrypted transaction); Rule: The payment processing is audit-logged with the account, the order, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Payment security (encrypted transaction).
2. Observe the result and verify the full behavior: Payment security (encrypted transaction).
**Expected Result:** Payment security (encrypted transaction) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-008 — Payment event logging (initiated, succeeded, failed)
**Type:** Positive
**Covers:** 2.1 → Payment event logging (initiated, succeeded, failed)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Payment event logging (initiated.
2. Observe the result and verify the full behavior: Payment event logging (initiated, succeeded, failed).
**Expected Result:** Payment event logging (initiated, succeeded, failed) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-009 — Audit logging of the payment processing
**Type:** Positive
**Covers:** 2.1 → Audit logging of the payment processing
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the payment processing.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 2.2 Payment History

### TC-ST-07-02-010 — Full payment history (date, amount, description, method, status)
**Type:** Positive
**Covers:** 2.2 → Full payment history (date, amount, description, method, status); Rule: The payment history is read-only to the Student.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Full payment history (date.
2. Observe the result and verify the full behavior: Full payment history (date, amount, description, method, status).
**Expected Result:** Full payment history (date, amount, description, method, status) — delivered exactly as documented.
**Priority:** Critical

### TC-ST-07-02-011 — Filter by date range and status
**Type:** Positive
**Covers:** 2.2 → Filter by date range and status; Rule: Filters operate on date range and status.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Filter by date range and status.
2. Observe the result and verify the full behavior: Filter by date range and status.
**Expected Result:** Filter by date range and status — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-012 — Download a receipt for a payment
**Type:** Positive
**Covers:** 2.2 → Download a receipt for a payment; Rule: A receipt can be downloaded for any payment.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Download a receipt for a payment.
2. Observe the result and verify the full behavior: Download a receipt for a payment.
**Expected Result:** Download a receipt for a payment — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-013 — Search the payment history
**Type:** Positive
**Covers:** 2.2 → Search the payment history; Rule: The history is available on web and mobile.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Search the payment history.
2. Observe the result and verify the full behavior: Search the payment history.
**Expected Result:** Search the payment history — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-014 — Payment history available on web and mobile
**Type:** Positive
**Covers:** 2.2 → Payment history available on web and mobile; Rule: History events (viewed, receipt downloaded) are logged with the payment and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Payment history available on web and mobile.
2. Observe the result and verify the full behavior: Payment history available on web and mobile.
**Expected Result:** Payment history available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-015 — History is read-only to the Student
**Type:** Positive
**Covers:** 2.2 → History is read-only to the Student; Rule: The payment history is audit-logged with the account, the payment, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: History is read-only to the Student.
2. Observe the result and verify the full behavior: History is read-only to the Student.
**Expected Result:** History is read-only to the Student — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-016 — History event logging (viewed, receipt downloaded)
**Type:** Positive
**Covers:** 2.2 → History event logging (viewed, receipt downloaded)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: History event logging (viewed.
2. Observe the result and verify the full behavior: History event logging (viewed, receipt downloaded).
**Expected Result:** History event logging (viewed, receipt downloaded) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-017 — Audit logging of the payment history
**Type:** Positive
**Covers:** 2.2 → Audit logging of the payment history
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the payment history.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 2.3 Invoices and Receipts

### TC-ST-07-02-018 — Invoice per payment (plan, subjects, taxes, total)
**Type:** Positive
**Covers:** 2.3 → Invoice per payment (plan, subjects, taxes, total); Rule: An invoice is issued per payment.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Invoice per payment (plan.
2. Observe the result and verify the full behavior: Invoice per payment (plan, subjects, taxes, total).
**Expected Result:** Invoice per payment (plan, subjects, taxes, total) — delivered exactly as documented.
**Priority:** Critical

### TC-ST-07-02-019 — View an invoice detail
**Type:** Positive
**Covers:** 2.3 → View an invoice detail; Rule: The invoice shows the breakdown (plan, subjects, taxes, total).
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: View an invoice detail.
2. Observe the result and verify the full behavior: View an invoice detail.
**Expected Result:** View an invoice detail — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-020 — Download an invoice
**Type:** Positive
**Covers:** 2.3 → Download an invoice; Rule: An invoice can be downloaded.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Download an invoice.
2. Observe the result and verify the full behavior: Download an invoice.
**Expected Result:** Download an invoice — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-021 — Invoice list by date
**Type:** Positive
**Covers:** 2.3 → Invoice list by date; Rule: The invoice is read-only to the Student.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Invoice list by date.
2. Observe the result and verify the full behavior: Invoice list by date.
**Expected Result:** Invoice list by date — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-022 — Invoice available on web and mobile
**Type:** Positive
**Covers:** 2.3 → Invoice available on web and mobile; Rule: Invoice events (viewed, downloaded) are logged with the invoice and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Invoice available on web and mobile.
2. Observe the result and verify the full behavior: Invoice available on web and mobile.
**Expected Result:** Invoice available on web and mobile — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-023 — Invoice is read-only to the Student
**Type:** Positive
**Covers:** 2.3 → Invoice is read-only to the Student; Rule: The invoices and receipts is audit-logged with the account, the invoice, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Invoice is read-only to the Student.
2. Observe the result and verify the full behavior: Invoice is read-only to the Student.
**Expected Result:** Invoice is read-only to the Student — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-024 — Invoice event logging (viewed, downloaded)
**Type:** Positive
**Covers:** 2.3 → Invoice event logging (viewed, downloaded)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Invoice event logging (viewed.
2. Observe the result and verify the full behavior: Invoice event logging (viewed, downloaded).
**Expected Result:** Invoice event logging (viewed, downloaded) — delivered exactly as documented.
**Priority:** High

### TC-ST-07-02-025 — Audit logging of the invoices and receipts
**Type:** Positive
**Covers:** 2.3 → Audit logging of the invoices and receipts
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the invoices and receipts.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical
