Payment methods

Payment methods can easily be installed via json file. For each payment method you need to create a json file in the Resources/payment_methods/ directory of your plugin or AdditionalBundle.

Payment methods will automatically be installed and updated.

Resources/payment_methods/my_payment_method.json
{
    "technicalName": "my_payment_method",
    "handlerIdentifier": "My\\PaymentMethod\\Handler", // optional
    "position": 1,                                     // optional
    "active": true,                                    // optional
    "afterOrderEnabled": false,                        // optional 
    "media": "logo.png",                               // optional
    "translations": {
        "de-DE": {
            "name": "Meine Zahlungsart",
            "description": "Ein Beschreibungstext"     // optional
        },
        "en-GB": {
            "name": "My payment method",
            "description": "A description text"        // optional
        }
    }
}

The fields position, active, afterOrderEnabled, media, name and description will only be installed - not updated. So the user can edit them in the Shopware administration.

The media field is optional and must contain the file name of the media file. The file will automatically be installed and must be found in Resources/payment_methods/ directory.

Run bin/console plugin:update <PluginName> to update payment methods.

Last updated