# 1. Payment Gateway Configuration — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: payment_gateway_configuration.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 |
|---------|--------------------|----------|
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Payment method: the method (the credit card, the debit card, the UPI, the wallet, the bank transfer) | TC-SA-15-01-001 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Gateway mapping: the mapping (the method to the gateway, e.g., the card to Stripe) | TC-SA-15-01-002 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Method settings: the settings (the method's settings, e.g., the currency, the region) | TC-SA-15-01-003 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Option configuration: the configuration (the method, the gateway, the settings) | TC-SA-15-01-004 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Option enablement: the enablement (the method is enabled at checkout) | TC-SA-15-01-005 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Option record: the record (the method, the gateway, the settings, the status) | TC-SA-15-01-006 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Audit logging of the option configuration and the changes | TC-SA-15-01-007 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Rule: the payment method is the option (the credit card, the debit card, the UPI, the wallet, the bank transfer); the method is the choice | TC-SA-15-01-001 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Rule: the gateway mapping is the integration (the method to the gateway, e.g., the card to Stripe); the mapping is the link | TC-SA-15-01-002 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Rule: the method settings are the configuration (the method's settings, e.g., the currency, the region); the settings are the control | TC-SA-15-01-003 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Rule: an option change (the gateway, the settings updated) is recorded (the new gateway, the new settings, the time); it is auditable | TC-SA-15-01-007 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Rule: the payment options are visible (the methods, the gateways, the settings, the statuses); the options are managed | TC-SA-15-01-004 |
| 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer | Rule: option configuration and changes are audit-logged with the method, gateway, and timestamp | TC-SA-15-01-007 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Gateway integration: the integration (the gateway, the credentials, the status) | TC-SA-15-01-008 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Gateway credentials: the credentials (the gateway's credentials, e.g., the API key) | TC-SA-15-01-009 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Gateway status: the status (the active, the inactive, the error) | TC-SA-15-01-010 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Integration management: the management (the gateway, the credentials, the status) | TC-SA-15-01-011 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Integration test: the test (the test of the integration, e.g., the test transaction) | TC-SA-15-01-012 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Integration record: the record (the gateway, the credentials, the status, the date) | TC-SA-15-01-013 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Audit logging of the integration management and the changes | TC-SA-15-01-014 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Rule: the gateway integration is the link (the gateway, the credentials, the status); the integration is the connection | TC-SA-15-01-008 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Rule: the gateway credentials are the access (the gateway's credentials, e.g., the API key); the credentials are the key | TC-SA-15-01-009 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Rule: the gateway status is the control (the active, the inactive, the error); the status is the state | TC-SA-15-01-010 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Rule: an integration change (the credentials, the status updated) is recorded (the new credentials, the new status, the time); it is auditable | TC-SA-15-01-014 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Rule: the gateway integrations are visible (the gateways, the credentials, the statuses); the integrations are managed | TC-SA-15-01-011 |
| 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options) | Rule: integration management and changes are audit-logged with the gateway, status, and timestamp | TC-SA-15-01-014 |
| 1.3 Enable/Disable Payment Methods | Method enablement: the enablement (the method is enabled, the method is available at checkout) | TC-SA-15-01-015 |
| 1.3 Enable/Disable Payment Methods | Method disablement: the disablement (the method is disabled, the method is not available at checkout) | TC-SA-15-01-016 |
| 1.3 Enable/Disable Payment Methods | Method status: the status (the enabled, the disabled) | TC-SA-15-01-017 |
| 1.3 Enable/Disable Payment Methods | Status change: the change (the status is changed, the reason, the date) | TC-SA-15-01-018 |
| 1.3 Enable/Disable Payment Methods | Status record: the record (the method, the status, the reason, the date) | TC-SA-15-01-019 |
| 1.3 Enable/Disable Payment Methods | Status view: the view (the methods, the statuses) | TC-SA-15-01-020 |
| 1.3 Enable/Disable Payment Methods | Audit logging of the status changes | TC-SA-15-01-021 |
| 1.3 Enable/Disable Payment Methods | Rule: the method status is the control (the enabled, the disabled); the status is the gate | TC-SA-15-01-017 |
| 1.3 Enable/Disable Payment Methods | Rule: the method enablement is the availability (the method is available at checkout); the enablement is the open | TC-SA-15-01-015 |
| 1.3 Enable/Disable Payment Methods | Rule: the method disablement is the unavailability (the method is not available at checkout, the reason is recorded); the disablement is the close | TC-SA-15-01-016 |
| 1.3 Enable/Disable Payment Methods | Rule: a status change (a disabled method re-enabled) is recorded (the new status, the reason, the time); it is auditable | TC-SA-15-01-018 |
| 1.3 Enable/Disable Payment Methods | Rule: the payment methods are visible (the methods, the statuses, the reasons); the methods are managed | TC-SA-15-01-020 |
| 1.3 Enable/Disable Payment Methods | Rule: status changes are audit-logged with the method, status, and timestamp | TC-SA-15-01-021 |

## 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer

### TC-SA-15-01-001 — Payment method: the method (the credit card, the debit card, the UPI, the wallet, the bank transfer); the method is the choice
**Type:** Positive
**Covers:** 1.1 → Payment method: the method (the credit card, the debit card, the UPI, the wallet, the bank transfer); Rule: the payment method is the option (the credit card, the debit card, the UPI, the wallet, the bank transfer); the method is the choice
**Preconditions:** Super Admin is logged in.
**Steps:**
1. Open the payment options configuration.
2. Set the payment method: the method (the credit card, the debit card, the UPI, the wallet, the bank transfer).
3. Verify the method is the option and is saved.
**Expected Result:** The payment method is set — the credit card, the debit card, the UPI, the wallet, or the bank transfer is the option.
**Priority:** Critical

### TC-SA-15-01-002 — Gateway mapping: the mapping (the method to the gateway, e.g., the card to Stripe); the mapping is the integration
**Type:** Negative
**Covers:** 1.1 → Gateway mapping: the mapping (the method to the gateway, e.g., the card to Stripe); Rule: the gateway mapping is the integration (the method to the gateway, e.g., the card to Stripe); the mapping is the link
**Preconditions:** Super Admin is configuring a payment option; Stripe and PayPal integrations exist.
**Steps:**
1. Set the gateway mapping: the mapping (the method to the gateway, e.g., the card to Stripe).
2. Attempt to map a method to a gateway that does not exist — verify the mapping is rejected.
3. Verify the mapping is the integration and is saved.
**Expected Result:** The gateway mapping is set — the method is linked to the gateway (e.g., the card to Stripe); an invalid gateway is rejected.
**Priority:** Critical

### TC-SA-15-01-003 — Method settings: the settings (the method's settings, e.g., the currency, the region); the settings are the configuration
**Type:** Positive
**Covers:** 1.1 → Method settings: the settings (the method's settings, e.g., the currency, the region); Rule: the method settings are the configuration (the method's settings, e.g., the currency, the region); the settings are the control
**Preconditions:** Super Admin is configuring a payment option.
**Steps:**
1. Set the method settings: the settings (the method's settings, e.g., the currency, the region).
2. Verify the settings are the configuration and are saved.
**Expected Result:** The method settings are set — the method's settings (e.g., the currency, the region) are the configuration.
**Priority:** High

### TC-SA-15-01-004 — Option configuration: the configuration (the method, the gateway, the settings); the options are managed
**Type:** Positive
**Covers:** 1.1 → Option configuration: the configuration (the method, the gateway, the settings); Rule: the payment options are visible (the methods, the gateways, the settings, the statuses); the options are managed
**Preconditions:** Super Admin is logged in.
**Steps:**
1. Configure the payment option: the configuration (the method, the gateway, the settings).
2. Save; verify the payment option is live and the method is available at checkout.
3. View the payment options — verify the methods, the gateways, the settings, and the statuses are visible.
**Expected Result:** The option configuration is saved — the method, the gateway, and the settings are configured and the options are visible.
**Priority:** Critical

### TC-SA-15-01-005 — Option enablement: the enablement (the method is enabled at checkout); the payment is recorded
**Type:** Positive
**Covers:** 1.1 → Option enablement: the enablement (the method is enabled at checkout)
**Preconditions:** A payment option is configured and live.
**Steps:**
1. A learner checks out; verify the method is available (the learner selects the method).
2. The payment is processed via the gateway; verify the payment is recorded.
**Expected Result:** The option is enabled — the method is available at checkout and the payment is processed via the gateway and recorded.
**Priority:** Critical

### TC-SA-15-01-006 — Option record: the record (the method, the gateway, the settings, the status); the record is the proof
**Type:** Positive
**Covers:** 1.1 → Option record: the record (the method, the gateway, the settings, the status)
**Preconditions:** A payment option has been configured.
**Steps:**
1. Open the option record.
2. Verify it shows the method, the gateway, the settings, and the status.
**Expected Result:** The option is recorded — the method, the gateway, the settings, and the status are shown.
**Priority:** High

### TC-SA-15-01-007 — Option configuration and changes are audit-logged with the method, gateway, and timestamp
**Type:** Positive
**Covers:** 1.1 → Audit logging of the option configuration and the changes; Rule: an option change (the gateway, the settings updated) is recorded (the new gateway, the new settings, the time); it is auditable; Rule: option configuration and changes are audit-logged with the method, gateway, and timestamp
**Preconditions:** A payment option has been configured and then changed (the gateway, the settings updated).
**Steps:**
1. Open the audit trail and filter by "payment option".
2. Verify entries show the method, the gateway, and the timestamp for the configuration.
3. Verify the change (the new gateway, the new settings, the time) is recorded and auditable.
**Expected Result:** The option configuration and the changes are audit-logged with the method, gateway, and timestamp.
**Priority:** Critical

## 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options)

### TC-SA-15-01-008 — Gateway integration: the integration (the gateway, the credentials, the status); the integration is the connection
**Type:** Positive
**Covers:** 1.2 → Gateway integration: the integration (the gateway, the credentials, the status); Rule: the gateway integration is the link (the gateway, the credentials, the status); the integration is the connection
**Preconditions:** Super Admin is logged in.
**Steps:**
1. Manage the gateway integration: the gateway (the Stripe, the PayPal, the local option), the credentials (the gateway's credentials, e.g., the API key), and the status (the active, the inactive, the error).
2. Verify the integration is the connection and is saved.
**Expected Result:** The gateway integration is set — the gateway, the credentials, and the status are configured.
**Priority:** Critical

### TC-SA-15-01-009 — Gateway credentials: the credentials (the gateway's credentials, e.g., the API key); the credentials are the access
**Type:** Negative
**Covers:** 1.2 → Gateway credentials: the credentials (the gateway's credentials, e.g., the API key); Rule: the gateway credentials are the access (the gateway's credentials, e.g., the API key); the credentials are the key
**Preconditions:** Super Admin is managing a gateway integration.
**Steps:**
1. Set the gateway credentials: the credentials (the gateway's credentials, e.g., the API key).
2. Attempt to save with an invalid/empty API key — verify the save is rejected with an error.
3. Verify the credentials are the access and are saved securely (not displayed in plain text).
**Expected Result:** The gateway credentials are set — the gateway's credentials (e.g., the API key) are the access; invalid credentials are rejected.
**Priority:** Critical

### TC-SA-15-01-010 — Gateway status: the status (the active, the inactive, the error); the status is the control
**Type:** Positive
**Covers:** 1.2 → Gateway status: the status (the active, the inactive, the error); Rule: the gateway status is the control (the active, the inactive, the error); the status is the state
**Preconditions:** A gateway integration exists.
**Steps:**
1. Set the gateway status: the status (the active, the inactive, the error).
2. Verify the status is the control and is saved.
3. Verify an integration in the error state is flagged and does not process payments.
**Expected Result:** The gateway status is set — the active, the inactive, or the error state is the control.
**Priority:** High

### TC-SA-15-01-011 — Integration management: the management (the gateway, the credentials, the status); the integrations are managed
**Type:** Positive
**Covers:** 1.2 → Integration management: the management (the gateway, the credentials, the status); Rule: the gateway integrations are visible (the gateways, the credentials, the statuses); the integrations are managed
**Preconditions:** Multiple gateway integrations exist (Stripe, PayPal, a local option).
**Steps:**
1. View the gateway integrations — verify the gateways, the credentials, and the statuses are visible.
2. Manage an integration (update the credentials, the status) — verify the management is saved.
**Expected Result:** The integration management works — the gateways, the credentials, and the statuses are visible and managed.
**Priority:** High

### TC-SA-15-01-012 — Integration test: the test (the test of the integration, e.g., the test transaction); the test is the verification
**Type:** Edge
**Covers:** 1.2 → Integration test: the test (the test of the integration, e.g., the test transaction)
**Preconditions:** A gateway integration is configured with valid credentials.
**Steps:**
1. Run the integration test: the test (the test of the integration, e.g., the test transaction).
2. Verify the test transaction succeeds and the result is shown.
3. Run the test with invalid credentials — verify the test fails and the failure is reported.
**Expected Result:** The integration test works — the test transaction verifies the integration and the result is shown.
**Priority:** High

### TC-SA-15-01-013 — Integration record: the record (the gateway, the credentials, the status, the date); the record is the proof
**Type:** Positive
**Covers:** 1.2 → Integration record: the record (the gateway, the credentials, the status, the date)
**Preconditions:** A gateway integration has been managed.
**Steps:**
1. Open the integration record.
2. Verify it shows the gateway, the credentials, the status, and the date.
**Expected Result:** The integration is recorded — the gateway, the credentials, the status, and the date are shown.
**Priority:** High

### TC-SA-15-01-014 — Integration management and changes are audit-logged with the gateway, status, and timestamp
**Type:** Positive
**Covers:** 1.2 → Audit logging of the integration management and the changes; Rule: an integration change (the credentials, the status updated) is recorded (the new credentials, the new status, the time); it is auditable; Rule: integration management and changes are audit-logged with the gateway, status, and timestamp
**Preconditions:** A gateway integration has been managed and then changed (the credentials, the status updated).
**Steps:**
1. Open the audit trail and filter by "gateway integration".
2. Verify entries show the gateway, the status, and the timestamp for the management.
3. Verify the change (the new credentials, the new status, the time) is recorded and auditable.
**Expected Result:** The integration management and the changes are audit-logged with the gateway, status, and timestamp.
**Priority:** Critical

## 1.3 Enable/Disable Payment Methods

### TC-SA-15-01-015 — Method enablement: the enablement (the method is enabled, the method is available at checkout); the enablement is the open
**Type:** Positive
**Covers:** 1.3 → Method enablement: the enablement (the method is enabled, the method is available at checkout); Rule: the method enablement is the availability (the method is available at checkout); the enablement is the open
**Preconditions:** A payment method is disabled.
**Steps:**
1. Enable the method: the status (the enabled).
2. Verify the method is available at checkout (the learner can select the method).
3. Verify the enablement is recorded.
**Expected Result:** The method is enabled — the method is available at checkout and the enablement is recorded.
**Priority:** Critical

### TC-SA-15-01-016 — Method disablement: the disablement (the method is disabled, the method is not available at checkout); the disablement is the close
**Type:** Negative
**Covers:** 1.3 → Method disablement: the disablement (the method is disabled, the method is not available at checkout); Rule: the method disablement is the unavailability (the method is not available at checkout, the reason is recorded); the disablement is the close
**Preconditions:** A payment method is enabled.
**Steps:**
1. Disable the method: the status (the disabled), the reason (e.g., the gateway issue, the maintenance).
2. Verify the method is not available at checkout (the learner cannot select the method).
3. Verify the reason is recorded and the disablement is recorded.
**Expected Result:** The method is disabled — the method is not available at checkout and the reason is recorded.
**Priority:** Critical

### TC-SA-15-01-017 — Method status: the status (the enabled, the disabled); the status is the gate
**Type:** Positive
**Covers:** 1.3 → Method status: the status (the enabled, the disabled); Rule: the method status is the control (the enabled, the disabled); the status is the gate
**Preconditions:** Payment methods exist with various statuses.
**Steps:**
1. View the payment methods: the methods (the credit card, the debit card, the UPI, the wallet, the bank transfer), the statuses (the enabled, the disabled).
2. Verify the status is the control (the gate) for each method.
**Expected Result:** The method status is shown — the enabled or the disabled state is the control for each method.
**Priority:** High

### TC-SA-15-01-018 — Status change: the change (the status is changed, the reason, the date); it is auditable
**Type:** Positive
**Covers:** 1.3 → Status change: the change (the status is changed, the reason, the date); Rule: a status change (a disabled method re-enabled) is recorded (the new status, the reason, the time); it is auditable
**Preconditions:** A payment method is disabled.
**Steps:**
1. Re-enable the method: the new status (the enabled), the reason, the time.
2. Verify the change is recorded (the new status, the reason, the time).
3. Verify the change is auditable in the audit trail.
**Expected Result:** The status change is recorded — the new status, the reason, and the time are recorded and auditable.
**Priority:** High

### TC-SA-15-01-019 — Status record: the record (the method, the status, the reason, the date); the record is the proof
**Type:** Positive
**Covers:** 1.3 → Status record: the record (the method, the status, the reason, the date)
**Preconditions:** A payment method status has been changed.
**Steps:**
1. Open the status record.
2. Verify it shows the method, the status, the reason, and the date.
**Expected Result:** The status is recorded — the method, the status, the reason, and the date are shown.
**Priority:** High

### TC-SA-15-01-020 — Status view: the view (the methods, the statuses); the methods are managed
**Type:** Positive
**Covers:** 1.3 → Status view: the view (the methods, the statuses); Rule: the payment methods are visible (the methods, the statuses, the reasons); the methods are managed
**Preconditions:** Payment methods exist with various statuses.
**Steps:**
1. View the payment methods — verify the methods, the statuses, and the reasons are visible.
2. Export the method statuses (the status report, the period) — verify the export is generated.
**Expected Result:** The status view works — the methods, the statuses, and the reasons are visible and the export is generated.
**Priority:** High

### TC-SA-15-01-021 — Status changes are audit-logged with the method, status, and timestamp
**Type:** Positive
**Covers:** 1.3 → Audit logging of the status changes; Rule: status changes are audit-logged with the method, status, and timestamp
**Preconditions:** Payment method status changes have occurred.
**Steps:**
1. Open the audit trail and filter by "payment method status".
2. Verify entries show the method, the status, and the timestamp.
**Expected Result:** The status changes are audit-logged with the method, status, and timestamp.
**Priority:** Critical
