VAI Pay (English)
- 1 Introduction
- 2 Installation / Update
- 3 Configuration
- 3.1 Shop
- 3.1.1 Payment methods
- 3.1.2 Shipping methods
- 3.2 JTL-Wawi
- 3.2.1 Set up payment method in Wawi 1.6
- 3.2.2 Set up payment method in Wawi 1.5
- 3.2.3 Set up the order attribute
- 3.2.4 Set up JTL-Workflow
- 3.2.4.1 Address data
- 3.2.4.2 VAT ID
- 3.2.5 Test WAWI-Workflow
- 3.2.6 Set up E-Mail template
- 3.2.6.1 Adapt subject
- 3.2.6.2 Customise Invoice PDF Name
- 3.1 Shop
- 4 On operation
- 5 Customization
- 6 Troubleshooting
- 6.1 Messages
- 6.2 Check logs
- 6.2.1 Browser log
- 6.2.2 Shop log
- 6.2.3 Webserver-Log
- 7 Changelog
- 8 Support und Contact
Introduction
This plugin integrates VAI Pay as a payment method in your JTL store.
VAI Trade GmbH offers an invoice purchase solution in the B2B sector, which allows merchants to purchase goods from their suppliers by invoice and pay in instalments. VAI Trade acts as a customer towards the supplier who buys on account and resells the purchased goods to the retailer accordingly. The supplier receives a payment for his goods within 24 hours and thus bears no risk.
Further information on the subject can be found here:
https://support.vaitrade.de/de-form/articles/2104656-wie-funktioniert-einkaufsfinanzierung
Features
Frontend
Payment method VAI Pay
Backend
Overview of the payments with VAI-Pay
Configuration help for the Plugin
Wawi
Wawi-Workflows
Installation / Update
System requirements
JTL-Shop 5.00+ and its requirements
Other requirements
You need a customer account, register at: https://vaitrade.de/de/b2b.
Get more information https://support.vaitrade.de/de-form/articles/2032365-welche-voraussetzungen-gibt-es about additional requirements to use VAI Pay.
Plugin-Installation
The installation of the plugin is done according to JTL standard, as it is described here.
Plugin-Update
When updating to a newer version, you can start updating the plugin to the next available version under the menu item "PLUG-INS → My Purchases > Bound Licenses → VAI Pay". In the Status column, click "Update".
Configuration
Shop
The plugin will help you to set up the payment method, for this select the "Help" tab in the plugin. There you will get an overview of the configuration. At the point, check the settings you have stored for the payment and shipping methods.
Payment methods
The configuration of the payment type is done via the standard administration in the JTL store. You can find the payment types under Administration → Payment methods. You can also find a direct link on the help page of the plugin. Select VAI Pay via the pencil icon and configure the payment method as needed.
In addition to the standard settings for payment methods, the plugin contains the settings for the payment method under the Settings tab. Here you can store the data necessary for operation, which you have received from VAI Pay for the setup.
If the VAI Pay payment method is selected, the pay button is replaced with a payment button in the VAI design. You can choose from three different button texts.
You specify where and with which method the button is embedded via the selector and selector method.
Option | Values | Description |
---|---|---|
Active: | Yes / No | Here you can globally enable or disable the plugin. |
API-Key: |
| Enter the API key here that you received from VAI Pay after your registration. This serves as the access key for communication with VAI Pay. |
Secret-Key: |
| Enter the secret key for communication with VAI Pay here. You have also received this after your registration with VAI Pay. This is used to secure the communication with VAI Pay. |
Mode: | Sandbox / Live | Select the operating mode here Sandbox - the plugin communicates with the test environment |
Button color sheme: | Light / Dark | Select the color scheme for the pay button here. |
Button text: | “Bezahlen mit VAI” | Choose your favorite button text. The text will be displayed in the VAI Pay button. |
Button selector (bind): | CSS - Selektor Standard: #complete-order-button | Specify the CSS selectors (comma-separated) to which the button should be bound. If nothing is specified, then the default selector is used. |
Button selector method: | after before append prepend replaceWith | after - the button will be added after the specified element before - the button will be added before the specifying element append - the button will be appended to the specifying element prepend - the button will be prepended to the specified element replaceWith - the specified element will be replaced with the button |
Element selector (remove): |
| Specify here the CSS selectors of the elements that should be hidden. By default, the element "#complete-order-button" is always hidden. If your button ID is named differently, you can specify your own selector here. |
Shipping methods
Assign VAI Pay to the appropriate shipping methods/countries under Administration → Shipping. The plugin also takes into account any surcharges to the payment method. You can also find a direct link on the plugin's help page.
JTL-Wawi
In order for the payments made via VAI Pay to be assigned to the orders in JTL-Wawi, extended settings must be set. For a correct function with VAI Pay, the described JTL workflows are of particular importance, more information on this topic you can be find here: https://support.vaitrade.de/de-form/articles/3482535-welche-informationen-mussen-auf-meiner-rechnung-vorhanden-sein.
Set up payment method in Wawi 1.6
In JTL WAWI, open the payment method management Zahlungen → Zahlungsarten.
Create "VAI Pay" as the payment method. Note that the payment methods must correspond to the "Displayed name" in the JTL store.
Setup “Eigenes Feld“ (custom field)
IN JTL-WAWI, open Admin→ “Eigene Felder”
If you have updated from v1.5 to v1.6, you will find the VaiDealNumber under "Automatisch generiert". You can create a new group "VAI Pay" and drag the VaiDealNumber into to structure your fields:
Otherwise, create a new field with the name "VaiDealNumber" and the data type "Kurztext":
The VaiDealNumber is then displayed in the offer/order on the right side under the tab “Eigene Felder“ (custom fields):
Set up payment method in Wawi 1.5
In JTL WAWI, open the payment method management Zahlungen → Zahlungsarten.
Create "VAI Pay" as the payment method. Note that the payment methods must correspond to the "Displayed name" in the JTL store.
Set up the order attribute
Change to Verkauf (F6) und open an order. You can edit the order attributes with
Create the Attribute “VaiDealNumber“. Now the transmitted dealNumber is displayed:
Set up JTL-Workflow
VAI Trade GmbH acts as the buyer to the seller, so unlike other orders, the invoice may not be addressed to the buyer, but must be addressed to VAI Trade instead. Set up a WAWI workflow to automatically change the invoice address of the order to the invoice address of VAI Trade to be defined when an order is created with VAI Pay as the payment type. To do this, proceed as follows:
Set up "VAI Pay" as a payment method.
Open Admin >JTL-Workflows:
Choose Aufträge:
and mark up “Komplett bezahlt”
Create a new Workflow:
Define conditions:
Define for the previously created payment type "VAI Pay" that payments should be processed.
Set up actions:
In Table Address data all variables are listed which have to be changed.
Choose action “Werte setzen“
Specify with "Variable" which value should be changed for
Auftrag > Zahlungen > Rechnungsadresse > VariableSpecify the new value for Wert.
Option “Feld leeren” is not available, to empty a variable please insert a "-" (minus) as a workaround.
Test Workflow
Save the Workflow
Address data
The setup help is intended to assist you in entering all the required variables.
Variable | Value | Comment | Setup help |
---|---|---|---|
Adresszusatz | - |
| done |
Anrede | - |
| done |
Bundesland | - |
| done |
| done | ||
Fax | - |
| done |
Firma | VAI Trade GmbH |
| done |
Firmenzusatz | - |
| |
LandISO | DE |
| |
Landname | Deutschland |
| |
Mobil | - |
| |
Name | - |
| |
Ort | Berlin |
| |
PLZ | 10245 |
| |
Straße | Warschauer Platz 11-13 |
| |
Telefon | +49 30 9599984 20 |
| |
Titel | - |
| |
Vorname | - |
| |
ZuHänden | - | up to Wawi 1.5 |
Tabelle: Invoice address data
The field "ZuHänden" no longer exists as of Wawi 1.6 and can be removed from the workflow.
VAT ID
If you have to show a VAT ID on the invoice, the VAT ID of VAI must also be shown on the invoice. The easiest way is to can enter your VAT ID in the “Firmenzusatz” field:
Test WAWI-Workflow
Now test the Wawi workflow on a test order by first creating a test order in your store (cash payment or similar) and transferring it to the WAWI. Set the payment for the order via "VAI Pay" and a payment receipt. Make a note of the order number (e.g. 123).
Go to JTL-Workflows by choosing Aufträge > Komplett bezahlt > “Auftrag_Komplett bezahlt”
Your workflow actions should look something like this:
Start the test
Select an object by searching for order number (e.g. 123)
Open the order again. The invoice recipient has been changed:
Set up E-Mail template
As a seller, you have to send the buyer's invoice to the intermediary. In this case, a differentiation based on payment type must be set up in the e-mail template. The correct e-mail address for the transaction has already been set by the workflow. The corresponding DealNumber has been assigned in the incoming payment for the transaction. Open Admin → “Druck- / E-Mail- / Exportvorlagen“
Select Mailen → Standardvorlage → Bearbeiten. “E-Mail-Vorlagen bearbeiten” opens. Set the subject to “Benutzerdefiniert” to be able to open the advanced settings "...". Make sure that the variable set starting with “Vorgang” is available on the right-hand side. If this is not the case, you use a new standard template. Use the template "Standard (Veraltet)" instead, this template contains the required variable set:
Adapt subject
If you have not made any changes to your standard e-mail template, you can use the code as it is. Otherwise, adapt the code or insert your modifications in the ELSE part:
{% if Vorgang.Zahlungen.ErstesObjekt.Zahlungsart.Name == "VAI Pay" %}
Rechnung zu VAI-Deal: #{{ Vorgang.Zahlungen.ErstesObjekt.ExterneTransaktionsID }}
{% else %}
Rechnung über "{{ Report.InvoicePosition[0].Name | Truncate: 20 }}"{% case Report.InvoicePosition.Size %}{% when 0%}{% when 1 %}{% when 2 %} und einem weiteren Artikel{% else %} und {{ Report.InvoicePosition.Size | Minus: 1 }} weiteren Artikeln{% endcase%} von {{ Report.Company.CompanyName }}
{% endif %}
Wawi 1.5
{% if Vorgang.Zahlungen.ErstesObjekt.Zahlungsart.Name == "VAI Pay" %}
Rechnung zu VAI-Deal: #{% assign Attribute = Vorgang.Auftrag.Attribute | Split: '|' %}{% for Attribut in Attribute %}{% if Attribut contains 'VaiDealNumber' %}{{ Attribut | ReplaceFirst: 'VaiDealNumber=','' }}{% endif %}{% endfor %}
{% else %}
Rechnung über "{{ Report.InvoicePosition[0].Name | Truncate: 20 }}"{% case Report.InvoicePosition.Size %}{% when 0%}{% when 1 %}{% when 2 %} und einem weiteren Artikel{% else %} und {{ Report.InvoicePosition.Size | Minus: 1 }} weiteren Artikeln{% endcase%} von {{ Report.Company.CompanyName }}
{% endif %}
Wawi 1.6
Customise Invoice PDF Name
The same applies to the naming of the PDF invoice name. Insert your modifications in the ELSE part at the end of the code line:
{% if Vorgang.Zahlungen.ErstesObjekt.Zahlungsart.Name == "VAI Pay" %}#{{ Vorgang.Zahlungen.ErstesObjekt.ExterneTransaktionsID }}.pdf{% else %}Rechnung-{{ Vorgang.Rechnungsnummer }}.pdf{% endif %}
Wawi 1.5
Wawi 1.6
On operation
Shop
The payment method is integrated in the storefront of the store like a regular JTL store payment method.
Frontend
he VAI Pay payment method is only available to buyers under certain conditions. The payment method can only be offered for B2B in Germany and only in Euro.
If the billing country is not Germany, VAI Pay will not be offered as a payment method.
If a currency other than Euro is selected in the store, then VAI Pay cannot be offered as a payment method.
If the buyer has not entered a company in the customer details, VAI Pay will not be offered as a payment method.
Backend
In the plugin backend you can view the orders that were paid with VAI Pay. The search helps you to find the desired orders.
Column | Description |
---|---|
Order ID | JTL-Shop order Id |
Customer | Name of the customer |
Invoice ID | Internal invoice number (UUID generated by the plugin) |
Deal-Number | VAI Pay deal number (internal ID generated by VAI Pay) |
Status | Status of the payment (confirmed/unconfirmed). The status is confirmed when the order has been created in the JTL store and VAI Pay has confirmed the transferred amounts. |
Total Sum | Total gross amount in the JTL store (due to any fees, the amounts in the VAI customer account may differ). |
Order date | Timestamp of the order or payment |
IP-Address | IP of the buyer/customer |
WAWI
The JTL workflows, once set up, start automatically during the Wawi synchronization and do not require any further processing during operation.
The plugin also has no further interaction with the Wawi, cancellations must be solved directly with VAI. Furthermore, the plug-in does not respond to a Wawi comparison in the opposite direction.
Customization
The payment method itself has no customizable elements. However, you can specify which color scheme and button text to display on the summary page.
If you are using your own template, enter your special selector for the "Order Paid" button under Button Selector (Show).
Troubleshooting
If you observe any problems with the plugin, first check the logs and if necessary contact our support or your service partner if you cannot solve the problem on your own.
The more information you can give to the support in case of a problem, the sooner we will be able to help you. Non-reproducible problems, on the other hand, are also difficult to analyze.
Messages
This message is displayed when the buyer has changed the currency other than Euro on the summary page and wants to complete the order. He will be redirected back to the shipping and payment method page and can select a payment method suitable for the desired currency.
This message is displayed when the customer clicks on "Cancel" in the VAI Pay account and thus cancels without submitting the order.
This message is displayed if the data transmitted by VAI Pay could not be decoded with the secret key.
This message is displayed when the data transmitted by VAI Pay does not match the current data in the session.
This message is displayed when an error occurred in the API communication. In this case, VAI could not finally confirm the authenticity of the transmitted data. However, the order could be successfully created in the JTL store. The buyer was redirected to the order confirmation page.
Check logs
In the plug-in backend, success and error messages are displayed to the merchant for each action. The plug-in logs all actions into the shop log (debug level). All corresponding messages can be conveniently filtered with the prefix "VAIPAY>".
To find out where a problem lies, the logs help you and us. Depending on the error pattern, one of the following 3 logs is more or less relevant.
Browser log
The browser log is usually relevant when something in the shop's frontend behaves strangely or does not react. (Example: You click a button and apparently nothing happens).
You can see the browser log by pressing F12 in the browser and then switching to Console.
Shop log
The shop log is always interesting if unexpected error messages are displayed in the frontend or if the plug-in reacts to inputs in the frontend but does not deliver the expected result. Sometimes the browser log also shows that the information is more likely to be found in the shop log.
You can find the shop log in the JTL admin area under Administration → Troubleshooting → Log.
Webserver-Log
The web server log becomes relevant if you encounter an error 500 (= white page) somewhere.
Your hosting provider can provide you with the web server log.
Changelog
v1.0.3 (July 2023)
Bugfix: Improved checks for payment errors during payment processing.
v1.0.2 (February 2023)
Transmission of the order number in the shop
v1.0.1 (January 2023)
JTL Shop 5.2 Kompatibilität
v1.0.0 (August 2022)
InitialRelease
Support und Contact
Go to Support und Contact