Integration of Payrexx Gateways in Sylius Online Shop

Development, Technology

Reto Kohli

May 16, 2022

Integration of Payrexx Gateways in Sylius Online Shop

Perfection is not achieved if you don’t add anything, but If you can’t leave anything out.

— Antoine de Saint-Exupéry

First experiences with Sylius

Even after numerous projects, with various shop systems and theirs the respective individual strengths and weaknesses, we always look out new solutions.

Sylius appeared on our horizon as early as 2020.We decided one to implement the first project with it.Because although the product was relatively new Even then it had an impressive range of functions and The same flexibility.

However, both are double -edged swords;on the other hand expect the developer a steep learning curve and correspondingly many Opportunities to make mistakes.We used these, learned from it, and were able to successfully implement the first online shop.

More “Swissness”

New requirements followed as part of the second project.It should be one Online payment can be integrated, which, in addition to the known credit cards National providers such as Twint allowed.As an internationally designed system However, Sylius does not offer any connection to established in Switzerland Number systems - except, of course, for PayPal, which is not the one supported means of payment supported and therefore was out of the question.

The decision for the payment provider noticed quickly Payrexx. This offers all in the Switzerland common payment methods, and a lot more.

Now the two systems had to be made to talk to each other.


Here, too, Sylius offered us the opportunity to get the desired functionality in the To integrate the ordering process: as Payum plugin.

/Pay(?:um|rexx)/

Payum Is in every installation of Sylius already included, and offers a universal adapter for payment processes, so to speak, on.His only and obvious deficiency is the documentation in moderate English - obviously not the author’s mother tongue - which primarily based on Values selected by examples shows, but hardly explained.

Unfortunately we encounter this situation with software more often than we would like, and We sometimes have to work with “trial and error” to find out how they works exactly.The first implementation was accordingly difficult.

About a few cycles of reading, rewriting and trying improved Not only our understanding, but also the code in relation to it. In the end, the latter was half as extensive as at the beginning.

Entry for interested parties:

It is easy to know when we know

In retrospect, we have useful insights from the two projects mentioned Get a lot of learning.The following selection is not Finally, but fully applicable to most projects:

Much more important than the internal functioning of software (Sylius, Payum) in Knowing detail is to be understood how it “ticks” on the whole, So what concepts are behind it.Apart from that, we leave ourselves largely on the fact that she does exactly what we expect from her. Otherwise their use would make no sense.

Another realization is that the use of software in the form of several individual components much more configure can require as program. A plugin is easily written, but useless without that Suitable counterpart…

The connection via the interface to the PAYREXX API for the actual handling of the payments;especially Because we have already brought experience with it.

Pic Credit: Calvin Sprague

Another reading material