Skip to content

17. Configuring Premium Features

ihofmann edited this page Nov 30, 2014 · 1 revision

Configuring Premium Features

It is possible to offer your project as "Freemium" game to users. Playing the game is basically free, but certain pages or actions will cost premium credit which needs to be purchased. Premium users are users who own virtual premium credit.

With simple configuration, you can limit following elements to premium users:

  • Pages: A page which, for instance, contains valuable extra information, can be only called if the user has enough premium credit. If not, the user will be redirected to a info page about how to get premium credit.
  • Actions: Everything which triggers an action can lead to debiting premium units from the user's premium account. Before actually executing the action, the user needs to confirm the transaction.
  • Blocks: Displaying of additional content only to premium users.

Please note: The usage of premium features is meant for porjects which are using the software for professional purposes. The following instructions are targeting only advanced users who know basic XML processing and who know the software well.

Legal note: The software provides only the technical infrastructure to receive money and to execute transactions. However, following the applicable law and avertising the products in a correct manner is the responsibility of the website operator.

General configuration

Log into the AdminCenter and go to Settings -> Premium Accounts. Enable the module and fill the form.

Convert pages, actions and blocks into premium features

In order to convert an element into a premium feature, simply add the attribute premiumBalanceMin to your module.xml configuration file at the corresponding element. This attribute indicates, how much credit a user needs at least in order to use the feature.

A sample configuration for a page:

<page id="my-premium-page" role="user" template="my_premium_page"
premiumBalanceMin="5"/>

For an action:

<action id="my-premium-action" controller="MyController" role="user"
	premiumBalanceMin="2">
	<param id="testparam1" type="text" required="true" />
	<param id="testparam2" type="number" required="true" />
</action>

And for a block:

<block id="mypremiumblock" role="user" model="MyBlockModel"
template="premiumblock" includepages="all" area="content_top"
premiumBalanceMin="2" />

Change and translate the subject for a premium transaction

If the user executes a premium action, the system will generate an account statement. By this, the user always keeps track of his transactions.

The subject of the account statement is basically the action ID. If you want to display a nicer text label, create a new message at any messages_en.xml file with the pattern:

actionsubject_action-Id

For the example above:

<message id="actionsubject_my-premium-action">Here goes your better readable subject</message>

Credit balance manually

In order to credit balance manually, it is recommended to use the AdminCenter page "Premium Transactions". Create for every credit note a new transaction via "Add new Record" so that the user can understand changes in his premium account.

Register payments via PayPal

The software includes a module which identifies payments via PayPal automatically.

This is the workflow:

  1. The user got redirected to the info page about how to get premium credit. Important: The PayPal integration requires that you use the pre-configured info page!
  2. The system displays various buy-in options (e.g. he can get 10 credit units for 5 EUR, 30 units for 10 EUR, etc.). The buy-in options can be configured in the settings.
  3. The user clicks on the PayPal-Buy-Button which is displayed on the info page.
  4. The user gets redirected to the PayPal website where he can make his payment.
  5. Once the payment is completed (e.g. immediately if the user pays with credit card), PayPal will automatically send a notification to your websoccer website which will register the payment at the user's premium account.

It is required that you have a business account at PayPal. Once you configured your business account and the buy-in options in the Websoccer AdminCenter, you can add the PayPal-Buy-Button.

For generating a Buy-Button, follow these steps:

  1. Log in to your PayPal Business account.
  2. Go to tab Merchant Portal.
  3. Click on Buy Now Buttons (in box Key Features).
  4. Fill the form for section Step 1 as follows:
  • Button type: Buy Now
  • Item name: (e.g.) Premium Credit
  • Check option: Customize button -> Add drop-down menu with price/option.
  1. Implement the buy-in options as you have configured them in the AdminCenter.
  2. Click on Create Button.
  3. Copy the button code and paste it without any modification at AdminCenter -> Settings -> Premium Accounts -> PayPal: Button Code.

Make sure that port 443 is open on your server!

Verify the settings in the AdminCenter!

  • Info page must be "premium-feature-requested". You can change the contents in template templates/default/views/premium_feature_requested.twig.
  • The buy-in options and currency (real) must match the PayPal buy now button!
  • PayPal: Account name must match the primary e-mail address that you use at PayPal. Otherwise payments will not be accepted.
  • Option "Enable payments through PayPal" is enabled.

Payments via other providers

The software can also detect payments from following providers:

  • SOFORT.com (bank transfer)
  • micropayment™ (bank transfer, phone, SMS, credit card)

You need to register as seller at the corresponding providers. Note the different terms and conditions of them. After the registration, you need to enable and configure the gateways at AdminCenter -> Settings -> Premium Accounts.