Documentation

FomoCoupon
in package

Fetch a FOMO coupon from our Real Commerce backend for free users with valid license.

Table of Contents

Constants

ENDPOINT_FOMO_COUPON  = '1.0.0/fomo/in-app-coupon'
OPTION_NAME_FOMO_COUPON  = RCB_OPT_PREFIX . '-fomo-coupon'
The option value can be one of the following:
RETRY_ENDPOINT_ON_ERROR_IN_SECONDS  = 6 * 60 * 60

Methods

revisionCurrent()  : mixed
Output the FOMO coupon to the current revision REST endpoint, so the UI can work with it.
fetchFomoCoupon()  : array<string|int, mixed>|false
Fetch the FOMO coupon from the Real Commerce database only once and cache it. If there is no free license activated, never fetch a coupon from the external server (GDPR).
getApiUrl()  : mixed
Get the URL to the Real Commerce API.

Constants

ENDPOINT_FOMO_COUPON

public mixed ENDPOINT_FOMO_COUPON = '1.0.0/fomo/in-app-coupon'

OPTION_NAME_FOMO_COUPON

The option value can be one of the following:

public mixed OPTION_NAME_FOMO_COUPON = RCB_OPT_PREFIX . '-fomo-coupon'
  • -1: You already have an in-app FOMO coupon received -> never send a request to the backend again
  • number > 0: Timestamp, when we retry the backend as it was not available
  • array: Result of the Fomo Coupon

RETRY_ENDPOINT_ON_ERROR_IN_SECONDS

public mixed RETRY_ENDPOINT_ON_ERROR_IN_SECONDS = 6 * 60 * 60

Methods

revisionCurrent()

Output the FOMO coupon to the current revision REST endpoint, so the UI can work with it.

public revisionCurrent(array<string|int, mixed> $arr) : mixed

If the FOMO coupon is not yet available, fetch it.

Parameters
$arr : array<string|int, mixed>

fetchFomoCoupon()

Fetch the FOMO coupon from the Real Commerce database only once and cache it. If there is no free license activated, never fetch a coupon from the external server (GDPR).

protected fetchFomoCoupon() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

getApiUrl()

Get the URL to the Real Commerce API.

protected getApiUrl() : mixed

        
On this page

Search results