# m\_payment

Source: https://zotonic.com/docs/3125/m_payment

URI: https://zotonic.com/id/3125

Language: en



Read payment data and maintain local payment records.

Template model paths
--------------------

```django
{{ m.payment.default.currency }}
{{ m.payment.status[payment_nr].status }}
```

`default.currency`, `default.amount` and `default.description` expose configured request defaults. `status[payment_nr]` exposes status, amount and currency; anonymous payments can be checked without authentication. `[payment_nr]` returns full data to payment administrators, restricted fields to authorized users and a status subset for anonymous payments. Other unauthorized reads return `eacces`.

`list_user[user]` requires payment administration or edit access to that user. `list_email[email]`, `years`, `profiles` and `succeeded_totals[filters]` require payment administration. The succeeded totals follow the search filters, across all pages, grouped by currency. `redirect_psp[payment_nr]` requires `use.mod_payment` and returns the provider's payment URL. Successful model callbacks return `{ok, {Value, Rest}}`; lookups can return `{error, notfound}`.

Erlang API
----------

`m_payment:get(PaymentIdOrNumber, Context)` returns `{ok, PaymentMap}` or an error. Direct Erlang reads and writes are trusted server APIs and do not inherit the model-path ACL checks. Use `mod_payment:receive_payment/3` for verified PSP updates so shared import policy, validation and notifications are applied. The database model also provides status changes, recurring payments, contact updates and searches.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/3125?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/3125?language=en>)
