SDK Client - main class
Entry point for the SDK exposing functions to interact with the NextEvent API.
getEvents()
List eventsgetWidget($hash)->generateEmbedCode($eventId)
Embed widget for specific eventgetBasket($orderId)
checkout the basketauthorizeOrder($orderId)
start payment processsettlePayment($payment, $customer, $transactionId)
settle paymentgetTicketDocuments($orderId)
get TicketDocuments with download urlsrebookOrder()
create rebooking basketgetWidget($hash)->generateEmbedCode(['basket' => $basket])
Embed widget with rebooking basket.requestCancellation()
request cancellation authorization for a given ordersettleCancellation()
settle cancellation with the authorization datagetAccessCodes($query)
get a collection of AccessCodesgetGate($gateId)
get a GategetGates($query)
get a collection GatesgetDevice($deviceId)
get a DevicegetDevices($query)
get a collection of DevicesgetScanLogs($query)
get a collection of ScanLogsgetBaseCategories($query)
get a collection of BaseCategoriesgetCategories($query)
get a collection of CategoriesgetBasePrices($query)
get a collection of BasePricesgetPrices($query)
get a collection of PricescreateEvent($event)
create a new EventcreateBaseCategory($categories)
create new BaseCategories and CategoriescreateBasePrice($prices)
create new BasePrices and PricesupdateBaseCategory($categories)
update BaseCategories and its CategoriesupdateBasePrice($prices)
update BasePrices and its Pricespackage |
NextEvent\PHPSDK |
---|
__construct(array $options)
Initializes a Client for using the NextEvent Api.
$options[]
see | \NextEvent\PHPSDK\Store\StoreInterface \Psr\Log\LoggerInterface |
---|---|
Throws |
|
array
expects array with appId, appUrl, authUsername, authPassword
abortPayment(\NextEvent\PHPSDK\Model\Payment $payment, string $reason) : boolean
Cancels the payment process previously started with authorizeOrder()
using the payment authorization data. This will unfreeze the reservation
and restore the basket linked with the payment authorization. To be called
when the user aborts the payment process in the shopping application.
Throws |
|
---|
string
why the payment is aborted
boolean
authenticate() : boolean
Throws |
|
---|
boolean
successfully authenticated
createAccessCode(\NextEvent\PHPSDK\Model\AccessCode $accessCode) : \NextEvent\PHPSDK\Model\AccessCode
Throws |
|
---|
\NextEvent\PHPSDK\Model\AccessCode
\NextEvent\PHPSDK\Model\AccessCode
createBaseCategory(\NextEvent\PHPSDK\Model\BaseCategory|array $categories) : \NextEvent\PHPSDK\Model\Collection
Each base category has to hold at least one base price. The attached base prices will also be created automatically. Make sure you created the base category instances with BaseCategory::spawn().
On success the new base category ids will be stored in the given instance(s).
Throws |
|
---|
\NextEvent\PHPSDK\Model\BaseCategory|array
Single or list of \NextEvent\PHPSDK\Model\BaseCategory
\NextEvent\PHPSDK\Model\Collection
createBasePrice(\NextEvent\PHPSDK\Model\BasePrice|array $prices) : \NextEvent\PHPSDK\Model\Collection
Make sure you created the price instances with BasePrice::spawn(). Each provided base price have to be assigned to a base category. Otherwise an exception will be thrown.
On success the new base price ids will be stored in the given instance(s).
Throws |
|
---|
\NextEvent\PHPSDK\Model\Collection
createDiscountCode(\NextEvent\PHPSDK\Model\DiscountCode|array $codes) : \NextEvent\PHPSDK\Model\Collection
Make sure you created the discount codes instances with DiscountCode::spawn().
On success the new discount code ids will be stored in the given instance(s).
Throws |
|
---|
\NextEvent\PHPSDK\Model\DiscountCode|array
Single or list of NextEvent\PHPSDK\Model\DiscountCode
\NextEvent\PHPSDK\Model\Collection
createEvent(\NextEvent\PHPSDK\Model\Event $event) : \NextEvent\PHPSDK\Model\Event
Make sure your created the event with Event::spawn().
On success the new event identifier will be stored in the given instance.
\NextEvent\PHPSDK\Model\Event
deleteBasket(integer $orderId) : boolean
Throws |
|
---|
integer
boolean
successfully deleted
deleteBasketItem(integer $orderId, integer $orderItemId) : boolean
Throws |
|
---|
integer
integer
boolean
successfully deleted
deleteDiscountCode(integer|\NextEvent\PHPSDK\Model\DiscountCode $discountCodeOrId) : boolean
Throws |
|
---|
integer|\NextEvent\PHPSDK\Model\DiscountCode
boolean
successfully deleted
getAccessCode(string $accessCodeId) : \NextEvent\PHPSDK\Model\AccessCode
Throws |
|
---|
string
\NextEvent\PHPSDK\Model\AccessCode
getAccessCodes(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\AccessCodeCollection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
access_code_id
operators: in|!in
code
operators: =|!=|in|!in
category_id
operators: =|!=|in|!in
price_id
operators: =|!=|in|!in
created
operators: =|!=|>|>=|<|<=
changed
operators: =|!=|>|>=|<|<=
processed
operators: =|!=|>|>=|<|<=
gate_id
operators: =|!=|in|!in
device_id
operators: =|!=|in|!in
state
= 'valid|cancelled|external' operators: =|!=|in|!in
entry_state
= 'in|out|null' operators: =|!=|is|!is|in|!in
\NextEvent\PHPSDK\Model\AccessCodeCollection
getApiToken() : \NextEvent\PHPSDK\Model\Token
Throws |
|
---|
\NextEvent\PHPSDK\Model\Token
getAppId() : string
string
getAuthUsername() : string
string
getBaseCategories(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
base_category_id
operators: in|!in
event_id
operators: in|!in
created
operators: =|!=|>|>=|<|<=
changed
operators: =|!=|>|>=|<|<=
\NextEvent\PHPSDK\Model\Collection
getBasePrices(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
base_price_id
operators: in|!in
base_category_id
operators: in|!in
event_id
operators: in|!in
created
operators: =|!=|>|>=|<|<=
changed
operators: =|!=|>|>=|<|<=
\NextEvent\PHPSDK\Model\Collection
getBasket(integer $orderId) : \NextEvent\PHPSDK\Model\Basket
Throws |
|
---|
integer
\NextEvent\PHPSDK\Model\Basket
order data
getCache() : \NextEvent\PHPSDK\Store\StoreInterface
getCategories(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
category_id
operators: in|!in
base_category_id
operators: in|!in
event_id
operators: in|!in
created
operators: =|!=|>|>=|<|<=
changed
operators: =|!=|>|>=|<|<=
\NextEvent\PHPSDK\Model\Collection
getDevice(integer $deviceId) : \NextEvent\PHPSDK\Model\Device
getDevices(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
device_id
operators: in|!in
uuid
operators: =|!=|in|!in
gate_id
operators: =|!=|in|!in
created
operators: =|!=|>|>=|<|<=
changed
operators: =|!=|>|>=|<|<=
platform
operators: =|!=|in|!in
version
operators: =|!=|in|!in
last_login
operators: =|!=|is|!is|>|>=|<|<=
\NextEvent\PHPSDK\Model\Collection
getDiscountCodes(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
augment
= 1|0 (provides additional properties like state
and redeemend
count)state
= 'inactive|active|removed'search
= '[string]'fetch_deleted
= '1|0'
discount_group_id
operators: in|!in
\NextEvent\PHPSDK\Model\Collection
getDiscountGroups(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
fetch_deleted
= '1|0'\NextEvent\PHPSDK\Model\Collection
getEvent(string $eventId) : \NextEvent\PHPSDK\Model\Event
Throws |
|
---|
string
\NextEvent\PHPSDK\Model\Event
getEvents(array|\NextEvent\PHPSDK\Util\Query $query = null) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|---|
Throws |
|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
order
= 'asc|desc' orders by event idsevent_id
operators: in|!in
created
operators: =|!=|>|>=|<|<=
changed
operators: =|!=|>|>=|<|<=
state
= 'draft|active|closed' (default: 'active') operators: =|!=|>|>=|<|<=
\NextEvent\PHPSDK\Model\Collection
getGate(integer $gateId) : \NextEvent\PHPSDK\Model\Gate
getGates(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
gate_id
operators: in|!in
hash
operators: =|!=|in|!in
created
operators: =|!=|>|>=|<|<=
changed
operators: =|!=|>|>=|<|<=
mode
= 'in|out|both' operators: =|!=|in|!in
replaced_gate_id
operators: =|!=|in|!in
\NextEvent\PHPSDK\Model\Collection
getIamClient() : \NextEvent\PHPSDK\Service\IAMClient
getNewPaymentToken() : \NextEvent\PHPSDK\Model\Token
Throws |
|
---|
\NextEvent\PHPSDK\Model\Token
getOrCreateDevice(string $name = null) : void
Throws |
|
---|
string
The argument is optional. By default the client's appId will be used if omitted.
getOrder(integer $orderId, array $embed = array('*')) : \NextEvent\PHPSDK\Model\Order
use order->invoice->status == 'paid' for checking invoice status
Throws |
|
---|
integer
The order ID
array
List of associations to embed in the response (any of 'tickets','document','invoice','items', 'user', 'sales_channel', 'vouchers')
\NextEvent\PHPSDK\Model\Order
Order model
getOrderDocuments(integer $orderId, integer $waitFor) : array<mixed,\NextEvent\PHPSDK\Model\OrderDocument>
When the order is paid, tickets and other documents are generated and can be downloaded.
Throws |
|
---|
integer
ID of the order record to fetch documents for
integer
Number of seconds to wait for documents to be generated
array<mixed,\NextEvent\PHPSDK\Model\OrderDocument>
getOrders(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
order
= 'asc|desc' orders by order idsstate
= ['reservation','completed','replaced','cancelled','aborted'] operators: in
\NextEvent\PHPSDK\Model\Collection
getPaymentToken() : \NextEvent\PHPSDK\Model\Token
Throws |
|
---|
\NextEvent\PHPSDK\Model\Token
getPrices(array|\NextEvent\PHPSDK\Util\Query $query) : \NextEvent\PHPSDK\Model\Collection
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Supported parameters are:
page
page_size
price_id
operators: in|!in
category_id
operators: in|!in
base_price_id
operators: in|!in
event_id
operators: in|!in
created
operators: =|!=|>|>=|<|<=
changed
operators: =|!=|>|>=|<|<=
\NextEvent\PHPSDK\Model\Collection
getRestClient() : \NextEvent\PHPSDK\Rest\Client
getScanLogs(array|\NextEvent\PHPSDK\Util\Query $query) : array
see |
\NextEvent\PHPSDK\Util\Query::setPage()
and \NextEvent\PHPSDK\Util\Query::setPageSize() |
---|
array|\NextEvent\PHPSDK\Util\Query
A query, supported by the API.
Only code
is supported for now.
Supported parameters are:
page
page_size
scan_log_id
operators: in|!in
code
operators: =|!=|in|!in
category_id
operators: =|!=|in|!in
price_id
operators: =|!=|in|!in
created
operators: =|!=|>|>=|<|<=
processed
operators: =|!=|>|>=|<|<=
gate_id
operators: =|!=|in|!in
device_id
operators: =|!=|in|!in
entry_state
= 'in|out' operators: =|!=|in|!in
connection
operators: =|!=|in|!in
verification
operators: =|!=|in|!in
array
A collection of NextEvent\PHPSDK\Model\ScanLog
getTicketDocuments(integer $orderId, integer $waitFor, \NextEvent\PHPSDK\Model\Order $order = null) : array<mixed,\NextEvent\PHPSDK\Model\TicketDocument>
When the order is paid, tickets are generated automatically and can be downloaded.
Attention By default tickets from the same Event are merged into one single document.
deprecated |
1.4.0
(use Client::getOrderDocuments() instead) |
---|---|
Throws |
|
integer
ID of the order record to fetch tickets for
integer
Number of seconds to wait for tickets to be issued
array<mixed,\NextEvent\PHPSDK\Model\TicketDocument>
getWidget(string $hash) : \NextEvent\PHPSDK\Util\Widget
Throws |
|
---|
string
The hash of the widget to be embedded
\NextEvent\PHPSDK\Util\Widget
rebookOrder(integer $orderId) : \NextEvent\PHPSDK\Model\Basket
Starts the rebooking process for the given order. As a result, a new "rebooking" basket will be created which can be processed like regular orders. When completed, this basket will replace the original order and invalidate the previously issued tickets.
Throws |
|
---|
integer
\NextEvent\PHPSDK\Model\Basket
Rebooking basket model
requestCancellation(integer $orderId) : \NextEvent\PHPSDK\Model\CancellationRequest
Like payment, canceling orders in NextEvent is a two-step process starting with sending a request for cancellation. This is a pre-check to verify whether the given order is actually eligible for cancellation and returns an authorization object to be used for later settlement.
Throws |
|
---|
integer
\NextEvent\PHPSDK\Model\CancellationRequest
Cancellation authorization used for settlement
setCache(\NextEvent\PHPSDK\Store\StoreInterface $cache)
Throws |
|
---|
setLogger(\Psr\Log\LoggerInterface $logger = null)
\Psr\Log\LoggerInterface
settleCancellation(\NextEvent\PHPSDK\Model\CancellationRequest $request, string $reason = null) : void
DANGER ZONE: This confirms a previously obtained cancellation request and finally cancels the given order in the NextEvent system which will invalidate all tickets and deny access for entrance checks.
Throws |
|
---|
\NextEvent\PHPSDK\Model\CancellationRequest
Cancellation authorization obtained from requestCancellation()
string
Optional message describing the reason why this order was cancelled
settlePayment(\NextEvent\PHPSDK\Model\Payment $payment, array $customer, null $transactionId = null) : array
This confirms a previously obtained payment authorization and completes the NextEvent order. The tickets will be finally booked for the supplied customer and will be issued afterwards.
$customer example
"customer": {
"email": "thomas.muster@example.com",
"name": "Thomas Muster",
"company": "Musterfirma",
"address": {
"street": "Musterstr. 1",
"pobox": "",
"zip": "3001",
"city": "Bern",
"country": "CH"
}
}
Throws |
|
---|
array
Customer data
null
array
Hash array with payment transaction data
updateBaseCategory(\NextEvent\PHPSDK\Model\BaseCategory|array $categories) : void
\NextEvent\PHPSDK\Model\BaseCategory|array
Single or list of \NextEvent\PHPSDK\Model\BaseCategory
updateBasePrice(\NextEvent\PHPSDK\Model\BasePrice|array $prices) : void
updateBasketExpiration(integer $orderId, \DateTime|integer $expires) : boolean
Throws |
|
---|
integer
\DateTime|integer
New expiration date/time or number of minutes to extend expiration for
boolean
successfully updated
PAYMENT_TOKEN_KEY