Custom payment gateway

Developer's guide for adding a new payment gateway integration to Tilda
Tilda has integrations with popular payment options, such as Paypal, 2Checkout or Stripe. Here's how to add a new payment integration using the "Custom payment gateway" option.
To add full-featured integration with another payment gateway, go to Site Settings → Payment Systems and select "Custom payment gateway".
Important: If there is no template among the payment solution templates that you want to use, contact the payment system developer team and send a link to this guide. Creating a new template will be successful only if you are a developer.
The system prompts you to choose a template for integration or create your own.

Templates are presets of parameters for a particular system. It includes unchangeable settings (API URL, order number field) and changeable Advanced settings.

If you have found a template for your payment solution, it means that developers have contacted us, and you can easily set up integration with that payment system.
If your payment system isn't on the list, you need to contact the developers of the payment solution. So that they can send an application to create a template.

To start the procedure you need to specify the name of the payment system, the POST-request URL to which the user will be redirected after starting the payment, email for contact and additional information that can help integration, such as a link to docs.
Important: Creating a new template requires deep knowledge of payment gateway integration and programming. To make a template, you need to be a payment solution developer or have in-depth knowledge of the integration details.
Once approved by the moderation team, the template will become available in the list for a specific project. After that, you can change additional settings, change the names of the variables that are passed when sending the order and debug the integration.

First, you need to specify the names of important and mandatory fields that are transmitted during the order and specify their additional settings (case, format, field length).
After configuring the mandatory fields, you need to add other variables that must be transmitted after order creation. It can be set in the "Additional fields list" section. The size of the list depends on the integration needs.
You also need to configure the order signature and specify the rules for its formation (excluded fields, sorting principle, separator, encryption algorithm).

First you need to select the signature rules or select "All fields", and specify the excluded fields, sorting principle and delimiter. If you need a custom data format, select the option "Special rules" and fill in the line of rules in a special format.
Then you need to configure the successful payment indicator (parameter name and value) and specify what the system should return in response to successful or declined payments.
Interaction format
1. The buyer adds a product to cart, fills all fields and clicks on the "Checkout" button.

2. A request to save the new order. Then the formed set of parameters is returned for the request to the Payment System in accordance with the "List of matching fields" and the "List of additional fields" from the "Advanced integration settings".
Important: Among the parameters there must always be a field containing the order signature. The signature is generated from the values of other fields according to a certain algorithm with the participation of the "Order Signature". You can configure this algorithm in the "Order signature" section of the "Advanced settings" integration.
The user is redirected to the "API URL" of the template. The parameters are passed by POST method.

The payment system processes the parameters and, if the signature is correct, displays the payment form, processes the payment and communicates with other systems if necessary.
Payment system can redirect the user to the success page after successful payment (if it is spelled out in the settings) or display another notification.

Also, the payment system must send a request to the "Notification URL", a special Tilda server URL. This request also needs to pass parameters and signature by POST method (signature algorithms may differ). Also you need to prescribe the field (and its value) that is responsible for the status of payment in the Advanced Settings. It will be a sign of successful payment.

Only when a request with a correct signature, order number, amount and payment sign is sent to the "URL for notifications", the order will be marked as paid in Tilda.
Customizing fields
To make it easier for users to understand which field in the Payment System corresponds to the field in the Tilda integration, we added the ability to rename some fields and tooltips in the "Form Settings" section of the "Advanced Settings".
Debugging integration
To debug the integration, create a page and configure it according to the "How to work with the cart" help: add the cart and the product block to the page and publish the page.

Try to make a test payment and see if the payment goes through on the test environment. If everything is fine, contact the moderation team and your template will be added to the public list.
Made on