\DevOwl\RealCookieBanner\liteFomoCoupon

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

Summary

Methods
Properties
Constants
revisionCurrent()
No public properties found
OPTION_NAME_FOMO_COUPON
ENDPOINT_FOMO_COUPON
RETRY_ENDPOINT_ON_ERROR_IN_SECONDS
fetchFomoCoupon()
getApiUrl()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

OPTION_NAME_FOMO_COUPON

OPTION_NAME_FOMO_COUPON =RCB_OPT_PREFIX . '-fomo-coupon'

The option value can be one of the following:

  • -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

ENDPOINT_FOMO_COUPON

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

RETRY_ENDPOINT_ON_ERROR_IN_SECONDS

RETRY_ENDPOINT_ON_ERROR_IN_SECONDS =6 * 60 * 60

Methods

revisionCurrent()

revisionCurrent(array  $arr)

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

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

Parameters

array $arr

fetchFomoCoupon()

fetchFomoCoupon(): array|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).

Returns

array|false

getApiUrl()

getApiUrl()

Get the URL to the Real Commerce API.