trait OrderAPI

Traits

Methods

addCart(array $item)

No description

addDiscount(array $item)

No description

addPayment(array $item)

No description

addData(string $key, string $value, string $label = '')

No description

addLogInfo(array|string $item)

No description

addLogWarning(array|string $item)

No description

addLogDanger(array|string $item)

No description

addLogSuccess(array|string $item)

No description

addLog(array|string $item, string $type = 'i')

No description

saveStatus($status)

No description

save(array $payload = [])

No description

refresh()

No description

addToSession()

No description

removeFromSession()

No description

checkoutEnd(array $payload = [])

Same as checkout, but set checkout_end date in payload for you

checkout(array $payload = [])

No description

register()

No description

lock()

Set order->status to "n" and checkout->checkout_end to now

emptyCart()

No description

delete()

No description

static OrderAPI
create(array $order = [])

Creates empty order object based on orderData

static OrderAPI
retrieveBySessionOrCreate(string|null $key = null)

If no session exist, it creates a new empty order in API with id and secret, and adds it to session.

static OrderAPI
retrieveBySession(string|null $key = null)

If no session exist, it creates a new empty order object WITHOUT id or secret.

static OrderAPI
retrieveBySecret(string $secret)

No description

static OrderAPI
retrieveByRegisterId(string $id)

No description

static OrderAPI
retrieve(string $id)

No description

static array|null
getFromCache(string $key)

No description

addToCache()

No description

forgetInCache()

No description

Details

in OrderAddAPI at line 15
OrderAddAPI addCart(array $item)

Parameters

array $item

Return Value

OrderAddAPI

Exceptions

Exception

in OrderAddAPI at line 31
OrderAddAPI addDiscount(array $item)

Parameters

array $item

Return Value

OrderAddAPI

Exceptions

Exception

in OrderAddAPI at line 47
OrderAddAPI addPayment(array $item)

Parameters

array $item

Return Value

OrderAddAPI

Exceptions

Exception

in OrderAddAPI at line 65
OrderAddAPI addData(string $key, string $value, string $label = '')

Parameters

string $key
string $value
string $label

Return Value

OrderAddAPI

Exceptions

Exception

in OrderAddAPI at line 90
OrderAddAPI addLogInfo(array|string $item)

Parameters

array|string $item

Return Value

OrderAddAPI

Exceptions

Exception

in OrderAddAPI at line 100
OrderAddAPI addLogWarning(array|string $item)

Parameters

array|string $item

Return Value

OrderAddAPI

Exceptions

Exception

in OrderAddAPI at line 110
OrderAddAPI addLogDanger(array|string $item)

Parameters

array|string $item

Return Value

OrderAddAPI

Exceptions

Exception

in OrderAddAPI at line 120
OrderAddAPI addLogSuccess(array|string $item)

Parameters

array|string $item

Return Value

OrderAddAPI

Exceptions

Exception

in OrderAddAPI at line 131
OrderAddAPI addLog(array|string $item, string $type = 'i')

Parameters

array|string $item
string $type

Return Value

OrderAddAPI

Exceptions

Exception

at line 21
OrderAPI saveStatus($status)

Parameters

$status

Return Value

OrderAPI

Exceptions

Exception

at line 31
OrderAPI save(array $payload = [])

Parameters

array $payload

Return Value

OrderAPI

Exceptions

Exception

at line 64
OrderAPI refresh()

Return Value

OrderAPI

Exceptions

Exception

at line 80
OrderAPI addToSession()

Return Value

OrderAPI

at line 90
OrderAPI removeFromSession()

Return Value

OrderAPI

at line 105
OrderAPI checkoutEnd(array $payload = [])

Same as checkout, but set checkout_end date in payload for you

Parameters

array $payload

Return Value

OrderAPI

Exceptions

Exception

at line 117
OrderAPI checkout(array $payload = [])

Parameters

array $payload

Return Value

OrderAPI

Exceptions

Exception

at line 128
OrderAPI register()

Return Value

OrderAPI

Exceptions

Exception

at line 140
OrderAPI lock()

Set order->status to "n" and checkout->checkout_end to now

Return Value

OrderAPI

Exceptions

Exception

at line 151
OrderAPI emptyCart()

Return Value

OrderAPI

Exceptions

Exception

at line 162
OrderAPI delete()

Return Value

OrderAPI

Exceptions

Exception

at line 176
static OrderAPI create(array $order = [])

Creates empty order object based on orderData

Parameters

array $order

Return Value

OrderAPI

Exceptions

Exception

at line 190
static OrderAPI retrieveBySessionOrCreate(string|null $key = null)

If no session exist, it creates a new empty order in API with id and secret, and adds it to session.

Parameters

string|null $key

Return Value

OrderAPI

Exceptions

Exception

at line 209
static OrderAPI retrieveBySession(string|null $key = null)

If no session exist, it creates a new empty order object WITHOUT id or secret.

But; It makes shure session is set when order is saved.

Parameters

string|null $key

Return Value

OrderAPI

Exceptions

Exception

at line 240
static OrderAPI retrieveBySecret(string $secret)

Parameters

string $secret

Return Value

OrderAPI

Exceptions

OrderNotFoundException

at line 260
static OrderAPI retrieveByRegisterId(string $id)

Parameters

string $id

Return Value

OrderAPI

Exceptions

OrderNotFoundException

at line 278
static OrderAPI retrieve(string $id)

Parameters

string $id

Return Value

OrderAPI

Exceptions

OrderNotFoundException

at line 297
static protected array|null getFromCache(string $key)

Parameters

string $key

Return Value

array|null

at line 314
protected OrderAPI addToCache()

Return Value

OrderAPI

at line 339
OrderAPI forgetInCache()

Return Value

OrderAPI