# 1. Payment Gateway Configuration

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*

---

## 1. Payment Gateway Configuration

### 1.1 Configure Multiple Payment Options: Credit Card, Debit Card, UPI, Wallet, Bank Transfer
**What it does:** Configures the multiple payment options: the payment methods (the credit card, the debit card, the UPI, the wallet, the bank transfer) are configured, so the learners (and the institutes) can pay with the method they prefer (the options are available at checkout). The Super Administrator configures each payment option (the method, the gateway, the settings) so the payment options are structured and the methods are explicit.

**Sub-features:**
- Payment method: the method (the credit card, the debit card, the UPI, the wallet, the bank transfer)
- Gateway mapping: the mapping (the method to the gateway, e.g., the card to Stripe)
- Method settings: the settings (the method's settings, e.g., the currency, the region)
- Option configuration: the configuration (the method, the gateway, the settings)
- Option enablement: the enablement (the method is enabled at checkout)
- Option record: the record (the method, the gateway, the settings, the status)
- Audit logging of the option configuration and the changes

**Super Administrator User Journey:**
1. Super Admin configures the payment option: the method (the credit card, the debit card, the UPI, the wallet, the bank transfer), the gateway (the gateway for the method, e.g., Stripe for the card), and the settings (the method's settings, e.g., the currency, the region); the option is explicit.
2. Sets the payment method: the method (the credit card, the debit card, the UPI, the wallet, the bank transfer); the method is the option.
3. Sets the gateway mapping: the mapping (the method to the gateway, e.g., the card to Stripe); the mapping is the integration.
4. Sets the method settings: the settings (the method's settings, e.g., the currency, the region); the settings are the configuration.
5. Saves; the payment option is live, and the method is available at checkout.
6. A learner checks out; the method is available (the learner selects the method, the payment is processed via the gateway); the payment is recorded.
7. For an option change (the gateway, the settings updated), Super Admin changes the option (the new gateway, the new settings, the time); the change is recorded.
8. The option configuration and the changes are audit-logged with the method, the gateway, and the timestamp.

**Rules & Edge Cases:**
- The payment method is the option (the credit card, the debit card, the UPI, the wallet, the bank transfer); the method is the choice.
- The gateway mapping is the integration (the method to the gateway, e.g., the card to Stripe); the mapping is the link.
- The method settings are the configuration (the method's settings, e.g., the currency, the region); the settings are the control.
- An option change (the gateway, the settings updated) is recorded (the new gateway, the new settings, the time); it is auditable.
- The payment options are visible (the methods, the gateways, the settings, the statuses); the options are managed.
- Option configuration and changes are audit-logged with the method, gateway, and timestamp.

### 1.2 Manage Payment Gateway Integrations (Stripe, PayPal, Local Options)
**What it does:** Manages the payment gateway integrations: the integrations with the payment gateways (the Stripe, the PayPal, the local options) are managed, so the payments are processed via the gateways (the integrations are active). The Super Administrator manages each integration (the gateway, the credentials, the status) so the integrations are structured and the gateways are explicit.

**Sub-features:**
- Gateway integration: the integration (the gateway, the credentials, the status)
- Gateway credentials: the credentials (the gateway's credentials, e.g., the API key)
- Gateway status: the status (the active, the inactive, the error)
- Integration management: the management (the gateway, the credentials, the status)
- Integration test: the test (the test of the integration, e.g., the test transaction)
- Integration record: the record (the gateway, the credentials, the status, the date)
- Audit logging of the integration management and the changes

**Super Administrator User Journey:**
1. Super Admin manages 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); the integration is explicit.
2. Sets the gateway: the gateway (the Stripe, the PayPal, the local option); the gateway is the provider.
3. Sets the gateway credentials: the credentials (the gateway's credentials, e.g., the API key); the credentials are the access.
4. Sets the gateway status: the status (the active, the inactive, the error); the status is the control.
5. Saves; the gateway integration is live, and the payments are processed via the gateway.
6. Tests the integration: the test (the test of the integration, e.g., the test transaction); the test is the verification.
7. For an integration change (the credentials, the status updated), Super Admin changes the integration (the new credentials, the new status, the time); the change is recorded.
8. The integration management and the changes are audit-logged with the gateway, the status, and the timestamp.

**Rules & Edge Cases:**
- The gateway integration is the link (the gateway, the credentials, the status); the integration is the connection.
- The gateway credentials are the access (the gateway's credentials, e.g., the API key); the credentials are the key.
- The gateway status is the control (the active, the inactive, the error); the status is the state.
- An integration change (the credentials, the status updated) is recorded (the new credentials, the new status, the time); it is auditable.
- The gateway integrations are visible (the gateways, the credentials, the statuses); the integrations are managed.
- Integration management and changes are audit-logged with the gateway, status, and timestamp.

### 1.3 Enable/Disable Payment Methods
**What it does:** Enables or disables the payment methods: the Super Administrator enables or disables the payment methods (the method, the status), so the methods are controlled (the disabled methods are not available at checkout). Each method has a status (the enabled, the disabled) with the date and the reason.

**Sub-features:**
- Method enablement: the enablement (the method is enabled, the method is available at checkout)
- Method disablement: the disablement (the method is disabled, the method is not available at checkout)
- Method status: the status (the enabled, the disabled)
- Status change: the change (the status is changed, the reason, the date)
- Status record: the record (the method, the status, the reason, the date)
- Status view: the view (the methods, the statuses)
- Audit logging of the status changes

**Super Administrator User Journey:**
1. Super Admin views the payment methods: the methods (the credit card, the debit card, the UPI, the wallet, the bank transfer), the statuses (the enabled, the disabled); the list is the overview.
2. Enables a method: the status (the enabled), the method is available at checkout (the learner can select the method); the enablement is recorded.
3. Disables a method: the status (the disabled), the reason (e.g., the gateway issue, the maintenance), the method is not available at checkout (the learner cannot select the method); the disablement is recorded.
4. The learners are affected: the checkout (the disabled method is not shown, the enabled methods are shown); the checkout is the control.
5. Reviews the methods: the methods, the statuses, the reasons, so the methods are visible.
6. For a status change (a disabled method re-enabled), Super Admin changes the status (the new status, the reason, the time); the change is recorded.
7. Exports the method statuses (the status report, the period); the export is the record.
8. The status changes are audit-logged with the method, the status, and the timestamp.

**Rules & Edge Cases:**
- The method status is the control (the enabled, the disabled); the status is the gate.
- The method enablement is the availability (the method is available at checkout); the enablement is the open.
- The method disablement is the unavailability (the method is not available at checkout, the reason is recorded); the disablement is the close.
- A status change (a disabled method re-enabled) is recorded (the new status, the reason, the time); it is auditable.
- The payment methods are visible (the methods, the statuses, the reasons); the methods are managed.
- Status changes are audit-logged with the method, status, and timestamp.
