Riverty Payments: Storefront
Riverty at the Sylius checkout - payment methods and availability check, instalment example, identification number for the Nordics, thank-you page, Twig hooks and functions
Riverty Payments: Storefront
This documentation always describes the latest published version.
Which payment methods the checkout offers
Riverty is only offered when the billing address is in a country for which the channel has an API key, and the order is in the currency Riverty accepts there (for example EUR in Germany). The admin explains why a method is missing on the list of settings, see Configuration.
Besides these local checks, the plugin asks Riverty which payment methods it offers for the cart and lists only those. An instalment method therefore disappears for an amount for which Riverty has no plan.
- Riverty is asked once per cart and the answer is cached for five minutes (
cache.app). - If Riverty cannot be reached, nothing is taken away: the methods that passed the local checks stay, and the authorization says no if it has to.
- If Riverty answers with a rejection or no method at all, no Riverty method is offered.
What the customer sees
Payment step
The chosen Riverty payment method shows a short text with the Riverty logo that explains the payment type (invoice, direct debit, instalments, pay in X), in English and German. The texts of all methods are in the page, and a CSS rule (:has()) shows the one behind the checked radio button. The switch is therefore instant and needs no round trip to the server. A browser without :has() shows all texts.

Instalment example (optional)
The settings form has the option Show the instalment example in the checkout per channel, off by default. When it is on, the instalment text also shows "from X/month" and the representative example of the cheapest plan Riverty offers for the cart: net loan amount, borrowing rate, effective APR, term, monthly instalment and total amount.
Naming a monthly amount in advertising brings the duties of the German PAngV section 6a with it. That is why the full example is always shown with it, and a plan that lacks one of its figures is never named. Switch the option on only when you want that.
Whether the instalment method is offered at all does not depend on the option. In your own templates the example is available as mmd_riverty_instalment_plan(). The function returns teaser, net_amount, interest_rate, apr, term, rate and total, or null when there is no complete plan. Without an argument it uses the current cart; you can also pass an order or a payment.
Identification number (Norway, Sweden, Denmark, Finland)
For a billing address in one of these countries, Riverty needs the personal identity number of a private customer or the registration number of a company. The payment step then shows one field Identification number. It appears while a Riverty method is checked and is required for Riverty only.

- The check is lenient on purpose: 6 to 20 characters, digits, letters and
+ - / ., the first character is a digit or a letter, at least three digits in a row, and spaces are removed. The formats of four countries, for people and for companies, differ, and Riverty does the real check. - The number is kept encrypted (with the key derived from
APP_SECRET, like the API keys) in the details of the payment and removed as soon as Riverty has been asked, whether Riverty accepted the order or not. It is never logged unmasked. - A customer who chooses another payment method leaves no number behind.
- Orders to the Nordics also need the currency Riverty expects there (NOK, SEK, DKK; EUR in Finland).
The field belongs to the storefront checkout. The Sylius Shop API cannot carry the number in its payment step, see Shop API.
Order confirmation
After a payment with Riverty, the confirmation page shows a notice with a link to MyRiverty, where the customer keeps track of open payments.
Twig hooks
The plugin registers on these hooks:
| Hook | Purpose |
|---|---|
sylius_shop.shared.form.select_payment.payment.choice.riverty |
Text under each Riverty payment method in the payment step |
sylius_shop.shared.form.select_payment.payment |
Field for the identification number, after the payment methods |
sylius_shop.checkout.select_payment.content |
Flash messages in the payment step, for example for a refused identification number |
sylius_shop.order.thank_you.content |
Riverty notice on the confirmation page |
The hook name in the first row carries the gateway factory name riverty: Sylius renders choice.<factory> and choice and merges the two lists, so the core's own card for the method stays and the plugin adds the text after it.
Your own templates and themes
If a theme replaces one of the templates attached to these hooks, the output there is gone. In that case, do not replace the whole template; attach your own hook entry with a higher priority to the hook names in the table. More Twig functions for your own templates:
| Function | Purpose |
|---|---|
mmd_riverty_instalment_plan() |
Instalment example, see above |
mmd_riverty_info(method) |
Type and bullet points for the text under a payment method, or null |
mmd_riverty_paid(order) |
true when the last payment of the order went through Riverty |