---
title: "Payment Gateway Management"
space: "Integrations"
url: "https://integrations.frappe.cloud/integrations/payment-integration/payment-core/payment-gateway-management"
updated: "2026-07-30"
---

The `Payment Gateway` doctype serves as the central registry for all payment gateway configurations, maintaining flexible links to gateway-specific settings.

## Payment Gateway Doctype


| Field                | Type           | Purpose                                                    |
| -------------------- | -------------- | ---------------------------------------------------------- |
| `gateway`            | Data           | Unique gateway identifier (e.g., "Stripe", "Razorpay")     |
| `gateway_settings`   | Link (DocType) | Link to gateway settings doctype (e.g., "Stripe Settings") |
| `gateway_controller` | Dynamic Link   | Link to specific gateway settings record                   |


**Technical Implementation:**

- Auto-naming based on `gateway` field for unique identification
- Dynamic link pattern allows multiple instances of same gateway type
- Supports both single-instance and multi-instance gateway configurations
- Gateway creation automated through `create_payment_gateway()` utility

## Gateway Controller Pattern

All gateway settings doctypes follow a standardized controller interface:

```python
class GatewaySettings(Document):
    supported_currencies = ("USD", "EUR", "GBP", ...)
    
    def validate_transaction_currency(self, currency):
        """Validate if gateway supports the transaction currency."""
        
    def get_payment_url(self, **kwargs):
        """Generate payment URL for checkout redirection."""
        
    def create_request(self, data):
        """Process payment request and return response."""
```

**Required Methods:**

- `validate_transaction_currency(currency)`: Currency validation
- `get_payment_url(**kwargs)`: Checkout URL generation
- `create_request(data)`: Payment processing (optional for redirect-based flows)