Skip to main content
Version: 4.0 preview

Paymentmethodparams

Version
4.0 preview
Updated
View markdown

The per-connector settings of a payment method. The shape is decided by the chosen connector, not by the property definition.

Storage kind: column · Column: varchar(255) inherited — give it an explicit dataType

This is the legacy PSP mechanism. New provider work belongs on commerce2providersettings; this type stays for the connectors already on it.

Settings

It takes the shared settings only. What it renders comes from the selected PSP connector: each connector declares the setting keys it needs (ConfigboxPspHelper::getPspConnectorSettingKeys()), and this property draws that form section and harvests those keys back out of the request.

The stored format

Not JSON — a newline-separated list of key="value" pairs, built by concatenation:

merchant_id="12345"
secret_key="abc…"

One line per key the connector declares, in the connector's order, whether or not the operator filled it in. Only declared keys are read from the request, so a crafted POST cannot inject settings the connector does not know about.

There is no escaping of a " inside a value. Treat the values as opaque credentials and do not expect the format to survive a value containing quotes or newlines.

Note the write is conditional on $data->connector_name being present: if the connector is not part of the submitted data, the property writes nothing and the previous value stands.

Notes

This is why a payment method's edit form changes after you pick a connector and save — the connector selection (connector_name, a pseudojoin) decides what this property then shows. Before the first save there is no connector, so there is nothing to render.

Because the shape is dynamic, generated artifacts describe the column, not the settings inside it. There is no static schema for the contents, and an assistant writing through the API cannot discover the keys from the schema — it has to ask the connector.

The type declares no getDefaultDataType(), so it inherits varchar(255). A connector with more than a couple of settings will outgrow that; declare a wider dataType.

@see commerce2providersettings.md — the modern equivalent @see pseudojoin.md @see ../../customization/com_configbox_payment_connectors.md — writing a connector and its setting keys