Package au.com.woolworths.village.sdk

Types

ApiException
Link copied to clipboard

Base exception type. Used when no other error type is appropriate.

open class ApiException(message: String, cause: Throwable?) : Exception
ApiKeyRequestHeader
Link copied to clipboard

Adds the API key to the request

class ApiKeyRequestHeader(options: VillageOptions) : RequestHeaderFactory
ApiResult
Link copied to clipboard

A result from an API operation

sealed class ApiResult<T : Any>
ApiTokenType
Link copied to clipboard
sealed class ApiTokenType
BearerTokenRequestHeader
Link copied to clipboard

Adds a 'Bearer' token to the request.

class BearerTokenRequestHeader<T : HasAccessToken>(token: String?) : RequestHeaderFactory, CredentialsStore<T>
CustomerApiRepositoryFactory
Link copied to clipboard

Factory function type to give to SDK factory functions to instantiate a new API repository instance.

typealias CustomerApiRepositoryFactory = (VillageCustomerOptions, RequestHeadersFactory, ApiAuthenticator<HasAccessToken>) -> VillageCustomerApiRepository
EverydayPayWalletHeader
Link copied to clipboard
class EverydayPayWalletHeader(options: VillageOptions) : RequestHeaderFactory
HttpErrorException
Link copied to clipboard

Thrown when the server returns an HTTP error

class HttpErrorException(statusCode: Int, responseHeaders: Map<String, List<String>>, responseBody: String) : ApiException
JsonParsingException
Link copied to clipboard

Throw when there is an error parsing JSON data

class JsonParsingException(message: String, cause: Throwable?, details: Map<String, Any>?) : ApiException
MerchantApiRepositoryFactory
Link copied to clipboard

Factory function type to give to SDK factory functions to instantiate a new API repository instance.

typealias MerchantApiRepositoryFactory = (VillageMerchantOptions, RequestHeadersFactory, ApiAuthenticator<HasAccessToken>) -> VillageMerchantApiRepository
MerchantIdRequestHeader
Link copied to clipboard
class MerchantIdRequestHeader(merchantId: String) : RequestHeaderFactory
RequestHeaderChain
Link copied to clipboard

A RequestHeadersFactory that populates the HTTP request headers Map using a list of RequestHeaderFactorys

class RequestHeaderChain(factories: List<RequestHeaderFactory>) : RequestHeadersFactory
RequestHeaderFactory
Link copied to clipboard

Abstracts how HTTP headers are added to a Map.

interface RequestHeaderFactory
RequestHeadersFactory
Link copied to clipboard

Creates a Map of headers to be added to HTTP requests

interface RequestHeadersFactory
VillageCustomerApiRepository
Link copied to clipboard

Defines the API operations that the SDK can use to call the Customer Village API

The SDK is technology agnostic with applications being able to choose an implementation that meets the needs and preexisting technology choices of the application.

Implementations of the protocol may provide additional constraints on the user.

interface VillageCustomerApiRepository
VillageCustomerOptions
Link copied to clipboard

Options unique to using the Customer API operations.

class VillageCustomerOptions(apiKey: String, baseUrl: String, wallet: Wallet?, walletId: String?) : VillageOptions
VillageMerchantApiRepository
Link copied to clipboard

Defines the API operations that the SDK can use to call the Merchant Village API

The SDK is technology agnostic with applications being able to choose an implementation that meets the needs and preexisting technology choices of the application.

Implementations of the protocol may provide additional constraints on the user.

interface VillageMerchantApiRepository
VillageMerchantOptions
Link copied to clipboard

Options unique to using the Merchant API operations.

class VillageMerchantOptions(apiKey: String, baseUrl: String, wallet: Wallet?, merchantId: String?) : VillageOptions
VillageOptions
Link copied to clipboard

Options to configure the SDK

open class VillageOptions(apiKey: String, baseUrl: String, wallet: Wallet?)
Wallet
Link copied to clipboard

The different wallets the SDK can interact with via the API

enum Wallet : Enum<Wallet>
WalletIdRequestHeader
Link copied to clipboard

Adds the Wallet ID to the request

class WalletIdRequestHeader(walletId: String) : RequestHeaderFactory

Functions

createCustomerSDK
Link copied to clipboard

Entry point into the SDK for customers.

createMerchantSDK
Link copied to clipboard

Entry point into the SDK for merchants.

createSDKComponents
Link copied to clipboard

Base factory function that can be used to create components needed for an SDK instance.

Properties

AUTHORISATION
Link copied to clipboard
const val AUTHORISATION: String
X_API_KEY
Link copied to clipboard

Header name to specify API key

const val X_API_KEY: String
X_EVERYDAY_PAY_WALLET
Link copied to clipboard

Header name to specify the use of the Everyday Pay Wallet

const val X_EVERYDAY_PAY_WALLET: String
X_MERCHANT_ID
Link copied to clipboard

Header name to specify merchant ID

const val X_MERCHANT_ID: String
X_WALLET_ID
Link copied to clipboard

Header name to specify wallet ID

const val X_WALLET_ID: String