en:authors_main:game_management:payments

Paid Content (Paywall)

A game can sell access to a single level, to a hint, or to any piece of the task text. The scheme is this: the author creates a product, puts a payment button into the task, and closes off the paid content with a template that checks whether the product has been paid for.

Before you start: the payment system is switched on by the domain administrator, not by the game author. If payment is not configured on the domain, the payment button simply never appears on the page. The paywall can still be tested without configured payment — see the “How to Test It” section.

In the game editor, on the “Useful links” tab, open “Products / Paid access (Paywall)“. The products screen has four fields:

  • Key — the identifier you will use to reach the product from the task. Latin letters, digits and underscores only: a key with a hyphen, a space or Cyrillic letters will be saved, but the payment button will not find it. The key cannot be changed after creation — the only way is to delete the product and create it again.
  • Name — goes to the payment system as the invoice description. It is not shown to the player on the button.
  • Price — must be greater than zero.
  • Currency — UAH, USD, EUR, GBP, CAD, PLN, CZK.

The products of a game: key, name, price and currency

A game may have as many products as you like: a separate product for each paid level, for example.

The template does not have to be typed from scratch: the “Copy” button in the “Template” column puts a ready snippet with this product's key into the clipboard, and the same example with an explanation sits under the table.

At the spot in the task where the button should appear, write:

%pay_button product_key%

The engine replaces this with a “Pay {price} {currency}“ button. Pressing it opens a separate payment system window.

What is worth knowing about the button:

  • If the product has already been bought, the button disappears by itself — there is no need to hide it manually.
  • If the key is misspelled and there is no such product, a grey “Product not found” message with that key appears instead of the button. Handy for checking yourself.
  • The button can be placed in the task text, in hints, in bonuses and in the finish text — anywhere substitutions work. That includes inside a template: templates are evaluated first, so the button lives quite happily in the {%= no} branch.

The button on its own hides nothing — the paid text has to be closed off with the product_KEY template. It has three values:

  • yes — the product is bought, access granted.
  • pending — payment has started but the bank has not confirmed it yet. Rare, but the branch is better provided for.
  • no — not paid.
{% match product_level_5 }:{
  {%= yes}:{
Thank you for your purchase! The code to pass the level: ZOO
  %}
  {%= pending}:{
Your payment is being processed by the bank. Wait a moment and refresh the page.
  %}
  {%= no}:{
This level contains paid content.
%pay_button level_5%
  %}
%}

This is what a player sees while it is unpaid: no text, a button in its place.

The "not paid" branch: the text is closed off by the template, a payment button stands in its place

The template is evaluated on the server, so unpaid content never reaches the page source — there is no way to peek at it.

If the product name has a typo in it, the template does not complain — it simply always returns no. Check the key against the button: in that case it will show “Product not found”.

When the player completes the payment, the payment system window closes by itself and the game page reloads — the paid content appears without the player having to do anything.

The same level after payment: the "yes" branch fired, and the payment button disappeared by itself

Access is granted to the team, not to the player: one pays, everyone gets it. In single-player games that is, naturally, the same person.

The list of purchases for the game is visible to the author on the game purchases screen — unfinished payment attempts are shown there too. Access can also be granted by hand from that screen: handy when a player paid you some other way, or when a payment got stuck and has to be closed manually.

Purchases for the game: who bought what, what is awaiting payment, and granting access by hand

Enter the game through “Test Game”. For a test team the engine substitutes a test payment system of its own, regardless of what is configured on the domain, or whether anything is configured at all. The payment button works like the real one, but instead of the bank it opens a form with a field for a code — the code you need is written right there in the form. No real money is charged.

The test payment: for a test team the engine substitutes the payment system, and the code is written in the form itself

That way the whole chain can be checked end to end: the no branch with the button, and the switch to the yes branch after “payment”.

The whole chain: the button, the form, the confirmation code — and the level opens through the yes branch

Not to Be Confused with Paid Entry to a Game

What is described here is selling content inside a game. Charging for taking part in a game is a separate mechanism: the price is set in the game settings, and teams are admitted to the game automatically once they have paid. See Game Settings.

Example in game

  • en/authors_main/game_management/payments.txt
  • Last modified: 2026/08/20 05:18
  • (external edit)