Project

class Project

A project contains configuration information and backend api urls needed for a retailer.

Types

Link copied to clipboard

Properties

Link copied to clipboard

Url to load shops that are not currently 'live'. Shops that are already live are already included in the normal metadata json and do'nt need to be loaded afterwards

Link copied to clipboard

Url to download the product database

Link copied to clipboard
Link copied to clipboard

Url to retrieve app user information

Link copied to clipboard
lateinit var assets: Assets

Provides access to images used by various ui components

Link copied to clipboard

Url to retrieve image assets that change dynamically between retailers

Link copied to clipboard

List of payment methods that should be available to the user

Link copied to clipboard
var brand: Brand?

If multiple projects are linked to the same retailer, they can have a optional Brand associated with them, so they can be grouped together. E.g. in the Payment Options Screen

Link copied to clipboard
lateinit var checkout: Checkout

The snabble checkout API.

Link copied to clipboard

Url to start a checkout flow

Link copied to clipboard

List of code templates used for parsing vendor specific barcodes.

Link copied to clipboard

Object describing the company associated for this project.

Link copied to clipboard
lateinit var coupons: Coupons

Provides a list of active coupons

Link copied to clipboard
lateinit var currency: Currency

The currency used to calculate and display prices

Link copied to clipboard

The number of used currency fractions digits

Link copied to clipboard
lateinit var currencyLocale: Locale

The locale in which this currency is used

Link copied to clipboard

Sets the customer card number for user identification with the backend

Link copied to clipboard

Returns the possible accepted cards and if a customer card is required

Link copied to clipboard
var customizationConfig: JsonElement?
Link copied to clipboard

The code template that should be used, when no code template is specified by a scannable code

Link copied to clipboard

Parameters in which codes used for offline processing (for example: Checkout using a QR-Code) should be encoded

Link copied to clipboard
lateinit var events: Events

Event logger which ships logging data to the snabble backend

Link copied to clipboard

Url to post events to the snabble Backend (e.g. cart updates)

Link copied to clipboard
Link copied to clipboard
lateinit var id: String

The unique identifier of the Project

Link copied to clipboard

The internal storage directly used for various files stored by the snabble SDK that are related to this project.

Link copied to clipboard

Indicator if checkout should be available when using this Project

Link copied to clipboard

Indicator if prices should be displayed using the net price instead of the gross price

Link copied to clipboard

The limit of all checkout methods, in cents (or other base currency values)

Link copied to clipboard

The limit of online payments, in cents (or other base currency values)

Link copied to clipboard

The user facing name of the Project.

Link copied to clipboard
lateinit var okHttpClient: OkHttpClient

OkHttpClient which wraps http calls to the snabble backend with valid tokens.

Link copied to clipboard

List of payment method descriptors indicating which payment methods and providers are available in the Project

Link copied to clipboard

A price formatter for formatting prices using the provided currency information.

Link copied to clipboard

List of code templates that are used when supplying an existing Product with a different barcode which contains a reduced price

Link copied to clipboard

Url to retrieve products by barcode

Link copied to clipboard

Url to retrieve products by sku

Link copied to clipboard

The primary product database of this project

Link copied to clipboard

If a customer card is strictly required to use the checkout functionality at all.

Link copied to clipboard

The roundingMode which should be used when doing offline calculations

Link copied to clipboard

List of code templates that are searchable using the barcode search functionality

Link copied to clipboard

The users shopping cart

Link copied to clipboard

Flow to observe the current users shopping cart

Link copied to clipboard

List of shops which are available.

Link copied to clipboard

List of supported barcode formats used by this retailer. The scanner should restrict its scanning to include only those formats

Link copied to clipboard
Link copied to clipboard

Url to retrieve authentication tokens

Link copied to clipboard

A key-value map containing urls provided by the metadata. All urls are absolute, even if the original metadata contained relative urls.

Functions

Link copied to clipboard

Adds a listener that gets called every time the metadata updates

Link copied to clipboard

Get a code template by its name

Link copied to clipboard
fun getText(key: String, defaultValue: String? = null): String?

Get text included in the metadata

Link copied to clipboard

Get a code transformation template by its name

Link copied to clipboard

Causes hidden shops to be loaded asynchronously if config.loadActiveShops is set to true.

Link copied to clipboard
fun logErrorEvent(format: String?, vararg args: Any?)

Logs a event tagged with error to the snabble Backend

Link copied to clipboard
fun logEvent(format: String?, vararg args: Any?)

Logs a event to the snabble Backend

Link copied to clipboard
fun parse(jsonObject: JsonObject)

Parse a json definition of a Project

Link copied to clipboard

Removes an already added listener