# m\_payment\_log

Source: https://zotonic.com/docs/3127/m_payment_log

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

Language: en



Append audit events to a payment's log from trusted server code.

```erlang
m_payment_log:log(PaymentId, <<"received">>,
    #{psp_module => mod_payment_stripe, description => <<"Payment received">>}, Context).
```

`log/4` accepts an event and a map or property list. Events are trimmed and lowercased; property-list keys become binaries. The result is `{ok, LogId}` or `{error, Reason}`. Log rows belong to a payment and are deleted with it. This module has no template model paths or independent ACL checks; callers must provide an authorized server context and avoid logging unnecessary sensitive data.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/3127?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/3127?language=en>)
