Markus Michalski FAQ

Riverty Payments: Installation and Operations

Installing Riverty Payments for Sylius - Composer via Packeton, bundle and route setup, setup command, update, cron job and uninstall in the correct order

Deutsche Version

Back to overview

Riverty Payments: Installation and Operations

This documentation always describes the latest published version.

Check the requirements

The full list is on the overview. Two points often decide between success and failure:

Never change APP_SECRET after Riverty API keys have been saved. The keys are stored encrypted, and the encryption key is derived from APP_SECRET (%kernel.secret%). If the value changes, the stored keys can no longer be decrypted and every Riverty call fails until you enter all keys again. Back up APP_SECRET together with your database backups. If you rotate it on purpose, save all Riverty API keys again afterwards.

Keep the payment request transport synchronous. The authorization at Riverty is a payment request command. If it runs through a queue, it is only carried out once a worker consumes that queue, and until then the payment stays New and the customer is not sent to Riverty. The Sylius default is SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_DSN=sync://. Some skeleton .env files set a Doctrine queue here, so check yours.

Installation

The plugin lives in a private repository and is served through Packeton (https://packeton.markus-michalski.net). You receive the credentials after buying the license.

Private repositories are managed through Packeton. Add the repository to your composer.json and store the credentials as you would for any private Composer repository.

  1. Add the repository and install the plugin:

    { "repositories": [{ "type": "composer", "url": "https://packeton.markus-michalski.net" }] }
    
    composer require mmd/sylius-riverty-payments
    
  2. Register the bundle in config/bundles.php:

    Mmd\SyliusRivertyPaymentsPlugin\MmdSyliusRivertyPaymentsPlugin::class => ['all' => true],
    
  3. Import the admin routes, for example in config/routes/mmd_sylius_riverty_payments.yaml:

    mmd_sylius_riverty_payments_admin:
        resource: "@MmdSyliusRivertyPaymentsPlugin/config/routes/admin.yaml"
    

    There are no shop routes: the plugin ships no storefront or API endpoints of its own (see Shop API).

  4. Run the setup command. It creates the tables. Do not use doctrine:migrations:migrate, see Migrations:

    bin/console mmd:riverty:setup
    
  5. Schedule the reconciliation of open payments, for example every 10 minutes:

    */10 * * * * cd /path/to/shop && bin/console mmd:riverty:reconcile
    
  6. Continue with the configuration: enter the API keys and create the payment methods.

Migrations

mmd:riverty:setup runs only the open migrations of this plugin, nothing from the app or other plugins:

The migrations are written for MySQL 8 and MariaDB. On any other platform they abort with an error message.

Update

  1. Update the plugin:

    composer update mmd/sylius-riverty-payments
    
  2. Run the setup command again (idempotent, it adds new tables and columns):

    bin/console mmd:riverty:setup
    
  3. Clear the cache:

    bin/console cache:clear
    

Cron job

Command Recommended interval Description
bin/console mmd:riverty:reconcile every 10 minutes Reconciles open payments with Riverty, checks expiring reservations, sends the daily digest mail and cleans up old API log entries

All options are listed on the page Reconciliation and expiry.

Uninstall

The order matters, because the migrations must be rolled back while the bundle is still registered.

  1. Disable the Riverty payment methods in the admin so that no customer can choose them any more.

  2. Roll back the migrations, one version at a time, newest first:

    bin/console doctrine:migrations:execute --down 'Mmd\SyliusRivertyPaymentsPlugin\Migrations\Version20261106090000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusRivertyPaymentsPlugin\Migrations\Version20261105090000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusRivertyPaymentsPlugin\Migrations\Version20261104090000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusRivertyPaymentsPlugin\Migrations\Version20261103090000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusRivertyPaymentsPlugin\Migrations\Version20261102090000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusRivertyPaymentsPlugin\Migrations\Version20261101100000'
    bin/console doctrine:migrations:execute --down 'Mmd\SyliusRivertyPaymentsPlugin\Migrations\Version20261101090000'
    
  3. Remove the route import and the bundle entry.

  4. Remove the plugin:

    composer remove mmd/sylius-riverty-payments
    

Rolling back deletes the Riverty transactions and the API log. Back up the database first if you still need them.