---
title: "Web Form Integration"
space: "Integrations"
url: "https://integrations.frappe.cloud/integrations/payment-integration/payment-core/web-form-integration"
updated: "2026-07-30"
---

Payments app extends Frappe Web Forms with seamless payment acceptance capabilities.

## Payment Fields in Web Form

Custom fields added to Web Form doctype:


| Field                   | Type      | Purpose                                 |
| ----------------------- | --------- | --------------------------------------- |
| `payments_tab`          | Tab Break | Payments section in form                |
| `accept_payment`        | Check     | Enable payment for this form            |
| `payment_gateway`       | Link      | Select payment gateway                  |
| `payment_button_label`  | Data      | Custom button text (default: "Buy Now") |
| `amount_based_on_field` | Check     | Dynamic amount from field               |
| `amount_field`          | Select    | Field to pull amount from               |
| `amount`                | Currency  | Fixed payment amount                    |
| `currency`              | Link      | Transaction currency                    |


## Payment Web Form Override

The `PaymentWebForm` class extends standard web form behavior:

```python
class PaymentWebForm(WebForm):
    def validate_payment_amount(self):
        """Validate payment amount configuration."""
        if self.amount_based_on_field and not self.amount_field:
            frappe.throw("Please select an Amount Field.")
        if not flt(self.amount) > 0:
            frappe.throw("Amount must be greater than 0.")
    
    def get_payment_gateway_url(self, doc):
        """Generate payment URL for form submission."""
```

**Configuration Pattern:**

1. Enable "Accept Payment" in web form
2. Select payment gateway
3. Configure amount (fixed or field-based)
4. Set currency
5. Customize button label